/* CeMAP Trainer website. Colours, type and spacing follow the app's design tokens
   (lib/ui/theme/tokens.dart) so the site and the app read as one product. */

@font-face { font-family: "Geist"; src: url("/fonts/geist-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ground: #F3F5F7;
  --surface: #FFFFFF;
  --ink: #16222E;
  --muted: #5B6B78;
  --line: #DCE2E7;
  --brand: #17324B;
  --accent: #1E6E8C;
  --correct: #2E7D5B;
  --wrong: #C0503F;
  --on-brand: #FFFFFF;
  --on-accent: #FFFFFF;

  --radius: 16px;
  --card-radius: 20px;
  --page: 1080px;
  --reading: 640px;

  color-scheme: light dark;
}

/* Dark mode: follows the device unless the visitor picks a theme with the
   header switch, which sets data-theme on <html> (assets/theme.js). */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
    --ground: #0E151B;
    --surface: #16212B;
    --ink: #E7EDF2;
    --muted: #93A4B1;
    --line: #263340;
    --brand: #7FB2C9;
    --accent: #4FA8C4;
    --correct: #57B58A;
    --wrong: #D97A63;
    --on-brand: #0E151B;
    --on-accent: #0E151B;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
      --ground: #0E151B;
      --surface: #16212B;
      --ink: #E7EDF2;
      --muted: #93A4B1;
      --line: #263340;
      --brand: #7FB2C9;
      --accent: #4FA8C4;
      --correct: #57B58A;
      --wrong: #D97A63;
      --on-brand: #0E151B;
      --on-accent: #0E151B;
      color-scheme: dark;
  }
}

/* Things drawn differently per theme (badge, screenshot): show one of each pair. */
.for-dark { display: none !important; }
:root[data-theme="dark"] .for-light { display: none !important; }
:root[data-theme="dark"] .for-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .for-light { display: none !important; }
  :root:not([data-theme="light"]) .for-dark { display: block !important; }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Geist", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -0.025em; }
h3 { font-size: 1.12rem; letter-spacing: -0.01em; line-height: 1.35; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 24px; }
.reading { max-width: var(--reading); }
.muted { color: var(--muted); }
.label { font-size: 0.9rem; font-weight: 500; color: var(--muted); letter-spacing: 0.01em; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header */
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 76px; }
.site-header .site-nav { margin-left: auto; }
/* One small icon: a moon in light mode, a sun in dark mode. The button is
   44px for touch, but draws nothing but the icon. */
