/* The marketing page (Kris, 2026-11-02): the story on the left, big and bold;
   on the right the app itself, zoomed in, fading off the edge. The app's
   palette (Tokens.swift), light and dark, and its one orange. */
@font-face { font-family: 'Syne'; src: url('/fonts/Syne-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Syne'; src: url('/fonts/Syne-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  color-scheme: light dark;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  --display: 'Syne', var(--sans);
  /* Light (the app's light tokens) */
  --bg: #ffffff; --page2: #f6f4f1; --s1: #f3f3f3; --s2: #e6e6e6; --child: #ffffff; --field: #ffffff;
  --border: #d0d0d0; --border2: #b8b8b8; --hair: rgba(0,0,0,.12);
  --text: #111111; --dim: #555555; --dimmer: #666666;
  --amber: #e0772b; --on-amber: #000; --red: #d81e1e;
  --warn-fg: #8a5200; --warn-bg: #fbecd6; --danger-bg: #fbe0e0;
  --load: #4f5bb3; --load-bg: #d9ddf3; --wrap-bg: #f8e3e3;
  --glow: rgba(224,119,43,.16); --shadow: 0 40px 120px rgba(0,0,0,.14);
  --green: #1fa84a; --done-bg: #d7efde; --ahead: #17803a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --page2: #0b0b0b; --s1: #141414; --s2: #1e1e1e; --child: #262626; --field: #0d0d0d;
    --border: #2a2a2a; --border2: #6a6a6a; --hair: rgba(255,255,255,.1);
    --text: #f0f0f0; --dim: #c0c0c0; --dimmer: #a0a0a0;
    --amber: #f98d0b; --red: #f42121;
    --warn-fg: #f79c1f; --warn-bg: #2b2010; --danger-bg: #2c1414;
    --load: #9aa5e8; --load-bg: #2c3149; --wrap-bg: #2a1a1a;
    --glow: rgba(249,141,11,.14); --shadow: 0 40px 140px rgba(0,0,0,.7);
    --done-bg: #2d4535; --ahead: #3fd06b;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--amber); }

/* Two chapters, planning then live: each a story beside its own sticky app */
.chapter { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); min-height: 100vh; }
.chapter + .chapter { border-top: 1px solid var(--hair); }

/* ── The story ─────────────────────────────────────────────── */
.story { padding: 56px clamp(28px, 4.5vw, 80px) 72px; max-width: 760px; margin-left: auto; width: 100%; }
.brand { display: flex; align-items: center; gap: 14px; font-family: var(--display); font-weight: 700; font-size: 26px; margin-bottom: 72px; }
/* The mark: the app's icon, rounded as on a home screen */
.mark { width: 44px; height: 44px; border-radius: 22%; flex: none; display: block; }
.mark.small { width: 38px; height: 38px; }
/* Syne's descenders reach below a tight line: room for the g of "change" */
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(46px, 4.8vw, 74px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 28px; padding-bottom: 0.12em; }
.lede { font-size: clamp(21px, 1.7vw, 26px); line-height: 1.4; font-weight: 600; margin: 0 0 24px; }
/* The one call to action: the TestFlight beta (Kris, 2026-11-02: no marketing yet) */
.cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; margin: 0 0 28px; }
.cta { display: inline-block; background: var(--amber); color: var(--on-amber); font-weight: 800; font-size: 19px; text-decoration: none; padding: 14px 24px; border-radius: 12px; }
.cta:hover { filter: brightness(1.08); }
.cta:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.cta-note { color: var(--dim); font-size: 16px; font-weight: 600; }
button.cta { border: 0; cursor: pointer; font-family: var(--sans); }
.cta[disabled] { opacity: .6; cursor: default; }
/* The request form */
.beta { border: 1px solid var(--border); border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--s1); color: var(--text); box-shadow: var(--shadow); }
.beta::backdrop { background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.beta form { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.beta h2 { margin: 0; }
.beta-lede { margin: 0 0 4px; color: var(--dim); font-size: 17px; line-height: 1.45; }
.beta label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 15px; }
.beta .opt { font-weight: 500; color: var(--dimmer); font-size: 13px; }
.beta input, .beta textarea { font: 500 17px var(--sans); color: var(--text); background: var(--field); border: 2px solid var(--border2); border-radius: 10px; padding: 10px 12px; outline: none; }
.beta input:focus, .beta textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 4px var(--glow); }
.beta .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.beta-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 4px; }
.ghost { background: none; border: 2px solid var(--border2); color: var(--text); border-radius: 12px; padding: 12px 20px; font: 700 17px var(--sans); cursor: pointer; }
.ghost:hover { border-color: var(--amber); }
.beta-msg { margin: 0; min-height: 1.2em; font-weight: 700; }
.beta-msg.err { color: var(--red); } .beta-msg.done { color: var(--ahead); }
.beta-fine { margin: 0; color: var(--dimmer); font-size: 13px; line-height: 1.5; }
.try { display: flex; align-items: center; gap: 12px; color: var(--amber); font-weight: 800; font-size: 19px; margin: 0 0 80px; }
.try-arrow { width: 28px; height: 3px; background: var(--amber); position: relative; border-radius: 2px; }
.try-arrow::after { content: ''; position: absolute; right: -2px; top: -5px; border: 6.5px solid transparent; border-left-color: var(--amber); border-right: 0; }
section { margin: 0 0 56px; }
h2 { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 2.4vw, 36px); line-height: 1.1; margin: 0 0 16px; }
section p { font-size: clamp(18px, 1.35vw, 21px); line-height: 1.55; color: var(--dim); margin: 0 0 16px; }
section strong { color: var(--text); }
.punch { color: var(--text) !important; font-weight: 800; font-size: clamp(21px, 1.6vw, 25px) !important; }
.fine { border-top: 1px solid var(--hair); padding-top: 28px; margin-top: 72px; }
.live-intro { padding-top: 16px; }
h2.big { font-size: clamp(40px, 4.4vw, 64px); line-height: 1.08; padding-bottom: 0.1em; letter-spacing: -0.02em; margin-bottom: 24px; }
.live-intro .lede { color: var(--text); }
.fine p { font-size: 15px; line-height: 1.55; color: var(--dimmer); margin: 0 0 8px; }

