/* ==========================================================================
   Heurisco — design system
   Palette (justified): ink navy + cool graph-paper off-white feel like a maths
   exercise book, not a SaaS template. Amber is a highlighter pen: used only as a
   fill behind navy text, never as text on paper (contrast).
   ========================================================================== */

/* Self-hosted fonts (SIL OFL). No third-party requests: better for under-18 privacy. */
@font-face { font-family: "STIX Two Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/stix-two-text-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "STIX Two Text"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/stix-two-text-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "STIX Two Text"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/stix-two-text-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "STIX Two Text"; font-style: italic; font-weight: 600; font-display: swap; src: url("../fonts/stix-two-text-latin-600-italic.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: italic; font-weight: 100 900; font-display: swap; src: url("../fonts/hanken-grotesk-latin-wght-italic.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --navy: #0c1a36;
  --amber: #ffb224;

  --bg: #f3f5f7;
  --fg: #0c1a36;
  --muted: #475676;          /* 6.9:1 on --bg */
  --surface: #ffffff;
  --line: #c9d2e0;
  --grid: #dde4ee;
  --accent: var(--amber);
  --on-accent: var(--navy);
  --focus: #1b4fd8;
  --flag-bg: #ffe08a;
  --flag-fg: #3b2a00;

  --serif: "STIX Two Text", "Cambria", "Georgia", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1.03rem, 1rem + 0.15vw, 1.12rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.55rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.4vw, 2.3rem);
  --step-3: clamp(2.1rem, 1.5rem + 3vw, 3.4rem);
  --step-4: clamp(2.5rem, 1.6rem + 4vw, 4.1rem);

  --gutter: 1rem;
  --maxw: 72rem;
  --radius: 4px;
}

:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09112a; --fg: #e9eefa; --muted: #a6b5d3; --surface: #101d3d;
    --line: #2a3b63; --grid: #14213f; --focus: #8fb0ff;
  }
}
:root[data-theme="dark"] {
  --bg: #09112a; --fg: #e9eefa; --muted: #a6b5d3; --surface: #101d3d;
  --line: #2a3b63; --grid: #14213f; --focus: #8fb0ff;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 var(--step-0)/1.62 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; text-wrap: balance; letter-spacing: -0.005em; }
h1 { font-size: var(--step-4); line-height: 1.02; letter-spacing: -0.015em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; max-width: 64ch; text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--on-accent); padding: .75rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.num { font-variant-numeric: tabular-nums; }
.lede { font-size: var(--step-1); line-height: 1.5; max-width: 38ch; font-family: var(--serif); }

/* Editorial flags: [VERIFY] / [CONFIRM] must be impossible to miss in review. */
.flag { background: var(--flag-bg); color: var(--flag-fg); padding: 0 .3em; border-radius: 2px; font-weight: 600; font-size: .92em; }
.placeholder-tag { display: inline-block; border: 1px dashed var(--muted); color: var(--muted); padding: .05rem .5rem; font-size: var(--step--1); border-radius: 99px; }

/* ---------- Sections (modifiers never fight the base padding) ---------- */
.section { padding-block: clamp(3rem, 8vw, 6rem); }
.section--grid {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
.band-ink {
  --bg: #0c1a36; --fg: #eaf0fa; --muted: #aebcd9; --surface: #14264d; --line: #2d4170; --focus: #ffd27a;
  background: var(--bg); color: var(--fg);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.35rem; border: 2px solid var(--fg); border-radius: var(--radius);
  font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  background: transparent; color: var(--fg);
}
.btn:hover { background: var(--fg); color: var(--bg); text-decoration: none; }
.btn--primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: 3px 3px 0 var(--fg); }
.btn--primary:hover { background: var(--accent); color: var(--on-accent); transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--fg); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
@media (prefers-reduced-motion: no-preference) { .btn { transition: transform .08s, box-shadow .08s, background .15s, color .15s; } }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: .55rem; font: 600 1.45rem/1 var(--serif); text-decoration: none; letter-spacing: -0.01em; }
.wordmark:hover { text-decoration: none; }
.mark { width: 1.35em; height: 1.35em; flex: none; }
.mark circle { fill: currentColor; }
.nav { display: none; gap: 1.5rem; align-items: center; }
.nav a { text-decoration: none; padding: .5rem 0; font-weight: 500; }
.nav a:hover { text-decoration: underline; text-underline-offset: .35em; }
.head-actions { display: flex; align-items: center; gap: .5rem; }
.basket-link { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .75rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-weight: 600; }
.basket-count { min-width: 1.4rem; height: 1.4rem; border-radius: 99px; background: var(--fg); color: var(--bg); font-size: .8rem; display: inline-grid; place-items: center; padding: 0 .3rem; }
.menu { position: relative; }
.menu summary { list-style: none; min-height: 44px; min-width: 44px; display: grid; place-items: center; cursor: pointer; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; padding: 0 .85rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + .5rem); width: min(80vw, 18rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; box-shadow: 4px 4px 0 var(--fg); display: grid; }
.menu-panel a { padding: .85rem .75rem; text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line); }
.menu-panel a:last-child { border-bottom: 0; }
@media (min-width: 62rem) { .nav { display: flex; } .menu { display: none; } }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem); }
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 62rem) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.product .placeholder-tag { margin-left: .5rem; }
.product h1 { margin-top: .5rem; }
.hero h1 { margin-bottom: .35em; }
.hero .lede { margin-bottom: 1.5rem; }
.signup { display: grid; gap: .65rem; max-width: 30rem; }
.signup .row { display: grid; gap: .65rem; }
@media (min-width: 34rem) { .signup .row { grid-template-columns: 1fr auto; } }
.field { width: 100%; min-height: 48px; padding: .65rem .9rem; border: 2px solid var(--fg); border-radius: var(--radius); background: var(--surface); color: var(--fg); font: 400 1rem/1.3 var(--sans); }
.field::placeholder { color: var(--muted); opacity: 1; }
.hero-secondary { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; }

