/* PrismaMath — marketing site.
   Direction: an editorial maths notebook. Newsreader (textbook serif) for
   headings and figures, Manrope for text; graph-paper ground; the brand
   hexagon's split (wireframe / solid) as the visual idea: structure checked,
   understanding filled in. Palette from the logo. Text colours meet WCAG AA
   in both themes. */

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/Newsreader.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/Manrope.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f4ee;
  --paper-2: #eeebe2;
  --card: #fcfbf7;
  --ink: #13264a;
  --text: #33445c;
  --muted: #56657a;
  --line: #d8d3c6;
  --line-strong: #bfb8a8;
  --grid: rgba(19, 38, 74, 0.055);
  --grid-major: rgba(19, 38, 74, 0.085);
  --accent: #086ea1;
  --accent-ink: #0b3f86;
  --cyan: #19c6e6;
  --ok: #0c7556;
  --ok-bg: #e3f3ec;
  --draft-bg: #fbf1dc;
  --draft-line: #d9a441;
  --panel-dark: #13264a;
  --panel-dark-text: #e9eff7;
  --shadow: 0 1px 0 rgba(19, 38, 74, 0.04), 0 18px 40px -22px rgba(19, 38, 74, 0.35);
  --focus: #0b3f86;
  --radius: 14px;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0c1424;
  --paper-2: #101b2f;
  --card: #132038;
  --ink: #e9eff7;
  --text: #c9d4e2;
  --muted: #98a8bd;
  --line: #263654;
  --line-strong: #37496b;
  --grid: rgba(150, 190, 240, 0.05);
  --grid-major: rgba(150, 190, 240, 0.08);
  --accent: #5cc8ee;
  --accent-ink: #9fe3f7;
  --cyan: #2ad3f0;
  --ok: #55d6a8;
  --ok-bg: #11372c;
  --draft-bg: #2e2412;
  --draft-line: #b8862c;
  --panel-dark: #e9eff7;
  --panel-dark-text: #13264a;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 22px 44px -24px rgba(0, 0, 0, 0.7);
  --focus: #9fe3f7;
  color-scheme: dark;
}

/* Without JavaScript the system preference still applies. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #0c1424; --paper-2: #101b2f; --card: #132038; --ink: #e9eff7; --text: #c9d4e2;
    --muted: #98a8bd; --line: #263654; --line-strong: #37496b; --grid: rgba(150, 190, 240, 0.05);
    --grid-major: rgba(150, 190, 240, 0.08); --accent: #5cc8ee; --accent-ink: #9fe3f7; --ok: #55d6a8;
    --ok-bg: #11372c; --draft-bg: #2e2412; --panel-dark: #e9eff7; --panel-dark-text: #13264a; --focus: #9fe3f7;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--cyan) 35%, transparent); color: var(--ink); }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 500; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.5rem, 5.2vw, 4.4rem); line-height: 1.02; letter-spacing: -0.025em; font-weight: 450; }
h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.1; }
h3 { font-size: 1.4rem; line-height: 1.2; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }
.narrow { max-width: 780px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.note { font-size: 0.92rem; color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 1.05rem; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--text); max-width: 38em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; color: var(--paper); }
main:focus { outline: none; }

/* Kicker: "§ 01 — Cómo funciona" */
.kicker {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 18px;
}
.kicker::after { content: ""; height: 1px; flex: 0 1 64px; background: var(--line-strong); }
.kicker-n { color: var(--accent); font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: 0.02em; text-transform: none; font-size: 1.05rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px;
  font: 700 0.98rem/1.2 var(--sans); letter-spacing: 0.005em; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer; transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent-ink); color: var(--paper); }
