/* Rethink landing. Same tokens as rethink/ui/theme.ts: paper + ink, flat poster colours, one accent at a time. */

@font-face { font-family: 'Bricolage'; src: url('assets/fonts/Bricolage-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('assets/fonts/Bricolage-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('assets/fonts/Figtree-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('assets/fonts/Figtree-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('assets/fonts/DMMono-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }

:root {
  --paper: #F3EEE3;
  --card: #FFFCF5;
  --ink: #1B1A1F;
  --ink-soft: #57534B;
  --ink-faint: #8A8478;
  --line: #E2DACB;
  --tomato: #FF6B4A;
  --cobalt: #3D4ED8;
  --sun: #FFDD3C;
  --mint: #8EDFC0;
  --lilac: #C3B4FF;

  --display: 'Bricolage', 'Arial Black', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1200px;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --land: cubic-bezier(0.34, 1.32, 0.64, 1);
  --stroke: 2px;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 17px/1.55 var(--body);
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
code { font-family: var(--mono); font-size: 0.86em; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--card); padding: 10px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { top: 12px; }

/* ---------- Type ---------- */
.display {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(48px, 8.4vw, 112px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin: 0;
}
.display-sm { font-size: clamp(40px, 6vw, 76px); }
.h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
}
.h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
}

.marker { position: relative; white-space: nowrap; z-index: 0; }
.marker svg {
  position: absolute; left: -2%; right: -2%; bottom: 0.02em; width: 104%; height: 0.32em;
  z-index: -1; fill: var(--sun);
  transform-origin: left center;
  animation: mark 520ms var(--ease) 380ms both;
}
@keyframes mark { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 16px/1 var(--body);
  padding: 16px 22px;
  border-radius: 999px;
  border: var(--stroke) solid var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.btn:active { transform: translateY(2px); }
.btn-ink { background: var(--ink); color: var(--card); box-shadow: 0 4px 0 var(--tomato); }
.btn-ink:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--tomato); }
.btn-ink:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--tomato); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--card); }
.btn-sm { padding: 10px 16px; font-size: 14px; box-shadow: none; }
.btn-sm:hover { box-shadow: none; transform: none; background: #2c2a31; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-line .ico { fill: currentColor; stroke: none; }
.link { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- Header ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms;
}
.bar.scrolled { border-bottom-color: var(--line); }
.wordmark { font: 800 26px/1 var(--display); letter-spacing: -0.04em; text-decoration: none; }
.dot { color: var(--tomato); }
.bar nav { display: flex; align-items: center; gap: clamp(14px, 2.6vw, 28px); font-weight: 600; font-size: 15px; }
.bar nav a:not(.btn) { text-decoration: none; }
.bar nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Phone ---------- */
.phone {
  position: relative;
  aspect-ratio: 540 / 1230;
  border: 3px solid var(--ink);
  border-radius: 13% / 5.7%;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 10px 12px 0 var(--ink);
}
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; }
/* Clean status bar over the recordings. */
.status {
  position: absolute; inset: 0 0 auto 0; height: 5.8%; z-index: 3;
  background: var(--paper);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 9% 0 10%;
  font: 600 clamp(9px, 1.1vw, 13px)/1 var(--body);
}
.status i { width: 12%; height: 32%; border: 1.5px solid var(--ink); border-radius: 3px; position: relative; }
.status i::after { content: ''; position: absolute; inset: 1.5px 25% 1.5px 1.5px; background: var(--ink); border-radius: 1px; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) var(--gutter) clamp(72px, 9vw, 120px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-areas: "hook try" "copy try";
  column-gap: clamp(32px, 6vw, 88px);
  align-items: start;
}
.hook { grid-area: hook; align-self: end; }
.hero-copy { grid-area: copy; margin-top: clamp(28px, 4vw, 48px); }
.try { grid-area: try; }

.hook-line { margin: 0; font-size: clamp(18px, 1.6vw, 22px); font-weight: 600; color: var(--ink-soft); }
.count {
  margin: 4px 0 -0.04em;
  font: 800 clamp(128px, 17vw, 232px)/0.9 var(--display);
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}
.odo { display: inline-flex; }
.digit { display: inline-block; height: 0.9em; overflow: hidden; }
.digit > span { display: block; transition: transform 1500ms cubic-bezier(0.2, 0.75, 0.2, 1); }
.digit > span > i { display: block; height: 0.9em; font-style: normal; }

