/* ==========================================================================
   Everything About GCSEs — /education/GCSE
   A self-contained, accessible, interactive explainer.
   Design tokens • layout • components • mini-apps • charts • print
   ========================================================================== */

/* ----------------------------- Design tokens ---------------------------- */
:root {
  /* Brand palette: exam-hall indigo + achievement gold + subject accents */
  --ink: #14122b;
  --ink-soft: #2a2748;
  --paper: #f7f7fb;
  --paper-2: #eef0f8;
  --card: #ffffff;
  --card-2: #f3f4fb;
  --line: #e4e6f1;
  --line-strong: #cdd0e6;

  --indigo: #4338ca;
  --indigo-600: #4f46e5;
  --indigo-300: #a5b4fc;
  --indigo-050: #eef2ff;
  --gold: #d9a407;
  --gold-soft: #fbe6a2;
  --teal: #0d9488;
  --rose: #e11d48;
  --sky: #0284c7;
  --violet: #7c3aed;
  --emerald: #059669;
  --amber: #d97706;

  --text: #1c1a33;
  --text-2: #4a4866;
  --text-3: #6b6986;
  --text-on-dark: #f4f4fb;

  --grade9: #4338ca;
  --grade7: #0d9488;
  --grade4: #d97706;
  --grade1: #be123c;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --shadow-sm: 0 1px 2px rgba(20, 18, 43, .06), 0 2px 6px rgba(20, 18, 43, .05);
  --shadow: 0 6px 18px rgba(20, 18, 43, .08), 0 2px 6px rgba(20, 18, 43, .05);
  --shadow-lg: 0 22px 50px rgba(20, 18, 43, .16), 0 8px 18px rgba(20, 18, 43, .08);

  --gut: clamp(16px, 4vw, 40px);
  --maxw: 1160px;
  --readw: 720px;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, monospace;

  --t-fast: 140ms cubic-bezier(.4, 0, .2, 1);
  --t: 240ms cubic-bezier(.4, 0, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #07060f;
    --ink-soft: #131127;
    --paper: #0d0b1a;
    --paper-2: #131127;
    --card: #181631;
    --card-2: #211e3f;
    --line: #2c2950;
    --line-strong: #3a3766;

    --indigo-050: #1d1b40;
    --gold-soft: #4a3a08;

    --text: #ecebf7;
    --text-2: #c2c0dc;
    --text-3: #9a98bb;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 8px 24px rgba(0, 0, 0, .45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  }
}

/* Manual theme override hooks (data-theme on <html>) */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

/* --------------------------------- Reset -------------------------------- */
*, *::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: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--paper);
  line-height: 1.6;
  font-size: clamp(16px, 1.05vw + 13px, 18px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; height: auto; display: block; }
a { color: var(--indigo-600); text-decoration-color: color-mix(in srgb, var(--indigo-600) 35%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 0 0 .4em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--indigo-600); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--gold-soft); color: var(--ink); }

/* ------------------------------- Utilities ------------------------------ */
.wrap { width: min(var(--maxw), 100% - var(--gut) * 2); margin-inline: auto; }
.read { max-width: var(--readw); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--indigo-600);
  background: var(--indigo-050);
  padding: .35em .8em; border-radius: 999px;
}
.muted { color: var(--text-3); }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--indigo-600); color: #fff; padding: 10px 16px; border-radius: 10px;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 12px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------ Reading bar ----------------------------- */
.progress-rail {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 90;
  background: transparent; pointer-events: none;
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--indigo-600), var(--gold));
  transition: width 80ms linear;
}