:root[data-theme="dark"] .btn-primary:hover { background: #ffffff; color: #0c1424; }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-small { min-height: 40px; padding: 8px 16px; font-size: 0.9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.text-link { display: inline-block; padding-block: 6px; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* Header: the dark board strip on every page, in both themes. Every page
   opens on a dark band, so the header and that band read as one. */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7, 13, 26, 0.9);
  backdrop-filter: saturate(1.3) blur(12px); -webkit-backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid rgba(160, 190, 230, 0.14);
  padding-top: env(safe-area-inset-top, 0px);
  color: #c3cfdf;
}
.site-header :focus-visible, .site-footer :focus-visible { outline-color: #7fe3f6; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.mark { width: 31px; height: 35px; flex: none; overflow: visible; color: #0a172c; }
.site-header .mark, .on-dark .mark { color: #e9eff7; }
.brand-name { font: 800 1.18rem/1 var(--sans); letter-spacing: -0.01em; color: var(--ink); }
.brand-name span { color: var(--accent); }
.site-header .brand-name, .on-dark .brand-name, .site-header .brand:hover { color: #f2f6fb; }
.site-header .brand-name span, .on-dark .brand-name span { color: #7fe3f6; }
.site-nav { display: flex; align-items: center; gap: 24px; flex: 1; justify-content: space-between; }
.nav-links { display: flex; gap: 22px; margin-left: 12px; }
.nav-links a, .nav-signin, .nav-lang { color: #c3cfdf; text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: color 0.15s ease; }
.nav-links a:hover, .nav-signin:hover, .nav-lang:hover, .nav-links a[aria-current="page"] { color: #ffffff; }
.nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-color: #2fd3f0; text-decoration-thickness: 2px; text-underline-offset: 0.5em; }
.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-lang { display: inline-block; padding-block: 8px; font-size: 0.88rem; color: #93a5bd; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(160, 190, 230, 0.22); background: transparent; color: #f2f6fb; cursor: pointer;
  transition: border-color 0.15s ease;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle:hover { border-color: rgba(160, 190, 230, 0.55); }
.site-header .btn-primary { background: #f2f6fb; color: #0a1428; }
.site-header .btn-primary:hover { background: #ffffff; color: #0a1428; box-shadow: 0 0 0 5px rgba(47, 211, 240, 0.18); }
.menu-toggle { display: none; }

@media (max-width: 940px) {
  .menu-toggle {
    display: inline-grid; place-items: center; margin-left: auto; width: 44px; height: 44px;
    border: 1px solid rgba(160, 190, 230, 0.22); border-radius: 12px; background: transparent; color: #f2f6fb; cursor: pointer;
  }
  .menu-bars, .menu-bars::before, .menu-bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform 0.2s ease, opacity 0.2s ease; }
  .menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
  .menu-bars::before { top: -6px; }
  .menu-bars::after { top: 6px; }
  .menu-open .menu-bars { background: transparent; }
  .menu-open .menu-bars::before { transform: translateY(6px) rotate(45deg); }
  .menu-open .menu-bars::after { transform: translateY(-6px) rotate(-45deg); }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 8px; padding: 12px clamp(16px, 4vw, 40px) 20px;
    background: #070d1a; border-bottom: 1px solid rgba(160, 190, 230, 0.14); box-shadow: 0 30px 50px -20px rgba(0, 0, 0, 0.7);
  }
  .menu-open .site-nav { display: flex; }
  .nav-links { flex-direction: column; gap: 0; margin: 0; }
  .nav-links a { padding: 12px 4px; border-bottom: 1px solid rgba(160, 190, 230, 0.14); font-size: 1.05rem; }
  .nav-actions { flex-wrap: wrap; justify-content: space-between; padding-top: 12px; }
  .nav-actions .btn { flex: 1 0 100%; }
}
.js .site-nav { transition: none; }

/* Sections: paper sections are separated by a hairline; dark bands by colour. */
.section { padding-block: clamp(64px, 8vw, 112px); }
.section-rule { border-top: 1px solid var(--line); }
.section-title { max-width: 22ch; }
.center-page { min-height: 60vh; display: grid; place-items: center; }

/* Dark bands (the hero and the verification band) stay dark in both themes:
   they are the board, and the board is dark in the app too. */
.on-dark {
  --n-bg: #070d1a;
  --n-ink: #f2f6fb;
  --n-text: #c3cfdf;
  --n-muted: #93a5bd;
  --n-line: rgba(160, 190, 230, 0.16);
  --n-cyan: #7fe3f6;
  --n-ok: #55d6a8;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  background: var(--n-bg);
  color: var(--n-text);
}
.on-dark h1, .on-dark h2, .on-dark h3 { color: var(--n-ink); }
.on-dark .kicker { color: var(--n-muted); }
.on-dark .kicker::after { background: var(--n-line); }
.on-dark .kicker-n { color: var(--n-cyan); }
.on-dark ::selection { color: var(--n-ink); }

/* Hero: the live board (board.js) fills the right side; the copy sits on it. */
.hero-dark {
  position: relative; overflow: hidden; isolation: isolate;
  padding-top: clamp(40px, 6vw, 80px);
  background:
    radial-gradient(58% 72% at 70% 44%, #10233f 0%, rgba(16, 35, 63, 0) 72%),
    radial-gradient(36% 46% at 4% 104%, rgba(47, 211, 240, 0.1), transparent 70%),
    var(--n-bg);
}
.hero-dark::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(160, 190, 230, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(160, 190, 230, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(70% 80% at 30% 40%, #000 30%, transparent 80%);
  mask-image: radial-gradient(70% 80% at 30% 40%, #000 30%, transparent 80%);
}
.hero-board { position: absolute; inset: 0 0 0 36%; z-index: 0; }
.hero-board canvas { display: block; width: 100%; height: 100%; }
.hero-board.no-webgl { display: none; }
.hero-grid {
  position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: min(calc(100vh - 68px - 220px), 660px); align-items: center; pointer-events: none;
}
.hero-copy, .cascheck-card { pointer-events: auto; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 26px;
  font: italic 500 1.02rem/1.3 var(--serif); color: var(--n-cyan); letter-spacing: 0.01em;
}
.hero-kicker::before { content: ""; width: 28px; height: 1px; background: currentColor; flex: none; }
.hero-dark h1 { font-size: clamp(2.8rem, 5.8vw, 5.2rem); line-height: 0.98; max-width: 10.5ch; margin-bottom: 0.42em; }
.hero-dark .lead { color: var(--n-text); max-width: 29em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 8px; }
.btn-light { background: var(--n-ink); color: #0a1428; }
.btn-light:hover { background: #ffffff; color: #0a1428; box-shadow: 0 0 0 6px rgba(47, 211, 240, 0.18); }
.btn-outline-light { border-color: rgba(242, 246, 251, 0.34); color: var(--n-ink); background: rgba(7, 13, 26, 0.4); }
.btn-outline-light:hover { border-color: var(--n-ink); color: var(--n-ink); }
.on-dark :focus-visible { outline-color: var(--n-cyan); }

/* The CAS card: the checks the lesson ran, ticked once the line is drawn. */
.cascheck-card {
  grid-column: 2; align-self: end; justify-self: end; width: min(100%, 410px); margin-bottom: 30px;
  padding: 16px 18px 14px; border: 1px solid var(--n-line); border-radius: 14px;
  background: rgba(8, 15, 29, 0.74); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.cascheck-card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font: 800 0.7rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--n-muted); }
.cascheck-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--n-ok); box-shadow: 0 0 0 4px rgba(85, 214, 168, 0.16); }
.cascheck-card ol { list-style: none; margin: 0; padding: 0; }
.cascheck-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px dashed var(--n-line); }
.cascheck-row code { font: 500 0.78rem/1.45 var(--mono); color: #a9bbd4; overflow-wrap: anywhere; }
.cascheck-result { font: 500 1.08rem/1.2 var(--serif); color: var(--n-ink); white-space: nowrap; }
.cascheck-tick { color: var(--n-ok); font-weight: 800; }
.cascheck-note { margin: 10px 0 0; font: italic 1rem/1.35 var(--serif); color: var(--n-text); }
.cascheck-fail { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--n-line); font-size: 0.8rem; line-height: 1.45; color: var(--n-muted); }
.hero.has-board .cascheck-row { opacity: 0.38; transition: opacity 0.5s ease; }
.hero.has-board .cascheck-tick { opacity: 0; transform: scale(0.3); transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.5); }
.hero.has-board .cascheck-note { opacity: 0; transition: opacity 0.5s ease 1.1s; }
.hero.has-board.is-checked .cascheck-row, .hero.has-board.is-checked .cascheck-note { opacity: 1; }
.hero.has-board.is-checked .cascheck-tick { opacity: 1; transform: none; }
.hero.has-board .cascheck-row[data-row="1"], .hero.has-board .cascheck-row[data-row="1"] .cascheck-tick { transition-delay: 0.35s; }
.hero.has-board .cascheck-row[data-row="2"], .hero.has-board .cascheck-row[data-row="2"] .cascheck-tick { transition-delay: 0.7s; }
.hero-hint { position: absolute; z-index: 1; right: clamp(16px, 4vw, 40px); top: 22px; margin: 0; font: italic 0.95rem var(--serif); color: var(--n-muted); pointer-events: none; }
@media (hover: none) { .hero-hint { display: none; } }
.hero-proof { position: relative; z-index: 1; }
.proof { list-style: none; margin: 0; padding: 22px 0 30px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; border-top: 1px solid var(--n-line); }
.proof li { display: grid; gap: 4px; }
.proof strong { font: 500 1.55rem/1.1 var(--serif); color: var(--n-ink); }
.proof span { font-size: 0.86rem; line-height: 1.45; color: var(--n-muted); }

/* The lesson: a sticky board that builds itself as the steps are read. */
.lesson-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: end; }
.lesson-intro .lead { margin-bottom: 0.5em; }
.lesson-question {
  margin: clamp(32px, 5vw, 56px) 0 0; padding-left: 20px; border-left: 3px solid var(--cyan);
  font: italic 400 clamp(1.45rem, 2.6vw, 2.1rem)/1.25 var(--serif); color: var(--ink); max-width: 30em;
}
.lesson-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(28px, 5vw, 72px); }
.lesson-board-inner {
  position: sticky; top: calc(68px + 6vh); margin-top: 7vh;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 8px;
}
.lesson-steps { list-style: none; margin: 0; padding: 0; }
.lesson-step { min-height: 64vh; display: flex; flex-direction: column; justify-content: center; padding: 28px 0 28px 22px; border-left: 2px solid transparent; transition: border-color 0.4s ease; }
.lesson-step:last-child { min-height: 52vh; }
/* Steps not being read step back in colour, not in contrast: muted text
   still meets AA. */
[data-lesson].is-live .lesson-step.is-current { border-left-color: var(--accent); }
[data-lesson].is-live .lesson-step:not(.is-current) h3,
[data-lesson].is-live .lesson-step:not(.is-current) p { color: var(--muted); }
[data-lesson].is-live .lesson-step:not(.is-current) .cas-chip { background: transparent; }
.lesson-step-n { margin-bottom: 12px; font: 800 0.74rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.lesson-step h3 { font-size: clamp(1.5rem, 2.3vw, 1.95rem); }
.lesson-step p { font-size: 1.02rem; }
.cas-chip {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 6px 0 0; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); font-size: 0.86rem;
}
.cas-by { font: 800 0.68rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cas-chip code { font: 500 0.8rem/1.45 ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--text); overflow-wrap: anywhere; }
.cas-arrow { color: var(--muted); }
.cas-chip strong { font: 500 1.12rem/1.2 var(--serif); color: var(--ink); }
.cas-ok { margin-left: auto; color: var(--ok); font-weight: 800; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; }
.lesson-source { margin-top: 24px; }

:root { --amber: #a4560a; }
:root[data-theme="dark"] { --amber: #f2a654; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --amber: #f2a654; } }
.l-fig { display: block; width: 100%; height: auto; color: var(--accent); }
.l-grid { fill: none; stroke: var(--grid-major); stroke-width: 1; }
.l-axes line { stroke: var(--muted); stroke-width: 1.1; }
.l-axes text { fill: var(--muted); font: 500 13px var(--sans); }
.l-axes .l-name { font: italic 500 17px var(--serif); fill: var(--text); }
.l-curve { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.l-curve-label { font: italic 500 17px var(--serif); fill: var(--ink); }
.l-height { stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 4 5; }
.l-tick { font: italic 500 15px var(--serif); fill: var(--ink); }
.l-note { font: italic 500 16px var(--serif); fill: var(--text); }
.l-slope { fill: none; stroke: var(--amber); stroke-width: 2.2; stroke-linejoin: round; }
.l-note.s2 { fill: var(--amber); }
.l-tangent { fill: none; stroke: var(--accent); stroke-width: 2.8; stroke-linecap: round; }
.l-halo-label { font: italic 500 16px var(--serif); fill: var(--accent); }
.l-leader { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 4; }
.l-point circle { fill: var(--card); stroke: var(--ink); stroke-width: 2.6; }
.l-point text { font: italic 600 19px var(--serif); fill: var(--ink); paint-order: stroke; stroke: var(--card); stroke-width: 5px; stroke-linejoin: round; }

/* Step by step: each element appears when its step is reached. Without
   JavaScript the figure carries every reached-N class and shows it all. */
[data-lesson].is-live .l-fig .s1, [data-lesson].is-live .l-fig .s2,
[data-lesson].is-live .l-fig .s3, [data-lesson].is-live .l-fig .s4 { opacity: 0; transition: opacity 0.6s ease; }
[data-lesson].is-live .l-fig.reached-1 .s1, [data-lesson].is-live .l-fig.reached-2 .s2,
[data-lesson].is-live .l-fig.reached-3 .s3, [data-lesson].is-live .l-fig.reached-4 .s4 { opacity: 1; }
[data-lesson].is-live .l-curve, [data-lesson].is-live .l-slope, [data-lesson].is-live .l-tangent {
  stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.3s cubic-bezier(0.55, 0.05, 0.3, 1), opacity 0.3s ease;
}
[data-lesson].is-live .reached-1 .l-curve, [data-lesson].is-live .reached-2 .l-slope, [data-lesson].is-live .reached-3 .l-tangent { stroke-dashoffset: 0; }
.l-halo { transform-box: fill-box; transform-origin: center; }
[data-lesson].is-live .l-fig.reached-4 .l-halo { animation: halo 2.6s ease-in-out infinite; }
@keyframes halo { 0%, 100% { transform: scale(0.85); } 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) {
  [data-lesson].is-live .l-fig * { transition: none !important; animation: none !important; }
}

/* Verification: question, the CAS query, the result, then the stamp. */
.verify { position: relative; overflow: hidden; }
.verify::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 80% at 85% 30%, rgba(47, 211, 240, 0.09), transparent 70%);
}
.verify .wrap { position: relative; }
.verify .section-title { max-width: 18ch; font-size: clamp(2rem, 4vw, 3.2rem); }
.verify-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: clamp(28px, 5vw, 72px); align-items: start; margin-top: 12px; }
.verify-text { color: var(--n-text); font-size: 1.05rem; }
.verify-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.verify-node { position: relative; padding: 20px 20px 22px; border: 1px solid var(--n-line); background: rgba(255, 255, 255, 0.025); }
.verify-node + .verify-node { border-left: 0; }
.verify-node:first-child { border-radius: 14px 0 0 14px; }
.verify-node:nth-child(3) { border-radius: 0 14px 14px 0; background: rgba(85, 214, 168, 0.06); }
.verify-node:nth-child(-n + 2)::after {
  content: "→"; position: absolute; right: -13px; top: 50%; z-index: 1; transform: translateY(-50%);
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--n-bg); border: 1px solid var(--n-line); color: var(--n-cyan); font-size: 0.85rem;
}
.verify-label { display: block; margin-bottom: 14px; font: 800 0.68rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--n-muted); }
.verify-value { font: italic 400 1.2rem/1.35 var(--serif); color: var(--n-ink); }
.verify-node:nth-child(3) .verify-value { font: 400 clamp(2.4rem, 4vw, 3.2rem)/1 var(--serif); color: var(--n-cyan); }
.verify-code { display: block; font: 500 0.86rem/1.55 var(--mono); color: #b9c9de; overflow-wrap: anywhere; }
.verify-stamp {
  grid-column: 1 / -1; justify-self: end; margin-top: 22px; padding: 9px 16px;
  border: 2px solid var(--n-ok); border-radius: 10px; color: var(--n-ok);
  font: 800 0.8rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; transform: rotate(-2.5deg);
}
@media (prefers-reduced-motion: no-preference) {
  .js .verify-flow.reveal { opacity: 1; transform: none; }
  .js .verify-flow .verify-node { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .js .verify-flow .verify-node:nth-child(2) { transition-delay: 0.45s; }
  .js .verify-flow .verify-node:nth-child(3) { transition-delay: 1.9s; }
  .js .verify-flow .verify-code { clip-path: inset(0 100% 0 0); transition: clip-path 1.1s steps(28, end) 0.9s; }
  .js .verify-flow .verify-stamp { opacity: 0; transform: rotate(-9deg) scale(1.35); transition: opacity 0.3s ease 2.5s, transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3) 2.5s; }
  .js .verify-flow.is-visible .verify-node { opacity: 1; transform: none; }
  .js .verify-flow.is-visible .verify-code { clip-path: inset(0 0 0 0); }
  .js .verify-flow.is-visible .verify-stamp { opacity: 1; transform: rotate(-2.5deg); }
}

/* Study room: one large screenshot that settles as it arrives. */
.studio-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px clamp(24px, 5vw, 72px); align-items: end; margin-bottom: clamp(28px, 4vw, 48px); }
.studio-head .kicker { grid-column: 1 / -1; }
.studio-head .lead { margin-bottom: 0.5em; }
.studio-shot .plate-frame { border-radius: 18px; box-shadow: 0 60px 110px -60px rgba(19, 38, 74, 0.6), var(--shadow); }
@media (prefers-reduced-motion: no-preference) {
  .js .studio-shot.reveal { transform: perspective(1800px) rotateX(9deg) translateY(36px); transform-origin: 50% 0; transition: opacity 0.9s ease, transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .js .studio-shot.reveal.is-visible { transform: none; }
}

/* Topics: an index of figures. */
.topics { border-top: 1px solid var(--line); }
.topics-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 8px clamp(24px, 5vw, 72px); align-items: end; margin-bottom: clamp(28px, 4vw, 44px); }
.topics-head .kicker { grid-column: 1 / -1; }
.topic-grid { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); }
.topic { position: relative; display: grid; grid-template-rows: auto 1fr; gap: 14px; min-height: 184px; padding: 20px 18px; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); background: var(--card); transition: background-color 0.2s ease; }
.topic:hover { background: var(--paper); }
.topic-n { position: absolute; top: 14px; right: 16px; font: italic 500 0.95rem var(--serif); color: var(--muted); }
.topic-label { align-self: end; font: 500 1.1rem/1.25 var(--serif); color: var(--ink); }
.glyph { width: 76px; height: 57px; color: var(--ink); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.glyph .g-accent { stroke: var(--accent); stroke-width: 2.3; }
.glyph .g-thick { stroke-width: 3; }
.glyph .g-soft { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: color-mix(in srgb, var(--accent) 50%, transparent); stroke-width: 1; }
.glyph .g-soft-fill { fill: color-mix(in srgb, var(--cyan) 18%, transparent); stroke: none; }
.glyph .g-dash { stroke: var(--muted); stroke-dasharray: 3 4; }
.glyph .g-dot { fill: var(--accent); stroke: none; }
.glyph .g-tip { fill: currentColor; stroke: none; }
@media (prefers-reduced-motion: no-preference) {
  .js .topic.reveal:nth-child(5n + 2) { transition-delay: 0.06s; }
  .js .topic.reveal:nth-child(5n + 3) { transition-delay: 0.12s; }
  .js .topic.reveal:nth-child(5n + 4) { transition-delay: 0.18s; }
  .js .topic.reveal:nth-child(5n + 5) { transition-delay: 0.24s; }
}

/* Entrance: the hero copy rises in; reveal-on-scroll elsewhere. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-copy > * { opacity: 0; animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
  .js .hero-copy > :nth-child(1) { animation-delay: 0.05s; }
  .js .hero-copy > :nth-child(2) { animation-delay: 0.16s; }
  .js .hero-copy > :nth-child(3) { animation-delay: 0.3s; }
  .js .hero-copy > :nth-child(4) { animation-delay: 0.44s; }
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Plates (screenshots of the real app) */
.plate { margin: 0; }
.plate-frame {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: var(--card); box-shadow: var(--shadow); line-height: 0;
}
.plate-frame img { display: block; width: 100%; height: auto; }
.plate-frame img.shot-dark { display: none; }
:root[data-theme="dark"] .plate-frame img.shot-dark { display: block; }
:root[data-theme="dark"] .plate-frame img.shot-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .plate-frame img.shot-dark { display: block; }
  :root:not([data-theme]) .plate-frame img.shot-light { display: none; }
}
.plate figcaption { margin-top: 14px; font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 1.02rem; }
.fig-n { font-style: normal; font-family: var(--sans); font-weight: 800; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-right: 6px; }

/* Numbered blocks (schools page) */
.feature-n { font: 800 0.78rem/1 var(--sans); letter-spacing: 0.16em; color: var(--accent); margin-bottom: 14px; }
.blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px) clamp(24px, 4vw, 64px); }
.block { border-top: 2px solid var(--ink); padding-top: 18px; }
.block h3 { font-size: clamp(1.35rem, 2vw, 1.6rem); }
.status { display: inline-block; font-size: 0.85rem; font-weight: 700; color: var(--ok); background: var(--ok-bg); border-radius: 999px; padding: 5px 12px; }

