/* Lern landing page: a night-time desk, one long notebook page, a red margin rule.
   Light paper objects are the student's own material; dark sheets with highlighter
   are what Lern makes. Yellow is the main action; other highlighters tag kinds of things. */

/* Self-hosted fonts (SIL OFL 1.1, see fonts/LICENSE.md). Latin subsets only. */
@font-face {
  font-family: "Newsreader"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("/fonts/newsreader.woff2") format("woff2");
}
@font-face {
  font-family: "Kalam"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/kalam-400.woff2") format("woff2");
}
@font-face {
  font-family: "Kalam"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/kalam-700.woff2") format("woff2");
}

:root {
  --desk: #121214;
  --sheet: #1a1a1d;
  --sheet-2: #222226;
  --rule: #2e2e33;
  --chalk: #ece7dc;
  --chalk-2: #c9c4b9;
  --pencil: #8e8a82;
  --ink: #16161a;
  --paper: #ede8dd;
  --paper-line: #c9c2b2;

  --yellow: #f4d35e;
  --yellow-deep: #e6b93a;
  --red: #e5534b;
  --mint: #7ddbb5;
  --pink: #f49ac1;
  --lav: #b4a7f5;
  --sky: #8ec5f4;
  --orange: #f2a57a;

  --serif: "Newsreader", "New York", ui-serif, Georgia, serif;
  --hand: "Kalam", "Bradley Hand", "Segoe Print", cursive;

  /* The notebook margin, and where content starts to its right. */
  --m: clamp(16px, 4.5vw, 76px);
  --gut: calc(var(--m) + clamp(22px, 4vw, 64px));
  --right: clamp(20px, 5vw, 80px);
  --maxw: 1280px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, .05, .25, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--desk);
  /* The app's dot grid, plus a fine paper grain. */
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.065) 1.1px, transparent 1.4px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 24px 24px, 160px 160px;
  color: var(--chalk);
  font-family: var(--serif);
  font-size: clamp(17px, 0.45vw + 15px, 20px);
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; max-width: 34em; }
h1, h2, h3 { margin: 0; font-weight: 650; text-wrap: balance; }
p, li { text-wrap: pretty; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(244, 211, 94, .35); color: var(--chalk); }

[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--gut); top: -60px; z-index: 100;
  background: var(--yellow); color: var(--ink); padding: 10px 16px; border-radius: 8px;
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; margin-inline: auto; }

/* The red margin rule down the whole page. */
.margin-rule {
  position: absolute; top: 0; bottom: 0; left: var(--m); width: 1.5px;
  background: linear-gradient(to bottom, transparent, rgba(229, 83, 75, .55) 120px, rgba(229, 83, 75, .55) calc(100% - 120px), transparent);
  pointer-events: none; z-index: 0;
}

/* ---------- Buttons ---------- */
.btn {
  --bg: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: 0 26px; border-radius: 14px;
  font-family: var(--serif); font-size: 1.02rem; font-weight: 600; letter-spacing: .005em;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  background: var(--bg);
  transition: transform .35s var(--ease-out), background-color .2s, border-color .2s, box-shadow .35s var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn-primary {
  --bg: var(--yellow); color: var(--ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 10px 30px -12px rgba(244, 211, 94, .55);
}
.btn-primary:hover { --bg: #f7dc73; box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 16px 40px -14px rgba(244, 211, 94, .7); transform: translateY(-1px); }
.btn-ghost { color: var(--chalk); border-color: #3a3a40; background: rgba(255,255,255,.02); }
.btn-ghost:hover { border-color: #55555c; background: rgba(255,255,255,.05); }
.btn-small { min-height: 44px; padding: 0 18px; font-size: .95rem; border-radius: 12px; }
.btn-wide { width: 100%; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 14px var(--right) 14px var(--gut);
  background: linear-gradient(to bottom, rgba(18,18,20,.92), rgba(18,18,20,.72));
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.is-scrolled { border-bottom-color: rgba(255,255,255,.06); }
.nav nav { margin-left: auto; }
.nav-links { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px;
  text-decoration: none; color: var(--chalk-2); font-size: .98rem;
  transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--chalk); background: rgba(255,255,255,.04); }

.wordmark { text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }
.wordmark-text {
  position: relative; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1;
  font-variation-settings: "opsz" 72;
}
.wordmark-text::after {
  content: ""; position: absolute; left: -4px; right: -4px; bottom: .02em; height: .32em; z-index: -1;
  background: var(--yellow); opacity: .78; border-radius: 999px; transform: rotate(-1.5deg);
}

/* ---------- Shared section layout ---------- */
main > section { position: relative; padding: clamp(96px, 13vh, 170px) var(--right) clamp(96px, 13vh, 170px) var(--gut); }
.section-title {
  font-size: clamp(2.1rem, 3.4vw + 1rem, 4rem); line-height: 1.04; letter-spacing: -.018em;
  font-variation-settings: "opsz" 72; font-weight: 650; max-width: 16ch; margin-bottom: .45em;
}
.section-title.center { max-width: 20ch; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 6vw, 110px); align-items: center; max-width: var(--maxw); }
.split-rev .split-copy { order: 2; }
.split-copy p { color: var(--chalk-2); }
.fine { font-size: .86rem; color: var(--pencil); max-width: none; }
.aside { font-size: .92rem; color: var(--pencil); }

/* Tape, used on sticky notes and taped-in photos. */
.tape {
  position: absolute; top: -11px; left: 50%; width: 74px; height: 22px; margin-left: -37px;
  background: rgba(255,255,255,.2); transform: rotate(-3deg);
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
  -webkit-mask: linear-gradient(90deg, transparent 0 2px, #000 2px calc(100% - 2px), transparent calc(100% - 2px));
}

/* ======================================================================
   HERO
   ====================================================================== */
.hero {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5.4fr); align-items: center;
  gap: clamp(24px, 3vw, 56px);
  min-height: calc(100svh - 72px);
  padding-top: clamp(40px, 7vh, 90px) !important; padding-bottom: clamp(56px, 9vh, 120px) !important;
  max-width: calc(var(--maxw) + 200px);
}
.lamp {
  position: absolute; inset: -20% -10% auto 30%; height: 120%; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, rgba(244, 211, 94, .13), rgba(244, 211, 94, .04) 55%, transparent 75%);
  filter: blur(10px);
}
.hero-copy { position: relative; z-index: 2; }
.hero-title {
  font-size: clamp(3rem, 4.1vw + 1rem, 6.4rem); line-height: .96; letter-spacing: -.03em;
  font-weight: 700; font-variation-settings: "opsz" 72; margin-bottom: .32em;
}
.hero-title .line { display: block; white-space: nowrap; }
.swipe {
  /* The app's highlighter swipe, drawn left to right once the page loads. */
  background-image: linear-gradient(transparent 62%, rgba(244, 211, 94, .78) 62%, rgba(244, 211, 94, .78) 92%, transparent 92%);
  background-repeat: no-repeat; background-size: 0% 100%;
  padding: 0 .06em; margin: 0 -.06em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.lede { font-size: clamp(1.08rem, .55vw + .9rem, 1.32rem); color: var(--chalk-2); max-width: 30em; margin-bottom: 1.6em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.cta-row.center { justify-content: center; }

/* Load sequence. Everything starts hidden only when JS is running. */
.js .hero-title .line, .js .lede, .js .hero .cta-row, .js .hero .fine {
  opacity: 0; transform: translateY(18px);
  transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out);
}
.js .hero-title .line:nth-child(2) { transition-delay: .08s; }
.js .lede { transition-delay: .18s; }
.js .hero .cta-row { transition-delay: .26s; }
.js .hero .fine { transition-delay: .32s; }
.is-ready .hero-title .line, .is-ready .lede, .is-ready .hero .cta-row, .is-ready .hero .fine { opacity: 1; transform: none; }
.swipe { transition: background-size 1s var(--ease-io) 1.05s; }
.is-ready .swipe, .no-js .swipe { background-size: 100% 100%; }

/* ---------- The notebook ---------- */
.hero-stage {
  --bw: min(600px, 46vw);
  position: relative; height: calc(var(--bw) * .92); min-height: 360px;
  display: grid; place-items: center;
  transform: perspective(1600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
}
.book {
  --pw: calc(var(--bw) / 2);
  position: relative; width: var(--bw); height: calc(var(--bw) * .7);
  perspective: 2400px; transform-style: preserve-3d;
  /* Closed, the cover (right half) sits in the middle of the stage. */
  transform: translateX(calc(var(--bw) * -.25)) rotate(-2deg);
  transition: transform 1.5s var(--ease-io) .5s;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.55)) drop-shadow(0 6px 10px rgba(0,0,0,.35));
}
.is-open .book { transform: translateX(0) rotate(0deg); }

.page {
  position: absolute; top: 0; width: 50%; height: 100%;
  background-color: #1d1d21;
  background-image:
    linear-gradient(to right, rgba(0,0,0,.35), transparent 9%),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--bw) * .052 - 1px), rgba(142, 197, 244, .1) calc(var(--bw) * .052 - 1px) calc(var(--bw) * .052));
  background-position: 0 0, 0 calc(var(--bw) * .085);
  overflow: hidden;
}
.page-right {
  left: 50%; border-radius: 3px 12px 12px 3px;
  padding: calc(var(--bw) * .03) calc(var(--bw) * .036) calc(var(--bw) * .03) calc(var(--bw) * .045);
  box-shadow: inset 1px 0 0 rgba(255,255,255,.04);
}
/* Page edges peeking out under the right page. */
.page-right::after {
  content: ""; position: absolute; right: 0; top: 2%; bottom: 2%; width: 4px;
  background: repeating-linear-gradient(to right, #2b2b30 0 1px, #1d1d21 1px 2px);
}
.page-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1.5px solid rgba(229, 83, 75, .55); padding-bottom: calc(var(--bw) * .012); margin-bottom: calc(var(--bw) * .024); }
.page-title { font-weight: 700; font-size: calc(var(--bw) * .034); font-variation-settings: "opsz" 40; }
.page-meta { font-size: calc(var(--bw) * .022); color: var(--pencil); }