/* --------------------------------- Nav ---------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 80;
  backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 18px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; color: var(--text); }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--indigo-600), var(--violet));
  color: #fff; display: grid; place-items: center; font-size: .92rem; font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.brand small { display: block; font-weight: 600; font-size: .68rem; color: var(--text-3); letter-spacing: .02em; }
.nav-links { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.nav-links a {
  font-size: .86rem; font-weight: 600; color: var(--text-2); text-decoration: none;
  padding: 8px 11px; border-radius: 9px; white-space: nowrap;
}
.nav-links a:hover { background: var(--card-2); color: var(--text); }
.nav-toggle, .theme-btn {
  border: 1px solid var(--line-strong); background: var(--card); color: var(--text);
  width: 40px; height: 40px; border-radius: 11px; cursor: pointer; display: grid; place-items: center;
  font-size: 1.05rem; transition: background var(--t-fast), transform var(--t-fast);
}
.theme-btn:hover { background: var(--card-2); }
.theme-btn:active { transform: scale(.94); }
.nav-toggle { display: none; }
@media (max-width: 940px) {
  .nav-links {
    position: fixed; inset: 60px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 12px var(--gut) 20px; box-shadow: var(--shadow);
    transform: translateY(-130%); transition: transform var(--t);
    max-height: calc(100vh - 60px); overflow: auto;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
  .nav-toggle { display: grid; }
}

/* --------------------------------- Hero --------------------------------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 80px);
  background:
    radial-gradient(1100px 520px at 78% -8%, color-mix(in srgb, var(--violet) 24%, transparent), transparent 60%),
    radial-gradient(900px 460px at 8% 6%, color-mix(in srgb, var(--indigo-600) 22%, transparent), transparent 58%),
    linear-gradient(180deg, var(--ink), var(--ink-soft));
  color: var(--text-on-dark);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 78%);
          mask-image: linear-gradient(180deg, #000, transparent 78%);
}
.hero .wrap { position: relative; z-index: 2; }
.hero .eyebrow { background: rgba(255, 255, 255, .12); color: #e9e9ff; }
.hero h1 {
  color: #fff; max-width: 16ch;
  font-size: clamp(2.3rem, 6.2vw, 4.6rem); line-height: 1.04; margin: .35em 0 .3em;
}
.hero h1 .hl {
  background: linear-gradient(120deg, var(--gold), #ffd86b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: #d9d9f2; max-width: 60ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: .55em; cursor: pointer;
  font-weight: 700; font-size: .98rem; text-decoration: none;
  padding: 13px 22px; border-radius: 13px; border: 1px solid transparent;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.btn-primary { background: linear-gradient(135deg, var(--gold), #f0bf3c); color: #2a1d00; box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .25); }
.btn-ghost:hover { background: rgba(255, 255, 255, .16); }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 42px;
}
.hero-stats .stat {
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius); padding: 18px 18px 16px; backdrop-filter: blur(6px);
}
.hero-stats .num { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; color: #fff; letter-spacing: -.02em; }
.hero-stats .num .unit { font-size: .55em; color: var(--gold-soft); margin-left: .15em; }
.hero-stats .lbl { font-size: .82rem; color: #cfcfe8; margin-top: 2px; }
@media (max-width: 760px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------ Sections -------------------------------- */
.section { padding: clamp(48px, 7vw, 92px) 0; position: relative; scroll-margin-top: 76px; }
.section.alt { background: var(--paper-2); }
.section-head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.7rem); }
.section-head .kicker {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.section-head .kicker .idx {
  font-family: var(--mono); font-size: .8rem; font-weight: 700; color: var(--indigo-600);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 3px 8px; background: var(--card);
}
.section-head .dek { font-size: 1.1rem; color: var(--text-2); }

/* prose */
.prose p { color: var(--text-2); }
.prose h3 { margin-top: 1.6em; font-size: 1.3rem; }
.prose ul, .prose ol { color: var(--text-2); padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose strong { color: var(--text); }

/* generic grids */
.grid { display: grid; gap: clamp(16px, 2vw, 24px); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* card base */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(20px, 2.4vw, 28px); box-shadow: var(--shadow-sm);
}
.card.pad-lg { padding: clamp(24px, 3vw, 36px); }

/* ----------------------------- Fact cards ------------------------------- */
.fact {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 8px; position: relative;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.fact:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.fact .ico { font-size: 1.5rem; line-height: 1; }
.fact .ft { font-weight: 700; color: var(--text); font-size: 1.02rem; }
.fact .fd { font-size: .92rem; color: var(--text-2); margin: 0; }
.fact .src { margin-top: auto; font-size: .76rem; }
.fact .src a { color: var(--text-3); text-decoration: none; border-bottom: 1px dotted var(--line-strong); }
.fact .src a:hover { color: var(--indigo-600); }

/* Big stat tiles within sections */
.stat-tile { text-align: left; }
.stat-tile .big { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -.03em; color: var(--indigo-600); line-height: 1; }
.stat-tile.gold .big { color: var(--gold); }
.stat-tile.teal .big { color: var(--teal); }
.stat-tile.rose .big { color: var(--rose); }
.stat-tile .cap { margin-top: 8px; font-size: .9rem; color: var(--text-2); }

/* --------------------------------- Chart -------------------------------- */
.chart-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(18px, 2.2vw, 26px); box-shadow: var(--shadow-sm);
}
.chart-card h3 { font-size: 1.18rem; margin-bottom: 4px; }
.chart-card .chart-desc { font-size: .9rem; color: var(--text-2); margin-bottom: 14px; }
.chart-holder { position: relative; width: 100%; height: clamp(260px, 42vw, 380px); }
.chart-holder.tall { height: clamp(320px, 50vw, 460px); }
.chart-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: .78rem; color: var(--text-3); }
.chart-foot a { color: var(--text-3); }
.chart-note { margin-top: 12px; padding: 12px 14px; background: var(--card-2); border-radius: var(--radius-sm); font-size: .85rem; color: var(--text-2); border-left: 3px solid var(--indigo-300); }

/* legend chips for custom viz */
.legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; font-size: .82rem; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* ------------------------------- Timeline ------------------------------- */
.timeline { position: relative; margin: 8px 0; padding-left: 4px; }
.timeline::before {
  content: ""; position: absolute; left: 21px; top: 6px; bottom: 6px; width: 3px;
  background: linear-gradient(180deg, var(--indigo-600), var(--gold)); border-radius: 3px;
}
.tl-item { position: relative; padding: 0 0 26px 58px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: 12px; top: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--indigo-600); z-index: 1;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--indigo-600) 14%, transparent);
}
.tl-item.gold .tl-dot { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 18%, transparent); }
.tl-year { font-family: var(--mono); font-weight: 700; color: var(--indigo-600); font-size: .92rem; }
.tl-item.gold .tl-year { color: var(--gold); }
.tl-event { font-weight: 700; margin: 2px 0 2px; }
.tl-detail { font-size: .9rem; color: var(--text-2); margin: 0; }