/* The brand wireframe, drawn in: page heads, closing bands, small pages. */
.hex-art { display: block; overflow: visible; }
.ha-wire { fill: none; stroke: rgba(160, 190, 230, 0.34); stroke-width: 0.9; stroke-linejoin: round; }
.ha-cut { fill: none; stroke: #7fe3f6; stroke-width: 1.6; stroke-linecap: round; }
.ha-solid { fill: rgba(47, 211, 240, 0.1); }
.center-art .ha-wire { stroke: color-mix(in srgb, var(--ink) 40%, transparent); }
.center-art .ha-cut { stroke: var(--accent); }
.center-art { width: 120px; margin: 0 auto 24px; }
@media (prefers-reduced-motion: no-preference) {
  .js .ha-wire > *, .js .ha-cut { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ha-draw 2.2s cubic-bezier(0.55, 0.05, 0.3, 1) 0.2s forwards; }
  .js .ha-cut { animation-duration: 0.9s; animation-delay: 1.5s; }
  .js .ha-solid { opacity: 0; animation: ha-fade 1.2s ease 1.9s forwards; }
}
@keyframes ha-draw { to { stroke-dashoffset: 0; } }
@keyframes ha-fade { to { opacity: 1; } }

/* Inner page heads: a dark band continuing the header. */
.page-hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding-block: clamp(56px, 8vw, 108px) clamp(64px, 9vw, 124px);
  background: radial-gradient(50% 90% at 80% 40%, #10233f 0%, rgba(16, 35, 63, 0) 72%), var(--n-bg);
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(160, 190, 230, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(160, 190, 230, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(80% 90% at 30% 50%, #000 30%, transparent 85%);
  mask-image: radial-gradient(80% 90% at 30% 50%, #000 30%, transparent 85%);
}
.page-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(180px, 22vw, 290px); gap: clamp(28px, 6vw, 96px); align-items: center; }
.page-hero h1 { font-size: clamp(2.5rem, 5.2vw, 4.2rem); line-height: 1.02; max-width: 15ch; margin-bottom: 0.4em; }
.page-hero .lead { color: var(--n-text); margin: 0; }
.page-hero-art { width: 100%; }
.page-hero + .section { padding-top: clamp(48px, 6vw, 80px); }

/* Closing band: dark, bookending the page with the footer. */
.closing {
  position: relative; overflow: hidden; isolation: isolate; text-align: center;
  padding-block: clamp(88px, 12vw, 150px);
  background: radial-gradient(55% 80% at 50% 50%, #10233f 0%, rgba(16, 35, 63, 0) 75%), var(--n-bg);
}
.closing-art { position: absolute; z-index: -1; right: max(-4vw, -60px); top: 50%; width: min(46vw, 520px); transform: translateY(-50%); opacity: 0.42; }
.closing-inner { max-width: 760px; margin: 0 auto; }
.closing h2 { font-size: clamp(2.3rem, 5vw, 3.8rem); line-height: 1.04; max-width: 16ch; margin-inline: auto; }
.closing p { color: var(--n-text); font-size: 1.1rem; max-width: 34em; margin: 0 auto 30px; }

/* Home: the plan and schools side by side, as two columns of the notebook. */
.plans-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plans-col { padding-right: clamp(24px, 5vw, 72px); }
.plans-col + .plans-col { padding: 0 0 0 clamp(24px, 5vw, 72px); border-left: 1px solid var(--line); }
.plans-col h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); max-width: 18ch; }
.plans-col .cta-row { align-items: center; gap: 12px 24px; margin: 24px 0 0; }
.price-line { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 12px; }
.price { font-family: var(--serif); font-size: clamp(2.8rem, 4.8vw, 3.6rem); line-height: 1; color: var(--ink); font-weight: 500; letter-spacing: -0.02em; }
.price-text { font-size: 2rem; }
.per { color: var(--muted); font-weight: 600; }

/* Home: an offer right after the lesson. */
.lesson-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; margin-top: clamp(40px, 6vw, 72px); padding-top: 28px; border-top: 1px solid var(--line); }
.lesson-cta p { margin: 0; max-width: 26em; font: italic 400 clamp(1.3rem, 2vw, 1.6rem)/1.3 var(--serif); color: var(--ink); }
.lesson-cta .cta-row { margin: 0; }

/* Pricing: the plan card overlaps the dark head, joining the two. */
.pricing { padding-top: 0; }
.pricing-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.8fr); gap: clamp(18px, 3vw, 28px); align-items: stretch; margin-top: calc(-1 * clamp(40px, 6vw, 72px)); position: relative; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: clamp(24px, 3.4vw, 40px); box-shadow: var(--shadow); }
.plan-main { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(20px, 3vw, 40px); border-top: 4px solid var(--accent); }
.plan-main .price { font-size: clamp(3.2rem, 5.2vw, 4.4rem); }
.plan-main .price-line { flex-wrap: wrap; column-gap: 6px; }
.per { white-space: nowrap; }
.plan-head { border-right: 1px solid var(--line); padding-right: clamp(20px, 3vw, 40px); }
.plan-alt { display: flex; flex-direction: column; gap: 6px; }
.plan-alt .btn { margin-top: auto; }
.plan-alt .text-link { align-self: center; margin-top: 10px; }
.plan-name { font: 800 0.9rem/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 32px; color: var(--ink); font-weight: 600; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0.1em; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; }
.have-account { margin: 14px 0 0; }
.meter-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.meter { margin: 0; }
.meter-grid { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 6px; }
.meter-grid i { aspect-ratio: 1; border: 1.5px solid var(--line-strong); border-radius: 3px; }
.meter-grid i.used { background: var(--accent); border-color: var(--accent); }
.meter figcaption { display: flex; justify-content: space-between; margin-top: 10px; font: italic 1rem var(--serif); color: var(--muted); }