.deal { position: relative; height: calc(var(--bw) * .4); }
.icard {
  position: absolute; left: 0; right: 0; padding: calc(var(--bw) * .018) calc(var(--bw) * .022);
  background: var(--sheet-2); border: 1px solid #34343a; border-radius: 6px;
  box-shadow: 0 8px 18px -8px rgba(0,0,0,.7);
  font-size: calc(var(--bw) * .021); line-height: 1.35;
  display: flex; flex-direction: column; gap: 2px;
}
.icard b { font-weight: 650; color: var(--chalk); }
.icard span { color: var(--mint); }
.icard.c1 { top: 0; --r: -1.5deg; }
.icard.c2 { top: 32%; --r: 1.2deg; }
.icard.c3 { top: 64%; --r: -.6deg; }
.icard { transform: translateY(0) rotate(var(--r)); }
.js .icard { opacity: 0; transform: translate(30%, 40%) rotate(14deg); transition: opacity .5s, transform .9s var(--ease-out); }
.js .is-open .icard { opacity: 1; transform: translateY(0) rotate(var(--r)); }
.js .is-open .icard.c1 { transition-delay: 2.35s; }
.js .is-open .icard.c2 { transition-delay: 2.55s; }
.js .is-open .icard.c3 { transition-delay: 2.75s; }

