/* =============================================================================
   Sofia - landing page
   Nordic editorial: paper ground, hairline rules, a serif that carries the voice
   and a sans that stays out of the way. Light only, on purpose. Committing to one
   scheme is what lets the paper tone and the photography stay in register.
   Fonts are self-hosted: an EU consumer page must not hand the visitor's IP to a
   font CDN just to render a heading.
   ========================================================================== */

@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter var";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Ground and ink */
  --paper: #fbfaf7;
  --paper-warm: #f4f1ea;
  --card: #ffffff;
  --ink: #16202e;
  --ink-soft: #45505f;
  --ink-mute: #6f7987;
  --rule: #e2ded4;
  --rule-strong: #cdc7ba;

  /* The two exams keep the colours they have inside the app, so the page and the
     product mean the same thing by the same blue and the same teal. */
  --hp: #24408e;
  --mfp: #0f766e;
  --accent: var(--hp);
  --accent-wash: #eef1f9;

  --measure: 34rem;      /* prose column: ~68 characters */
  --page: 68rem;         /* outer grid */
  --wide: 78rem;

  --serif: "Source Serif 4", ui-serif, Georgia, Cambria, "Times New Roman", serif;
  --sans: "Inter var", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --step-2: clamp(0.78rem, 0.76rem + 0.1vw, 0.84rem);
  --step-1: clamp(0.9rem, 0.87rem + 0.15vw, 0.98rem);
  --step0: clamp(1.03rem, 1rem + 0.2vw, 1.14rem);
  --step1: clamp(1.2rem, 1.12rem + 0.4vw, 1.45rem);
  --step2: clamp(1.5rem, 1.34rem + 0.8vw, 2.05rem);
  --step3: clamp(1.95rem, 1.6rem + 1.7vw, 3rem);
  --step4: clamp(2.4rem, 1.75rem + 3.1vw, 4.4rem);

  --gap: clamp(1.5rem, 1rem + 2vw, 3rem);
  --band: clamp(4rem, 2.5rem + 6vw, 8.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step0);
  line-height: 1.65;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}

/* ---- primitives ---------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 0.6rem + 2.4vw, 2.75rem);
}
.wrap--wide { max-width: var(--wide); }
.prose { max-width: var(--measure); }
/* Headings inside a prose column carry no margin of their own (h1-h3 are reset above), so
   without this they sit flush against the paragraph they introduce. */
.prose > h1, .prose > h2, .prose > h3,
.stack-lg h1, .stack-lg h2, .stack-lg h3 { margin-bottom: 0.75rem; }

.band { padding-block: var(--band); }
.band--rule { border-top: 1px solid var(--rule); }
.band--warm { background: var(--paper-warm); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--step4); letter-spacing: -0.028em; }
h2 { font-size: var(--step3); }
h3 { font-size: var(--step1); line-height: 1.25; letter-spacing: -0.008em; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }

strong { font-weight: 600; }

.eyebrow {
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 1.4rem;
}
.lead {
  font-family: var(--serif);
  font-size: var(--step1);
  line-height: 1.5;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
}
.small { font-size: var(--step-1); }
.mute { color: var(--ink-mute); }

/* Hairline rules are the page's main structural device - they carry the
   editorial feel that borders and shadows would make heavy. */
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ---- masthead ------------------------------------------------------------ */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.masthead[data-stuck="true"] { border-bottom-color: var(--rule); }
.masthead__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}
.wordmark span {
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.masthead__spacer { flex: 1; }

.langswitch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  overflow: hidden;
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.langswitch a {
  padding: 0.32rem 0.72rem;
  text-decoration: none;
  color: var(--ink-mute);
}
.langswitch a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.langswitch a:not([aria-current="true"]):hover { background: var(--paper-warm); color: var(--ink); }

/* ---- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  font-size: var(--step-1);
  letter-spacing: 0.01em;
  padding: 0.78rem 1.35rem;
  border-radius: 2px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---- hero ---------------------------------------------------------------- */

.hero { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5.5rem) 0; }
.hero__grid {
  display: grid;
  gap: var(--gap);
  align-items: end;
  grid-template-columns: 1fr;
}
@media (min-width: 60rem) {
  .hero__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
}
.hero h1 { margin-bottom: 1.1rem; }
.hero .lead { max-width: 30rem; }
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.25rem;
  margin-top: 2rem;
}
.hero__note { font-size: var(--step-1); color: var(--ink-mute); }