/* The proof panel: the one moving thing on the page. A worked solution writes itself and ends in the therefore sign. */
.proof { background: var(--surface); border: 2px solid var(--fg); border-radius: var(--radius); box-shadow: 8px 8px 0 var(--fg); padding: clamp(1.1rem, 3vw, 1.75rem); font-family: var(--serif); font-size: clamp(1.05rem, .95rem + .6vw, 1.35rem); line-height: 1.5; }
.proof-head { display: flex; justify-content: space-between; gap: 1rem; font: 500 var(--step--1)/1.3 var(--sans); color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: .65rem; margin-bottom: 1rem; }
.proof .q { margin: 0 0 1rem; max-width: none; }
.proof ol { list-style: none; margin: 0; padding: 0; }
.proof li { padding: .3rem 0; display: flex; gap: .75rem; align-items: baseline; }
.proof li .why { margin-left: auto; font: 400 var(--step--1)/1.3 var(--sans); color: var(--muted); text-align: right; }
.proof i { font-style: italic; }
.proof .result { margin-top: .6rem; padding-top: .8rem; border-top: 1px solid var(--line); font-weight: 600; font-size: 1.12em; }
.hl { background: linear-gradient(transparent 52%, var(--accent) 52% 94%, transparent 94%); padding: 0 .2em; color: var(--navy); }
:root[data-theme="dark"] .hl, .band-ink .hl { color: var(--fg); background: linear-gradient(transparent 52%, rgba(255,178,36,.45) 52% 94%, transparent 94%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hl { color: var(--fg); background: linear-gradient(transparent 52%, rgba(255,178,36,.45) 52% 94%, transparent 94%); } }
@media (prefers-reduced-motion: no-preference) {
  .proof [data-step] { opacity: 0; animation: write .5s ease-out forwards; animation-delay: calc(var(--i) * .75s + .5s); }
  @keyframes write { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
}

/* ---------- Tests ---------- */
.esat-feature { display: grid; gap: 1.5rem; border: 2px solid var(--fg); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); background: var(--surface); }
@media (min-width: 52rem) { .esat-feature { grid-template-columns: 1.3fr 1fr; align-items: center; } }
.esat-feature h3 { font-size: var(--step-2); margin-bottom: .25em; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0 0 1.25rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.countdown { border-left: 4px solid var(--accent); padding: .25rem 0 .25rem 1rem; }
.countdown .big { font: 600 var(--step-3)/1 var(--serif); font-variant-numeric: tabular-nums; }
.countdown p { margin: .35rem 0 0; }
.soon-list { list-style: none; margin: 1.5rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.soon-list li { display: grid; gap: .25rem 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--line); align-items: center; }
@media (min-width: 46rem) { .soon-list li { grid-template-columns: 8rem 1fr auto; } }
.soon-list strong { font: 600 var(--step-1)/1.2 var(--serif); }

/* ---------- Covers (CSS paper mockups) ---------- */
.cover-wrap { position: relative; padding: 0 .5rem .5rem 0; }
.cover {
  position: relative; aspect-ratio: 3 / 4; border-radius: 3px 6px 6px 3px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; padding: 7% 8%;
  background: var(--navy); color: #eaf0fa; box-shadow: 3px 3px 0 rgba(12,26,54,.9), 0 0 0 1px rgba(12,26,54,.9);
  font-family: var(--serif); isolation: isolate;
}
.cover::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5%; background: rgba(255,255,255,.08); z-index: -1; } /* spine */
.cover-top { display: flex; align-items: center; gap: .4em; font: 600 .78em/1 var(--serif); opacity: .9; }
.cover-top .mark { width: 1.2em; height: 1.2em; }
.cover-test { font-size: 2.1em; font-weight: 600; line-height: 1; letter-spacing: -.01em; }
.cover-mod { font-size: 1.05em; font-style: italic; opacity: .92; margin-top: .25em; }
.cover-title { font: 600 1.05em/1.15 var(--serif); }
.cover-meta { font: 500 .72em/1.3 var(--sans); opacity: .78; margin-top: .4em; }
.cover-rule { height: 4px; width: 38%; background: var(--amber); margin: .6em 0; }
.cover--topic { background-color: #fbfcfd; color: var(--navy); background-image: linear-gradient(#dde4ee 1px, transparent 1px), linear-gradient(90deg, #dde4ee 1px, transparent 1px); background-size: 14px 14px; }
.cover--topic::before { background: rgba(12,26,54,.12); }
.cover--phys, .cover--chem, .cover--bio { background-image: linear-gradient(rgba(37,60,110,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(37,60,110,.13) 1px, transparent 1px); background-size: 14px 14px; }
.cover--phys { background-color: #edf4fd; }
.cover--chem { background-color: #fff7e2; }
.cover--bio { background-color: #eef9f1; }
.cover--phys::before { background: rgba(37,99,176,.16); } .cover--chem::before { background: rgba(214,160,10,.2); } .cover--bio::before { background: rgba(34,140,74,.17); }
.cover--bundle { background: #13244a; }
.cover-stack { position: absolute; inset: 0; z-index: -1; }
.cover-wrap::before, .cover-wrap::after { content: ""; position: absolute; left: .5rem; right: 0; top: .5rem; bottom: 0; background: #fff; border: 1px solid var(--navy); border-radius: 3px 6px 6px 3px; z-index: 0; }
.cover-wrap::after { left: .25rem; top: .25rem; bottom: .25rem; right: .25rem; }
.cover-wrap .cover { z-index: 1; }
.cover-wrap { width: 100%; }
.cover-xl { font-size: clamp(.95rem, .8rem + .8vw, 1.3rem); width: min(100%, 17rem); }
.cover-sm { font-size: .78rem; }
@media (max-width: 55.99rem) { .product-media .cover-wrap { width: 12.5rem; } .product-media .cover-xl { font-size: .85rem; } }
.mark-inline { display: inline-block; width: .85em; height: .85em; vertical-align: -.06em; margin-right: .4em; }

/* ---------- Product grid ---------- */
.grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 14.5rem), 1fr)); list-style: none; padding: 0; margin: 0; }
.pcard { display: grid; gap: .85rem; align-content: start; position: relative; }
.pcard h3 { font-size: 1.12rem; line-height: 1.25; margin: 0; }
.pcard a.stretch { text-decoration: none; }
.pcard a.stretch::after { content: ""; position: absolute; inset: 0; }
.pcard .kind { color: var(--muted); font-size: var(--step--1); margin: 0; }
.price-row { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.price { font: 600 1.45rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.was { color: var(--muted); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.save { font-weight: 700; font-size: var(--step--1); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pcard .cover-wrap { transition: transform .15s; }
  .pcard:hover .cover-wrap { transform: translateY(-4px); }
}

/* ---------- How it works / trust ---------- */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 2rem 0 0; display: grid; gap: 2rem; }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }
.steps li { counter-increment: s; border-top: 2px solid var(--fg); padding-top: 1rem; }
.steps li::before { content: counter(s); font: 600 var(--step-2)/1 var(--serif); display: block; margin-bottom: .5rem; }
.steps h3 { margin-bottom: .3em; }
.split { display: grid; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 52rem) { .split { grid-template-columns: 1fr 1fr; } }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.checks li { display: grid; grid-template-columns: 1.6rem 1fr; gap: .75rem; }
.checks svg { width: 1.4rem; height: 1.4rem; margin-top: .15rem; }
.checks svg path { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.notice { border: 1px dashed var(--muted); padding: .85rem 1rem; border-radius: var(--radius); font-size: var(--step--1); }
.slot { border: 2px dashed var(--line); padding: 1.25rem; border-radius: var(--radius); color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); max-width: 48rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 1.1rem 2.5rem 1.1rem 0; font: 600 var(--step-1)/1.3 var(--serif); position: relative; min-height: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: 1rem; font: 400 1.6rem/1 var(--sans); }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 0 1.25rem; }

/* ---------- Product page ---------- */
.crumbs { font-size: var(--step--1); color: var(--muted); padding-block: 1rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .6rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: .6rem; color: var(--line); }
.product { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); padding-bottom: 3rem; }
@media (min-width: 56rem) { .product { grid-template-columns: minmax(0, 20rem) 1fr; align-items: start; } .product-media { position: sticky; top: 5.5rem; } }
.product h1 { font-size: var(--step-3); margin-bottom: .3em; }
.buybox { border: 2px solid var(--fg); border-radius: var(--radius); background: var(--surface); padding: 1.25rem; display: grid; gap: .9rem; margin-block: 1.5rem; }
.buybox .price { font-size: 2.1rem; }
.buy-actions { display: grid; gap: .6rem; }
@media (min-width: 34rem) { .buy-actions { grid-template-columns: 1fr 1fr; } }
.assure { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: var(--step--1); color: var(--muted); }
.spec { display: grid; grid-template-columns: 1fr; margin: 0; border-top: 1px solid var(--line); }
.spec div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; font-weight: 600; text-align: right; }
.includes { margin: 0; padding-left: 1.2rem; }
.sheet { background: #fff; color: var(--navy); border: 1px solid var(--navy); border-radius: 2px; padding: 1.25rem 1.5rem 1.5rem; font-family: var(--serif); box-shadow: 5px 5px 0 var(--navy); max-width: 34rem; position: relative;
  background-image: repeating-linear-gradient(transparent 0 31px, #e3e9f2 31px 32px); }
.sheet .q { font-size: 1.05rem; line-height: 32px; margin: 0; max-width: none; }
.sheet .opts { list-style: none; margin: .5rem 0 0; padding: 0; line-height: 32px; }
.sheet .opts li { display: flex; gap: .75rem; }
.sheet .opts b { width: 1.5rem; font-weight: 600; }
.sheet-tag { position: absolute; top: .6rem; right: .8rem; font: 600 .7rem/1 var(--sans); color: #475676; border: 1px dashed #475676; padding: .2rem .45rem; border-radius: 99px; background: #fff; }
.mini-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.mini-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.related { border-top: 1px solid var(--line); padding-top: 2.5rem; }
.sticky-buy { display: none; }
@media (max-width: 55.99rem) {
  .sticky-buy { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; gap: 1rem; align-items: center; justify-content: space-between; padding: .7rem var(--gutter) calc(.7rem + env(safe-area-inset-bottom)); background: var(--bg); border-top: 2px solid var(--fg); }
  .sticky-buy .price { font-size: 1.5rem; }
  body.has-sticky { padding-bottom: 5.5rem; }
}

/* ---------- Footer, consent, toast ---------- */
.site-footer { padding-block: 3rem 2rem; }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 52rem) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer h2 { font: 600 1rem/1.3 var(--sans); margin-bottom: .6rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; }
.site-footer li a { display: inline-block; padding: .35rem 0; }
.disclaimer { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.25rem; font-size: var(--step--1); color: var(--muted); max-width: 70ch; }
.consent { position: fixed; left: var(--gutter); right: var(--gutter); bottom: var(--gutter); z-index: 80; max-width: 36rem; background: var(--surface); color: var(--fg); border: 2px solid var(--fg); border-radius: var(--radius); box-shadow: 5px 5px 0 var(--fg); padding: 1rem 1.1rem; }
.consent[hidden] { display: none; }
.consent p { margin: 0 0 .8rem; font-size: var(--step--1); }
.consent .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
body.has-sticky .consent { bottom: 5.5rem; }
@media (min-width: 56rem) { body.has-sticky .consent { bottom: var(--gutter); } }
.toast { position: fixed; left: 50%; bottom: 6rem; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: .8rem 1.1rem; border-radius: var(--radius); z-index: 90; max-width: min(92vw, 28rem); font-weight: 500; }
.toast[hidden] { display: none; }
.form-note { font-size: var(--step--1); color: var(--muted); margin: 0; }
.form-ok { font-weight: 600; margin: 0; }
.stub { padding-block: clamp(4rem, 12vw, 8rem); }


/* ---------- Inner pages ---------- */
.page-head { padding-block: 0 clamp(2rem, 5vw, 3.5rem); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: var(--step-3); margin-bottom: .3em; }
.page-head .lede { max-width: 46ch; margin-bottom: 0; }
.page-head .crumbs { padding-top: 1.25rem; }
.prose { max-width: 46rem; }
.prose h2 { font-size: var(--step-2); margin-top: 2.5rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: .5rem; }
.callout { border-left: 4px solid var(--accent); background: var(--surface); padding: .9rem 1.1rem; max-width: 46rem; margin: 1.5rem 0 0; }
.plain { padding-left: 1.2rem; display: grid; gap: .5rem; }
.shelf { margin-top: 3.5rem; scroll-margin-top: 5rem; }
.shelf:first-of-type { margin-top: 2rem; }
.jump ul { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; }
.jump a { display: inline-flex; min-height: 44px; align-items: center; padding: 0 1rem; border: 2px solid var(--fg); border-radius: 99px; text-decoration: none; font-weight: 600; }
.jump a:hover { background: var(--fg); color: var(--bg); }
.soon { margin-top: 1.25rem; color: var(--muted); }
.soon summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.soon ul { columns: 2 16rem; padding-left: 1.2rem; margin: .5rem 0 0; }

.mod-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.mod-card { position: relative; background: var(--surface); border: 2px solid var(--fg); border-radius: var(--radius); padding: 1.25rem; display: grid; gap: .25rem; align-content: start; }
.mod-card h3 { font-size: var(--step-1); margin: 0 0 .25rem; }
.mod-card a.stretch { text-decoration: none; }
.mod-card a.stretch::after { content: ""; position: absolute; inset: 0; }
.mod-card p { margin: 0 0 .5rem; }
@media (hover: hover) { .mod-card:hover { box-shadow: 4px 4px 0 var(--fg); } }

.table-wrap { overflow-x: auto; border-top: 2px solid var(--fg); }
.topics { width: 100%; border-collapse: collapse; }
.topics th, .topics td { text-align: left; padding: .8rem .75rem .8rem 0; border-bottom: 1px solid var(--line); vertical-align: baseline; font-weight: 400; }
.topics thead th { font: 600 var(--step--1)/1.3 var(--sans); color: var(--muted); }
.topics tbody th { font-weight: 600; }
.topics .num { margin-right: .5rem; }
@media (max-width: 40rem) { .hide-sm { display: none; } }

.lesson-list { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: 0; border-top: 2px solid var(--fg); }
.lesson-list a { display: grid; grid-template-columns: 2.2rem 1fr; gap: .1rem .75rem; padding: .9rem 0; border-bottom: 1px solid var(--line); text-decoration: none; min-height: 48px; }
.lesson-list a:hover strong { text-decoration: underline; }
.lesson-list .small { grid-column: 2; }
.lesson-grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
@media (min-width: 56rem) { .lesson-grid { grid-template-columns: 1fr 22rem; align-items: start; } .side { position: sticky; top: 5.5rem; } }
.side .buybox { margin-block: 0 1rem; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-weight: 600; }

.preview-grid { display: grid; gap: 1.25rem; margin-top: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.preview-grid figure { margin: 0; }
.preview-grid img { width: 100%; height: auto; border: 1px solid var(--navy); box-shadow: 4px 4px 0 var(--navy); background: #fff; aspect-ratio: 820 / 1160; }
.preview-grid figcaption { margin-top: .6rem; font-size: var(--step--1); color: var(--muted); }
.preview-grid.one { grid-template-columns: minmax(0, 22rem); align-content: start; }

.report { display: grid; gap: .5rem; max-width: 34rem; }
.report label { font-weight: 600; margin-top: .5rem; }
.report textarea.field { resize: vertical; min-height: 8rem; }
.report select.field { appearance: auto; }
.report .btn { margin-top: 1rem; justify-self: start; }

button.linklike { background: none; border: 0; padding: .25rem; margin-left: .5rem; font: inherit; text-decoration: underline; cursor: pointer; color: inherit; min-height: 44px; }

/* ---------- Section navigation: always shows where you are (type) and which subject ---------- */
.subnav { background: var(--surface); border-bottom: 1px solid var(--line); }
.subnav .wrap { display: grid; gap: .25rem 2rem; padding-block: .6rem; }
@media (min-width: 62rem) { .subnav .wrap { grid-template-columns: auto 1fr; align-items: center; } .subnav .wrap > nav { display: flex; align-items: center; gap: .75rem; } }
.subnav-label { font-size: var(--step--1); color: var(--muted); white-space: nowrap; display: block; }
.subnav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; }
.subnav .tabs a, .subnav .chips a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 .85rem; text-decoration: none; font-weight: 600; font-size: var(--step--1); border-radius: 99px; }
.subnav .tabs a { border: 1px solid transparent; }
.subnav .tabs a:hover, .subnav .chips a:hover { background: var(--grid); }
.subnav .tabs a[aria-current="page"] { background: var(--fg); color: var(--bg); }
.subnav .chips a { border: 1px solid var(--line); }
.subnav .chips a[aria-current="page"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.subnav nav { overflow-x: auto; }
@media (max-width: 61.99rem) { .subnav ul { flex-wrap: nowrap; } .subnav .tabs a, .subnav .chips a { white-space: nowrap; } .subnav .wrap { gap: .1rem; } }
.tag { font: 700 .72rem/1 var(--sans); letter-spacing: .02em; margin: 0 0 .35rem; color: var(--muted); }
.tag--mock { color: var(--fg); }
.matrix .topics td, .matrix .topics th { padding-block: 1rem; }
.matrix .topics th a { font: 600 var(--step-1)/1.2 var(--serif); }

@media print { .site-header, .sticky-buy, .consent, .toast { display: none !important; } }

/* ---------- Stage 3: basket, checkout form, consent ticks, test-mode banner ---------- */
.basket-grid { display: grid; gap: 2rem; }
@media (min-width: 52rem) { .basket-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
.basket-grid[hidden] { display: none; }
.basket-items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.basket-item { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.basket-item .cover { font-size: .45rem; }
.basket-item h3 { font-size: 1.05rem; margin: 0 0 .25rem; }
.basket-item p { margin: 0; font-size: var(--step--1); }
.basket-price { display: grid; justify-items: end; gap: .1rem; font-weight: 600; }
.basket-price .linklike { margin: 0; font-weight: 400; }
.checkout { margin-block: 0; }
.field-group { display: grid; gap: .35rem; }
.field-group label { font-weight: 600; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: var(--step--1); line-height: 1.45; cursor: pointer; }
.check input { flex: none; width: 1.35rem; height: 1.35rem; margin-top: .1rem; accent-color: var(--navy); }
.signup .check { color: var(--muted); }
.form-error { color: #9b1c1c; font-weight: 600; margin: 0; font-size: var(--step--1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form-error { color: #ff9d9d; } }
:root[data-theme="dark"] .form-error { color: #ff9d9d; }
.form-error[hidden] { display: none; }
.testbanner { background: var(--flag-bg); color: var(--flag-fg); border: 2px solid var(--flag-fg); margin-bottom: 1.5rem; }
.testbanner[hidden], .callout[hidden] { display: none; }
.field-group[hidden] { display: none; }
.basket-item .save, .checkout .save { display: inline-block; width: fit-content; padding: .1rem .45rem; background: var(--amber); color: var(--navy); font-weight: 600; background-image: none; }