.theme-toggle {
  display: none; place-items: center; width: 44px; height: 44px; margin: 0 -14px 0 -8px; padding: 0;
  border: 0; background: none; color: var(--muted); cursor: pointer;
}
.js .theme-toggle { display: grid; }
.theme-toggle:hover { color: var(--ink); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.02em; font-size: 1.08rem; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; gap: 24px; font-size: 0.95rem; font-weight: 500; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

/* Hero */
.hero { padding: 48px 0 88px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.hero-copy { padding-top: 24px; }
.hero-copy .label { margin-bottom: 16px; }
.hero-copy h1 { margin-bottom: 24px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
/* Store badges are the official artwork, shown at the same height. */
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 32px 0 0; }
.badge { display: inline-flex; line-height: 0; border-radius: 8px; }
.badge img { display: block; height: 48px; width: auto; }
.badge[aria-disabled="true"] { cursor: default; }
.stores-note { margin-top: 12px; font-size: 0.92rem; color: var(--muted); }

/* Sample question card */
.sampler { background: var(--surface); border-radius: 28px; padding: 24px; }
.sampler-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 0.9rem; font-weight: 500; min-height: 40px; padding: 0 14px;
  border: 0; border-radius: 12px; background: var(--ground); color: var(--ink); cursor: pointer;
}
.chip[aria-selected="true"] { background: var(--brand); color: var(--on-brand); }
.q-meta { margin-bottom: 8px; }
.q-text { font-size: 1.12rem; font-weight: 500; line-height: 1.45; margin-bottom: 20px; letter-spacing: -0.005em; }
.options { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.option {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  font: inherit; font-size: 0.98rem; line-height: 1.4; color: var(--ink);
  min-height: 56px; padding: 12px; border-radius: var(--radius);
  background: var(--ground); border: 1.5px solid transparent; cursor: pointer;
}
.option:hover:not(:disabled) { border-color: var(--line); }
.option:disabled { cursor: default; }
.disc {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--muted); font-size: 0.85rem; font-weight: 500;
}
.option.is-correct { border-color: var(--correct); background: color-mix(in srgb, var(--correct) 10%, var(--surface)); }
.option.is-correct .disc { background: var(--correct); color: #fff; }
.option.is-wrong { border-color: var(--wrong); background: color-mix(in srgb, var(--wrong) 10%, var(--surface)); }
.option.is-wrong .disc { background: var(--wrong); color: #fff; }
.answer { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.answer .verdict { font-weight: 700; margin-bottom: 6px; }
.answer p { font-size: 0.96rem; }
.source { margin-top: 12px; font-size: 0.92rem; color: var(--muted); }
.source a { font-weight: 500; }

.sampler-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; }
.next {
  font: inherit; font-weight: 500; font-size: 0.95rem; min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 0; background: var(--accent); color: var(--on-accent); cursor: pointer;
}

/* Sections */
section { scroll-margin-top: 24px; }
.section { padding: 88px 0; }
.section + .section { padding-top: 0; }
.section-head { margin-bottom: 40px; }
.section-head p { margin-top: 12px; color: var(--muted); font-size: 1.08rem; }

/* What's in the app: the phone beside the four points. */
.inside { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 80px; align-items: center; }
.phone { margin: 0; }
.phone img { width: 100%; height: auto; filter: drop-shadow(0 24px 40px rgba(22, 34, 46, 0.18)); }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 48px; }
.feature { border-top: 2px solid var(--ink); padding-top: 16px; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--muted); }

.proof { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.proof-lede { margin-top: 12px; }
.proof-list { margin: 16px 0 0; padding-left: 1.2em; display: grid; gap: 4px; color: var(--muted); }
.proof-list li::marker { color: var(--muted); }
.proof-list strong { color: var(--ink); font-weight: 500; }
.ref { background: var(--surface); border-radius: var(--card-radius); padding: 28px; }
.ref .label { margin-bottom: 8px; }
.ref p { font-size: 0.98rem; }
.ref .source { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }

.units { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--card-radius); overflow: hidden; font-size: 0.98rem; }
.units th, .units td { text-align: left; padding: 16px 20px; vertical-align: top; }
.units thead th { font-size: 0.85rem; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); }
.units tbody tr + tr td, .units tbody tr + tr th { border-top: 1px solid var(--line); }
.units tbody th { font-weight: 700; white-space: nowrap; }
.units .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-note { margin-top: 16px; font-size: 0.95rem; color: var(--muted); }

.faq { display: grid; gap: 8px; }
.faq details { background: var(--surface); border-radius: var(--radius); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 56px 20px 24px; position: relative;
  font-weight: 500; font-size: 1.04rem; line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 26px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq .faq-body { padding: 0 24px 24px; color: var(--muted); }
.faq .faq-body p + p { margin-top: 12px; }

.note p:not(.label) { font-size: 1.2rem; line-height: 1.55; }
.note .label { margin-bottom: 12px; }
.note p.signature { margin-top: 16px; font-size: 1rem; font-weight: 500; }

/* Plain document pages (privacy, support) */
.doc { padding: 40px 0 96px; }
.doc .reading { max-width: 820px; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 12px; }
.doc .updated { color: var(--muted); margin-bottom: 40px; }
.doc h2 { font-size: 1.3rem; letter-spacing: -0.015em; margin: 40px 0 12px; }
.doc p + p, .doc ul + p, .doc p + ul { margin-top: 12px; }
.doc ul { padding-left: 1.2em; margin: 12px 0 0; }
.doc li + li { margin-top: 6px; }
.callout { background: var(--surface); border-radius: var(--card-radius); padding: 24px 28px; }
.callout p + p { margin-top: 8px; }
.email { font-size: 1.25rem; font-weight: 500; }
address { font-style: normal; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 56px; font-size: 0.92rem; color: var(--muted); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; }
.site-footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.site-footer nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-footer nav a:hover { text-decoration: underline; }
.site-footer p { max-width: 46em; }

@media (max-width: 860px) {
  .hero { padding: 16px 0 64px; }
  .hero .wrap, .proof { grid-template-columns: 1fr; gap: 40px; }
  .hero-copy { padding-top: 8px; }
  .features { grid-template-columns: 1fr; gap: 24px; }
  .inside { grid-template-columns: 1fr; gap: 48px; }
  .phone { max-width: 260px; margin: 0 auto; }
  .section { padding: 64px 0; }
  .site-footer .wrap { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .site-nav { gap: 16px; }
  .site-nav .hide-sm { display: none; }
  .sampler { padding: 20px 16px; border-radius: 24px; }
  .sampler-head { flex-direction: column; align-items: flex-start; }
  .chips { gap: 6px; }
  .units th, .units td { padding: 12px 14px; }
  .units .col-covers { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .option, .chip, .next { transition: background-color 0.15s ease, border-color 0.15s ease; }
}