.hero__figure { margin: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) 0 0; }
.hero__figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

/* ---- figures ------------------------------------------------------------- */

figure { margin: 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}
figcaption {
  font-size: var(--step-2);
  color: var(--ink-mute);
  margin-top: 0.7rem;
  letter-spacing: 0.01em;
  max-width: 26rem;
}

/* Alternating text/image band. */
.split {
  display: grid;
  gap: var(--gap);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 58rem) {
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.5rem, 1rem + 5vw, 5rem); }
  .split--flip > figure { order: -1; }
}
.split h2 { margin-bottom: 1.1rem; }

/* ---- section headings ---------------------------------------------------- */

.sectionhead { margin-bottom: clamp(2.25rem, 1.5rem + 2.5vw, 3.75rem); }
.sectionhead h2 { margin-bottom: 1rem; }
.sectionhead p { max-width: var(--measure); color: var(--ink-soft); }

/* ---- the daily loop: numbered editorial list ----------------------------- */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 0 1.25rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}
.steps > li:last-child { border-bottom: 1px solid var(--rule); }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--rule-strong);
  line-height: 1.05;
  font-variant-numeric: lining-nums tabular-nums;
}
.steps h3 { margin-bottom: 0.35rem; }
.steps p { color: var(--ink-soft); max-width: var(--measure); }
@media (min-width: 58rem) {
  .steps > li { grid-template-columns: 3.75rem minmax(0, 14rem) minmax(0, 1fr); align-items: baseline; gap: 0 2rem; }
  .steps h3 { margin-bottom: 0; }
}

/* ---- feature cards ------------------------------------------------------- */

.cards {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border-block: 1px solid var(--rule);
  grid-template-columns: 1fr;
}
@media (min-width: 44rem) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 66rem) { .cards--3 { grid-template-columns: repeat(3, 1fr); } }
.cards > li {
  background: var(--paper);
  padding: clamp(1.5rem, 1rem + 1.4vw, 2.25rem);
  list-style: none;
}
.cards h3 { margin-bottom: 0.55rem; }
.cards p { color: var(--ink-soft); font-size: var(--step-1); }

/* ---- exam tiles ---------------------------------------------------------- */

.exams { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 52rem) { .exams { grid-template-columns: repeat(2, 1fr); } }
.exam {
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--tint, var(--accent));
  border-radius: 2px;
  padding: clamp(1.5rem, 1rem + 1.6vw, 2.25rem);
}
.exam--hp { --tint: var(--hp); }
.exam--mfp { --tint: var(--mfp); }
.exam__tag {
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tint);
  margin-bottom: 0.85rem;
}
.exam h3 { margin-bottom: 0.7rem; }
.exam p { color: var(--ink-soft); font-size: var(--step-1); }
.exam dl { margin: 1.35rem 0 0; display: grid; gap: 0; }
.exam dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--rule);
  font-size: var(--step-1);
}
.exam dt { color: var(--ink-mute); }
.exam dd { margin: 0; text-align: right; font-weight: 500; }

/* ---- pull quote ---------------------------------------------------------- */

.pull {
  font-family: var(--serif);
  font-size: var(--step2);
  line-height: 1.32;
  letter-spacing: -0.015em;
  max-width: 40rem;
  margin: 0;
}
.pull cite {
  display: block;
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: var(--step-1);
  font-style: normal;
  letter-spacing: 0.01em;
  color: var(--ink-mute);
}

/* ---- waitlist ------------------------------------------------------------ */