/* ── The stage: the app, zoomed in, sticky, fading off the edge ── */
.stage { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
  background: radial-gradient(90% 70% at 30% 45%, var(--glow) 0%, transparent 70%), var(--page2); }
.lens { width: 100%;
  /* Close up: the day runs past the right edge and melts away there, a little at the top and bottom too */
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 76%, transparent 99%), linear-gradient(180deg, transparent 0%, #000 4%, #000 94%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, #000 0%, #000 76%, transparent 99%), linear-gradient(180deg, transparent 0%, #000 4%, #000 94%, transparent 100%);
  mask-composite: intersect; }
.demo { width: 1080px; max-width: none; margin-left: clamp(24px, 3.5vw, 64px); padding: 20px 0; }
.stage-note { margin: 10px 0 0 clamp(24px, 4vw, 72px); color: var(--dimmer); font-size: 14px; font-weight: 600; }

.day { background: var(--s1); border: 1px solid var(--border); border-radius: 18px; padding: 28px 28px 22px; box-shadow: var(--shadow); }
.day-head { display: grid; grid-template-columns: 96px 1fr 96px; align-items: start; }
.tile { width: 80px; height: 92px; border-radius: 10px; background: var(--s2); border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; align-items: center; }
.tile-wd { width: 100%; text-align: center; background: var(--amber); color: var(--on-amber); font-family: var(--display); font-weight: 700; font-size: 14px; padding: 4px 0; }
.tile-d { font-weight: 800; font-size: 34px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile-m { font-family: var(--display); font-weight: 700; font-size: 12px; color: var(--dimmer); }
.day-mid { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.badge { background: var(--amber); color: var(--on-amber); font-family: var(--display); font-weight: 700; font-size: 19px; padding: 5px 13px; border-radius: 6px; }
.day-title { font-weight: 800; font-size: 34px; }

.stats { display: flex; justify-content: center; margin: 28px 0 24px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 26px; min-width: 140px; }
.stat + .stat { border-left: 1px solid var(--hair); }
.label { font-size: 14px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.value { font-weight: 800; font-size: 28px; height: 50px; display: flex; align-items: center; font-variant-numeric: tabular-nums; }
.value.late { color: var(--red); }

/* Boxes you can type in: the app's time and minutes boxes */
.timebox, .minbox { background: var(--field); color: var(--text); border: 2px solid var(--border2); border-radius: 9px; text-align: center;
  font: 800 28px var(--sans); font-variant-numeric: tabular-nums; outline: none; transition: border-color .15s, box-shadow .15s; }
.timebox { width: 122px; height: 50px; }
.minbox { width: 74px; height: 40px; font-size: 23px; }
.timebox:hover, .minbox:hover { border-color: var(--amber); }
.timebox:focus, .minbox:focus { border-color: var(--amber); box-shadow: 0 0 0 4px var(--glow); }

/* Rows: grip · times · boxes · words · icon · name */
.rows { display: flex; flex-direction: column; gap: 10px; position: relative; }
.row { display: grid; grid-template-columns: 34px 84px 74px 92px 38px minmax(0, 1fr); column-gap: 16px; align-items: center;
  background: var(--child); border-radius: 10px; padding: 14px 20px 14px 14px; position: relative;
  /* Every row a shot's height (two time lines), as in the app: Unload, Wrap and Strike too */
  min-height: calc(2 * 40px + 8px + 28px); }
.row.block { background: var(--s2); }
.row.block::before, .row.load::before, .row.wrapline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 5px 0 0 5px; background: var(--text); }
.row.load { background: var(--load-bg); }
.row.load::before { background: var(--load); }
.row.shot { margin-left: 22px; }
.row.wrapline { background: var(--s2); }
.row.wrapline::before { background: var(--dim); }
.row.wrapline.late { background: var(--wrap-bg); }
.row.wrapline.late::before { background: var(--red); }

.times, .boxes, .words { display: flex; flex-direction: column; gap: 8px; }
.time { font-weight: 800; font-size: 26px; height: 40px; display: flex; align-items: center; font-variant-numeric: tabular-nums; }
.word { font-size: 17px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); height: 40px; display: flex; align-items: center; }
.row.block .word { color: var(--text); }
.row.load .word, .row.load .icon { color: var(--load); }
.wrapline.late .time, .wrapline.late .icon { color: var(--red); }
.icon { width: 30px; height: 30px; color: var(--dim); }
.name { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.name b { font-size: 25px; font-weight: 800; height: 40px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name span { font-size: 19px; color: var(--dim); height: 40px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name .soft { font-weight: 600; color: var(--dim); }

.grip { width: 34px; height: 40px; border: 0; background: none; color: var(--dimmer); cursor: grab; display: flex; align-items: center; justify-content: center; border-radius: 8px; touch-action: none; padding: 0; }
.grip:hover { color: var(--amber); background: var(--glow); }
.grip:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }
.grip svg { width: 22px; height: 22px; }

/* Times that just moved light up */
.changed { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { color: var(--amber); text-shadow: 0 0 18px var(--amber); } 100% { text-shadow: 0 0 0 transparent; } }

/* Dragging a shot */
.row.dragging { z-index: 5; box-shadow: 0 22px 50px rgba(0,0,0,.35), 0 0 0 3px var(--amber); }
.row.dragging .grip { cursor: grabbing; color: var(--amber); }
.row.moving { transition: transform .18s ease; }
body.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }

.warn { margin-top: 12px; background: var(--warn-bg); color: var(--warn-fg); border-radius: 10px; padding: 14px 18px; font-size: 19px; font-weight: 700; }
.warn.danger { background: var(--danger-bg); color: var(--red); }

/* ── Narrow screens: each chapter's story with its app after the opening ── */
@media (max-width: 1100px) {
  .chapter { display: flex; flex-direction: column; }
  .story { display: contents; }
  .brand, h1, .lede, .try, section, .fine { padding-left: 20px; padding-right: 20px; margin-left: 0; margin-right: 0; }
  .brand { padding-top: 32px; margin-bottom: 48px; }
  .o0 { order: 0; } .o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; } .o6 { order: 6; } .o7 { order: 7; } .o8 { order: 8; }
  .try { margin-bottom: 28px; }
  .stage { position: relative; height: auto; padding: 36px 0; margin-bottom: 56px; }
  .live-intro { padding-top: 48px; }
  .fine { padding-bottom: 48px; }
  .demo { width: 980px; margin-left: 20px; }
  .stage-note { margin-left: 20px; }
  .notice { left: 20px; right: 20px; }
}
@media (max-width: 640px) {
  /* A phone: the day at the screen's width, still large; the edge still fades */
  /* A phone: the day fits the screen; only a short fade at its edge */
  .demo { width: calc(100vw - 8px); margin-left: 12px; }
  .lens { -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 93%, transparent 100%); mask-image: linear-gradient(90deg, #000 0%, #000 93%, transparent 100%); }
  .day { padding: 18px 14px 14px; border-radius: 14px; }
  .day-head { grid-template-columns: 70px 1fr 0; }
  .tile { width: 60px; height: 70px; } .tile-d { font-size: 26px; } .tile-wd { font-size: 11px; }
  .badge { font-size: 15px; } .day-title { font-size: 25px; }
  .stats { justify-content: flex-start; }
  .stat { min-width: 0; padding: 0 14px; }
  .stat:first-child { padding-left: 0; }
  .label { font-size: 11px; } .value { font-size: 21px; height: 40px; }
  .timebox { width: 90px; height: 40px; font-size: 21px; }
  /* Without the words column: grip · times · boxes · icon · name */
  .row { grid-template-columns: 26px 62px 54px 24px minmax(0, 1fr); column-gap: 10px; padding: 10px 12px 10px 8px; min-height: calc(2 * 34px + 8px + 20px); }
  .row.shot { margin-left: 10px; }
  .words { display: none; }
  .rows.live .row { grid-template-columns: 26px 96px 46px 24px minmax(0, 1fr); }
  .mins { width: 46px; height: 34px; font-size: 17px; }
  .time { font-size: 20px; height: 34px; } .word { height: 34px; }
  .minbox { width: 54px; height: 34px; font-size: 18px; }
  .name b { font-size: 19px; height: 34px; } .name span { font-size: 15px; height: 34px; }
  .icon { width: 24px; height: 24px; } .grip { width: 26px; height: 34px; }
}
/* ── Live ─────────────────────────────────────────────────── */
.live-badge { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--on-amber); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.check { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--border2); background: none; padding: 0; display: flex; align-items: center; justify-content: center; color: transparent; }
.check svg { width: 20px; height: 20px; }
.check.now { border-color: var(--amber); cursor: pointer; box-shadow: 0 0 0 0 var(--glow); animation: ring 1.8s ease-out infinite; }
.check.now:hover { background: var(--glow); }
.check.now:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 var(--amber); } 100% { box-shadow: 0 0 0 12px transparent; } }
.check.done { border-color: var(--green); background: var(--green); color: #fff; }
.check[disabled] { cursor: default; }
.row.done { background: var(--done-bg); }
.row.done .name span, .row.done .word { color: var(--text); opacity: .75; }
.row.current { box-shadow: 0 0 0 3px var(--amber); }
.mins { font-weight: 800; font-size: 22px; height: 40px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border2); border-radius: 9px; width: 74px; font-variant-numeric: tabular-nums; }
.row.done .mins { border-color: transparent; }
.delta { font-size: 16px; font-weight: 800; margin-left: 8px; font-variant-numeric: tabular-nums; }
.delta.ahead { color: var(--ahead); } .delta.behind { color: var(--warn-fg); }
.value .delta { font-size: 18px; }
.pace-ahead { color: var(--ahead); } .pace-behind { color: var(--warn-fg); }
.live-foot { display: flex; justify-content: flex-start; margin-top: 14px; }
/* Live, the time column also holds how far ahead or behind (as the app's) */
.rows.live .row { grid-template-columns: 34px 132px 74px 92px 38px minmax(0, 1fr); }
.again { background: none; border: 2px solid var(--border2); color: var(--text); border-radius: 9px; padding: 9px 16px; font: 700 16px var(--sans); cursor: pointer; }
.again:hover { border-color: var(--amber); color: var(--amber); }
.notice { position: absolute; top: 28px; left: clamp(24px, 4vw, 72px); width: min(460px, calc(100% - 48px)); z-index: 10; display: flex; gap: 12px; align-items: flex-start;
  background: color-mix(in srgb, var(--s1) 88%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--hair); border-radius: 20px; padding: 14px 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: drop .45s cubic-bezier(.2,.9,.3,1.2); }
.notice[hidden] { display: none; }
.notice img { border-radius: 9px; flex: none; }
.notice-app { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--dimmer); display: flex; justify-content: space-between; }
.notice-app span { font-weight: 500; letter-spacing: 0; }
.notice-title { font-size: 18px; font-weight: 800; margin-top: 2px; }
.notice-body { font-size: 16px; color: var(--dim); margin-top: 2px; }
@keyframes drop { from { transform: translateY(-30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* A phone, live: after the live rules so the boxes stay narrow */
@media (max-width: 640px) {
  .rows.live .row { grid-template-columns: 26px 84px 40px 22px minmax(0, 1fr); }
  .mins { width: 40px; height: 34px; font-size: 17px; }
  .check { width: 26px; height: 26px; } .check svg { width: 15px; height: 15px; }
  .delta { font-size: 13px; margin-left: 4px; }
  .value { white-space: nowrap; }
  #livePace { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .dot, .check.now, .notice { animation: none; }
  .changed { animation: none; }
  .row.moving { transition: none; }
}
