/* Nightsesh public site. Dark only. Brand kit v1 tokens (docs/BRAND.md). No third-party assets. */

@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/InstrumentSerif-Regular.woff2") format("woff2"),
       url("/assets/fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/InstrumentSerif-Italic.woff2") format("woff2"),
       url("/assets/fonts/InstrumentSerif-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #0C0D0F;
  --ink-2: #151619;
  --charcoal: #1B1C20;
  --ivory: #F5F1E8;
  --muted: #A4A3AA;
  --amber: #E4B35A;
  --lamp-line: #D9D4CC;
  --line: rgba(245, 241, 232, 0.12);
  --line-strong: rgba(245, 241, 232, 0.22);
  --serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-chip: 10px;
  --r-card: 16px;
  --r-panel: 22px;
  --gutter: 16px;
  --max: 1080px;
  --max-doc: 720px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--ivory); text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--ivory); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: rgba(228, 179, 90, 0.35); color: var(--ivory); }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--charcoal);
  color: var(--ivory);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-chip);
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (min-width: 640px) {
  :root { --gutter: 24px; }
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
  text-decoration: none;
}
.brand-link img { width: 124px; height: auto; margin-left: -9px; } /* the SVG has built-in side padding */
.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: 10px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  border-radius: var(--r-chip);
}
.site-nav a:hover { color: var(--ivory); }
.site-nav a[aria-current="page"] { color: var(--ivory); }
@media (max-width: 380px) {
  .brand-link img { width: 108px; margin-left: -8px; }
  .site-nav a { padding: 10px 8px; }
}

/* Type */

h1, h2, h3 { margin: 0; font-weight: 400; }

.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.02;
}
.display em { font-style: italic; }

.eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
}

.lede {
  margin: 20px 0 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.1875rem;
  line-height: 1.55;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
}
.btn-primary {
  background: var(--amber);
  color: var(--ink);
}
.btn-primary.is-static { cursor: default; }
.btn-quiet {
  color: var(--ivory);
  border: 1px solid var(--line-strong);
}
.btn-quiet:hover { border-color: var(--ivory); }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}
.platforms {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Landing (index.html only)
   The demos are built in HTML and CSS so they stay sharp and can move. Rules for the motion:
   - The plain styles are the FINISHED state. Motion is added on top, only when the visitor hasn't asked for
     reduced motion, and the scroll-driven parts only where the browser supports animation-timeline.
   - The hero demo is a 16-second loop with a Pause control (a checkbox; no JavaScript).
   - The demos in the story play as you scroll to them and rest in the finished state. */

:root {
  --sky: #59CCFF;
  --gold: #F5C46B;
  --violet: #BA99FF;
  --mint: #4FE8B8;
  --teal: #4FE0E3;
  --surface-2: #26272C;
}

figure { margin: 0; }

/* Real app screens: a phone-shaped frame (the screenshots have square corners). */
.phone {
  width: 100%;
  border-radius: 13% / 6%;
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 0 6px var(--ink-2), 0 0 0 7px var(--line), 0 30px 90px rgba(0, 0, 0, 0.55);
}
.lock {
  width: 100%;
  border-radius: var(--r-panel);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  overflow: clip;
  padding: 24px 0 64px;
}
.hero::before {
  /* One soft desk-lamp glow. */
  content: "";
  position: absolute;
  z-index: 0;
  top: -180px;
  right: -120px;
  width: 720px;
  height: 720px;
  background: radial-gradient(closest-side, rgba(228, 179, 90, 0.16), rgba(228, 179, 90, 0.05) 55%, rgba(228, 179, 90, 0) 100%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 26px;
}
.hero h1 { font-size: clamp(2.875rem, 12.6vw, 5.5rem); }
.hero .lede { margin-top: 14px; font-size: 1.0625rem; line-height: 1.5; }
.hero-demo { width: 100%; max-width: 400px; justify-self: center; }
.hero-cta .actions { margin-top: 0; }
.hero-cta .platforms { margin-top: 12px; }

@media (min-width: 900px) {
  .hero { padding: 72px 0 96px; }
  .hero::before { top: -120px; right: -80px; width: 900px; height: 900px; }
  .hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 400px);
    grid-template-areas: "copy demo" "cta demo";
    gap: 32px 72px;
    align-items: center;
  }
  .hero-copy { grid-area: copy; align-self: end; }
  .hero-cta { grid-area: cta; align-self: start; }
  .hero-demo { grid-area: demo; }
  .hero .lede { margin-top: 20px; font-size: 1.25rem; }
  .stage { font-size: 1.0625rem; }
  .explained { padding: 18px 16px 16px; }
  .xp-card { padding: 18px 18px 18px 22px; }
  .lockscreen { padding: 24px 20px; }
}