.waitlist { background: var(--ink); color: var(--paper); }
.waitlist h2 { color: #fff; }
.waitlist .lead { color: #c9cfda; }
.waitlist a { color: #fff; }
.waitlist__grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}
@media (min-width: 58rem) {
  .waitlist__grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(2.5rem, 1rem + 5vw, 5rem); }
}

.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: var(--step-1); font-weight: 500; letter-spacing: 0.01em; }
.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  font: inherit;
  font-size: var(--step-1);
  color: var(--ink);
  background: #fff;
  /* A visible edge by default: the same .form markup is used on the paper-coloured privacy
     page, where a transparent border makes the field disappear into the background. */
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.7rem 0.85rem;
  width: 100%;
}
.waitlist .field input[type="text"],
.waitlist .field input[type="email"],
.waitlist .field select,
.waitlist .field textarea { border-color: transparent; }
.field textarea { min-height: 6.5rem; resize: vertical; }
/* Dark ring on light ground. The white ring below is only legible against the dark band -
   on the privacy page it measured 1.04:1 against the paper, i.e. invisible. */
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.waitlist .field input:focus-visible,
.waitlist .field select:focus-visible,
.waitlist .field textarea:focus-visible {
  outline-color: #fff;
}
.btn--ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.field__hint { font-size: var(--step-2); color: #a7b0be; }

.choice { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  border: 1px solid #46505f;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-size: var(--step-1);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.choice input:checked + label { background: #fff; border-color: #fff; color: var(--ink); }
.choice input:focus-visible + label { outline: 2px solid #fff; outline-offset: 2px; }

.consent { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: start; }
.consent input { margin-top: 0.35rem; width: 1rem; height: 1rem; accent-color: #fff; }
.consent label { font-size: var(--step-2); color: #c9cfda; line-height: 1.5; }
.consent a { color: #fff; }

.form .btn { justify-self: start; padding-inline: 1.75rem; }
/* Inverted only inside the dark band. The withdrawal form on the privacy page uses the
   same .form class on a paper ground, where a white-on-cream button disappears. */
.waitlist .form .btn { background: #fff; border-color: #fff; color: var(--ink); }
.waitlist .form .btn:hover { background: var(--accent-wash); border-color: var(--accent-wash); color: var(--ink); }

.formstatus {
  font-size: var(--step-1);
  padding: 0.85rem 1rem;
  border-radius: 2px;
  border: 1px solid var(--rule-strong);
  margin: 0;
}
/* Light ground is the default; the dark band overrides below. */
.formstatus[data-kind="ok"] { border-color: #9ec39b; background: #eef6ed; color: #1f4620; }
.formstatus[data-kind="error"] { border-color: #d0a3a3; background: #fbeeee; color: #7a2020; }
.waitlist .formstatus { border-color: #46505f; }
.waitlist .formstatus[data-kind="ok"] { border-color: #7ea87c; background: #1d2b25; color: #d7ecd6; }
.waitlist .formstatus[data-kind="error"] { border-color: #b08080; background: #2b1d1d; color: #f2d9d9; }
.formstatus[hidden] { display: none; }

/* Honeypot: a real person never sees or focuses this. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- faq ----------------------------------------------------------------- */

.faq { border-top: 1px solid var(--rule); }
.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 0.35rem 0;
}
.faq summary {
  font-family: var(--serif);
  font-size: var(--step1);
  font-weight: 600;
  letter-spacing: -0.008em;
  padding: 1.1rem 2.5rem 1.1rem 0;
  cursor: pointer;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.35rem;
  top: 50%;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 1.5px solid var(--ink-mute);
  border-bottom: 1.5px solid var(--ink-mute);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faq .faq__body { padding: 0 0 1.4rem; max-width: var(--measure); color: var(--ink-soft); }

/* ---- footer -------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--rule);
  padding-block: 3rem 4rem;
  font-size: var(--step-1);
  color: var(--ink-mute);
}
.footer__grid { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; align-items: baseline; }
.footer__grid > :last-child { margin-left: auto; }
.footer a { color: var(--ink-soft); }

/* ---- utilities ----------------------------------------------------------- */

.stack-lg > * + * { margin-top: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem); }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skiplink {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: 2px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skiplink:focus { top: 0.75rem; }

@media print {
  .masthead, .langswitch, .waitlist form { display: none; }
  body { background: #fff; }
}