/* Side column + content: FAQ, forms. */
.side-grid, .form-grid { display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.side-head { position: sticky; top: 100px; }
.side-head h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.form-grid .form { margin-top: calc(-1 * clamp(80px, 10vw, 150px)); position: relative; }
.next-steps { list-style: none; counter-reset: step; padding: 0; margin: 20px 0 0; display: grid; gap: 18px; }
.next-steps li { counter-increment: step; position: relative; padding-left: 48px; }
.next-steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent);
  font: italic 500 1.05rem/1 var(--serif);
}
.mail-line { margin-top: 18px; }
.mail-line a { font: 500 1.3rem/1.3 var(--serif); overflow-wrap: anywhere; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 44px 20px 0; position: relative; font-family: var(--serif); font-size: 1.3rem; line-height: 1.3; color: var(--ink); transition: color 0.15s ease; }
.faq summary:hover { color: var(--accent); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-family: var(--sans); font-size: 1.5rem; color: var(--accent); transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 44px 20px 0; margin: 0; }

/* Schools: the flow from a Moodle course to the study room. */
.flow { list-style: none; margin: 36px 0 22px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flow-node { position: relative; display: grid; align-content: start; gap: 6px; padding: 24px 26px 28px; border: 1px solid var(--line-strong); background: var(--card); }
.flow-node + .flow-node { border-left: 0; }
.flow-node:first-child { border-radius: 16px 0 0 16px; }
.flow-node:last-child { border-radius: 0 16px 16px 0; }
.flow-node:not(:last-child)::after {
  content: "→"; position: absolute; right: -14px; top: 50%; z-index: 1; transform: translateY(-50%);
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line-strong); color: var(--accent); font-size: 0.9rem;
}
.flow-n { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 10px; border-radius: 50%; background: var(--ink); color: var(--paper); font: italic 500 1.05rem/1 var(--serif); }
.flow-label { font: 500 1.35rem/1.2 var(--serif); color: var(--ink); }
.flow-value { color: var(--text); }
.flow-note { display: inline-flex; gap: 10px; align-items: baseline; margin: 0; padding: 10px 18px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-weight: 700; }

