/* Raksa website – one stylesheet for every page. Colours follow the Raksa Android app. */

@font-face { font-family: Manrope; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/manrope-regular.woff2") format("woff2"); }
@font-face { font-family: Manrope; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/manrope-semibold.woff2") format("woff2"); }
@font-face { font-family: Manrope; font-style: normal; font-weight: 700 800; font-display: swap; src: url("assets/fonts/manrope-bold.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: #F5F2EC;
  --surface: #FFFCF7;
  --surface-2: #F2EDE5;
  --text: #302923;
  --muted: #675D54;
  --subtle: #81756A;
  --border: #D8D0C5;
  --accent: #1769AA;
  --on-accent: #FFFFFF;
  --gold: #8F6510;
  --gold-line: #B98212;
  --gold-soft: rgba(185, 130, 18, .12);
  --grid: rgba(23, 105, 170, .08);
  --header: rgba(245, 242, 236, .92);
  --shadow: 0 18px 48px rgba(48, 41, 35, .14);
  --radius: 22px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --logo-halo-core: rgba(27, 38, 51, .28);
  --logo-halo-mid: rgba(27, 38, 51, .10);
  --font: Manrope, "Segoe UI", Roboto, Arial, sans-serif;
}
:root[data-resolved-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1014;
  --surface: #15171B;
  --surface-2: #1B1E23;
  --text: #F2F2F1;
  --muted: #BABAB8;
  --subtle: #8D8D8A;
  --border: #3E4148;
  --accent: #4A9BE8;
  --on-accent: #0E1014;
  --gold: #E2B84F;
  --gold-line: #E2B84F;
  --gold-soft: rgba(226, 184, 79, .12);
  --grid: rgba(103, 200, 255, .07);
  --header: rgba(14, 16, 20, .92);
  --shadow: 0 22px 60px rgba(0, 0, 0, .45);
  --logo-halo-core: rgba(169, 195, 221, .27);
  --logo-halo-mid: rgba(169, 195, 221, .09);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: 1.1; letter-spacing: -.02em; font-weight: 700; overflow-wrap: break-word; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
button, a, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
html[lang="fi"] [data-lang="en"], html[lang="en"] [data-lang="fi"] { display: none; }

.container { width: min(1160px, 100% - 40px); margin-inline: auto; }
.container-narrow { width: min(860px, 100% - 40px); margin-inline: auto; }
.eyebrow { margin: 0 0 .6rem; color: var(--gold); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.lead { color: var(--muted); font-size: 1.2rem; max-width: 640px; }

.skip { position: fixed; top: -80px; left: 12px; z-index: 99; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.skip:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; padding: 0 clamp(16px, 5vw, 64px);
  background: var(--header);
  backdrop-filter: blur(16px) saturate(1.1);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 2px; border-radius: 14px; text-decoration: none; transition: background-color 180ms var(--ease); }
.brand:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.brand-mark { position: relative; display: grid; place-items: center; width: 56px; height: 56px; }
.brand-mark::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; background: radial-gradient(circle at 50% 54%, var(--logo-halo-core), var(--logo-halo-mid) 45%, transparent 70%); }
.brand-logo { position: relative; width: 52px; height: 52px; object-fit: contain; }
.brand span { display: flex; flex-direction: column; line-height: 1; }
.brand b { font-size: 1.35rem; font-weight: 800; letter-spacing: .06em; }
.brand small { margin-top: 6px; color: var(--accent); font-size: .82rem; font-weight: 600; }

.site-nav { display: flex; gap: 4px; margin: 0 12px 0 auto; }
.site-nav a { padding: 10px 14px; color: var(--muted); font-weight: 600; text-decoration: none; border-radius: 12px; transition: background-color 180ms var(--ease), color 180ms var(--ease); }
.site-nav a:hover { color: var(--text); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.site-nav a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.header-actions { display: flex; align-items: center; gap: 4px; }

.settings { position: relative; }
#settingsButton, #menuButton {
  display: grid; place-items: center; width: 48px; height: 48px;
  color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 50%; cursor: pointer;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease), transform 150ms var(--ease);
}
#settingsButton:hover, #menuButton:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
#settingsButton:active, #menuButton:active { transform: scale(.93); }
#settingsButton[aria-expanded="true"], #menuButton[aria-expanded="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); }
#menuButton { display: none; }
.icon { width: 26px; height: 26px; fill: currentColor; transition: transform 380ms var(--ease); }
#settingsButton[aria-expanded="true"] .icon { transform: rotate(45deg); }
#settingsPanel {
  position: absolute; top: 56px; right: 0;
  width: min(280px, calc(100vw - 28px)); padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transform-origin: top right; animation: panel-in 220ms var(--ease);
}
#settingsPanel label { display: block; margin-bottom: 6px; color: var(--muted); font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
#settingsPanel select {
  width: 100%; min-height: 50px; margin-bottom: 16px; padding: 0 40px 0 14px;
  color: var(--text); font: 600 1rem var(--font);
  background-color: var(--surface-2);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
  border: 1px solid var(--border); border-radius: 14px; appearance: none; cursor: pointer;
}
#settingsPanel select:last-child { margin-bottom: 0; }
#settingsPanel select:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 24px; border-radius: 16px;
  font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform 150ms var(--ease), box-shadow 200ms var(--ease), background-color 200ms var(--ease), border-color 200ms var(--ease);
}
.button:active { transform: scale(.97); }
.primary { color: var(--on-accent); background: var(--accent); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 24%, transparent); }
.primary:hover { box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 32%, transparent); }
.secondary { border: 1px solid var(--border); }
.play-icon { flex: none; width: 18px; height: 18px; margin-right: 10px; fill: currentColor; }
.play-pending { color: var(--muted); background: var(--surface-2); border: 1px dashed var(--border); cursor: default; }
.secondary:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

