/* truenerd.app. One stylesheet, no framework. Logical properties keep Arabic right-to-left. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7fc;
  --surface: #ffffff;
  --text: #15142b;
  --muted: #565470;
  --line: #e2e4f0;
  --grid: rgba(48, 41, 217, 0.07);
  --accent: #3029d9;
  --accent-strong: #1d17a8;
  --accent-soft: rgba(48, 41, 217, 0.08);
  --on-accent: #ffffff;
  --red: #e5383b;
  /* Research charts: a neutral baseline, the answer app in red, tutoring in indigo. */
  --bar-answers: #e5383b; --bar-hints: #3029d9; --dot-behind: #c4c2d8;
  --green: #1f8a4c;
  --shadow: 0 1px 2px rgba(20, 18, 60, 0.06), 0 12px 32px -12px rgba(20, 18, 60, 0.18);
  --radius: 18px;
  /* The app's graph paper; each surface sets its own background-size. */
  --app-grid: linear-gradient(rgba(70, 90, 150, 0.09) 1px, transparent 1px), linear-gradient(90deg, rgba(70, 90, 150, 0.09) 1px, transparent 1px);
  --graph-paper: var(--app-grid);
  --paper: #ffffff;
  --ink-filter: none;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --live: linear-gradient(90deg, #2e7aff, #8a5cff, #ff5ea3, #ff9e42);
  --night: #110d4a; --night-text: #f3f2ff; --night-muted: #bdb9ec; --night-line: rgba(255, 255, 255, 0.13); --night-accent: #b9b4ff;
  --night-glow: radial-gradient(900px 520px at 80% 20%, rgba(124, 108, 255, 0.38), transparent 62%), radial-gradient(700px 520px at 0% 100%, rgba(46, 122, 255, 0.2), transparent 60%);
  --night-grid: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 32px 32px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0b26;
    --bg-soft: #13113a;
    --surface: #1a1748;
    --text: #eceaff;
    --muted: #aeaacd;
    --line: #2c2862;
    --grid: rgba(160, 156, 255, 0.07);
    --accent: #9c97ff;
    --accent-strong: #c2bfff;
    --accent-soft: rgba(156, 151, 255, 0.12);
    --on-accent: #0d0b26;
    --red: #ff6b6e;
    --bar-answers: #e8484c; --bar-hints: #7d77f2; --dot-behind: #4b4784;
    --paper: #17143d;
    --graph-paper: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    /* Handwriting drawn in dark ink turns light; the red wave stays red. */
    --ink-filter: invert(1) hue-rotate(180deg) brightness(0.95);
    --green: #5fd38e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.015em; }
h1, h2 { font-family: var(--serif); font-weight: 600; }
:lang(ja) h1, :lang(ja) h2, :lang(zh-Hans) h1, :lang(zh-Hans) h2, :lang(ko) h1, :lang(ko) h2,
:lang(hi) h1, :lang(hi) h2, :lang(ar) h1, :lang(ar) h2 { font-family: var(--sans); font-weight: 700; letter-spacing: 0; }
h2 { font-size: clamp(2rem, 1.3rem + 2.5vw, 3.05rem); text-wrap: balance; }
h3 { font-size: 1.08rem; font-weight: 650; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 32px); }
.icon { width: 1.25em; height: 1.25em; flex: none; }

.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { top: 12px; }