/* Forms */
.form { display: grid; gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: clamp(22px, 3.4vw, 40px); box-shadow: var(--shadow); }
.field { display: grid; gap: 7px; }
.field label { font-weight: 700; color: var(--ink); font-size: 0.95rem; }
.field input, .field select, .field textarea {
  font: 500 1rem/1.4 var(--sans); color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; min-height: 48px; width: 100%;
  transition: border-color 0.15s ease;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field textarea { resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
.field input::placeholder { color: var(--muted); }
.hp { position: absolute !important; left: -9999px; }
.form-notice { font-size: 0.84rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
.form-notice dl { display: grid; gap: 6px; margin: 8px 0 10px; }
.form-notice dl div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 10px; }
.form-notice dt { font-weight: 700; color: var(--text); }
.form-notice dd { margin: 0; }
.form-notice p { margin: 0; }
.form .btn { justify-self: start; }

/* Legal */
.legal-page h2 { font-size: 1.35rem; margin-top: 1.6em; }
.draft { background: var(--draft-bg); border: 1px solid var(--draft-line); border-left-width: 6px; border-radius: 12px; padding: 16px 20px; margin: 0 0 28px; color: var(--ink); }
.draft p { margin: 6px 0 0; }
.kicker-center { justify-content: center; }
.kicker-center::after { display: none; }

/* Footer: the dark board closes every page. */
.site-footer { background: var(--n-bg); border-top: 1px solid var(--n-line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; padding-block: 64px 36px; }
.footer-brand p { margin-top: 14px; color: var(--n-muted); max-width: 26em; }
.footer-title { font: 800 0.76rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--n-muted); margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.site-footer ul a { display: inline-block; padding-block: 5px; color: var(--n-text); text-decoration: none; font-size: 0.95rem; transition: color 0.15s ease; }
.site-footer ul a:hover { color: var(--n-ink); text-decoration: underline; text-decoration-color: #2fd3f0; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 20px 28px; border-top: 1px solid var(--n-line); font-size: 0.86rem; color: var(--n-muted); }
.footer-base p { margin: 0; }
.closing + .site-footer { border-top-color: rgba(160, 190, 230, 0.1); }

/* Responsive */
@media (max-width: 980px) {
  .pricing-grid, .lesson-intro, .studio-head, .topics-head, .verify-grid, .meter-row, .side-grid, .form-grid, .plan-main { grid-template-columns: minmax(0, 1fr); }
  .plan-head { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
  .side-head { position: static; }
  .form-grid .form { margin-top: 0; }
  .form-grid .side-head { order: 2; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }

  /* Hero: the board fills the top of the first screen; the copy rises over
     its fading lower edge; the CAS card follows the buttons. */
  .hero-dark { display: flex; flex-direction: column; padding-top: 0; }
  .hero-grid { display: contents; }
  .hero-board {
    position: absolute; inset: 0 0 auto 0; height: clamp(320px, 92vw, 520px);
    -webkit-mask-image: linear-gradient(#000 58%, transparent 96%); mask-image: linear-gradient(#000 58%, transparent 96%);
  }
  .hero-copy { order: 1; position: relative; z-index: 1; width: 100%; padding: clamp(210px, 56vw, 330px) clamp(16px, 4vw, 40px) 0; }
  .cascheck-card { order: 2; position: relative; z-index: 1; width: auto; margin: 26px clamp(16px, 4vw, 40px) 0; }
  .hero-hint { display: none; }
  .hero-proof { order: 3; margin-top: 28px; }

  /* Lesson: the board sticks under the header, the steps scroll beneath. */
  .lesson-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .lesson-board { position: sticky; top: 68px; z-index: 2; padding-block: 10px 12px; background: var(--paper); }
  .lesson-board::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 28px; background: linear-gradient(var(--paper), transparent); pointer-events: none; }
  .lesson-board-inner { position: static; margin-top: 0; padding: 4px; }
  .l-fig { max-height: 36vh; margin-inline: auto; }
  .lesson-step { min-height: 56vh; justify-content: flex-start; padding-top: 18vh; }
  .lesson-step:last-child { min-height: 44vh; }

  .verify-flow, .flow { grid-template-columns: minmax(0, 1fr); }
  .verify-node + .verify-node { border-left: 1px solid var(--n-line); border-top: 0; }
  .verify-node:first-child { border-radius: 14px 14px 0 0; }
  .verify-node:nth-child(3) { border-radius: 0 0 14px 14px; }
  .verify-node:nth-child(-n + 2)::after { content: "↓"; right: auto; left: 24px; top: auto; bottom: -13px; transform: none; }
  .flow-node + .flow-node { border-left: 1px solid var(--line-strong); border-top: 0; }
  .flow-node:first-child { border-radius: 16px 16px 0 0; }
  .flow-node:last-child { border-radius: 0 0 16px 16px; }
  .flow-node:not(:last-child)::after { content: "↓"; right: auto; left: 30px; top: auto; bottom: -14px; transform: none; }

  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .blocks, .plans-grid { grid-template-columns: minmax(0, 1fr); }
  .plans-col { padding-right: 0; }
  .plans-col + .plans-col { padding: 32px 0 0; margin-top: 32px; border-left: 0; border-top: 1px solid var(--line); }
  .page-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .page-hero-art { position: absolute; right: -40px; top: -20px; width: 180px; opacity: 0.45; }
  .closing-art { right: 50%; transform: translate(50%, -50%); width: 120vw; opacity: 0.18; }
  .page-hero-copy { position: relative; }
  .proof { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .proof li { grid-template-columns: 6.5rem minmax(0, 1fr); align-items: baseline; }
  .form-notice dl div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .cta-row .btn { flex: 1 1 100%; }
  .lesson-cta .cta-row { width: 100%; }
  .meter-grid { gap: 4px; }
  .topic { min-height: 150px; padding: 16px 14px; }
  .glyph { width: 64px; height: 48px; }
  .topic-label { font-size: 1rem; }
  .cas-ok { margin-left: 0; }
  /* The figure is drawn at 640 wide; on a phone its labels need more size. */
  .l-axes text { font-size: 19px; }
  .l-axes .l-name, .l-curve-label { font-size: 24px; }
  .l-note, .l-tick, .l-halo-label { font-size: 23px; }
  .l-point text { font-size: 26px; }
}

/* The 18+ checkbox on the access form. */
.field-check label { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.field-check input { width: 24px; height: 24px; min-height: 0; flex: none; accent-color: var(--accent); }
.field-check p { margin: 0; }