.mini-ring { position: absolute; left: calc(var(--bw) * .045); bottom: calc(var(--bw) * .03); display: flex; align-items: center; gap: calc(var(--bw) * .014); font-size: calc(var(--bw) * .022); color: var(--pencil); }
.mini-ring svg { width: calc(var(--bw) * .062); height: calc(var(--bw) * .062); transform: rotate(-90deg); }
.mini-ring circle { fill: none; stroke-width: 5; }
.mini-ring .track { stroke: #34343a; }
.mini-ring .fill { stroke: var(--yellow); stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: 64.5; }
.js .mini-ring .fill { stroke-dashoffset: 113.1; transition: stroke-dashoffset 1.4s var(--ease-out) 3s; }
.js .is-open .mini-ring .fill { stroke-dashoffset: 64.5; }
.mini-ring strong { color: var(--chalk); font-weight: 700; }

/* Cover: front is the Lern notebook, back is the left page of handwritten notes. */
.cover {
  position: absolute; left: 50%; top: 0; width: 50%; height: 100%;
  transform-origin: left center; transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: transform 1.5s var(--ease-io) .55s;
}
.is-open .cover { transform: rotateY(-178deg); }
.cover-front, .cover-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cover-front {
  border-radius: 4px 14px 14px 4px;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,.05), transparent 60%),
    linear-gradient(160deg, #26262b, #1b1b1f);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), inset -2px 0 0 rgba(0,0,0,.4);
  display: grid; place-items: center; overflow: hidden;
}
.cover-back {
  transform: rotateY(180deg); left: 0; width: 100%;
  border-radius: 12px 3px 3px 12px;
  background-image:
    linear-gradient(to left, rgba(0,0,0,.35), transparent 9%),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--bw) * .052 - 1px), rgba(142, 197, 244, .1) calc(var(--bw) * .052 - 1px) calc(var(--bw) * .052));
  background-position: 0 0, 0 calc(var(--bw) * .085);
  padding: calc(var(--bw) * .062) calc(var(--bw) * .04) 0 calc(var(--bw) * .05);
}
/* Red margin on the handwritten page. */
.cover-back::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--bw) * .036); width: 1px; background: rgba(229, 83, 75, .45); }
.spine { position: absolute; left: 0; top: 0; bottom: 0; width: 9%; background: linear-gradient(90deg, #141417, #1c1c20); box-shadow: inset -1px 0 0 rgba(255,255,255,.04); }
.cover-l {
  position: relative; z-index: 2; font-family: var(--serif); font-weight: 700; color: var(--chalk);
  font-size: calc(var(--bw) * .23); line-height: 1; font-variation-settings: "opsz" 72;
  transform: translate(-6%, -2%);
}
.cover-swipe {
  position: absolute; z-index: 1; width: 52%; height: 9%; left: 16%; top: 56%;
  background: var(--yellow); border-radius: 30px 8px 30px 10px; transform: rotate(-9deg);
  opacity: .95;
}
.band {
  position: absolute; z-index: 5; top: -1.5%; bottom: -1.5%; width: 2.2%;
  left: calc(50% + 50% * .8);
  background: linear-gradient(90deg, #c94740, var(--red) 35%, #f06b62 55%, #c94740);
  border-radius: 3px; box-shadow: 0 2px 6px rgba(0,0,0,.4);
  transition: transform .7s cubic-bezier(.5, -0.4, .6, 1) .05s, opacity .4s .45s;
}
.is-open .band { transform: translate(90px, 20px) rotate(16deg); opacity: 0; }

.scribble {
  position: relative; z-index: 1; margin: 0; max-width: none;
  font-family: var(--hand); color: #d9d3c6; white-space: nowrap;
  font-size: calc(var(--bw) * .027); line-height: calc(var(--bw) * .052);
  transform: rotate(-.6deg);
}
.scribble.s0 { color: var(--chalk); font-weight: 700; }
.scribble.s6 { color: var(--red); transform: rotate(-2.5deg) translateX(4%); }
.scribble mark {
  color: inherit; background-image: linear-gradient(transparent 50%, rgba(244, 211, 94, .55) 50%, rgba(244, 211, 94, .55) 88%, transparent 88%);
  background-color: transparent; background-repeat: no-repeat; background-size: 100% 100%;
  padding: 0 2px;
}
.js .scribble { clip-path: inset(0 100% 0 0); transition: clip-path .7s steps(14, end); }
.js .is-open .scribble { clip-path: inset(0 0 0 0); }
.js .is-open .scribble.s0 { transition-delay: 1.75s; }
.js .is-open .scribble.s1 { transition-delay: 2.05s; }
.js .is-open .scribble.s2 { transition-delay: 2.35s; }
.js .is-open .scribble.s3 { transition-delay: 2.65s; }
.js .is-open .scribble.s4 { transition-delay: 2.95s; }
.js .is-open .scribble.s5 { transition-delay: 3.25s; }
.js .is-open .scribble.s6 { transition-delay: 3.6s; }
.js .scribble mark { background-size: 0% 100%; transition: background-size .5s var(--ease-io); }
.js .is-open .s1 mark { transition-delay: 3.9s; }
.js .is-open .s2 mark { transition-delay: 4.05s; }
.js .is-open .s5 mark { transition-delay: 4.2s; }
.js .is-open .scribble mark { background-size: 100% 100%; }

/* Desk objects */
.desk-pencil {
  position: absolute; left: 4%; bottom: 3%; width: 46%; height: 16px; z-index: 6;
  transform: rotate(-16deg) translateY(var(--py, 0)); transform-origin: center;
  filter: drop-shadow(0 10px 8px rgba(0,0,0,.5));
}
.desk-pencil i {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #4b5263, #3a404e 50%, #2f3440);
  border-radius: 2px 0 0 2px;
  clip-path: polygon(0 0, 86% 0, 100% 50%, 86% 100%, 0 100%);
}
.desk-pencil::before { /* eraser */
  content: ""; position: absolute; left: -7%; width: 7.5%; top: 0; bottom: 0; border-radius: 4px 0 0 4px;
  background: linear-gradient(90deg, #e88aa9, var(--pink));
}
.desk-pencil::after { /* sharpened wood + lead */
  content: ""; position: absolute; right: 0; width: 14%; top: 0; bottom: 0;
  background: linear-gradient(90deg, #d9b98d 0 70%, #2a2a2e 70%);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.js .desk-pencil { opacity: 0; transform: rotate(-30deg) translate(-40px, 40px); transition: opacity .8s, transform 1.4s var(--ease-out) .3s; }
.js .is-open .desk-pencil { opacity: 1; transform: rotate(-16deg); }

.desk-sticky {
  position: absolute; right: 1%; bottom: 9%; z-index: 7; width: 132px; padding: 18px 14px 22px;
  background: linear-gradient(160deg, #f7a9cb, var(--pink)); color: #3b1428;
  font-family: var(--hand); font-weight: 700; font-size: 1.18rem; line-height: 1.1; text-align: center;
  transform: rotate(7deg); box-shadow: 0 14px 24px -10px rgba(0,0,0,.6);
  border-radius: 2px 2px 14px 2px;
}
.js .desk-sticky { opacity: 0; transform: translateY(-60px) rotate(-6deg); transition: opacity .3s 4.4s, transform .9s cubic-bezier(.3, 1.5, .5, 1) 4.4s; }
.js .is-open .desk-sticky { opacity: 1; transform: rotate(7deg); }

/* ======================================================================
   SCROLL STORY
   ====================================================================== */
.story { height: 360vh; padding-top: 0 !important; padding-bottom: 0 !important; }
.story-sticky {
  position: sticky; top: 0; height: 100svh;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center;
  gap: clamp(24px, 4vw, 64px); max-width: calc(var(--maxw) + 100px);
}
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 6px; counter-reset: s; }
.step {
  position: relative; padding: 14px 0 14px 46px; color: var(--pencil);
  transition: color .5s var(--ease-out);
}
.step::before {
  content: attr(data-num);
  position: absolute; left: 0; top: 14px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--hand); font-weight: 700; font-size: 1.05rem;
  border: 1.5px solid #3a3a40; color: var(--pencil); line-height: 1;
  transition: background-color .4s, color .4s, border-color .4s;
}
.step h3 { font-size: 1.35rem; color: inherit; font-variation-settings: "opsz" 36; margin-bottom: 4px; transition: color .5s; }
.step p { margin: 0; font-size: 1rem; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .7s var(--ease-out), opacity .5s; }
.step.is-active { color: var(--chalk-2); }
.step.is-active h3 { color: var(--chalk); }
.step.is-active p { max-height: 9em; opacity: 1; }
.step.is-active::before { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

.story-stage { position: relative; height: min(640px, 78svh); --k: 1; }
.obj { position: absolute; left: 50%; top: 50%; will-change: transform, opacity; transform: translate(-50%, -50%); }

/* Light paper: the student's own material. */
.src-pdf {
  width: 150px; height: 196px; padding: 34px 18px 0; border-radius: 4px;
  background: var(--paper); box-shadow: 0 18px 30px -12px rgba(0,0,0,.65);
  display: flex; flex-direction: column; gap: 9px;
}
.src-pdf i, .src-web i { display: block; height: 5px; border-radius: 3px; background: var(--paper-line); }
.src-pdf i.short, .src-web i.short { width: 60%; }
.src-pdf .tag {
  position: absolute; top: 0; right: 0; padding: 4px 9px; border-radius: 0 4px 0 8px;
  background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .02em;
}
.src-photo {
  width: 176px; padding: 10px 10px 34px; background: #f4f1ea; border-radius: 3px;
  box-shadow: 0 18px 30px -12px rgba(0,0,0,.65);
}
.photo-inner {
  height: 120px; border-radius: 2px; display: grid; place-content: center; gap: 2px;
  background: radial-gradient(120% 100% at 30% 20%, #3f5a4b, #2a3d33);
  font-family: var(--hand); color: rgba(255,255,255,.88); font-size: 1.15rem; text-align: center; line-height: 1.2;
}
.src-rec {
  width: 220px; height: 62px; padding: 0 16px; border-radius: 31px;
  background: #26262b; border: 1px solid #36363c; box-shadow: 0 18px 30px -12px rgba(0,0,0,.65);
  display: flex; align-items: center; gap: 12px;
}
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(229, 83, 75, .2); flex: none; }
.wave { display: flex; align-items: center; gap: 4px; height: 30px; flex: 1; }
.wave i { flex: 1; height: 30%; border-radius: 3px; background: var(--lav); animation: wave 1.1s ease-in-out infinite; }
.wave i:nth-child(2n) { animation-delay: -.3s; } .wave i:nth-child(3n) { animation-delay: -.6s; } .wave i:nth-child(5n) { animation-delay: -.85s; }
@keyframes wave { 0%, 100% { height: 25%; } 50% { height: 95%; } }
.rec-time { font-size: .85rem; color: var(--pencil); font-variant-numeric: tabular-nums; }
.src-video {
  width: 200px; height: 118px; border-radius: 10px; overflow: hidden;
  background: linear-gradient(140deg, #3b3550, #24202e); box-shadow: 0 18px 30px -12px rgba(0,0,0,.65);
  display: grid; place-items: center;
}
.play { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.92); position: relative; }
.play::after { content: ""; position: absolute; left: 18px; top: 14px; border-left: 15px solid #24202e; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.scrub { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); }
.scrub::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 38%; border-radius: 2px; background: var(--pink); }
.src-web {
  width: 190px; padding: 30px 16px 16px; border-radius: 8px; background: var(--paper);
  box-shadow: 0 18px 30px -12px rgba(0,0,0,.65); display: flex; flex-direction: column; gap: 8px;
}
.src-web .dots { position: absolute; top: 10px; left: 12px; display: flex; gap: 5px; }
.src-web .dots i { width: 7px; height: 7px; border-radius: 50%; background: #bdb6a6; }

/* The Lern notebook in the middle of the story. */
.story-book {
  width: 150px; height: 200px; border-radius: 4px 12px 12px 4px; z-index: 3;
  background: radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,.06), transparent 60%), linear-gradient(160deg, #27272c, #1b1b1f);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 30px 50px -16px rgba(0,0,0,.8);
  display: grid; place-items: center; overflow: hidden;
  --bw: 300px;
}
.story-book .band { left: 80%; top: 0; bottom: 0; width: 8px; transition: none; }
.story-book.is-glowing { box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 0 0 6px rgba(244, 211, 94, .12), 0 0 80px 10px rgba(244, 211, 94, .25), 0 30px 50px -16px rgba(0,0,0,.8); }

/* Dark sheets with highlighter: what Lern makes. */
.out-notes, .out-quiz {
  width: 180px; padding: 16px 18px 18px; border-radius: 10px; background: var(--sheet-2);
  border: 1px solid #36363c; box-shadow: 0 22px 34px -14px rgba(0,0,0,.75);
  display: flex; flex-direction: column; gap: 9px;
}
.out-notes b, .out-quiz b { font-size: 1.05rem; font-weight: 700; padding-bottom: 6px; border-bottom: 1.5px solid rgba(229, 83, 75, .5); }
.ln { display: block; height: 5px; border-radius: 3px; background: #3d3d44; width: 100%; }
.ln.w80 { width: 80%; } .ln.w70 { width: 70%; } .ln.w60 { width: 60%; }
.ln.hl { background: rgba(244, 211, 94, .75); }
.q { display: flex; align-items: center; gap: 8px; }
.q .box { width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid #5a5a62; flex: none; }
.q .box.on { background: var(--mint); border-color: var(--mint); }
.out-cards { width: 220px; height: 140px; z-index: 4; }
.oc {
  position: absolute; inset: 0; border-radius: 10px; background: var(--sheet-2); border: 1px solid #36363c;
  box-shadow: 0 18px 30px -14px rgba(0,0,0,.75); display: grid; place-items: center; padding: 16px; text-align: center;
}
.oc:nth-child(1) { transform: rotate(-7deg) translate(-8px, 6px); }
.oc:nth-child(2) { transform: rotate(4deg) translate(6px, 2px); }
.oc b { font-size: 1rem; font-weight: 650; line-height: 1.25; }
.oc:nth-child(3)::before { content: ""; position: absolute; left: 0; right: 0; top: 30px; height: 1.5px; background: rgba(229, 83, 75, .5); }

.week {
  width: min(560px, 92%); display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  padding: 18px; border-radius: 16px; background: var(--sheet); border: 1px solid var(--rule);
  box-shadow: 0 30px 60px -24px rgba(0,0,0,.8);
}
.day { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.day b { font-weight: 600; font-size: .9rem; color: var(--pencil); }
.chips { display: flex; flex-direction: column-reverse; gap: 4px; width: 100%; height: 150px; justify-content: flex-start; }
.chips i { display: block; height: 18px; border-radius: 4px; background: var(--c, var(--yellow)); opacity: 0; transform: translateY(-30px) rotate(-6deg); transition: opacity .3s, transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.week.is-in .chips i { opacity: .9; transform: none; }
.week-note { grid-column: 1 / -1; margin: 6px 0 0; font-family: var(--hand); color: var(--yellow); text-align: center; max-width: none; font-size: 1.1rem; }

/* ======================================================================
   TRY A CARD
   ====================================================================== */
.kbd-hint { font-size: .9rem; color: var(--pencil) !important; }
kbd {
  display: inline-block; min-width: 1.7em; padding: 1px 7px; border-radius: 6px; text-align: center;
  font-family: var(--serif); font-size: .85em; color: var(--chalk);
  background: var(--sheet-2); border: 1px solid #3a3a40; border-bottom-width: 2.5px;
}
.deck-wrap { width: min(480px, 100%); justify-self: center; }
.deck { position: relative; aspect-ratio: 5 / 4; margin-bottom: 22px; perspective: 1800px; touch-action: pan-y; }
.flash {
  position: absolute; inset: 0; transform-style: preserve-3d; cursor: grab; user-select: none; -webkit-user-select: none;
  will-change: transform;
}
.flash:active { cursor: grabbing; }
.flash.is-behind { pointer-events: none; }
.flash-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .75s cubic-bezier(.3, 1.25, .45, 1); }
.flash.is-flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 12px; background-color: var(--sheet);
  background-image: repeating-linear-gradient(to bottom, transparent 0 33px, rgba(142, 197, 244, .08) 33px 34px);
  background-position: 0 64px;
  border: 1px solid var(--rule); box-shadow: 0 30px 50px -22px rgba(0,0,0,.85), 0 2px 0 rgba(255,255,255,.03) inset;
  display: flex; flex-direction: column;
}
.flash-face.back { transform: rotateY(180deg); border-color: rgba(244, 211, 94, .4); }
.flash-head {
  display: flex; justify-content: space-between; align-items: center; height: 58px; padding: 0 22px;
  border-bottom: 1.5px solid rgba(229, 83, 75, .55); color: var(--pencil); font-size: .95rem; font-weight: 600;
}
.back .flash-head { color: var(--yellow); }
.flash-text { flex: 1; display: grid; place-items: center; margin: 0; padding: 18px 28px; max-width: none; text-align: center; font-size: clamp(1.3rem, 1.4vw + .8rem, 1.8rem); line-height: 1.3; font-weight: 600; font-variation-settings: "opsz" 36; }
.back .flash-text { font-weight: 400; }
.flash-hint { text-align: center; padding-bottom: 16px; font-family: var(--hand); color: var(--pencil); font-size: 1rem; }
.flash-stamp {
  position: absolute; top: 74px; z-index: 5; padding: 6px 14px; border-radius: 8px; font-weight: 700; font-size: 1.05rem;
  border: 2.5px solid currentColor; opacity: 0; pointer-events: none; transform: rotate(var(--sr));
}
.flash-stamp.good { right: 22px; color: var(--mint); --sr: 8deg; }
.flash-stamp.again { left: 22px; color: var(--orange); --sr: -8deg; }

.deck-controls { min-height: 56px; }
.rate { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-rate { border-width: 1.5px; }
.rate-again { color: var(--orange); background: rgba(242, 165, 122, .1); border-color: rgba(242, 165, 122, .45); }
.rate-good { color: var(--mint); background: rgba(125, 219, 181, .1); border-color: rgba(125, 219, 181, .45); }
.rate-again:hover { background: rgba(242, 165, 122, .18); }
.rate-good:hover { background: rgba(125, 219, 181, .18); }
.deck-note { min-height: 1.6em; margin: 14px 0 6px; font-family: var(--hand); color: var(--red); font-size: 1.12rem; text-align: center; max-width: none; }
.piles { display: flex; justify-content: space-between; color: var(--pencil); font-size: .92rem; }
.piles b { font-variant-numeric: tabular-nums; }
.pile-again b { color: var(--orange); }
.pile-good b { color: var(--mint); }
.deck-done { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; border-radius: 12px; border: 1.5px dashed #3a3a40; padding: 24px; }
.deck-done h3 { font-size: 1.6rem; }
.deck-done p { color: var(--chalk-2); margin: 0 auto; max-width: 24em; }

/* ======================================================================
   FORGETTING CURVE
   ====================================================================== */
.curve { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 90px); align-items: center; max-width: calc(var(--maxw) + 100px); }
.curve-copy p { color: var(--chalk-2); }
.curve-figure { margin: 0; padding: clamp(16px, 2.4vw, 32px); border-radius: 18px; background: var(--sheet); border: 1px solid var(--rule); box-shadow: 0 40px 80px -40px rgba(0,0,0,.9); }
.curve-svg { width: 100%; height: auto; overflow: visible; }
.curve-svg .gridline { stroke: rgba(142, 197, 244, .09); stroke-width: 1; }
.curve-svg .axis-label { fill: var(--pencil); font-family: var(--serif); font-size: 15px; }
.curve-svg .cram { fill: none; stroke: var(--pencil); stroke-width: 2.5; stroke-dasharray: 2 7; stroke-linecap: round; opacity: .8; }
.curve-svg .lern { fill: none; stroke: var(--yellow); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 10px rgba(244, 211, 94, .25)); }
.curve-svg .mark circle { fill: var(--desk); stroke: var(--yellow); stroke-width: 3; }
.curve-svg .mark { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.3); transition: opacity .3s, transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.curve-svg .mark.is-on { opacity: 1; transform: none; }
.curve-svg .note { font-family: var(--hand); font-size: 19px; }
.curve-svg .note-cram { fill: var(--pencil); }
.curve-svg .note-lern { fill: var(--yellow); }
.curve-figure figcaption { margin-top: 14px; font-size: .9rem; color: var(--pencil); }

/* ======================================================================
   CARD FILE
   ====================================================================== */
.methods { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 90px); align-items: end; max-width: calc(var(--maxw) + 100px); }
.methods-copy p { color: var(--chalk-2); }
.cardfile { position: relative; height: clamp(540px, 48vw, 640px); }
.cardfile-cards { position: absolute; left: 4%; right: 4%; top: 44px; bottom: 0; }
.fcard {
  position: absolute; left: 0; right: 0; height: 43%;
  border-radius: 4px 4px 10px 10px; background: var(--sheet-2); border: 1px solid #38383e;
  box-shadow: 0 -10px 24px -14px rgba(0,0,0,.8);
  will-change: transform;
}
.fcard[data-row="0"] { top: 49%; }
.fcard[data-row="1"] { top: 56%; }
.ftab {
  position: absolute; bottom: 100%; height: 38px; width: 19%; margin-bottom: -1px;
  border: 1px solid #38383e; border-bottom: 0; border-radius: 9px 9px 0 0;
  background: var(--sheet-2); cursor: pointer;
  font-family: var(--serif); font-size: .88rem; font-weight: 600; color: var(--chalk-2);
  display: flex; align-items: center; gap: 7px; padding: 0 10px; white-space: nowrap; overflow: hidden;
}
.ftab::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.ftab:hover { color: var(--chalk); }
.fcard.is-selected .ftab { color: var(--ink); background: var(--c); border-color: var(--c); }
.fcard.is-selected .ftab::before { background: var(--ink); }
.fcard-body {
  padding: clamp(18px, 2.4vw, 30px); opacity: 0; transition: opacity .25s;
  display: grid; gap: 10px; border-top: 3px solid var(--c); border-radius: 4px 4px 0 0; height: 100%;
  align-content: start;
}
.fcard.is-selected .fcard-body { opacity: 1; transition-delay: .12s; }
.fcard-body h3 { font-size: clamp(1.5rem, 1.6vw + .8rem, 2.1rem); font-variation-settings: "opsz" 48; }
.fcard-body p { color: var(--chalk-2); margin: 0; }
.fcard-example {
  margin-top: 6px; padding: 12px 16px; border-radius: 10px; background: rgba(0,0,0,.22);
  font-family: var(--hand); font-size: 1.08rem; line-height: 1.45; color: var(--chalk); border-left: 3px solid var(--c);
}
.cardfile-box {
  position: absolute; left: 0; right: 0; bottom: 0; height: 31%; z-index: 40; pointer-events: none;
  border-radius: 8px 8px 18px 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.07), transparent 22%),
    linear-gradient(160deg, #2f2a26, #221e1b);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 40px 60px -20px rgba(0,0,0,.85);
  display: grid; place-items: center;
}
.box-label {
  padding: 8px 18px; background: var(--paper); color: #3a332a; border-radius: 4px; transform: rotate(-1.5deg);
  font-family: var(--hand); font-size: 1.1rem; box-shadow: 0 2px 0 rgba(0,0,0,.25);
}

/* Small screens: the card file becomes a tab row and a single card. */
@media (max-width: 760px) {
  .cardfile { height: auto; }
  .cardfile-cards { position: static; display: flex; flex-wrap: wrap; gap: 8px; }
  .fcard { position: static; height: auto; background: none; border: 0; box-shadow: none; display: contents; }
  .ftab { position: static; width: auto; height: 44px; border-radius: 22px; border: 1px solid #38383e; padding: 0 14px; }
  .fcard-body { display: none; order: 99; flex-basis: 100%; margin-top: 10px; opacity: 1; background: var(--sheet-2); border: 1px solid #38383e; border-top: 3px solid var(--c); border-radius: 12px; }
  .fcard.is-selected .fcard-body { display: grid; }
  .cardfile-box { display: none; }
}

/* ======================================================================
   SOLVE
   ====================================================================== */
.ticks { list-style: none; padding: 0; margin: 1.4em 0 0; display: grid; gap: 12px; color: var(--chalk-2); }
.ticks li { position: relative; padding-left: 34px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .32em; width: 18px; height: 10px;
  border-left: 2.5px solid var(--mint); border-bottom: 2.5px solid var(--mint); transform: rotate(-45deg);
}
.problem { width: min(520px, 100%); justify-self: center; }
.problem-photo {
  position: relative; padding: 26px 26px 24px; border-radius: 3px; background: var(--paper); color: #2b2620;
  transform: rotate(-1.8deg); box-shadow: 0 24px 40px -18px rgba(0,0,0,.75);
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(80, 120, 170, .22) 31px 32px);
  background-position: 0 18px;
}
.problem-photo .hand { font-family: var(--hand); font-size: 1.4rem; margin: 0; line-height: 1.4; max-width: none; }
.solution { list-style: none; padding: 0; margin: 22px 0 18px; display: grid; gap: 10px; }
.solution li {
  padding: 14px 18px; border-radius: 12px; background: var(--sheet); border: 1px solid var(--rule);
  display: none; font-size: 1.02rem;
}
.solution li.is-shown { display: block; animation: write-in .6s var(--ease-out) both; }
@keyframes write-in { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.step-n { display: block; font-family: var(--hand); color: var(--sky); font-size: 1rem; line-height: 1.2; margin-bottom: 2px; }
.solution li:last-child .step-n { color: var(--yellow); }
.answer { font-weight: 700; font-size: 1.15rem; background-image: linear-gradient(transparent 60%, rgba(244, 211, 94, .5) 60%, rgba(244, 211, 94, .5) 92%, transparent 92%); }

/* ======================================================================
   EXAM PLAN
   ====================================================================== */
.plan { max-width: calc(var(--maxw) + 100px); }
.plan-copy { max-width: 760px; }
.plan-copy p, .plan-more { color: var(--chalk-2); }
.board {
  position: relative; margin: clamp(40px, 6vh, 70px) 0 clamp(28px, 4vh, 40px);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(180px, 1.15fr); gap: clamp(14px, 1.8vw, 28px); align-items: center;
}
.sticky-note {
  --tilt: -2deg;
  position: relative; padding: 26px 18px 22px; min-height: 172px; border-radius: 2px 2px 16px 2px;
  color: var(--ink); box-shadow: 0 20px 30px -16px rgba(0,0,0,.7);
  transform: rotate(var(--tilt)); transform-origin: 50% 0;
}
.sticky-note:nth-child(2) { --tilt: 1.6deg; } .sticky-note:nth-child(3) { --tilt: -1deg; } .sticky-note:nth-child(4) { --tilt: 2.2deg; } .sticky-note:nth-child(5) { --tilt: -1.4deg; }
.sticky-note b { display: block; font-family: var(--hand); font-size: 1.45rem; line-height: 1; margin-bottom: 10px; }
.sticky-note ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .98rem; line-height: 1.3; }
.sticky-note li { position: relative; }
.n-sky { background: linear-gradient(170deg, #a5d2f7, var(--sky)); }
.n-mint { background: linear-gradient(170deg, #97e5c6, var(--mint)); }
.n-lav { background: linear-gradient(170deg, #c6bcf8, var(--lav)); }
.n-pink { background: linear-gradient(170deg, #f7b2d0, var(--pink)); }
.n-exam { background: linear-gradient(170deg, #f8df85, var(--yellow)); }
.n-exam b { color: #a02f29; }
/* A pencil tick drawn across a finished day. */
.sticky-note::after {
  content: ""; position: absolute; right: 14px; top: 16px; width: 30px; height: 16px;
  border-left: 3.5px solid rgba(22, 22, 26, .85); border-bottom: 3.5px solid rgba(22, 22, 26, .85);
  transform: rotate(-45deg) scale(0); transform-origin: 30% 70%;
  transition: transform .45s cubic-bezier(.3, 1.6, .5, 1);
}
.sticky-note.is-done::after { transform: rotate(-45deg) scale(1); }
.sticky-note.is-done li { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(22,22,26,.6); }
.n-exam::after { display: none; }

.readiness { display: flex; align-items: center; gap: 16px; padding-left: 8px; }
.readiness svg { width: 104px; height: 104px; transform: rotate(-90deg); flex: none; }
.readiness circle { fill: none; stroke-width: 10; }
.readiness .track { stroke: #2c2c31; }
.readiness .fill { stroke: var(--yellow); stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 144.5; transition: stroke-dashoffset .8s var(--ease-out); }
.readiness strong { display: block; font-size: 2.3rem; line-height: 1; font-variant-numeric: tabular-nums; font-variation-settings: "opsz" 72; }
.readiness span { color: var(--pencil); font-size: .95rem; }

/* ======================================================================
   STREAK
   ====================================================================== */
.calendar-card {
  position: relative; width: min(470px, 100%); justify-self: center; padding: 26px; border-radius: 20px;
  background: var(--sheet); border: 1px solid var(--rule); box-shadow: 0 40px 80px -40px rgba(0,0,0,.9);
}
.cal-head { display: flex; align-items: center; gap: 12px; font-size: 1.7rem; font-weight: 700; margin-bottom: 18px; font-variation-settings: "opsz" 48; }
.cal-head strong { font-variant-numeric: tabular-nums; }
.flame {
  width: 26px; height: 34px; background: var(--orange); flex: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 0c1 6 9 9 9 19a9 9 0 0 1-18 0c0-5 3-7 4-11 1 3 3 4 4 5 1-4 2-8 1-13z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 0c1 6 9 9 9 19a9 9 0 0 1-18 0c0-5 3-7 4-11 1 3 3 4 4 5 1-4 2-8 1-13z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.cal .wd { text-align: center; font-size: .8rem; color: var(--pencil); padding-bottom: 2px; }
.cal .d {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; font-size: .92rem; color: var(--pencil);
  font-variant-numeric: tabular-nums; position: relative;
}
.cal .d::before {
  content: ""; position: absolute; inset: 0; border-radius: 8px; background: var(--yellow); z-index: -1;
  transform: scaleX(0); transform-origin: left; transition: transform .28s var(--ease-io);
}
.cal .d.on { color: var(--ink); font-weight: 700; }
.cal .d.on::before { transform: scaleX(1); }
.cal .d.today { box-shadow: inset 0 0 0 1.5px var(--chalk); }
.cal .d.future { opacity: .35; }
.cal { position: relative; z-index: 0; isolation: isolate; }
.goal-note {
  position: absolute; right: -26px; bottom: -34px; width: 190px; padding: 22px 16px 16px; z-index: 5;
  background: linear-gradient(160deg, #f8df85, var(--yellow)); color: var(--ink); border-radius: 2px 2px 14px 2px;
  box-shadow: 0 20px 30px -14px rgba(0,0,0,.7); display: grid; gap: 2px;
  opacity: 0; transform: translateY(-40px) rotate(-10deg);
  transition: opacity .25s, transform .8s cubic-bezier(.3, 1.6, .5, 1);
}
.goal-note b { font-size: 1.05rem; }
.goal-note span:last-child { font-family: var(--hand); font-size: 1.05rem; }
.goal-note.is-in { opacity: 1; transform: rotate(4deg); }

/* ======================================================================
   PHONES
   ====================================================================== */
.phone-row { display: flex; justify-content: center; align-items: flex-end; gap: clamp(16px, 3vw, 44px); margin-top: clamp(40px, 6vh, 70px); }
.phone {
  margin: 0; width: clamp(200px, 21vw, 280px); padding: 9px; border-radius: 46px;
  background: linear-gradient(160deg, #3a3a40, #1e1e22); box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 50px 80px -30px rgba(0,0,0,.9);
}
.phone img { border-radius: 38px; width: 100%; height: auto; }
.phone.p1 { transform: rotate(-5deg) translateY(24px); }
.phone.p3 { transform: rotate(5deg) translateY(24px); }
.phone.p2 { z-index: 2; }

/* ======================================================================
   TRUST
   ====================================================================== */
.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 64px); max-width: calc(var(--maxw) + 100px); }
.trust h3 { font-size: 1.4rem; margin: 22px 0 8px; font-variation-settings: "opsz" 36; }
.trust p { color: var(--chalk-2); font-size: 1rem; }
.code-card, .lock-card, .device-card { height: 116px; border-radius: 12px; display: grid; place-items: center; }
.code-card {
  width: 220px; background: var(--sheet-2); border: 1px solid #38383e; transform: rotate(-2deg);
  font-size: 1.75rem; font-weight: 700; letter-spacing: .08em; font-variant-numeric: tabular-nums;
  border-top: 3px solid var(--sky); box-shadow: 0 20px 30px -16px rgba(0,0,0,.8);
}
.lock-card { width: 116px; background: var(--sheet-2); border: 1px solid #38383e; border-top: 3px solid var(--mint); box-shadow: 0 20px 30px -16px rgba(0,0,0,.8); }
.lock-card span { position: relative; width: 40px; height: 32px; border-radius: 7px; background: var(--mint); margin-top: 18px; }
.lock-card span::before { content: ""; position: absolute; left: 7px; right: 7px; top: -22px; height: 28px; border: 5px solid var(--mint); border-bottom: 0; border-radius: 16px 16px 0 0; }
.device-card { width: 220px; display: flex; align-items: flex-end; justify-content: flex-start; gap: 12px; padding-bottom: 10px; }
.device-card span { border: 2.5px solid var(--lav); border-radius: 8px; display: block; }
.d-phone { width: 34px; height: 64px; border-radius: 10px !important; }
.d-tab { width: 66px; height: 86px; }
.d-mac { width: 96px; height: 64px; position: relative; margin-bottom: 10px; }
.d-mac::after { content: ""; position: absolute; left: -12px; right: -12px; bottom: -13px; height: 5px; border-radius: 3px; background: var(--lav); }

/* ======================================================================
   PRICING
   ====================================================================== */
.pricing { max-width: calc(var(--maxw) + 100px); }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.6vw, 36px); max-width: 920px; margin: clamp(40px, 6vh, 64px) auto 28px; }
.plan-card {
  position: relative; padding: clamp(26px, 3vw, 40px); border-radius: 20px; background: var(--sheet);
  border: 1px solid var(--rule); display: flex; flex-direction: column;
}
.plan-pro { border: 1.5px solid rgba(244, 211, 94, .55); background: linear-gradient(180deg, rgba(244, 211, 94, .06), transparent 40%), var(--sheet); }
.plan-card h3 { font-size: 1.5rem; font-variation-settings: "opsz" 48; }
.price { margin: 14px 0 4px; color: var(--chalk-2); }
.price strong { font-size: 3rem; line-height: 1; color: var(--chalk); font-variation-settings: "opsz" 72; letter-spacing: -.02em; margin-right: 4px; }
.plan-sub { color: var(--pencil); font-size: .98rem; }
.limits { width: 100%; border-collapse: collapse; margin: 14px 0 28px; font-size: .98rem; }
.limits th, .limits td { padding: 11px 0; border-bottom: 1px solid var(--rule); text-align: left; font-weight: 400; }
.limits th { color: var(--chalk-2); }
.limits td { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.plan-pro .limits td { color: var(--yellow); }
.plan-card .btn { margin-top: auto; }

/* ======================================================================
   FAQ
   ====================================================================== */
.faq { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 90px); max-width: calc(var(--maxw) + 100px); }
.faq-list { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  min-height: 64px; padding: 14px 0; font-size: 1.18rem; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 14px; height: 14px; flex: none; margin-right: 6px;
  background: linear-gradient(var(--chalk-2), var(--chalk-2)) center / 100% 2px no-repeat, linear-gradient(var(--chalk-2), var(--chalk-2)) center / 2px 100% no-repeat;
  transition: transform .35s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--yellow); }
.faq details p { color: var(--chalk-2); padding: 0 0 22px; margin: 0; }

/* ======================================================================
   CLOSING
   ====================================================================== */
.closing { text-align: center; padding-bottom: clamp(110px, 16vh, 200px) !important; }
.closing-book { --bw: 300px; position: relative; width: 300px; height: 210px; margin: 0 auto 48px; perspective: 1600px; transform-style: preserve-3d; filter: drop-shadow(0 30px 30px rgba(0,0,0,.6)); }
.cb-page {
  position: absolute; left: 50%; top: 0; width: 50%; height: 100%; border-radius: 3px 10px 10px 3px; background-color: #1d1d21;
  background-image: repeating-linear-gradient(to bottom, transparent 0 15px, rgba(142, 197, 244, .1) 15px 16px);
}
.cb-cover {
  position: absolute; left: 50%; top: 0; width: 50%; height: 100%; transform-origin: left center;
  border-radius: 4px 12px 12px 4px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,.06), transparent 60%), linear-gradient(160deg, #27272c, #1b1b1f);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
  transform: rotateY(-178deg); backface-visibility: visible;
  transition: transform 1.3s var(--ease-io);
}
.cb-cover .cover-l, .cb-cover .cover-swipe, .cb-cover .spine { opacity: 0; transition: opacity .2s .65s; }
.cb-band {
  position: absolute; z-index: 3; left: calc(50% + 50% * .8); width: 7px; top: -3px; bottom: -3px; border-radius: 3px;
  background: linear-gradient(90deg, #c94740, var(--red) 35%, #f06b62 55%, #c94740);
  opacity: 0; transform: translate(70px, -30px) rotate(-18deg);
  transition: transform .6s cubic-bezier(.3, 1.7, .5, 1) 1.25s, opacity .2s 1.25s;
}
.closing-book { transition: transform 1.3s var(--ease-io); }
.closing-book.is-closed { transform: translateX(-25%); }
.closing-book.is-closed .cb-cover { transform: rotateY(0deg); }
.closing-book.is-closed .cb-cover .cover-l, .closing-book.is-closed .cb-cover .cover-swipe, .closing-book.is-closed .cb-cover .spine { opacity: 1; }
.closing-book.is-closed .cb-band { opacity: 1; transform: none; }
.closing-book .cover-l { font-size: 70px; }
.closing-title { font-size: clamp(2.3rem, 4.4vw + 1rem, 5.2rem); line-height: 1.02; letter-spacing: -.025em; max-width: 15ch; margin: 0 auto .6em; font-variation-settings: "opsz" 72; }

/* ---------- Footer ---------- */
.footer { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 36px var(--right) 48px var(--gut); border-top: 1px solid rgba(255,255,255,.06); }
.footer-links { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--chalk-2); text-decoration: none; }
.footer-links a:hover { color: var(--chalk); }
.footer .fine { margin: 0 0 0 auto; max-width: 46em; }

/* ======================================================================
   RESPONSIVE
   ====================================================================== */
@media (max-width: 1100px) {
  .board { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .readiness { grid-column: 1 / -1; justify-content: center; margin-top: 18px; }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav nav { margin-left: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 8px; }
  .hero-stage { --bw: min(560px, 88vw); margin-top: 8px; height: calc(var(--bw) * .82); min-height: 0; }
  .desk-sticky { width: 112px; font-size: 1rem; right: 0; }
  .split, .curve, .methods, .faq { grid-template-columns: minmax(0, 1fr); }
  .split-rev .split-copy { order: 0; }
  .story { height: 330vh; }
  .story-sticky { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; padding-top: 64px; gap: 8px; }
  .story-copy .section-title { font-size: clamp(1.7rem, 5vw, 2.4rem); margin-bottom: .2em; }
  .steps { margin-top: 4px; }
  .step { display: none; padding: 6px 0 6px 42px; }
  .step.is-active { display: block; }
  .story-stage { height: min(520px, 58svh); }
  .trust { grid-template-columns: minmax(0, 1fr); }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .n-exam { grid-column: span 2; max-width: 60%; justify-self: center; }
  .phone-row { overflow-x: auto; justify-content: flex-start; scroll-snap-type: x mandatory; padding: 20px 4px 40px; margin-inline: calc(var(--gut) * -1) calc(var(--right) * -1); padding-inline: var(--gut); }
  .phone { flex: none; scroll-snap-align: center; transform: none !important; }
  .footer .fine { margin-left: 0; }
  .goal-note { right: -6px; }
}
@media (max-width: 520px) {
  .cta-row .btn { width: 100%; }
  .hero-title { font-size: clamp(2.5rem, 11.5vw, 3.4rem); }
  .hero-title .line { white-space: normal; }
  .desk-sticky { display: none; }
}

/* ======================================================================
   REDUCED MOTION: show every end state, no movement.
   ====================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; transition-delay: 0s !important; }
  .story { height: auto; }
  .story-sticky { position: static; height: auto; padding-block: 40px; }
  .step p { max-height: none; opacity: 1; }
  .step { color: var(--chalk-2); display: block !important; }
  .wave i { height: 60%; }
}

/* ======================================================================
   DOCUMENT PAGES (privacy, support, 404)
   ====================================================================== */
.doc-main { position: relative; padding: clamp(48px, 8vh, 96px) var(--right) clamp(80px, 12vh, 140px) var(--gut); }
.doc { max-width: 44rem; }
.doc h1 { font-size: clamp(2.4rem, 3vw + 1.4rem, 4rem); line-height: 1.02; letter-spacing: -.02em; font-variation-settings: "opsz" 72; margin-bottom: .35em; }
.doc .updated { color: var(--pencil); font-size: .95rem; margin-bottom: 2.4em; }
.doc .summary { font-size: 1.12rem; color: var(--chalk); padding: 20px 24px; border-radius: 14px; background: var(--sheet); border: 1px solid var(--rule); border-left: 3px solid var(--yellow); margin-bottom: 2.6em; max-width: none; }
.doc h2 { font-size: 1.6rem; font-variation-settings: "opsz" 48; margin: 2.2em 0 .6em; padding-top: 1.2em; border-top: 1px solid var(--rule); scroll-margin-top: 90px; }
.doc h3 { font-size: 1.18rem; margin: 1.6em 0 .4em; }
.doc p, .doc li { color: var(--chalk-2); max-width: none; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 1em; display: grid; gap: .45em; }
.doc strong { color: var(--chalk); font-weight: 650; }
.doc a:not(.btn) { color: var(--yellow); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.doc a:not(.btn):hover { text-decoration-thickness: 2px; }
.doc .table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--rule); border-radius: 12px; }
.doc table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 520px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.doc thead th { color: var(--chalk); font-weight: 650; background: var(--sheet); }
.doc tbody tr:last-child td { border-bottom: 0; }
.doc td { color: var(--chalk-2); }
.doc .toc { margin: 0 0 2.4em; padding: 18px 22px; border-radius: 14px; background: var(--sheet); border: 1px solid var(--rule); }
.doc .toc ol { margin: 0; columns: 2; column-gap: 28px; display: block; }
.doc .toc li { margin-bottom: .3em; break-inside: avoid; }
.doc .toc a { color: var(--chalk-2); text-decoration: none; }
.doc .toc a:hover { color: var(--yellow); }
.doc .contact-card { padding: 24px; border-radius: 16px; background: var(--sheet); border: 1px solid var(--rule); margin: 0 0 1.4em; }
.doc .contact-card .btn { margin-top: 8px; }
.doc .contact-card .card-title { border: 0; margin: 0 0 .4em; padding: 0; }
.doc .closing-note { margin-top: 3em; font-size: .92rem; color: var(--pencil); }
.nav-doc .nav-links { display: flex; }
.notfound { min-height: 70svh; display: grid; align-content: center; justify-items: start; gap: 6px; }
.notfound .hand { font-family: var(--hand); color: var(--red); font-size: 1.4rem; transform: rotate(-2deg); margin: 0; }
@media (max-width: 640px) { .doc .toc ol { columns: 1; } }