/* Hero */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 6vw, 72px); }
.hero-text { max-width: 820px; }
.hero h1 { margin: .15em 0 .3em; font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.02; letter-spacing: -.045em; }
.status { display: flex; align-items: center; gap: 10px; margin-top: 26px; color: var(--muted); font-size: .92rem; font-weight: 600; }
.status-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--gold-line); box-shadow: 0 0 0 4px var(--gold-soft); }

/* Sections */
.section-heading { max-width: 760px; margin-bottom: 36px; }
.section-heading h1, .section-heading h2, .future h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); }
.tools { padding: 72px 0 24px; }
.tool {
  display: grid; grid-template-columns: 1fr minmax(240px, 340px); gap: clamp(32px, 6vw, 72px); align-items: center;
  margin: 0 0 56px; padding: clamp(24px, 4vw, 48px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 28px;
}
.tool.reverse { grid-template-columns: minmax(240px, 340px) 1fr; }
.tool.reverse .tool-text { order: 2; }
.tool-number { color: var(--gold); font-weight: 800; letter-spacing: .08em; }
.tool h3 { margin: .25em 0 .4em; font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.tool p { color: var(--muted); }
.tool ul { margin: 18px 0 0; padding: 0; list-style: none; }
.tool li { position: relative; padding: 10px 0 10px 28px; color: var(--text); border-top: 1px solid var(--border); }
.tool li::before { content: ""; position: absolute; left: 4px; top: 1.15em; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.phone-shot { justify-self: center; width: 100%; max-width: 340px; margin: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 30px; box-shadow: var(--shadow); background: var(--bg); }
.phone-shot img { display: block; width: 100%; }

.testing { padding: 48px 0; }
.beta .testing { padding-top: clamp(40px, 6vw, 72px); }
.testing-note { color: var(--text); font-weight: 600; }
.join-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.join-steps li { display: flex; flex-direction: column; align-items: flex-start; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.join-steps h2, .join-steps h3 { margin: 14px 0 .4em; font-size: 1.3rem; }
.join-steps p { flex: 1; margin: 0 0 20px; color: var(--muted); }
.join-steps .button { white-space: normal; text-align: center; }
.step-number { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--on-accent); background: var(--accent); font-weight: 800; }
.testing-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 48px; margin-top: 32px; }
.testing-info h2, .testing-info h3 { margin: 0 0 .5em; font-size: 1.15rem; }
.testing-info p, .testing-info li { color: var(--muted); }
.testing-info ul, .testing-info ol { margin: 0 0 20px; padding-left: 1.3em; }
.testing-info li { margin: 6px 0; }
.features { padding: 48px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.feature-grid li { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.feature-grid h3 { margin: 0 0 .5em; font-size: 1.15rem; }
.feature-grid p { margin: 0; color: var(--muted); font-size: .95rem; }

.future { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; padding: 64px 0 40px; }
.future p { color: var(--muted); }
.future-list { margin: 0; padding: 0; list-style: none; }
.future-list li { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; font-weight: 700; border-bottom: 1px solid var(--border); }
.future-list li::after { content: ""; flex: none; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-line); }

.notice { margin-bottom: 72px; padding: 20px 24px; color: var(--muted); background: var(--gold-soft); border-left: 4px solid var(--gold-line); border-radius: 0 16px 16px 0; }
.notice p { margin: 0; }

/* Document pages (privacy, support) */
.doc { padding: 56px 0 72px; }
.doc-intro h1 { margin: .15em 0 .25em; font-size: clamp(2rem, 7vw, 4.2rem); letter-spacing: -.04em; }
.privacy-meta { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 24px 0 8px; }
.privacy-meta div { display: flex; flex-direction: column; }
.privacy-meta dt { color: var(--subtle); font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.privacy-meta dd { margin: 2px 0 0; font-weight: 700; }
.doc-body section { padding: 24px 0; border-top: 1px solid var(--border); scroll-margin-top: 96px; }
.doc-body h2 { margin: 0 0 10px; font-size: 1.45rem; }
.doc-body p, .doc-body li { color: var(--muted); }
.doc-body strong { color: var(--text); }
.doc-body a { color: var(--accent); text-underline-offset: 3px; }
.doc-body ol { padding-left: 1.4em; }
.doc-body .callout { margin: 16px 0 0; padding: 16px 20px; }
.doc-body .callout p { margin: 0; color: var(--text); }
.reveal { padding: 0; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; }
.doc-body .summary, .doc-body .callout { margin: 24px 0; padding: 24px 24px 24px 28px; background: var(--gold-soft); border-top: 0; border-left: 4px solid var(--gold-line); border-radius: 0 18px 18px 0; }

/* Footer */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px;
  padding: 32px clamp(16px, 5vw, 64px); color: var(--muted); border-top: 1px solid var(--border);
}
.site-footer b { color: var(--gold); letter-spacing: .08em; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* Responsive */
@media (max-width: 800px) {
  .site-header { height: 68px; }
  .brand-mark { width: 48px; height: 48px; }
  .brand-logo { width: 44px; height: 44px; }
  #settingsPanel { top: 52px; }
  #menuButton { display: grid; }
  .site-nav {
    display: none; position: absolute; top: calc(100% + 6px); right: 12px; z-index: 21;
    flex-direction: column; min-width: 220px; margin: 0; padding: 8px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; animation: panel-in 220ms var(--ease); }
  .site-nav a { padding: 12px 14px; }
  .future { grid-template-columns: 1fr; }
  .tool, .tool.reverse { grid-template-columns: 1fr; }
  .tool.reverse .tool-text { order: initial; }
  .actions > * { flex: 1 1 140px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .container, .container-narrow { width: calc(100% - 32px); }
  .site-header { padding-inline: 12px; }
  .brand b { font-size: 1.15rem; }
  .brand small { font-size: .74rem; }
  .hero h1 { font-size: 2.5rem; }
  .tool { padding: 20px; border-radius: 22px; }
}
@media (hover: none) {
  .primary:hover, .secondary:hover { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