/* -------------------------------- People -------------------------------- */
.person {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.person .av {
  width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 1.05rem; letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--indigo-600), var(--violet));
}
.person:nth-child(3n+2) .av { background: linear-gradient(135deg, var(--teal), var(--sky)); }
.person:nth-child(3n) .av { background: linear-gradient(135deg, var(--amber), var(--gold)); }
.person .pn { font-weight: 700; }
.person .pr { font-size: .82rem; color: var(--indigo-600); font-weight: 600; }
.person .pc { font-size: .88rem; color: var(--text-2); margin: 4px 0 0; }

/* -------------------------------- Quotes -------------------------------- */
.quote {
  border-left: 4px solid var(--gold); background: var(--card-2);
  padding: 20px 22px; border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow-sm);
}
.quote blockquote { margin: 0; font-size: 1.12rem; font-weight: 500; color: var(--text); }
.quote cite { display: block; margin-top: 10px; font-size: .85rem; color: var(--text-3); font-style: normal; }
.quote cite a { color: var(--text-3); }

/* -------------------------- Callout / disclaimer ------------------------ */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  background: var(--card-2);
}
.callout .ci { font-size: 1.3rem; flex: none; }
.callout.info { border-left: 4px solid var(--sky); }
.callout.warn { border-left: 4px solid var(--amber); }
.callout p { margin: 0; font-size: .92rem; color: var(--text-2); }
.callout strong { color: var(--text); }

/* ------------------------------- Mini-apps ------------------------------ */
.app {
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  padding: clamp(22px, 2.6vw, 32px); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.app::before {
  content: "INTERACTIVE"; position: absolute; top: 16px; right: -34px; transform: rotate(45deg);
  background: var(--indigo-600); color: #fff; font-size: .62rem; font-weight: 800; letter-spacing: .14em;
  padding: 4px 44px;
}
.app h3 { font-size: 1.35rem; }
.app .app-sub { color: var(--text-2); font-size: .95rem; margin-top: -4px; }
.app-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* generic form controls */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
select, input[type="text"], input[type="number"] {
  font: inherit; color: var(--text); background: var(--card-2);
  border: 1px solid var(--line-strong); border-radius: 11px; padding: 11px 13px; min-width: 0;
}
select:focus, input:focus { border-color: var(--indigo-600); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-strong); background: var(--card-2); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font-size: .88rem; font-weight: 600; cursor: pointer;
  transition: all var(--t-fast); user-select: none;
}
.chip:hover { border-color: var(--indigo-300); }
.chip[aria-pressed="true"], .chip.on { background: var(--indigo-600); color: #fff; border-color: var(--indigo-600); }
.chip.cat-eng[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); }
.chip.cat-mat[aria-pressed="true"] { background: var(--sky); border-color: var(--sky); }
.chip.cat-sci[aria-pressed="true"] { background: var(--emerald); border-color: var(--emerald); }
.chip.cat-hum[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); }
.chip.cat-lang[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); }

/* range slider */
.range-wrap { display: flex; align-items: center; gap: 14px; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 8px; border-radius: 999px; background: var(--line-strong); outline-offset: 6px; flex: 1; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--indigo-600); border: 4px solid #fff; box-shadow: var(--shadow-sm); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--indigo-600); border: 4px solid #fff; cursor: pointer; }

/* grade converter display */
.gc-display { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin: 18px 0; }
.gc-badge {
  display: grid; place-items: center; aspect-ratio: 1; width: 100%; max-width: 150px; margin-inline: auto;
  border-radius: var(--radius-lg); color: #fff; font-weight: 800; box-shadow: var(--shadow);
  background: var(--indigo-600);
}
.gc-badge .g { font-size: clamp(2.6rem, 8vw, 4rem); line-height: 1; }
.gc-badge .gt { font-size: .8rem; opacity: .9; font-weight: 700; letter-spacing: .1em; }
.gc-arrow { font-size: 1.6rem; color: var(--text-3); }
.gc-meaning { text-align: center; font-size: .95rem; color: var(--text-2); margin-top: 6px; min-height: 2.6em; }

