:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c1b19;
  --muted: #6b6862;
  --accent: #6a4df4;
  --accent-ink: #ffffff;
  /* The warm complement: burnt orange for everything on the mistake side
     (the "is not" column, the misconception labels, the pattern badges). */
  --warm: #b8500f;
  --warm-ink: #ffffff;
  --icon-ring: rgba(0,0,0,.09);
  --line: #e7e4dd;
  --radius: 16px;
  --maxw: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14130f;
    --surface: #1e1c18;
    --ink: #f3f1ea;
    --muted: #a5a196;
    --accent: #9d8bff;
    --accent-ink: #14130f;
    --warm: #ffa15c;
    --warm-ink: #14130f;
    --icon-ring: rgba(255,255,255,.18);
    --line: #322f28;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

section, header, footer { padding-inline: 24px; }

/* ---- nav ---- */
.site-nav {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 20px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark-logo { display: block; }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav-links a:hover { text-decoration: underline; }

/* ---- buttons ---- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  white-space: nowrap;   /* a button is one line; shorten the label, never wrap it */
  transition: transform .08s ease, opacity .15s ease;
}
.btn:hover { opacity: .92; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 16px; font-size: .9rem; }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }

/* "Tell me when it's out" (the mailto buttons): a lift and a glow on hover. */
.btn-lg[href^="mailto:"] { transition: transform .18s ease, box-shadow .18s ease, opacity .15s ease; }
.btn-lg[href^="mailto:"]:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px var(--accent);
}
.btn-lg[href^="mailto:"]:active { transform: translateY(0); box-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  .btn-lg[href^="mailto:"]:hover { transform: none; }
}

/* ---- hero ---- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding-block: 56px 72px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 14px;
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
}
.hero-art { display: grid; place-items: center; }
.app-icon {
  width: min(240px, 60vw);
  height: auto;
  border-radius: 24%;
  box-shadow: 0 0 0 1px var(--icon-ring), 0 20px 50px rgba(0,0,0,.22);
}
.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 28px; max-width: 46ch; }
.cta-row { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.cta-note { font-size: .85rem; color: var(--muted); }

/* ---- features ---- */
.features {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
  padding: 0;
}
/* six cards: three to a row */
.features-3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
/* The why band: four cards, two by two. */
#why .features { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.feature-icon {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 12px;
}
.feature h3 { margin: 0 0 8px; font-size: 1.15rem; }
.feature p { margin: 0; color: var(--muted); }
.feature-wide { grid-column: 1 / -1; }

/* ---- the loop: Learn / Try / Practise ---- */
.loop {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.loop-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  color: inherit; text-decoration: none;
}
a.loop-card:hover { border-color: var(--accent); }
.loop-card h3 { margin: 6px 0 0; font-size: 1.25rem; }
.loop-card p { margin: 0; color: var(--muted); flex: 1; }
.loop-link { font-weight: 600; color: var(--accent); }
.loop-link::after { content: " →"; display: inline-block; text-decoration: none; }
a.loop-card:hover .loop-link { text-decoration: underline; }
.clip {
  margin: 0; border-radius: 12px; overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--bg); border: 1px solid var(--line);
  display: grid; place-items: end start;
}
.clip video { display: block; width: 100%; height: 100%; object-fit: cover; }
.clip figcaption { font-size: .85rem; color: var(--muted); padding: 12px 14px; }
.clip-soon { background-image: repeating-linear-gradient(135deg, transparent 0 14px, var(--line) 14px 15px); }

/* ---- bands ---- */
.band { max-width: var(--maxw); margin: 0 auto; padding-block: 32px; }
.band h2 { font-size: 1.9rem; letter-spacing: -0.02em; margin: 0 0 24px; }
.band-narrow > * { max-width: 60ch; }
.band-narrow p { font-size: 1.05rem; margin: 0 0 14px; }
.band-lead { font-size: 1.2rem; font-weight: 600; margin: -8px 0 20px; }
.told { margin: 0 0 20px; padding-left: 1.2em; }
.told li { font-size: 1.05rem; margin-bottom: 10px; }

/* ---- is / isn't ---- */
.compare { width: 100%; border-collapse: collapse; }
.compare th, .compare td {
  width: 50%;
  text-align: left;
  vertical-align: top;
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--line);
}
.compare th {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}
.compare th:first-child { color: var(--accent); border-bottom-color: var(--accent); }
.compare td:first-child { font-weight: 600; }
.compare td:last-child { color: var(--muted); }
.compare th:last-child { color: var(--warm); border-bottom-color: var(--warm); }
.aside { color: var(--muted); margin: 24px 0 0; }
.aside a { color: var(--accent); font-weight: 600; text-decoration: none; }
.aside a:hover { text-decoration: underline; }
/* inline-block: the hover underline stops before the arrow. */
.aside a::after { content: " →"; display: inline-block; text-decoration: none; }

/* ---- download ---- */
.download {
  max-width: var(--maxw);
  margin: 40px auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 56px 24px;
}
.download-icon {
  width: 88px;
  height: auto;
  border-radius: 24%;
  box-shadow: 0 0 0 1px var(--icon-ring), 0 12px 30px rgba(0,0,0,.18);
  margin-bottom: 20px;
}
.download h2 { font-size: 2rem; letter-spacing: -0.02em; margin: 0 0 8px; }
.download p { color: var(--muted); margin: 0 0 24px; max-width: 46ch; margin-inline: auto; }