/* Header */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.menu { display: none; margin-inline-start: 8px; }
.menu summary { list-style: none; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; inset-inline: 0; top: 100%; display: grid; padding: 8px 16px 16px; border-bottom: 1px solid var(--line); background: var(--bg); box-shadow: 0 0 0 100vmax rgba(8, 6, 32, 0.45); }
.menu nav a + a { border-top: 1px solid var(--line); border-radius: 0; }
.menu nav a { padding: 12px 14px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.menu nav a:hover { background: var(--accent-soft); }
.top-row { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.logo { width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 2px 8px rgba(48, 41, 217, 0.35); }
.nav { display: flex; gap: 22px; margin-inline-start: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.nav a:hover { color: var(--text); }
@media (max-width: 860px) { .nav { display: none; } .menu { display: block; } .lang { margin-inline-start: auto; } }

.lang { position: relative; }
.lang summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.92rem; color: var(--text); background: var(--surface); }
.lang summary::-webkit-details-marker { display: none; }
.lang ul { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 210px; max-height: min(70vh, 560px); overflow: auto; }
.lang li a { display: block; padding: 8px 12px; border-radius: 9px; color: var(--text); text-decoration: none; }
.lang li a:hover { background: var(--accent-soft); }
.lang li a[aria-current] { font-weight: 650; color: var(--accent); }
.lang li a[aria-current]::after { content: " ✓"; }

/* Hero */
.hero { position: relative; padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 5vw, 64px); background: var(--night-glow), var(--night-grid), var(--night); color: var(--night-text); }
.hero h1 { color: #fff; }
/* The H1 opens with what TrueNerd is, in the words people search for, above the slogan. */
.hero h1 .kicker { display: block; margin-bottom: 18px; font-family: var(--sans); font-size: 0.9rem; line-height: 1.4; letter-spacing: 0.01em; text-transform: none; color: var(--night-accent); }
:lang(ar) .hero h1 .kicker, :lang(hi) .hero h1 .kicker { font-size: 1rem; }
/* Japanese has no spaces; break headings between phrases, not inside words. */
:lang(ja) h1, :lang(ja) h2 { word-break: auto-phrase; }
.hero .lede, .hero .caption, .hero .store, .closing .store { color: var(--night-muted); }
.hero .ipad { background: #24232c; box-shadow: 0 50px 90px -40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.1) inset, 0 0 120px -30px rgba(124, 108, 255, 0.55); }
.hero .controls button { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.hero .btn-sound[aria-pressed="true"] { background: #fff; color: var(--night); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
h1 { font-size: clamp(2.7rem, 1.5rem + 4.6vw, 4.75rem); margin-bottom: 0.55em; letter-spacing: -0.025em; text-wrap: balance; }
.lede { font-size: clamp(1.08rem, 1rem + 0.35vw, 1.22rem); color: var(--muted); max-width: 36em; }
/* The red wave: the tutor's mark, under one word that matters. */
.marked { background: url("/wave.svg") repeat-x 0 100% / auto 0.2em; padding-bottom: 0.16em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 26px; }
/* One action (watch a lesson) and a quiet launch status that does not pose as a button. */
.button { display: inline-flex; align-items: center; padding: 14px 24px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 650; text-decoration: none; }
.button:hover { background: var(--accent-strong); color: var(--on-accent); }
.hero .button, .closing .button { background: #fff; color: var(--night); }
.hero .button:hover, .closing .button:hover { background: var(--night-accent); color: var(--night); }
.hero .button.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45); }
.hero .button.ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
/* Math and illustrations read left to right in every language; mixed-script bubbles take their own direction. */
svg { direction: ltr; }
.msg, .msg small, .bubble, .art-question p, .subtitle { unicode-bidi: plaintext; }
.store { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 0.92rem; line-height: 1.3; text-align: start; color: var(--muted); }
.store .icon { width: 18px; height: 18px; }
.store small { font-size: inherit; }
.store small::after { content: " · "; }
.store span { display: inline; }
.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " →"; }
[dir="rtl"] .link-arrow::after { content: " ←"; }
.caption { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 12px; }

/* Bands */
.band { padding: clamp(52px, 7vw, 96px) 0; }
.paper-band { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section-head { max-width: 780px; margin-bottom: clamp(36px, 4.5vw, 60px); }
.section-head h2 { margin-bottom: 14px; }
.section-head h2:last-child { margin-bottom: 0; }
.section-lede { font-size: clamp(1.08rem, 1rem + 0.3vw, 1.2rem); color: var(--muted); max-width: 40em; margin: 0; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); }
@media (max-width: 900px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.steps li { position: relative; }
.steps h3 { font-size: 1.2rem; margin: 22px 0 8px; }
.steps p { color: var(--muted); margin: 0; }
/* The worked example sits on the app's paper, white in both themes. */
.mock { position: relative; display: flex; flex-direction: column; gap: 12px; height: 280px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background-color: var(--paper); background-image: var(--graph-paper); background-size: 14px 14px; color: #1b1b1f; }
.mock img, .sketch img, .art-tools { filter: var(--ink-filter); }
.mock img { display: block; width: 100%; max-width: 300px; height: auto; }
.bubble { margin: 0; max-width: 94%; padding: 10px 14px; border-radius: 14px; font-size: 0.92rem; line-height: 1.4; }
.steps .bubble { margin-top: auto; }
.bubble.tutor { align-self: flex-end; color: var(--text); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 24px -12px rgba(20, 18, 60, 0.35); }
.bubble.student { align-self: flex-start; background: #3029d9; color: #fff; }
.live-chip { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 8px; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: 1px; }
.levels-bars { display: inline-flex; align-items: center; gap: 2px; height: 12px; }
.levels-bars span { width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: center; }
.levels-bars span:nth-child(1) { transform: scaleY(0.35); animation-delay: 0.00s; }
.levels-bars span:nth-child(2) { transform: scaleY(0.7); animation-delay: 0.08s; }
.levels-bars span:nth-child(3) { transform: scaleY(1); animation-delay: 0.16s; }
.levels-bars span:nth-child(4) { transform: scaleY(0.55); animation-delay: 0.24s; }
.levels-bars span:nth-child(5) { transform: scaleY(0.85); animation-delay: 0.32s; }
.levels-bars span:nth-child(6) { transform: scaleY(0.4); animation-delay: 0.40s; }
.levels-bars span:nth-child(7) { transform: scaleY(0.95); animation-delay: 0.48s; }
.levels-bars span:nth-child(8) { transform: scaleY(0.6); animation-delay: 0.56s; }
.levels-bars span:nth-child(9) { transform: scaleY(0.3); animation-delay: 0.64s; }

/* Sessions */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; margin-bottom: 32px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.tabs button { font: inherit; font-size: 0.97rem; font-weight: 600; padding: 9px 20px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); }
@media (max-width: 640px) {
  .tabs { display: flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; padding: 9px 16px; }
}
.panel { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 920px) { .panel { grid-template-columns: minmax(0, 1fr); } .panel .player { order: -1; } }
.panel + .panel { margin-top: 64px; }
.js .panel[data-hidden] { display: none; }
.js .panel + .panel { margin-top: 0; }
.js .panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.summary { font-size: 1.08rem; }
.problem { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.problem p { margin: 0; }
.problem span { font-weight: 650; color: var(--accent); margin-inline-end: 6px; }

.transcript { margin-top: 18px; }
.transcript summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.transcript[open] summary { margin-bottom: 14px; }
.transcript p { margin: 0 0 10px; }
.card-img { display: block; width: min(100%, 520px); height: auto; background: #fff; border-radius: 12px; padding: 8px; margin: 0 0 14px; border: 1px solid var(--line); }
.solved { display: flex; gap: 8px; align-items: center; color: var(--green); font-weight: 650; }

/* The iPad replay. The figure is the size container, so the frame scales as one;
   text keeps a legible minimum rather than shrinking with the frame. */
.player { margin: 0; container-type: inline-size; }
.ipad { background: #1c1c22; border-radius: clamp(18px, 3.2cqi, 40px); padding: clamp(9px, 1.7cqi, 20px); box-shadow: 0 30px 60px -30px rgba(20, 18, 60, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06) inset; }
.screen { position: relative; aspect-ratio: 1180 / 820; background: #fff; border-radius: clamp(10px, 1.8cqi, 22px); overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 40%; color: #1b1b1f; font-family: var(--sans); }
.paper { position: relative; overflow: hidden; background-color: #fff; background-image: var(--app-grid); background-size: 2.4cqi 2.4cqi; }
.paper .still, .paper svg { display: block; width: 100%; height: auto; }
.paper svg .ink path { fill: none; stroke: #1b1b1f; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.paper svg .marks path { fill: none; stroke: #e5383b; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.guidance { position: relative; background: #f2f2f7; border-inline-start: 1px solid #e3e3ea; padding: clamp(8px, 1.4cqi, 16px); overflow: hidden; }
.feed { display: flex; flex-direction: column; gap: clamp(6px, 1cqi, 12px); }
.feed > * { animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.msg { font-size: clamp(11px, 1.6cqi, 15px); line-height: 1.4; padding: 0.6em 0.85em; border-radius: 1em; }
.msg small { display: block; font-size: 0.78em; font-weight: 650; color: #6b6b78; margin-bottom: 0.15em; text-transform: uppercase; letter-spacing: 0.04em; }
.msg.typed { background: rgba(48, 41, 217, 0.1); }
.card { background: #fff; border-radius: clamp(8px, 1.2cqi, 14px); padding: clamp(4px, 0.7cqi, 8px); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); outline: 2px solid transparent; transition: outline-color 1.2s; }
.card.fresh { outline-color: rgba(48, 41, 217, 0.55); }
.card img { display: block; width: 100%; height: auto; }
.thinking { font-size: clamp(11px, 1.5cqi, 14px); padding: 0.3em 0.1em; background: linear-gradient(90deg, #8a8a96 30%, #d0d0dc 50%, #8a8a96 70%) 0 0 / 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -300% 0; } }
.done { font-size: clamp(12px, 1.6cqi, 15px); font-weight: 650; color: #1f8a4c; display: flex; align-items: center; gap: 0.4em; }
.done .icon { width: 1.3em; height: 1.3em; }
.guidance::after { content: ""; position: absolute; inset: 0; padding: clamp(3px, 0.5cqi, 6px); background: conic-gradient(from var(--spin, 0deg), #2e7aff, #8a5cff, #ff5ea3, #ff9e42, #2e7aff); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); filter: blur(4px); opacity: 0; transition: opacity 0.4s; pointer-events: none; }
.guidance.glow::after { opacity: 1; animation: spin 3s linear infinite; }
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --spin: 360deg; } }
.livebar { position: absolute; inset-inline: 0; margin-inline: auto; width: fit-content; bottom: clamp(8px, 1.8cqi, 20px); display: flex; align-items: center; gap: 0.5em; padding: 0.45em 1em; border-radius: 999px; background: rgba(242, 242, 247, 0.96); box-shadow: 0 3px 14px rgba(0, 0, 0, 0.12); font-size: clamp(11px, 1.5cqi, 14px); white-space: nowrap; }
.livebar b { background: var(--live); -webkit-background-clip: text; background-clip: text; color: transparent; }
.live-state { color: #6b6b78; }
.live-state:empty { display: none; }
.live-dot { width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--live); }
.livebar[data-state="listening"] .live-dot, .livebar[data-state="speaking"] .live-dot { animation: pulse 0.9s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.5); opacity: 0.6; } }
.subtitle { position: absolute; inset-inline: 5%; bottom: clamp(40px, 6.6cqi, 76px); text-align: center; font-size: clamp(12px, 1.8cqi, 17px); line-height: 1.45; }
.subtitle span { display: inline; padding: 0.15em 0.5em; border-radius: 0.5em; background: rgba(20, 20, 30, 0.84); color: #fff; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.subtitle span.student { background: rgba(48, 41, 217, 0.9); }
/* A phone-width frame becomes an iPad in portrait: the page above, guidance below. */
@container (max-width: 560px) {
  .screen { aspect-ratio: 820 / 1180; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 46%; }
  .guidance { border-inline-start: 0; border-top: 1px solid #e3e3ea; }
  .paper { background-size: 3.6cqi 3.6cqi; }
  .feed > .card { width: 66%; }
}
.player.paused * { animation-play-state: paused !important; }

.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.controls button { font: inherit; font-size: 0.9rem; font-weight: 600; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.controls button:hover { border-color: var(--accent); }
.btn-sound[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* Pages start muted, as browsers require: a crossed speaker until the visitor turns sound on. */
.btn-sound[aria-pressed="false"] .waves, .btn-sound[aria-pressed="true"] .off { display: none; }
.turns { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; margin-inline-start: auto; }
.turns button { padding: 5px 11px; font-size: 0.82rem; }
.turns button[aria-current="step"] { border-color: var(--accent); color: var(--accent); }
.hero-player .controls { justify-content: center; }
.hero-player .turns { display: none; }

/* Voice */
.voice-band { background: var(--night); color: var(--night-text); }
.voice-band h2 { color: #fff; }
.voice-band .kicker { color: var(--night-accent); }
.voice-band .section-lede, .voice-band .note, .voice-points p { color: var(--night-muted); }
.voice-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
@media (max-width: 900px) { .voice-grid { grid-template-columns: minmax(0, 1fr); } }
.voice-wave { display: flex; align-items: center; gap: 5px; height: 72px; margin: 8px 0 26px; }
.voice-wave span { flex: 1; max-width: 6px; height: 100%; border-radius: 4px; background: linear-gradient(var(--night-accent), #6d66f0); transform-origin: center; }
.voice-wave span:nth-child(1) { transform: scaleY(0.2); background-position: 0% 0; animation-delay: 0.00s; }
.voice-wave span:nth-child(2) { transform: scaleY(0.35); background-position: 4% 0; animation-delay: 0.06s; }
.voice-wave span:nth-child(3) { transform: scaleY(0.6); background-position: 8% 0; animation-delay: 0.12s; }
.voice-wave span:nth-child(4) { transform: scaleY(0.4); background-position: 12% 0; animation-delay: 0.18s; }
.voice-wave span:nth-child(5) { transform: scaleY(0.8); background-position: 16% 0; animation-delay: 0.24s; }
.voice-wave span:nth-child(6) { transform: scaleY(1); background-position: 20% 0; animation-delay: 0.30s; }
.voice-wave span:nth-child(7) { transform: scaleY(0.7); background-position: 24% 0; animation-delay: 0.36s; }
.voice-wave span:nth-child(8) { transform: scaleY(0.45); background-position: 28% 0; animation-delay: 0.42s; }
.voice-wave span:nth-child(9) { transform: scaleY(0.9); background-position: 32% 0; animation-delay: 0.48s; }
.voice-wave span:nth-child(10) { transform: scaleY(0.55); background-position: 36% 0; animation-delay: 0.54s; }
.voice-wave span:nth-child(11) { transform: scaleY(0.3); background-position: 40% 0; animation-delay: 0.60s; }
.voice-wave span:nth-child(12) { transform: scaleY(0.65); background-position: 44% 0; animation-delay: 0.66s; }
.voice-wave span:nth-child(13) { transform: scaleY(0.95); background-position: 48% 0; animation-delay: 0.72s; }
.voice-wave span:nth-child(14) { transform: scaleY(0.5); background-position: 52% 0; animation-delay: 0.78s; }
.voice-wave span:nth-child(15) { transform: scaleY(0.25); background-position: 56% 0; animation-delay: 0.84s; }
.voice-wave span:nth-child(16) { transform: scaleY(0.6); background-position: 60% 0; animation-delay: 0.90s; }
.voice-wave span:nth-child(17) { transform: scaleY(0.85); background-position: 64% 0; animation-delay: 0.96s; }
.voice-wave span:nth-child(18) { transform: scaleY(0.4); background-position: 68% 0; animation-delay: 1.02s; }
.voice-wave span:nth-child(19) { transform: scaleY(0.7); background-position: 72% 0; animation-delay: 1.08s; }
.voice-wave span:nth-child(20) { transform: scaleY(1); background-position: 76% 0; animation-delay: 1.14s; }
.voice-wave span:nth-child(21) { transform: scaleY(0.6); background-position: 80% 0; animation-delay: 1.20s; }
.voice-wave span:nth-child(22) { transform: scaleY(0.35); background-position: 84% 0; animation-delay: 1.26s; }
.voice-wave span:nth-child(23) { transform: scaleY(0.75); background-position: 88% 0; animation-delay: 1.32s; }
.voice-wave span:nth-child(24) { transform: scaleY(0.5); background-position: 92% 0; animation-delay: 1.38s; }
.voice-wave span:nth-child(25) { transform: scaleY(0.3); background-position: 96% 0; animation-delay: 1.44s; }
.voice-wave span:nth-child(26) { transform: scaleY(0.55); background-position: 100% 0; animation-delay: 1.50s; }
.voice-wave span:nth-child(27) { transform: scaleY(0.35); background-position: 104% 0; animation-delay: 1.56s; }
.voice-wave span:nth-child(28) { transform: scaleY(0.2); background-position: 108% 0; animation-delay: 1.62s; }
.voice-points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 36px; }
@media (max-width: 560px) { .voice-points { grid-template-columns: minmax(0, 1fr); } }
.voice-points li { padding-top: 18px; border-top: 1px solid var(--night-line); }
.voice-points h3 { color: #fff; margin: 8px 0 6px; }
.voice-points p { margin: 0; }
.note { font-size: 0.9rem; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .voice-wave span, .levels-bars span { animation: talk 1.1s ease-in-out infinite alternate; }
}
@keyframes talk { from { transform: scaleY(0.15); } }

/* Features, subjects, FAQ */
.why-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(28px, 5vw, 72px); }
.why-list li { padding: 24px 0; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .why-list { grid-template-columns: minmax(0, 1fr); } }
.why-list h3 { font-size: 1.2rem; margin: 0 0 8px; }
.why-list p { margin: 0; color: var(--muted); }
.textbook { display: flex; gap: 22px; align-items: flex-start; margin-top: clamp(40px, 5vw, 64px); padding: clamp(24px, 3.5vw, 40px); border-radius: 24px; background: var(--night-glow), var(--night); color: var(--night-text); }
.textbook h3 { margin: 0 0 8px; font-size: 1.3rem; color: #fff; }
.textbook p { margin: 0; color: var(--night-muted); max-width: 52em; }
.bento { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tile { overflow: hidden; padding: 0 26px 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.tile.photo, .tile.privacy { grid-column: span 2; }
@media (max-width: 900px) { .bento { grid-template-columns: minmax(0, 1fr); } .tile.photo, .tile.privacy { grid-column: auto; } }
.tile h3 { font-size: 1.2rem; margin: 0 0 8px; }
.tile p { margin: 0; color: var(--muted); max-width: 34em; }
.tile-art { display: grid; place-items: center; height: 200px; margin: 0 -26px 24px; padding: 16px; overflow: hidden; border-bottom: 1px solid var(--line); background-color: var(--bg-soft); }
.tile.tools .tile-art, .tile.photo .tile-art { background-color: var(--paper); background-image: var(--graph-paper); background-size: 16px 16px; }
.tile-art svg { width: 100%; height: 100%; }
.art-photo .sheet { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.art-photo text { fill: var(--text); font: 600 22px var(--serif); }
.art-photo .crop { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.art-photo .picked { font-weight: 700; }
.art-photo .arrow { fill: none; stroke: var(--muted); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.art-photo .note { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.art-question { display: grid; gap: 10px; width: 100%; padding: 0 8px; }
.art-question p { margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 0.92rem; line-height: 1.35; }
.tile.privacy { display: flex; flex-direction: column; justify-content: flex-end; min-height: 240px; padding: 36px clamp(26px, 4vw, 48px); border-color: transparent; background: var(--accent-soft); }
.tile.privacy h3 { font-family: var(--serif); font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.3rem); font-weight: 600; }
.tile.privacy p { font-size: 1.1rem; }
.art-tools { max-height: 100%; width: auto; max-width: 100%; }
/* What the research says: magazine-style infographics. */
.research-band { background: var(--bg-soft); border-block: 1px solid var(--line); }
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; margin-top: 36px; padding: clamp(24px, 4.5vw, 56px); background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 8px); box-shadow: var(--shadow); }
@media (max-width: 860px) { .feature { grid-template-columns: minmax(0, 1fr); } }
.kicker { margin: 0 0 10px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
:lang(ja) .kicker, :lang(zh-Hans) .kicker, :lang(ko) .kicker, :lang(ar) .kicker, :lang(hi) .kicker { letter-spacing: 0; text-transform: none; }
.feature-head { font-family: var(--serif); font-size: clamp(1.7rem, 1.2rem + 1.7vw, 2.6rem); font-weight: 600; line-height: 1.15; margin: 0 0 16px; text-wrap: balance; }
:lang(hi) .feature-head, :lang(ar) .feature-head { font-family: var(--sans); font-weight: 700; }
.feature-text p { margin: 0 0 14px; color: var(--muted); font-size: 1.05rem; }
.feature-text .feature-note { margin: 18px 0 0; font-size: 0.85rem; }
/* 100 students in the same grade, lowest score on the left: your child moves from 50 to 61, passing 11. */
.crowd { --from: 50%; --to: 61%; position: relative; align-self: center; }
.crowd-move { position: relative; height: 58px; }
.crowd-count { position: absolute; top: 0; left: calc((var(--from) + var(--to)) / 2); transform: translateX(-50%); font-size: 0.9rem; font-weight: 700; color: var(--accent); white-space: nowrap; }
.crowd-from, .crowd-child { position: absolute; top: 28px; width: 22px; height: 22px; margin-left: -11px; box-sizing: border-box; border-radius: 50%; }
.crowd-from { left: var(--from); border: 2px dashed var(--muted); }
.crowd-child { left: var(--to); border: 6px solid var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
/* The path runs from the edge of the "today" ring to the child and ends in an arrowhead. */
.crowd-path { position: absolute; top: 38px; left: calc(var(--from) + 12px); width: calc(var(--to) - var(--from) - 26px); height: 2px; background: var(--accent); }
.crowd-path::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--accent); border-right: 0; }
.crowd-row { display: block; width: 100%; height: 64px; margin-top: 6px; }
.crowd-row rect { fill: color-mix(in srgb, var(--dot-behind) 75%, transparent); }
.crowd-row rect.passed { fill: var(--accent); }
.crowd-marks { position: relative; height: 76px; }
.crowd-marks p { position: absolute; top: 0; display: grid; gap: 4px; margin: 0; padding-top: 10px; }
.crowd-marks .from { right: calc(100% - var(--from)); padding-right: 10px; text-align: right; border-right: 1.5px dashed var(--muted); }
.crowd-marks .to { left: var(--to); padding-left: 10px; text-align: left; border-left: 1.5px solid var(--accent); }
.crowd-marks b { display: flex; align-items: flex-end; height: 2.6rem; font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1; color: var(--muted); }
.crowd-marks .from b { justify-content: flex-end; }
.crowd-marks .to b { font-size: 2.6rem; color: var(--accent); }
.crowd-marks span { font-size: 0.85rem; line-height: 1.3; color: var(--muted); }
.crowd-marks .to span { color: var(--text); font-weight: 600; }
.crowd-axis { display: flex; justify-content: space-between; margin: 10px 0 0; font-size: 0.78rem; color: var(--muted); }
@media (max-width: 640px) { .crowd-row { height: 52px; } .crowd-marks b { height: 2rem; font-size: 1.6rem; } .crowd-marks .to b { font-size: 2rem; } }
em.figure { font-style: normal; color: var(--accent); }
/* Hints vs answers, bars to scale. */
.vs { position: relative; display: grid; gap: 26px; padding-top: 12px; }
.vs-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; align-items: center; }
.vs-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.vs-row.answers .vs-icon { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.vs-icon .icon { width: 28px; height: 28px; }
.vs-label { font-weight: 650; }
.vs-track { height: 24px; }
.vs-fill { display: block; height: 100%; border-radius: 7px; background: var(--bar-hints); transition: width 0.9s cubic-bezier(.2, .7, .2, 1); }
.vs-row.answers .vs-fill { background: var(--bar-answers); }
.vs-fill.w100 { width: 100%; }
.vs-fill.w83 { width: 83%; }
.vs-badge { position: absolute; inset-inline-end: 0; top: -14px; font-family: var(--serif); font-size: clamp(2.6rem, 2rem + 2.2vw, 3.8rem); font-weight: 600; line-height: 1; color: var(--accent); }
@media (max-width: 640px) { .vs-badge { position: static; order: -1; justify-self: start; } }
@media (prefers-reduced-motion: no-preference) {
  /* Once, slowly: the child walks from 50 to 61 and the students it passes light up in turn. */
  .crowd-child { transition: left 2.2s linear 0.4s; }
  .crowd-path { transition: width 2.2s linear 0.4s; }
  .crowd-row rect.passed { transition: fill 0.15s; }
  .crowd-marks .to, .crowd-count { transition: opacity 0.6s 2.6s; }
  .js .crowd:not(.play) .crowd-child { left: var(--from); }
  .js .crowd:not(.play) .crowd-path { width: 0; }
  .js .crowd:not(.play) .crowd-row rect.passed { fill: color-mix(in srgb, var(--dot-behind) 75%, transparent); }
  .js .crowd:not(.play) .crowd-marks .to, .js .crowd:not(.play) .crowd-count { opacity: 0; }
  .crowd-row rect.passed:nth-child(51) { transition-delay: 0.6s; }
  .crowd-row rect.passed:nth-child(52) { transition-delay: 0.8s; }
  .crowd-row rect.passed:nth-child(53) { transition-delay: 1.0s; }
  .crowd-row rect.passed:nth-child(54) { transition-delay: 1.2s; }
  .crowd-row rect.passed:nth-child(55) { transition-delay: 1.4s; }
  .crowd-row rect.passed:nth-child(56) { transition-delay: 1.6s; }
  .crowd-row rect.passed:nth-child(57) { transition-delay: 1.8s; }
  .crowd-row rect.passed:nth-child(58) { transition-delay: 2.0s; }
  .crowd-row rect.passed:nth-child(59) { transition-delay: 2.2s; }
  .crowd-row rect.passed:nth-child(60) { transition-delay: 2.4s; }
  .crowd-row rect.passed:nth-child(61) { transition-delay: 2.6s; }
  .js .vs:not(.play) .vs-fill { width: 0; }
  .js .vs:not(.play) .vs-badge { opacity: 0; }
  .vs-badge { transition: opacity 0.5s 0.7s; }
}
@keyframes pass { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.findings-title { margin: clamp(56px, 7vw, 88px) 0 0; font-size: 1.25rem; }
.findings-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(28px, 5vw, 72px); }
.findings-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .findings-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .findings-list { grid-template-columns: minmax(0, 1fr); } }
.findings-list li { padding: 20px 0; border-top: 1px solid var(--line); }
.findings-list h4 { margin: 0 0 6px; font-size: 1.1rem; text-wrap: balance; }
.findings-list p { margin: 0; color: var(--muted); }
.fn { font-size: 0.62em; line-height: 0; margin-inline-start: 2px; vertical-align: super; }
.fn a { color: var(--accent); font-weight: 700; text-decoration: none; }
.sources { margin-top: 52px; padding-top: 20px; border-top: 1px solid var(--line); }
.sources summary { cursor: pointer; width: fit-content; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sources[open] summary { margin-bottom: 12px; }
.sources ol { margin: 0; padding-inline-start: 1.4em; columns: 2 320px; column-gap: 40px; font-size: 0.82rem; color: var(--muted); }
.sources li { break-inside: avoid; margin-bottom: 6px; }
.sources a { color: var(--muted); overflow-wrap: anywhere; }
.sources li:target a { color: var(--accent); }
.problem svg { display: block; width: min(100%, 260px); margin: 14px auto 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.problem svg text { fill: currentColor; stroke: none; font-size: 15px; font-style: italic; font-family: var(--serif, Georgia, serif); }
.problem svg text.n { font-style: normal; font-size: 13px; }
.problem svg .dot { fill: currentColor; stroke: none; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1000px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gallery figure { margin: 0; height: 100%; display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
/* Each sketch sits on the app's graph paper, white in both themes like the replays; its SVG is 4:3. */
.sketch { padding: 18px; background-color: var(--paper); background-image: var(--graph-paper); background-size: 16px 16px; border-bottom: 1px solid var(--line); }
.sketch img { display: block; width: 100%; height: auto; }
.gallery figcaption { padding: 12px 18px 14px; font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.faq-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (max-width: 900px) { .faq-grid { grid-template-columns: minmax(0, 1fr); } }
.faq-contact { margin: 0; padding-top: 22px; color: var(--muted); }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 22px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 14px; height: 14px; background: linear-gradient(currentColor, currentColor) center / 14px 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 14px no-repeat; color: var(--accent); transition: background-size 0.2s; }
.faq details[open] summary::after { background-size: 14px 2px, 2px 0; }
.faq details p { margin: 12px 0 0; color: var(--muted); max-width: 40em; }
.assurances { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(28px, 5vw, 72px); }
@media (max-width: 640px) { .assurances { grid-template-columns: minmax(0, 1fr); } }
.assurances li { padding: 24px 0; border-top: 1px solid var(--line); }
.parents-more { margin: 28px 0 0; }
.assurances h3 { margin: 0 0 6px; font-size: 1.2rem; }
.assurances p { margin: 0; color: var(--muted); }
.closing { padding: clamp(80px, 11vw, 140px) 0; text-align: center; background: var(--night-glow), var(--night-grid), var(--night); color: var(--night-text); }
.closing h2 { margin: 0 auto 18px; max-width: 18em; font-size: clamp(2.3rem, 1.4rem + 3.4vw, 3.9rem); color: #fff; }
.closing p { color: var(--night-muted); font-size: 1.15rem; }
.closing .cta { justify-content: center; }

/* Documents */
.doc { padding: clamp(36px, 6vw, 72px) 0; }
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; align-items: start; }
@media (max-width: 860px) { .doc-grid { grid-template-columns: minmax(0, 1fr); } }
.doc article { max-width: 46em; }
.doc h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem); }
.doc h2 { font-size: 1.35rem; margin-top: 1.8em; }
.doc li { margin-bottom: 0.4em; }
.doc-nav { position: sticky; top: 88px; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--surface); }
.doc-nav h2 { font-size: 0.95rem; font-family: var(--sans); color: var(--muted); }
.doc-nav ul { list-style: none; margin: 0 0 14px; padding: 0; }
.doc-nav li { margin: 6px 0; }
.doc-nav a[aria-current] { font-weight: 700; text-decoration: none; color: var(--text); }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 56px 0 36px; background: var(--bg); font-size: 0.95rem; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }
.foot .brand { color: var(--text); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: minmax(0, 1fr); } }
.foot h2 { font-family: var(--sans); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 6px 0; }
.fine { margin-top: 32px; font-size: 0.82rem; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.fine p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