/* The hero demo: Lock Screen, a tap on Lost me, then the explanation in the notes. */

.stage {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  box-shadow: 0 0 0 6px var(--ink-2), 0 0 0 7px var(--line), 0 30px 90px rgba(0, 0, 0, 0.55);
  font-size: 0.9375rem;
  line-height: 1.4;
}
.stage p { margin: 0; }

.explained { padding: 13px 12px 12px; }
.xp-context { padding: 0 6px 9px; color: var(--muted); font-size: 0.8125rem; }
.xp-card {
  padding: 14px 14px 14px 18px;
  border-radius: 22px;
  background: #1A2830;
  box-shadow: inset 4px 0 0 rgba(89, 204, 255, 0.85), inset 0 0 0 1px rgba(89, 204, 255, 0.14);
}
.xp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.xp-head strong { font-size: 1.125rem; font-weight: 700; line-height: 1.2; }
.ai-chip {
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(89, 204, 255, 0.14);
  color: var(--sky);
  font-size: 0.75rem;
  font-weight: 600;
}
.stage .xp-when { margin-top: 10px; color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.stage .xp-lead { margin-top: 6px; }
.xp-steps {
  display: grid;
  gap: 7px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: xp;
}
.xp-steps li { position: relative; padding-left: 30px; counter-increment: xp; }
.xp-steps li::before {
  content: counter(xp);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sky);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.stage .xp-eg { margin-top: 9px; }
.xp-eg b { margin-right: 4px; color: var(--sky); font-weight: 600; }

.lockscreen {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 18px 14px;
  background: linear-gradient(180deg, #181824 0%, #0E0F13 60%, #0C0D0F 100%);
  opacity: 0;
}
.lock-clock {
  text-align: center;
  font-size: 4.25rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.activity { padding: 16px 14px 14px; border-radius: 26px; background: #0A0B0D; }
.activity-head { display: flex; align-items: flex-start; gap: 10px; }
.activity-head p { margin: 0; }
.rec-dot {
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: #FF453A;
}
.activity-title strong { display: block; font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }
.activity-title span { display: block; color: var(--muted); font-size: 0.875rem; }
.activity-head .activity-time {
  margin-left: auto;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.digits { display: inline-block; height: 1.3em; overflow: hidden; vertical-align: top; }
.strip { display: block; transform: translateY(-75%); }
.strip > span { display: block; height: 1.3em; }

.markbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.markbtn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 6px;
  border-radius: 14px;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
}
.markbtn.matters { background: rgba(228, 179, 90, 0.16); }
.markbtn.matters svg { flex: none; color: var(--amber); }
.markbtn.lostme { background: rgba(89, 204, 255, 0.16); }
.markbtn .q, .markbtn .count { display: inline-block; color: var(--sky); font-weight: 700; }
.touch, .tap {
  position: absolute;
  border-radius: 50%;
  background: rgba(245, 241, 232, 0.2);
  border: 1.5px solid rgba(245, 241, 232, 0.6);
  opacity: 0;
  pointer-events: none;
}
.touch { left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; }

.demo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-top: 14px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.875rem;
}
.demo-caption { display: grid; margin: 0; }
.cap { grid-area: 1 / 1; }
.cap-a { opacity: 0; }
.demo-pause { display: none; }

/* Sections */

.section {
  padding: 64px 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) { .section { padding: 104px 0; } }

.section-head { max-width: 40rem; }
.section-head h2 { font-size: clamp(2.25rem, 8vw, 3.5rem); }
.section-head p { margin: 16px 0 0; color: var(--muted); font-size: 1.125rem; }

/* The story: four beats, each with one demo. */

.story { overflow-x: hidden; overflow-x: clip; }
.beats {
  display: grid;
  gap: 72px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}
.beat { display: grid; gap: 28px; align-items: center; }
.beat-copy { max-width: 30rem; }
.beat-copy h3 { font-size: clamp(2rem, 7.5vw, 2.75rem); line-height: 1.06; }
.beat-copy p { margin: 14px 0 0; color: var(--muted); }
.beat-copy strong { color: var(--ivory); font-weight: 600; }
.beat-copy .beat-no {
  margin: 0 0 12px;
  color: var(--amber);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.beat-art {
  width: 100%;
  max-width: 400px;
  justify-self: center;
  font-size: 0.9375rem;
  line-height: 1.4;
}
.beat-art p { margin: 0; }
@media (min-width: 900px) {
  .beats { gap: 128px; margin-top: 88px; }
  .beat { grid-template-columns: 1fr 1fr; gap: 72px; }
  .beat:nth-child(even) .beat-copy { order: 2; }
}

.panel {
  padding: 18px;
  border-radius: var(--r-panel);
  background: var(--ink-2);
  border: 1px solid var(--line);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

/* 1. Recording */
.reccard { background: #0A0B0D; border-color: var(--line-strong); }
.wave { display: flex; align-items: center; gap: 3px; height: 48px; margin-top: 18px; }
.wave i {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  background: var(--ivory);
  opacity: 0.8;
  transform: scaleY(0.3);
}
.wave i:nth-child(4n+1) { transform: scaleY(0.55); }
.wave i:nth-child(4n+2) { transform: scaleY(0.9); }
.wave i:nth-child(4n+3) { transform: scaleY(0.4); }
.wave i:nth-child(7n) { transform: scaleY(0.75); }
.wave i:nth-child(9n+4) { transform: scaleY(0.2); }
.beat-art .heard { margin-top: 16px; font-size: 1rem; line-height: 1.45; }
.heard .ln { display: block; }
.beat-art .ondevice { margin-top: 14px; color: var(--muted); font-size: 0.8125rem; }

/* 2. Marks */
.lockshot { position: relative; }
.tap { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
.tap-lost { left: 72.1%; top: 81.6%; }
.tap-matters { left: 27.9%; top: 81.6%; }
.marksline { position: relative; height: 66px; margin: 24px 10px 0; }
.ml-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line-strong);
}
.ml-played {
  display: block;
  height: 100%;
  background: var(--ivory);
  opacity: 0.75;
  transform-origin: left center;
}
.ml-pin {
  position: absolute;
  bottom: 38px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border-radius: 50%;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
}
.ml-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 8px;
  margin-left: -1px;
  background: currentColor;
  opacity: 0.6;
}
.ml-lost { left: 14%; background: #182C35; color: var(--sky); }
.ml-star { background: #2F281B; color: var(--amber); }
.ml-a { left: 46%; }
.ml-b { left: 80%; }
.ml-label {
  position: absolute;
  bottom: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.ml-start { left: 0; }
.ml-end { right: 0; }

/* 3. The note */
.sheet-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.8125rem; }
.chip {
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--charcoal);
  border: 1px solid var(--line);
  color: var(--ivory);
  font-weight: 600;
}
.beat-art .sheet-title { margin-top: 10px; font-size: 2.125rem; line-height: 1.05; }
.sec {
  margin-top: 10px;
  padding: 12px 14px 12px 18px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: inset 4px 0 0 var(--hue);
}
.sec strong { display: block; font-weight: 700; }
.sec strong::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--hue);
  vertical-align: 0.08em;
}
.sec span { display: block; margin-top: 2px; color: var(--hue); font-size: 0.875rem; }
.sec.gold { --hue: var(--gold); --paper: #2D271E; }
.sec.sky { --hue: var(--sky); --paper: #1A2830; }
.sec.violet { --hue: var(--violet); --paper: #262230; }
.sec.teal { --hue: var(--teal); --paper: #192B2D; }

/* 4. Quiz me */
.quiz-count { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.beat-art .quiz-q { margin-top: 8px; font-size: 1.1875rem; font-weight: 700; line-height: 1.25; }
.quiz-opts { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.quiz-opts li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--charcoal);
  border: 1px solid var(--line);
  opacity: 0.55;
}
.quiz-opts b {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 0.875rem;
}
.quiz-opts .is-right { background: #1E3531; opacity: 1; }
.quiz-opts .is-right b { background: var(--mint); color: var(--ink); }
.tap-quiz { left: auto; right: 22%; top: 50%; }
.beat-art .quiz-right {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-2);
  font-size: 0.875rem;
}
.quiz-right strong { display: block; margin-bottom: 2px; color: var(--mint); font-size: 1rem; }

/* Real screens, fanned */
.fan { max-width: 440px; margin: 80px auto 0; }
.fan-phones { position: relative; aspect-ratio: 100 / 108; }
.fan .phone {
  position: absolute;
  box-shadow: 0 0 0 4px var(--ink-2), 0 0 0 5px var(--line), 0 20px 60px rgba(0, 0, 0, 0.55);
}
.fan-c { left: 26%; top: 1.5%; width: 48%; z-index: 2; }
.fan-l { left: 4%; top: 8%; width: 42%; transform: rotate(-5deg); }
.fan-r { right: 4%; top: 8%; width: 42%; transform: rotate(5deg); }
.fan figcaption { margin-top: 20px; color: var(--muted); font-size: 0.875rem; text-align: center; }
@media (min-width: 900px) {
  .fan { max-width: 860px; margin-top: 128px; }
  .fan-phones {
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: repeat(3, 240px);
    justify-content: center;
    align-items: center;
    gap: 44px;
    padding: 24px 0;
  }
  .fan .phone { position: static; width: 100%; }
  .fan-l { transform: rotate(-3deg); }
  .fan-r { transform: rotate(3deg); }
}

/* Other ways to study: one sentence. */
.ways h2 { max-width: 46rem; font-size: clamp(2rem, 7.4vw, 3.25rem); line-height: 1.12; }
.ways .u {
  white-space: nowrap;
  background: linear-gradient(var(--amber), var(--amber)) no-repeat 0 96% / 100% 2px;
}
.ways-sub { margin: 18px 0 0; color: var(--muted); font-size: 1.125rem; }

/* Privacy pledges */
.pledges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 0 32px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.pledges li { padding: 20px 0; border-bottom: 1px solid var(--line); }
.pledges strong { display: block; font-weight: 600; }
.pledges span { display: block; margin-top: 4px; color: var(--muted); font-size: 0.9375rem; }

/* Closing */
.closing { text-align: center; }
.closing .app-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 28px;
  border-radius: 22.5%;
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.closing h2 { font-size: clamp(2.5rem, 9vw, 4.5rem); }
.closing .actions { justify-content: center; }
.closing p.sub { margin: 14px 0 0; color: var(--muted); font-size: 0.9375rem; }

.fineprint {
  max-width: 48rem;
  margin: 56px auto 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.6;
  text-align: left;
}

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  .hero::before { animation: lamp-on 2.2s ease-out 0.2s both; }
  .hero-copy { animation: rise 0.9s ease-out both; }
  .hero-demo { animation: rise 0.9s ease-out 0.15s both; }

  /* The hero loop. Every part runs on the same 16 seconds, so they stay in step. */
  .lockscreen { animation: demo-lock 16s ease-in-out infinite both; }
  .explained { animation: demo-note 16s ease-in-out infinite both; }
  .lockscreen .strip { animation: demo-tick 16s ease-in-out infinite both; }
  .lockscreen .rec-dot { animation: rec-pulse 1.6s ease-in-out infinite; }
  .touch { animation: demo-touch 16s ease-in-out infinite both; }
  .markbtn.lostme { animation: demo-press 16s ease-out infinite both; }
  .markbtn .count { animation: demo-count 16s ease-out infinite both; }
  .stage .xp-when { animation: demo-l1 16s ease-out infinite both; }
  .stage .xp-lead { animation: demo-l2 16s ease-out infinite both; }
  .xp-steps li:nth-child(1) { animation: demo-l3 16s ease-out infinite both; }
  .xp-steps li:nth-child(2) { animation: demo-l4 16s ease-out infinite both; }
  .xp-steps li:nth-child(3) { animation: demo-l5 16s ease-out infinite both; }
  .stage .xp-eg { animation: demo-l6 16s ease-out infinite both; }
  .cap-a { animation: demo-cap-a 16s ease-in-out infinite both; }
  .cap-b { animation: demo-cap-b 16s ease-in-out infinite both; }

  .demo-pause {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 4px 0 12px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
  }
  .demo-pause:hover { color: var(--ivory); }
  .demo-pause::before {
    content: "";
    box-sizing: border-box;
    width: 10px;
    height: 12px;
    border: solid currentColor;
    border-width: 0 3px;
  }
  .when-paused { display: none; }
  .demo-toggle:checked ~ .demo-bar .when-playing { display: none; }
  .demo-toggle:checked ~ .demo-bar .when-paused { display: inline; }
  .demo-toggle:checked ~ .demo-bar .demo-pause::before {
    height: 12px;
    border-color: transparent transparent transparent currentColor;
    border-width: 6px 0 6px 10px;
  }
  .demo-toggle:focus-visible ~ .demo-bar .demo-pause {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
    border-radius: 8px;
  }
  .demo-toggle:checked ~ .stage *,
  .demo-toggle:checked ~ .demo-bar .cap { animation-play-state: paused; }

  /* The rest plays as you scroll to it. */
  @supports (animation-timeline: view()) {
    .beat-art { view-timeline: --art block; }
    .fan { view-timeline: --fan block; }

    .reveal {
      animation: in-up linear both;
      animation-timeline: view();
      animation-range: cover 3% cover 20%;
    }
    .pledges .reveal:nth-child(2) { animation-range: cover 6% cover 23%; }
    .pledges .reveal:nth-child(3) { animation-range: cover 9% cover 26%; }

    .beat-art .in { animation: in-up linear both; animation-timeline: --art; }
    .beat-art .pop { animation: pop linear both; animation-timeline: --art; }
    .beat-art .wipe { animation: wipe linear both; animation-timeline: --art; }
    .beat-art .w1 { animation-range: cover 8% cover 18%; }
    .beat-art .w2 { animation-range: cover 12% cover 22%; }
    .beat-art .w3 { animation-range: cover 16% cover 26%; }
    .beat-art .w4 { animation-range: cover 20% cover 30%; }
    .beat-art .w5 { animation-range: cover 24% cover 34%; }
    .beat-art .w6 { animation-range: cover 29% cover 39%; }

    /* 1. The sound moves while you scroll. */
    .wave i {
      animation: wave-a linear both;
      animation-timeline: --art;
      animation-range: cover 0% cover 100%;
    }
    .wave i:nth-child(3n+1) { animation-name: wave-b; }
    .wave i:nth-child(3n+2) { animation-name: wave-c; }
    .wave i:nth-child(4n) { animation-range: cover -12% cover 88%; }
    .wave i:nth-child(5n) { animation-range: cover -24% cover 76%; }
    .wave i:nth-child(7n) { animation-range: cover 9% cover 109%; }

    /* 2. Class plays along the line; each tap leaves a mark. */
    .ml-played {
      animation: grow-x linear both;
      animation-timeline: --art;
      animation-range: cover 24% cover 41%;
    }
    .beat-art .ml-lost { animation-range: cover 25% cover 30%; }
    .beat-art .ml-a { animation-range: cover 30% cover 35%; }
    .beat-art .ml-b { animation-range: cover 36% cover 41%; }
    .tap-lost {
      animation: ripple linear both;
      animation-timeline: --art;
      animation-range: cover 21% cover 29%;
    }
    .tap-matters {
      animation: ripple-twice linear both;
      animation-timeline: --art;
      animation-range: cover 27% cover 41%;
    }

    /* 4. Pick an answer; it locks in. */
    .quiz-opts li {
      animation: dim linear both;
      animation-timeline: --art;
      animation-range: cover 27% cover 32%;
    }
    .quiz-opts .is-right { animation-name: pick-right; }
    .quiz-opts .is-right b {
      animation: pick-badge linear both;
      animation-timeline: --art;
      animation-range: cover 27% cover 32%;
    }
    .tap-quiz {
      animation: ripple linear both;
      animation-timeline: --art;
      animation-range: cover 22% cover 31%;
    }

    /* Real screens fan out. */
    .fan-l, .fan-r {
      animation: fan-left linear both;
      animation-timeline: --fan;
      animation-range: cover 8% cover 38%;
    }
    .fan-r { animation-name: fan-right; }

    /* Other ways: each one is underlined in turn. */
    .ways .u {
      animation: draw linear both;
      animation-timeline: view();
      animation-range: cover 14% cover 26%;
    }
    .ways .u2 { animation-range: cover 19% cover 31%; }
    .ways .u3 { animation-range: cover 24% cover 36%; }
    .ways .u4 { animation-range: cover 29% cover 41%; }
  }
}

@keyframes lamp-on {
  0% { opacity: 0; }
  18% { opacity: 0.7; }
  24% { opacity: 0.15; }
  34% { opacity: 0.85; }
  40% { opacity: 0.4; }
  100% { opacity: 1; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes demo-lock {
  0% { opacity: 0; transform: translateY(10px); }
  2.5%, 26% { opacity: 1; transform: none; }
  29.5%, 100% { opacity: 0; transform: translateY(-14px) scale(0.98); }
}
@keyframes demo-note {
  0%, 27.5% { opacity: 0; transform: translateY(14px); }
  32%, 95% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: none; }
}
@keyframes demo-tick {
  0%, 5% { transform: translateY(0); }
  5.6%, 9.5% { transform: translateY(-25%); }
  10.1%, 14% { transform: translateY(-50%); }
  14.6%, 100% { transform: translateY(-75%); }
}
@keyframes rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@keyframes demo-touch {
  0%, 11.5% { opacity: 0; transform: translate(36px, 52px); }
  15% { opacity: 1; transform: none; }
  16.5% { opacity: 1; transform: scale(0.76); }
  18% { opacity: 1; transform: none; }
  22%, 100% { opacity: 0; transform: scale(1.15); }
}
@keyframes demo-press {
  0%, 15.5% { transform: none; box-shadow: 0 0 0 0 rgba(89, 204, 255, 0); }
  16.5% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(89, 204, 255, 0.6); }
  18% { transform: none; box-shadow: 0 0 0 2px rgba(89, 204, 255, 0.5); }
  24%, 100% { transform: none; box-shadow: 0 0 0 14px rgba(89, 204, 255, 0); }
}
@keyframes demo-count {
  0%, 16.5% { opacity: 0; transform: scale(0.4); }
  18% { opacity: 1; transform: scale(1.4); }
  20%, 100% { opacity: 1; transform: none; }
}
@keyframes demo-l1 {
  0%, 33% { opacity: 0; transform: translateY(8px); }
  35.5%, 100% { opacity: 1; transform: none; }
}
@keyframes demo-l2 {
  0%, 36.5% { opacity: 0; transform: translateY(8px); }
  39%, 100% { opacity: 1; transform: none; }
}
@keyframes demo-l3 {
  0%, 43% { opacity: 0; transform: translateY(8px); }
  45.5%, 100% { opacity: 1; transform: none; }
}
@keyframes demo-l4 {
  0%, 49% { opacity: 0; transform: translateY(8px); }
  51.5%, 100% { opacity: 1; transform: none; }
}
@keyframes demo-l5 {
  0%, 55% { opacity: 0; transform: translateY(8px); }
  57.5%, 100% { opacity: 1; transform: none; }
}
@keyframes demo-l6 {
  0%, 62% { opacity: 0; transform: translateY(8px); }
  64.5%, 100% { opacity: 1; transform: none; }
}
@keyframes demo-cap-a {
  0% { opacity: 0; }
  2.5%, 26% { opacity: 1; }
  29.5%, 100% { opacity: 0; }
}
@keyframes demo-cap-b {
  0%, 28% { opacity: 0; }
  32%, 95% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes in-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  0% { opacity: 0; transform: translateY(8px) scale(0.3); }
  70% { opacity: 1; transform: scale(1.18); }
  100% { opacity: 1; transform: none; }
}
@keyframes wipe {
  from { opacity: 0.2; clip-path: inset(0 100% 0 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}
@keyframes grow-x {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes ripple {
  0% { opacity: 0; transform: scale(0.5); }
  30% { opacity: 1; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(1.5); }
}
@keyframes ripple-twice {
  0% { opacity: 0; transform: scale(0.5); }
  10% { opacity: 1; transform: scale(0.8); }
  16% { opacity: 1; transform: scale(0.7); }
  32%, 60% { opacity: 0; transform: scale(1.5); }
  61% { opacity: 0; transform: scale(0.5); }
  70% { opacity: 1; transform: scale(0.8); }
  76% { opacity: 1; transform: scale(0.7); }
  92%, 100% { opacity: 0; transform: scale(1.5); }
}
@keyframes wave-a {
  0% { transform: scaleY(0.3); }
  12% { transform: scaleY(0.9); }
  25% { transform: scaleY(0.45); }
  37% { transform: scaleY(1); }
  50% { transform: scaleY(0.35); }
  62% { transform: scaleY(0.8); }
  75% { transform: scaleY(0.5); }
  87% { transform: scaleY(0.95); }
  100% { transform: scaleY(0.55); }
}
@keyframes wave-b {
  0% { transform: scaleY(0.7); }
  10% { transform: scaleY(0.25); }
  22% { transform: scaleY(0.85); }
  35% { transform: scaleY(0.4); }
  47% { transform: scaleY(0.95); }
  60% { transform: scaleY(0.3); }
  72% { transform: scaleY(0.75); }
  85% { transform: scaleY(0.2); }
  100% { transform: scaleY(0.9); }
}
@keyframes wave-c {
  0% { transform: scaleY(0.5); }
  14% { transform: scaleY(0.6); }
  27% { transform: scaleY(0.2); }
  40% { transform: scaleY(0.7); }
  52% { transform: scaleY(0.15); }
  66% { transform: scaleY(0.55); }
  78% { transform: scaleY(0.25); }
  90% { transform: scaleY(0.65); }
  100% { transform: scaleY(0.4); }
}
@keyframes dim {
  from { opacity: 1; }
  to { opacity: 0.55; }
}
@keyframes pick-right {
  from { background-color: var(--charcoal); opacity: 1; }
  to { background-color: #1E3531; opacity: 1; }
}
@keyframes pick-badge {
  from { background-color: var(--surface-2); color: var(--ivory); }
  to { background-color: var(--mint); color: var(--ink); }
}
@keyframes fan-left {
  from { transform: translateX(52%) rotate(0deg) scale(0.94); }
}
@keyframes fan-right {
  from { transform: translateX(-52%) rotate(0deg) scale(0.94); }
}
@keyframes draw {
  from { background-size: 0% 2px; }
  to { background-size: 100% 2px; }
}

/* Documents (legal, support, parents) */

.doc {
  max-width: calc(var(--max-doc) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 48px var(--gutter) 80px;
}
@media (min-width: 860px) { .doc { padding-top: 72px; } }

.doc-head { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.doc-head h1 { font-size: clamp(2.5rem, 9vw, 3.75rem); }
.doc-head .updated { margin: 14px 0 0; color: var(--muted); font-size: 0.9375rem; }
.doc-head .intro { margin: 18px 0 0; }

.doc h2 {
  margin: 48px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 5.5vw, 2.125rem);
  line-height: 1.15;
  scroll-margin-top: 16px;
}
.doc h3 {
  margin: 28px 0 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  scroll-margin-top: 16px;
}
.doc p { margin: 12px 0 0; }
.doc ul, .doc ol { margin: 12px 0 0; padding-left: 1.3em; }
.doc li { margin: 6px 0 0; }
.doc li > ul { margin-top: 6px; }
.doc strong { font-weight: 600; }
.doc .muted { color: var(--muted); }
.doc address { font-style: normal; margin: 12px 0 0; }

.toc {
  margin: 28px 0 0;
  padding: 20px 24px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.toc h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc ol { margin: 10px 0 0; padding-left: 1.4em; columns: 1; }
@media (min-width: 640px) { .toc ol { columns: 2; column-gap: 32px; } }
.toc li { margin: 0; padding: 3px 0; break-inside: avoid; }
.toc.short ol { columns: 1; }
.toc a { text-decoration: none; color: var(--ivory); }
.toc a:hover { text-decoration: underline; }

.callout {
  margin: 24px 0 0;
  padding: 18px 20px;
  background: var(--charcoal);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
}
.callout p:first-child { margin-top: 0; }

.summary {
  margin: 28px 0 0;
  padding: 20px 24px;
  background: var(--charcoal);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.summary h2 { margin: 0; font-size: 1.625rem; }

.faq h3 { margin-top: 32px; }

/* Tables become stacked rows on narrow screens. */
.table-wrap { margin: 16px 0 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.55;
}
caption { text-align: left; color: var(--muted); padding-bottom: 8px; font-size: 0.875rem; }
th, td {
  padding: 12px 12px 12px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom-color: var(--line-strong);
}
tbody th { font-weight: 600; min-width: 8em; }
td:last-child, th:last-child { padding-right: 0; }

@media (max-width: 639px) {
  table.stack, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; width: 100%; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  table.stack th, table.stack td { padding: 2px 0; border: 0; }
  table.stack tbody th { font-size: 1rem; margin-bottom: 4px; }
  table.stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}

/* 404 */

.lost {
  min-height: 60vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 72px var(--gutter);
}
.lost h1 { font-size: clamp(2.75rem, 10vw, 4.5rem); }
.lost p { margin: 16px auto 0; color: var(--muted); max-width: 28rem; }
.lost .actions { justify-content: center; }

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}
.site-footer img { width: 104px; margin-left: -8px; opacity: 0.9; }
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer a { display: inline-block; padding: 8px 0; color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ivory); text-decoration: underline; }
.site-footer a[aria-current="page"] { color: var(--ivory); }
.site-footer .legal { width: 100%; margin: 0; font-size: 0.875rem; }
.site-footer .tagline { margin: 6px 0 0; font-family: var(--serif); font-style: italic; font-size: 1.125rem; color: var(--muted); }

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

@media print {
  :root { --ink: #fff; --ivory: #111; --muted: #444; --charcoal: #fff; --ink-2: #fff; }
  .site-header nav, .skip-link, .hero::before, .hero-demo, .beat-art, .fan, .phone, .lock { display: none; }
  a { color: #111; }
}