/* ---- footer ---- */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  color: var(--muted);
  font-size: .9rem;
  padding-block: 40px;
  border-top: 1px solid var(--line);
}
.site-footer a { color: var(--muted); font-weight: 600; text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ---- the reel in the hero: a phone frame, and the four moments under it ---- */
.hero-reel { margin: 0; display: grid; gap: 16px; justify-items: center; }
.phone {
  width: min(300px, 70vw);
  aspect-ratio: 480 / 1044;
  border-radius: 9.5%/4.4%;         /* iPhone-ish corners at this aspect */
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--icon-ring), 0 0 0 6px var(--surface), 0 0 0 7px var(--line), 0 24px 60px rgba(0,0,0,.25);
}
.phone img, .phone video { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-reel figcaption { text-align: center; color: var(--muted); font-size: 1.05rem; }
.moments-lead { display: block; font-weight: 600; color: var(--ink); }
/* The moments rotate: five lines, four seconds each, CSS only. One slot is 20% of the
   cycle; each line is fully out (0.6 s) before the next one is in, so two never overlap. */
.moments { list-style: none; margin: 4px 0 0; padding: 0; position: relative; height: 1.6em; }
.moments li {
  position: absolute; inset: 0; opacity: 0;
  animation: moment 20s infinite;
}
.moments li:nth-child(2) { animation-delay: 4s; }
.moments li:nth-child(3) { animation-delay: 8s; }
.moments li:nth-child(4) { animation-delay: 12s; }
.moments li:nth-child(5) { animation-delay: 16s; }
@keyframes moment {
  0% { opacity: 0; transform: translateY(4px); }
  3%, 15% { opacity: 1; transform: none; }
  18%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .moments { height: auto; }
  .moments li { position: static; opacity: 1; animation: none; display: inline; }
  .moments li + li::before { content: " · "; }
}

/* ---- the groups: each h2 finishes "A ten-minute math tutor…" ---- */
.group { padding-block: 40px; }
.group .eyebrow { margin-bottom: 6px; }
.group h2 { margin-bottom: 8px; }
.group .band-lead { margin-bottom: 36px; }

/* An item: copy on one side, a row of phone frames on the other, sides alternating. */
.item {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 40px;
  align-items: center;
  padding-block: 28px;
  border-top: 1px solid var(--line);
}
.item:nth-of-type(even) .item-copy { order: 2; }
.item h3 { margin: 0 0 10px; font-size: 1.45rem; letter-spacing: -0.015em; }
.item p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.shots { display: flex; gap: 14px; justify-content: center; }
.shots img {
  display: block;
  flex: 0 1 220px;
  min-width: 0;
  height: auto;
  border-radius: 7%/3.2%;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--icon-ring), 0 0 0 4px var(--surface), 0 0 0 5px var(--line), 0 14px 36px rgba(0,0,0,.18);
}
.shots-3 img { flex-basis: 170px; }
.shots-1 img { flex-basis: 240px; }

/* ---- by the numbers ---- */
.stats {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px 24px;
}
.stats li { color: var(--muted); line-height: 1.3; }
.stats b { display: block; font-size: 3.4rem; line-height: 1; letter-spacing: -0.03em; color: var(--accent); margin-bottom: 6px; }
/* The band breathes more than its neighbours and the figures carry it
   (Bogdan 2026-10-31: "should have more space around it, the numbers maybe bigger"). */
#numbers { padding-block: 72px; }
#numbers h2 { margin-bottom: 40px; }
#numbers .stats { gap: 32px 40px; }
#numbers .aside { margin-top: 44px; }

/* ---- the papers: footnote-sized, two columns, like a references list ---- */
#research .band-lead { max-width: 60ch; }
.papers {
  margin: 0; padding-left: 1.2em;
  columns: 2; column-gap: 40px;
  font-size: .88rem; line-height: 1.45; color: var(--muted);
}
.papers li { margin-bottom: 8px; break-inside: avoid; }
.papers strong { color: var(--ink); }
.papers a { color: var(--accent); font-weight: 600; text-decoration: none; }
.papers a:hover { text-decoration: underline; }

/* The closing cards: four across, no figures. */
.loop-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

@media (max-width: 800px) {
  .item { grid-template-columns: 1fr; gap: 20px; padding-block: 24px; }
  .item:nth-of-type(even) .item-copy { order: 0; }
  .shots { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 4px 16px; margin-inline: -4px; }
  .shots img { flex: 0 0 48%; scroll-snap-align: start; }
  .shots-3 img { flex-basis: 44%; }
  .shots-1 img { flex-basis: 60%; }
  .stats b { font-size: 2.6rem; }
  #numbers { padding-block: 48px; }
  #numbers .stats { gap: 24px 28px; }
  .papers { columns: 1; }
}

/* ---- responsive ---- */
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-block: 32px 44px; }
  .hero-art { order: -1; }
  .nav-links { gap: 14px; }
  .clip { aspect-ratio: 16 / 9; }
  /* The Honest math card is its own section: give it a gutter on phones. */
  .download { margin-inline: 16px; padding: 40px 20px; border-radius: 20px; }
}