/* result / output panels */
.result-panel {
  margin-top: 18px; padding: 18px 20px; border-radius: var(--radius);
  background: var(--card-2); border: 1px dashed var(--line-strong);
}
.result-panel.good { border-style: solid; border-color: var(--emerald); background: color-mix(in srgb, var(--emerald) 9%, var(--card)); }
.result-panel.bad { border-style: solid; border-color: var(--amber); background: color-mix(in srgb, var(--amber) 9%, var(--card)); }
.result-big { font-size: 1.5rem; font-weight: 800; }

/* meter */
.meter { height: 14px; border-radius: 999px; background: var(--line-strong); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--indigo-600), var(--gold)); transition: width var(--t); }

/* quiz */
.quiz-q { font-size: 1.15rem; font-weight: 700; margin-bottom: 14px; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt {
  text-align: left; border: 1px solid var(--line-strong); background: var(--card-2); color: var(--text);
  border-radius: 13px; padding: 14px 16px; cursor: pointer; font: inherit; font-weight: 600;
  transition: all var(--t-fast); display: flex; gap: 10px; align-items: center;
}
.quiz-opt:hover:not([disabled]) { border-color: var(--indigo-300); transform: translateX(2px); }
.quiz-opt .mk { width: 26px; height: 26px; border-radius: 8px; background: var(--card); border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: .8rem; flex: none; }
.quiz-opt.correct { border-color: var(--emerald); background: color-mix(in srgb, var(--emerald) 12%, var(--card)); }
.quiz-opt.wrong { border-color: var(--rose); background: color-mix(in srgb, var(--rose) 12%, var(--card)); }
.quiz-progress { font-size: .82rem; color: var(--text-3); font-weight: 600; }
.quiz-explain { margin-top: 12px; font-size: .9rem; color: var(--text-2); padding: 12px 14px; background: var(--card-2); border-radius: 12px; border-left: 3px solid var(--indigo-300); }

/* planner output */
.planner-grid { display: grid; gap: 8px; margin-top: 14px; }
.planner-day { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: center; padding: 10px 12px; background: var(--card-2); border-radius: 12px; }
.planner-day .d { font-weight: 700; font-size: .85rem; color: var(--indigo-600); }
.planner-day .s { font-size: .88rem; color: var(--text-2); }
.pill { display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--indigo-050); color: var(--indigo-600); margin: 0 4px 4px 0; }

/* countdown */
.countdown { display: flex; gap: 12px; flex-wrap: wrap; }
.cd-unit { text-align: center; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; min-width: 84px; }
.cd-unit .n { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; color: var(--indigo-600); font-variant-numeric: tabular-nums; line-height: 1; }
.cd-unit .u { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-top: 6px; }

/* ----------------------------- Source / links -------------------------- */
.linklist { columns: 2; column-gap: 28px; }
@media (max-width: 680px) { .linklist { columns: 1; } }
.linklist a { break-inside: avoid; display: block; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 600; font-size: .92rem; }
.linklist a:hover { color: var(--indigo-600); }
.linklist a .host { display: block; font-size: .76rem; color: var(--text-3); font-weight: 500; }

/* tags */
.tagrow { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: .78rem; font-weight: 600; color: var(--text-2); background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; }

/* ------------------------------- TOC jump ------------------------------- */
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.toc a {
  display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow-sm); transition: transform var(--t-fast), border-color var(--t-fast);
}
.toc a:hover { transform: translateY(-3px); border-color: var(--indigo-300); }
.toc a .ti { font-size: 1.4rem; }
.toc a .tx b { display: block; font-size: .96rem; }
.toc a .tx span { font-size: .8rem; color: var(--text-3); }

/* -------------------------------- Footer -------------------------------- */
.footer { background: var(--ink); color: #cfcfe8; padding: 56px 0 40px; }
.footer h4 { color: #fff; font-size: 1rem; }
.footer a { color: #b9b9e0; }
.footer .foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .footer .foot-grid { grid-template-columns: 1fr; } }
.footer .fine { margin-top: 36px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; color: #9a98bb; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

/* AI-assisted data disclaimer — site convention: pages whose charts/tables were
   compiled with AI help carry this at the foot of <main>. */
.ai-disclaimer {
  margin: 8px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: .82rem;
  line-height: 1.6;
}

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* print */
@media print {
  .nav, .progress-rail, .hero-cta, .app, .theme-btn, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .section { padding: 18px 0; }
  a { color: #000; text-decoration: underline; }
}