.hero .display { font-size: clamp(40px, 5.4vw, 74px); }
.lede { font-size: clamp(18px, 1.5vw, 20px); color: var(--ink-soft); max-width: 26em; margin: 20px 0 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { color: var(--ink-faint); font-size: 14px; margin: 18px 0 0; }

/* ---------- The live phone ---------- */
.try { position: relative; justify-self: center; width: min(316px, 100%); }
.phone-live { animation: rise 760ms var(--land) 120ms both; }
@keyframes rise { from { opacity: 0; transform: translateY(40px) rotate(2deg); } to { opacity: 1; transform: none; } }

.device {
  position: absolute; left: 0; top: 0; width: 392px; height: 893px;
  transform: scale(var(--s, 0.8)); transform-origin: 0 0;
  overflow: hidden; z-index: 1;
}
.scr { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 250ms var(--ease), visibility 0s 250ms; }
.scr.on { opacity: 1; visibility: visible; transition: opacity 250ms var(--ease); }

.try[data-scr="app"] .status { background: #fff; }
.try-say { margin: 22px auto 0; max-width: 21em; min-height: 4.6em; text-align: center; font-size: 15px; color: var(--ink-soft); }

.sticker {
  position: absolute; z-index: 4; margin: 0;
  top: var(--ig-y, 60%); right: calc(100% - var(--ig-x, 0px) + 22px);
  translate: 0 -150%; rotate: -5deg;
  background: var(--sun); border: var(--stroke) solid var(--ink); border-radius: 10px;
  padding: 8px 14px; font: 800 18px/1.1 var(--display); white-space: nowrap;
  transition: opacity 240ms var(--ease);
  animation: rise 600ms var(--land) 900ms backwards;
}
.sticker svg { position: absolute; right: -62px; top: 62%; width: 70px; height: 36px; fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transform: rotate(8deg); }
.try.used .sticker, .try:not(.is-home) .sticker { opacity: 0; pointer-events: none; }

/* Launcher */
.scr-home { background: var(--paper); }
.scr-home::before { content: ''; position: absolute; width: 330px; height: 330px; border-radius: 50%; background: var(--sun); right: -120px; top: 150px; }
.scr-home::after { content: ''; position: absolute; width: 58px; height: 58px; border-radius: 50%; background: var(--tomato); left: 40px; top: 420px; }
.home-clock { position: absolute; left: 28px; top: 92px; z-index: 1; }
.home-time { margin: 0; font: 800 96px/0.9 var(--display); letter-spacing: -0.05em; }
.home-date { margin: 10px 0 0 4px; font: 600 17px/1.2 var(--body); color: var(--ink-soft); }
.home-grid {
  position: absolute; left: 18px; right: 18px; bottom: 96px; z-index: 1;
  display: grid; grid-template-columns: repeat(4, 1fr); row-gap: 24px;
}
.appi {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font: 600 12.5px/1 var(--body); color: var(--ink);
}
.ic { position: relative; width: 62px; height: 62px; border-radius: 18px; border: 2px solid var(--ink); display: grid; place-items: center; transition: transform 160ms var(--ease); }
.appi:hover .ic { transform: translateY(-2px); }
.appi:active .ic { transform: scale(0.94); }
.ic svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic .fill { fill: currentColor; stroke: none; }
.ic-maps { background: var(--sun); }
.ic-camera { background: var(--card); }
.ic-msg { background: var(--cobalt); color: var(--card); }
.ic-phone { background: var(--mint); }
.ic-ig { background: linear-gradient(45deg, #FEDA75, #FA7E1E 30%, #D62976 60%, #962FBF 80%, #4F5BD5); color: #fff; }
.ic-yt { background: var(--tomato); color: #fff; }
.ic-wa { background: #25D366; color: #fff; }
.ic-rt { background: var(--ink); }
.ic-rt .mint { fill: var(--mint); stroke: none; }
.ic-rt .tom { fill: var(--tomato); stroke: none; }
.try:not(.used) .appi-ig .ic::after {
  content: ''; position: absolute; inset: -9px; border-radius: 24px; border: 2.5px solid var(--ink);
  animation: ping 1800ms var(--ease) 1400ms infinite both;
}
@keyframes ping { 0% { opacity: 0.9; transform: scale(0.9); } 70%, 100% { opacity: 0; transform: scale(1.25); } }
.shake .ic { animation: shake 360ms var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

.home-bar { position: absolute; left: 50%; bottom: 6px; width: 150px; height: 26px; transform: translateX(-50%); background: none; border: 0; cursor: pointer; z-index: 6; }
.home-bar::before { content: ''; position: absolute; left: 15px; right: 15px; top: 12px; height: 5px; border-radius: 3px; background: var(--ink); opacity: 0.85; }

/* Rethink's gate (dp values from GateScreen.kt) */
.scr-gate { background: var(--paper); }
.scr-gate.launch { animation: launch 420ms var(--ease); }
@keyframes launch { from { transform: scale(0.16); opacity: 0; border-radius: 60px; } to { transform: none; opacity: 1; } }
.scr-gate.in .g { animation: fade 400ms var(--ease); }
@keyframes fade { from { opacity: 0; } }

.g { position: absolute; inset: 60px 24px 34px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.g-pill {
  margin: 0; display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 999px;
  padding: 6px 14px 6px 6px; font: 700 14px/1 var(--body);
}
.pill-ic { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(45deg, #FEDA75, #FA7E1E 30%, #D62976 60%, #962FBF 80%, #4F5BD5); }
.g-opener { margin: 28px 0 0; font: 800 26px/31px var(--display); letter-spacing: -0.01em; opacity: 0; }
.g-orb { flex: 1; min-height: 0; width: 100%; position: relative; display: grid; place-items: center; opacity: 0; }
.g-orb canvas { width: 280px; height: 280px; max-height: 100%; }
.g-breath { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.g-breath b { font: 800 20px/1.2 var(--display); }
.g-breath span { font: 500 13px/1.4 var(--mono); color: rgba(27, 26, 31, 0.55); }
.g-quote { margin: 0; font: 800 22px/28px var(--display); }
.g-quote span { opacity: 0; transition: opacity 120ms linear; }
.g-author { margin: 10px 0 0; font: 500 11px/1 var(--mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-soft); opacity: 0; }
.g-caption { margin: 24px 0 4px; min-height: 17px; font: 500 13px/1.3 var(--mono); color: var(--ink-soft); }
.g-secondary {
  width: 100%; height: 52px; flex: none; background: none; border: 0; cursor: pointer;
  font: 700 15px/1 var(--body); color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}
.g-body { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.g-title { margin: 0; font: 800 30px/35px var(--display); letter-spacing: -0.015em; }
.g-cap { margin: 12px 0 0; font: 500 16px/23px var(--body); color: var(--ink-soft); }
.g-kicker { margin: 0 0 14px; font: 500 12px/1 var(--mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-soft); }
.g-reasons { list-style: none; margin: 28px 0 0; padding: 0; width: 100%; }
.g-reasons li { animation: rowIn 350ms cubic-bezier(0.4, 0, 0.2, 1) calc(var(--i) * 60ms) both; }
.g-reasons li + li { border-top: 1px solid var(--line); }
@keyframes rowIn { from { opacity: 0; transform: translateY(10px); } }
.g-reasons button {
  width: 100%; height: 54px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px; border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  font: 700 17px/1 var(--body); color: var(--ink); text-align: left;
}
.g-reasons button:hover, .g-reasons button:active { background: var(--card); }
.g-reasons span { font: 500 17px/1 var(--mono); color: var(--ink-soft); }
.g-foot { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.g-primary, .g-chip {
  border: 2px solid var(--ink); border-radius: 16px; cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink); transition: transform 90ms, box-shadow 90ms;
  font: 800 17px/1 var(--display);
}
.g-primary { width: calc(100% - 4px); height: 56px; background: var(--ink); color: var(--card); }
.g-primary:active, .g-chip:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.g-late { opacity: 0; transition: opacity 600ms var(--ease); }
.g-late.ready { opacity: 1; }
.g-chips { margin-top: 32px; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 16px; padding-right: 4px; }
.g-chip { height: 64px; background: var(--sun); color: var(--ink); font-size: 20px; }

/* Stand-in for the guarded app */
.scr-app { background: #fff; padding: 60px 0 0; }
.feed-top { display: flex; align-items: center; gap: 14px; padding: 0 18px 14px; }
.feed-top b { flex: 1; font: 800 24px/1 var(--display); letter-spacing: -0.02em; }
.feed-top i { width: 26px; height: 26px; border-radius: 8px; border: 2px solid #1B1A1F; }
.feed-stories { display: flex; gap: 14px; padding: 0 18px 16px; border-bottom: 1px solid #EEE; }
.feed-stories i { width: 60px; height: 60px; flex: none; border-radius: 50%; background: #EEE9DF; box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px #D62976; margin: 5px 0; }
.feed-post { padding-top: 12px; }
.feed-head { display: flex; align-items: center; gap: 10px; padding: 0 14px 10px; }
.feed-head i { width: 34px; height: 34px; border-radius: 50%; background: #E3DCCF; }
.feed-head b { width: 120px; height: 11px; border-radius: 6px; background: #E3DCCF; }
.feed-img { height: 300px; background: #EEE9DF; }
.feed-lines { padding: 12px 14px; display: grid; gap: 8px; }
.feed-lines b { height: 10px; border-radius: 5px; background: #ECE6DA; width: 80%; }
.feed-lines b + b { width: 55%; }
.try-say .clock { font: 500 0.95em/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Section heads ---------- */
.section-head { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section-head p { color: var(--ink-soft); font-size: 19px; max-width: 36em; margin: 16px 0 0; }

/* ---------- Tour: sticky phone, steps drive it, background follows the step ---------- */
.tour { --tone: var(--mint); background: var(--tone); transition: background 600ms var(--ease); border-top: var(--stroke) solid var(--ink); padding-top: clamp(64px, 8vw, 104px); }
.tour[data-tone="paper"] { --tone: var(--paper); }
.tour[data-tone="sun"] { --tone: var(--sun); }
.tour[data-tone="lilac"] { --tone: var(--lilac); }
.tour .section-head p { color: var(--ink); }
/* Pinned: the track is tall, the pin stays on screen, each slice of scroll is one beat */
.tour-track { height: calc(var(--beats, 8) * 40svh + 100svh); }
.tour-pin {
  position: sticky; top: 64px; height: calc(100svh - 64px);
  max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: auto minmax(0, 560px); gap: clamp(40px, 7vw, 120px);
  align-items: center; justify-content: center;
}
.phone-tour { height: min(calc(100svh - 130px), 800px); width: auto; }
.tour-panel { min-width: 0; }
.chapters { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chapters button {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 14px/1 var(--body); color: var(--ink); background: transparent; cursor: pointer;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 6px 12px 6px 6px;
  transition: background 200ms, color 200ms;
}
.chapters em { font-style: normal; }
.chapters span { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font: 700 12px/1 var(--display); }
.chapters button[aria-current="true"] { background: var(--ink); color: var(--card); }
.chap { display: none; }
.chap.on { display: block; animation: chapIn 420ms var(--ease); }
@keyframes chapIn { from { opacity: 0; transform: translateY(14px); } }
.chap h3 { font: 800 clamp(38px, 4.4vw, 64px)/1 var(--display); letter-spacing: -0.035em; margin: 30px 0 24px; }
.chap .seg { margin: 0; }
.beat-say { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; min-height: 4.6em; max-width: 30em; margin: 22px 0 0; animation: chapIn 360ms var(--ease); }
.chap .note { font-size: 14px; color: rgba(27, 26, 31, 0.66); margin: 8px 0 0; }
.chap .meter, .chap .btn { margin-top: 8px; }
.scroll-hint { margin: 36px 0 0; font: 500 13px/1 var(--mono); color: rgba(27, 26, 31, 0.6); }
.scroll-hint::before { content: '↓'; display: inline-block; margin-right: 8px; animation: nudge 1.6s var(--ease) infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }
.device .scr > img, .device img.scr { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Home, rebuilt from Home.tsx (positions measured from the real screen) */
.scr-homeapp { background: var(--paper); }
.h-date { position: absolute; left: 18px; top: 60px; margin: 0; font: 500 11px/1 var(--mono); letter-spacing: 1px; color: var(--ink-soft); }
.h-greet { position: absolute; left: 18px; top: 80px; margin: 0; font: 800 26px/1.2 var(--display); letter-spacing: -0.02em; }
.h-greet span { color: var(--tomato); }
.h-refresh { position: absolute; right: 18px; top: 80px; width: 36px; height: 36px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font: 600 17px/1 var(--body); }
.h-seg { position: absolute; left: 20px; right: 20px; top: 139px; height: 44px; padding: 3px; border-radius: 999px; background: var(--line); display: flex; }
.h-seg button { flex: 1; border: 0; border-radius: 999px; background: transparent; font: 600 15px/1 var(--body); color: var(--ink); cursor: pointer; }
.h-seg button[aria-selected="true"] { background: var(--ink); color: var(--card); }
.shot-seg { position: absolute; left: 27px; right: 27px; top: 139px; height: 44px; display: flex; gap: 7px; }
.shot-seg button { flex: 1; border: 0; background: transparent; cursor: pointer; border-radius: 999px; }
.shot-seg button:focus-visible { outline-offset: 0; }
.h-dial { position: absolute; left: 26px; top: 197px; width: 340px; height: 340px; }
.h-below { position: absolute; left: 16px; right: 16px; top: 548px; }
.h-below[hidden] { display: none; }
.h-hint { margin: 0 0 14px; font: 500 13px/1.4 var(--body); color: var(--ink-soft); }
.h-stats { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 14px; }
.h-stats div + div { border-left: 1px solid var(--line); padding-left: 12px; }
.h-stats dt { font: 500 10px/1 var(--mono); letter-spacing: 1px; color: var(--ink-soft); }
.h-stats dd { margin: 8px 0 0; font: 800 22px/1 var(--display); letter-spacing: -0.02em; }
.h-stats dd.s { margin-top: 4px; font: 500 12px/1.2 var(--body); color: var(--ink-soft); letter-spacing: 0; }
.h-tabbar {
  position: absolute; left: 12px; right: 12px; bottom: 22px; height: 60px; border-radius: 30px; background: var(--ink);
  display: flex; align-items: center; justify-content: space-around; padding: 0 6px;
  font: 600 11px/1 var(--body); color: var(--card);
}
.h-tabbar b { background: var(--sun); color: var(--ink); border-radius: 999px; padding: 15px 14px; font-weight: 700; }
.device .panel { position: absolute; left: 16px; right: 16px; top: 548px; margin: 0; max-width: none; }
.device .panel[hidden] { display: none; }

/* Segmented control, same shape as the app's FilterTabs */
.seg { display: inline-flex; gap: 4px; padding: 4px; margin-top: 26px; border-radius: 999px; background: rgba(27, 26, 31, 0.08); }
.seg button {
  font: 600 15px/1 var(--body); color: var(--ink); background: transparent;
  border: 0; border-radius: 999px; padding: 11px 20px; cursor: pointer; transition: background 200ms, color 200ms;
}
.seg button[aria-selected="true"] { background: var(--ink); color: var(--card); }
.tab-say { min-height: 3.2em; font-size: 18px; margin: 0; }
.chap .seg { background: rgba(27, 26, 31, 0.1); }

/* Dial (DayDial.tsx) */
.dial { width: 100%; height: 100%; display: block; cursor: pointer; touch-action: manipulation; }
.dial:focus-visible { outline-offset: -6px; border-radius: 50%; }
.dial-tick { font: 500 10px var(--mono); fill: var(--ink-faint); }
.dial .bar { transition: stroke-opacity 220ms var(--ease), stroke 220ms; }
.dial:not(.sweep):not(.swept) .bar { stroke-dashoffset: calc(var(--len) * 1px); }
.dial.sweep .bar { animation: grow 160ms var(--ease) var(--d) both; }
@keyframes grow { from { stroke-dashoffset: calc(var(--len) * 1px); } to { stroke-dashoffset: 0; } }
.dial .hand { opacity: 0; transform-box: view-box; transform-origin: 170px 170px; }
.dial.sweep:not(.swept) .hand { animation: hand 1400ms cubic-bezier(0.33, 1, 0.68, 1); }
@keyframes hand { 0% { opacity: 0.9; transform: rotate(0deg); } 80% { opacity: 0.6; } 100% { opacity: 0; transform: rotate(360deg); } }
.now-pulse { animation: nowPulse 2400ms ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes nowPulse { 50% { transform: scale(1.4); } }
.dial-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.dial-center p { margin: 0; }
.dial-label { font: 500 11px/1 var(--mono); letter-spacing: 1px; color: var(--ink-soft); }
.dial-label.sel { color: var(--cobalt); }
.dial-total { margin-top: 2px !important; font: 800 36px/42px var(--display); letter-spacing: -1.5px; }
.dial-cap { font: 600 11px/1.3 var(--body); color: var(--ink-soft); }
.dial-cap.good { color: #2F9E6E; }

/* Hour panel (SelectionPanel.tsx) */
.panel { padding: 16px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--cobalt); animation: rise 360ms var(--ease); }
.panel-head { display: flex; align-items: flex-start; gap: 12px; }
.panel-head > div { flex: 1; }
.panel-title { margin: 0; font: 700 19px/1.2 var(--display); }
.panel-meta { margin: 3px 0 0; font: 500 11px/1.4 var(--mono); color: var(--ink-soft); }
.panel-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; font: 500 20px/1 var(--body); color: var(--ink); }
.panel-rows { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.panel-rows li { animation: rowIn 300ms var(--ease) calc(60ms + var(--i) * 50ms) both; }
.pr-top { display: flex; justify-content: space-between; margin-bottom: 5px; font: 600 14px/1.2 var(--body); }
.pr-top b { font-weight: 700; }
.pr-track { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pr-track i { display: block; height: 100%; border-radius: 3px; background: var(--cobalt); transition: width 300ms var(--ease); }
.panel-more { margin: 12px 0 0; font: 500 11px/1 var(--mono); color: var(--ink-soft); }

/* Limit screen (port of the New limit screen) */
.scr-limit { background: var(--paper); padding: 62px 22px 0; }
.lim-top { display: flex; align-items: center; gap: 14px; }
.lim-back { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font: 600 18px/1 var(--body); }
.lim-top b { font: 700 22px/1 var(--display); }
.lim-title { margin: 30px 0 22px; font: 800 34px/1.05 var(--display); letter-spacing: -0.02em; }
.lim-title mark { background: var(--sun); color: inherit; padding: 0 4px; }
.lim-time { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; border: 2px solid var(--ink); border-radius: 18px; background: var(--card); }
.lim-time div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lim-time b { width: 104px; height: 80px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 14px; font: 800 40px/1 var(--display); }
.lim-time span { font: 500 11px/1 var(--mono); letter-spacing: 1px; color: var(--ink-soft); }
.lim-time i { font: 800 34px/1 var(--display); font-style: normal; margin-bottom: 22px; }
.lim-kicker { margin: 24px 0 10px; font: 500 11px/1 var(--mono); letter-spacing: 1px; color: var(--ink-soft); }
.lim-picks { display: flex; gap: 8px; }
.lim-picks button { flex: 1; height: 40px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; font: 600 15px/1 var(--body); color: var(--ink); cursor: pointer; transition: background 160ms; }
.lim-picks button.on { background: var(--sun); }
.lim-cap { margin: 16px 0 0; font: 500 14px/1.45 var(--body); color: var(--ink-soft); }
.lim-save {
  margin-top: 22px; width: calc(100% - 4px); height: 56px; border-radius: 14px; border: 2px solid var(--ink);
  background: var(--mint); color: var(--ink); font: 800 18px/1 var(--display); cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink); transition: transform 90ms, box-shadow 90ms;
}
.lim-save:active { transform: translate(4px, 4px); box-shadow: none; }
.g-sticker {
  margin: 0 0 16px; padding: 5px 12px; rotate: -4deg;
  background: var(--tomato); border: 2px solid var(--ink); border-radius: 10px;
  font: 800 13px/1.3 var(--display); letter-spacing: 0.8px;
}

.meter { margin-top: 24px; max-width: 380px; }
.meter[hidden] { display: none; }
.meter-top { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; margin-bottom: 8px; }
.meter-top span { font: 500 13px/1.6 var(--mono); font-variant-numeric: tabular-nums; }
.meter-track { height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card); overflow: hidden; }
.meter-track i { display: block; height: 100%; width: 0; background: var(--tomato); }
[data-focus-try] { margin-top: 24px; }
[data-focus-try][hidden] { display: none; }

/* ---------- Built ---------- */
.built { border-top: var(--stroke) solid var(--ink); padding: clamp(64px, 8vw, 104px) 0; background: var(--card); }

.pipeline { max-width: var(--max); margin: clamp(40px, 5vw, 64px) auto 0; padding: 0 var(--gutter); }
.pipeline ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); counter-reset: p; }
.pipeline li {
  counter-increment: p; position: relative;
  padding: 44px 18px 0 0;
  display: flex; flex-direction: column; gap: 6px;
}
.pipeline li::before {
  content: counter(p); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  border: var(--stroke) solid var(--ink); background: var(--card);
  display: grid; place-items: center; font: 700 14px/1 var(--display); z-index: 1;
}
.pipeline li::after { content: ''; position: absolute; left: 30px; right: 0; top: 14px; height: var(--stroke); background: var(--ink); }
.pipeline li:last-child::after { display: none; }
.pipeline li:nth-child(3)::before { background: var(--sun); }
.pipeline b { font: 700 18px/1.2 var(--display); }
.pipeline span { color: var(--ink-soft); font-size: 15px; line-height: 1.45; }
.pipeline code { margin-top: 4px; color: var(--cobalt); font-size: 13px; }
.pipeline figcaption { color: var(--ink-faint); font-size: 14px; margin-top: 22px; }

.engine {
  max-width: var(--max); margin: clamp(56px, 7vw, 88px) auto 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(28px, 4vw, 56px); align-items: start;
}
.engine-try > p { color: var(--ink-soft); margin: 0 0 18px; }
.cases { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.cases button {
  font: 600 14px/1.2 var(--body); color: var(--ink);
  padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; cursor: pointer;
  transition: background 160ms;
}
.cases button:hover { background: var(--paper); }
.cases button[aria-checked="true"] { background: var(--ink); color: var(--card); }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li {
  position: relative; padding: 11px 0 11px 34px; border-top: 1px solid var(--line);
  color: var(--ink-faint); transition: color 200ms;
}
.checks li::before {
  content: ''; position: absolute; left: 0; top: 14px; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--line); transition: background 200ms, border-color 200ms;
}
.checks li[data-a]::after { content: attr(data-a); position: absolute; right: 0; top: 11px; font: 500 13px/1.6 var(--mono); color: var(--ink-faint); }
.checks li.done { color: var(--ink-soft); }
.checks li.done::before { border-color: var(--ink-soft); background: var(--line); }
.checks li.hit { color: var(--ink); font-weight: 600; }
.checks li.hit::before { background: var(--tomato); border-color: var(--ink); }
.checks li.hit::after { color: var(--ink); }
.checks li.skipped { color: #CFC7B7; }
.checks li { padding-right: 40px; }

.result { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 18px 0 0; padding-top: 16px; border-top: var(--stroke) solid var(--ink); min-height: 64px; }
.chip { font: 700 15px/1 var(--display); padding: 9px 14px; border-radius: 999px; border: var(--stroke) solid var(--ink); background: var(--paper); }
.chip[data-kind="Block"] { background: var(--tomato); }
.chip[data-kind="Gate"] { background: var(--mint); }
.chip[data-kind="Shield"] { background: var(--sun); }
.chip[data-kind="Allow"] { background: var(--card); }
.result [data-result-text] { color: var(--ink-soft); font-size: 15px; flex: 1 1 14em; }
.result.pop .chip { animation: pop 380ms var(--land); }
@keyframes pop { from { transform: scale(0.8); } to { transform: none; } }

.code {
  margin: 0; padding: 22px 0; overflow-x: auto;
  background: var(--ink); color: #E8E3D8; border-radius: 18px;
  font: 500 12.5px/1.75 var(--mono);
  tab-size: 4;
}
.code code { display: block; min-width: max-content; padding: 0 22px; font-size: inherit; }
.code .c { color: #8F897E; }
.code .k { color: var(--lilac); }
.code .f { color: var(--sun); }
.code .t { color: var(--mint); }
.code .n { color: var(--tomato); }
.code .ln { display: inline-block; margin-left: -22px; padding-left: 19px; min-width: calc(100% + 22px); border-left: 3px solid transparent; transition: background 200ms, border-color 200ms; }
.code .ln.lit { background: rgba(255, 221, 60, 0.14); border-left-color: var(--sun); }

.more-toggle { display: none; }
.stack {
  max-width: var(--max); margin: clamp(56px, 7vw, 88px) auto 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(2, 1fr); column-gap: clamp(28px, 5vw, 72px);
}
.stack div { display: grid; grid-template-columns: 9.5em 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.stack dt { font: 700 17px/1.4 var(--display); }
.stack dd { margin: 0; color: var(--ink-soft); font-size: 16px; }

/* ---------- Download ---------- */
.download {
  border-top: var(--stroke) solid var(--ink);
  max-width: var(--max); margin: 0 auto;
  padding: clamp(64px, 8vw, 112px) var(--gutter);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px);
}
.download { max-width: none; padding-left: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); padding-right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); }
.dl-main > p { color: var(--ink-soft); font-size: 19px; margin: 16px 0 28px; }
.qr { display: flex; align-items: center; gap: 20px; margin-top: 36px; }
.qr-code { width: 132px; height: 132px; flex: none; background: var(--card); border: var(--stroke) solid var(--ink); border-radius: 16px; padding: 10px; }
.qr-code svg { width: 100%; height: 100%; display: block; }
.qr p { margin: 0; color: var(--ink-soft); font-size: 15px; max-width: 18em; }

.dl-side .h3 { margin-top: 4px; }
.dl-side .h3 + * { margin-top: 0; }
.install { margin: 0 0 40px; padding: 0; list-style: none; counter-reset: s; }
.install li { counter-increment: s; position: relative; padding: 12px 0 12px 44px; border-top: 1px solid var(--line); }
.install li::before {
  content: counter(s); position: absolute; left: 0; top: 10px; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--ink); display: grid; place-items: center; font: 700 14px/1 var(--display);
}
.perms { margin: 0; }
.perms dt { font-weight: 600; margin-top: 14px; }
.perms dd { margin: 4px 0 0; color: var(--ink-soft); font-size: 16px; }

/* ---------- Footer ---------- */
.foot {
  border-top: var(--stroke) solid var(--ink);
  padding: 28px var(--gutter) 40px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px 28px;
}
.foot p { margin: 0; color: var(--ink-soft); flex: 1; }
.foot nav { display: flex; gap: 22px; font-weight: 600; }

/* ---------- Demo dialog ---------- */
.demo {
  width: min(1100px, calc(100vw - 32px)); padding: 0; border: 3px solid var(--ink); border-radius: 18px;
  background: var(--ink); overflow: visible;
}
.demo::backdrop { background: rgba(27, 26, 31, 0.72); }
.demo[open] { animation: rise 420ms var(--land); }
.demo video { width: 100%; aspect-ratio: 16 / 9; border-radius: 15px; background: var(--ink); }
.demo form { position: absolute; right: -14px; top: -14px; z-index: 2; }
.close { width: 40px; height: 40px; border-radius: 50%; border: var(--stroke) solid var(--ink); background: var(--sun); cursor: pointer; display: grid; place-items: center; }
.close svg { width: 18px; height: 18px; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "hook" "try" "copy"; }
  .try { width: min(250px, 66vw); margin-top: 28px; }
  .sticker { display: none; }
  .pipeline ol { grid-template-columns: 1fr; }
  .pipeline li { padding: 0 0 26px 48px; }
  .pipeline li::after { left: 14px; right: auto; top: 30px; bottom: 0; width: var(--stroke); height: auto; }
  .engine { grid-template-columns: 1fr; }
  .stack { grid-template-columns: 1fr; }
  .download { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .bar nav a:not(.btn) { display: none; }
  /* Phone: the phone takes most of the pinned screen, the panel stays short below it. */
  .tour-pin {
    top: 56px; height: calc(100svh - 56px);
    grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 10px;
    align-items: start; justify-items: center; padding-top: 10px;
  }
  .phone-tour { height: min(60svh, 560px); box-shadow: 5px 6px 0 var(--ink); border-width: 2.5px; }
  .tour-panel { width: 100%; }
  .chapters { flex-wrap: nowrap; gap: 6px; }
  .chapters button { padding: 4px; font-size: 13px; white-space: nowrap; }
  .chapters button[aria-current="true"] { padding-right: 12px; }
  .chapters button:not([aria-current="true"]) em { display: none; }
  .chap h3 { font-size: 24px; margin: 10px 0 10px; }
  .chap .seg { padding: 3px; }
  .chap .seg button { padding: 8px 13px; font-size: 14px; }
  .beat-say { font-size: 15px; line-height: 1.45; min-height: 0; margin-top: 10px; }
  .chap .note { font-size: 12px; margin-top: 6px; }
  .chap .meter { margin-top: 10px; }
  .chap .btn { margin-top: 10px; padding: 12px 18px; font-size: 15px; }
  .scroll-hint { display: none; }
  .code { font-size: 11px; }
  .built:not(.open) .code, .built:not(.open) .stack { display: none; }
  .more-toggle {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: calc(100% - 2 * var(--gutter)); margin: 28px var(--gutter) 0; padding: 14px 18px;
    font: 600 15px/1 var(--body); color: var(--ink); background: transparent;
    border: 1.5px solid var(--ink); border-radius: 999px; cursor: pointer;
  }
  .more-toggle::after { content: '↓'; transition: transform 200ms var(--ease); }
  .more-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
  .built.open .stack { margin-top: 28px; }
  .stack div { grid-template-columns: 1fr; gap: 4px; }
  .qr { display: none; }
  .foot p { flex-basis: 100%; order: 3; }
  .seg button { padding: 10px 14px; }
}

@media (max-width: 760px) and (max-height: 760px) {
  .phone-tour { height: 50svh; }
  .chap h3 { font-size: 22px; margin: 8px 0; }
  .beat-say { font-size: 14px; margin-top: 8px; }
  .try { width: min(200px, 56vw); margin-top: 18px; }
  .count { font-size: 96px; }
  .hero { padding-top: 14px; }
}

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

/* The hour panel has less room inside the phone than in the app's scroll view. */
.device .panel { padding: 12px 14px; top: 540px; }
.device .panel-title { font-size: 17px; }
.device .panel-x { width: 28px; height: 28px; }
.device .panel-rows { margin-top: 10px; gap: 8px; }
.device .pr-top { font-size: 13px; margin-bottom: 4px; }
.device .panel-more { margin-top: 8px; }
