/* Last Cloud site. The sky is the palette, taken from app/src/ui/sky.ts:
   haze (day 1) clears to blue (zero day). Home scrolls through that change;
   reading pages sit on the pale horizon. */

@font-face {
  font-family: "Commissioner";
  src: url("/assets/fonts/commissioner-latin.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}

:root {
  --ink: #1b1922;
  --soft: #45414c;
  --ground: #edf3f9;
  --line: #cfdbe8;
  --link: #1b5694;
  --deep: #2268b5;
  --on-deep: #ffffff;
  --haze-1: #9a93a0; --haze-2: #b9aeb2; --haze-3: #d6c6bb;
  --mid-1: #b4b2bf; --mid-2: #c6cad4; --mid-3: #cbd8e4;
  --clear-1: #2563a8; --clear-2: #2668b0; --clear-3: #b9ddf6;
  --band-ink: #1b1922; --band-soft: #28252d;
  --clear-ink: #ffffff; --clear-soft: #e3eefa;
  --cloud: rgba(255, 255, 255, 0.55);
  --display: "Commissioner", "Avenir Next", "Segoe UI", sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3f6fa;
    --soft: #b9c3d1;
    --ground: #0b1a2e;
    --line: #23364f;
    --link: #8cc0f0;
    --deep: #123866;
    --haze-1: #24222b; --haze-2: #3a343d; --haze-3: #4a4045;
    --mid-1: #191e2c; --mid-2: #22304a; --mid-3: #2b3f5e;
    --clear-1: #06162e; --clear-2: #123866; --clear-3: #1f4f86;
    --band-ink: #ffffff; --band-soft: #c9c6cf;
    --clear-ink: #ffffff; --clear-soft: #c5d4e6;
    --cloud: rgba(255, 255, 255, 0.10);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.6 var(--text);
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; display: block; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; background: var(--ground); padding: 8px 12px; z-index: 10; }

/* ---------- Bar ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1120px; margin: 0 auto; padding: 18px 20px;
}
.mark {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 18px/1 var(--display); letter-spacing: -0.01em;
  color: inherit; text-decoration: none;
}
.mark svg { width: 30px; height: 20px; }
.bar nav { display: flex; gap: 20px; align-items: center; font-size: 15px; }
.bar nav a { color: inherit; text-decoration: none; opacity: 0.85; }
.bar nav a:hover { opacity: 1; text-decoration: underline; }
.bar nav a.btn { opacity: 1; color: var(--haze-2); text-decoration: none; }
@media (prefers-color-scheme: dark) { .bar nav a.btn { color: #1b1922; } }
@media (max-width: 640px) { .bar nav .wide { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px;
  padding: 0 24px; border-radius: 999px; border: 0; cursor: pointer;
  font: 600 17px/1 var(--text); text-decoration: none;
  background: var(--band-ink); color: var(--haze-2);
  box-shadow: 0 8px 22px -12px rgba(27, 25, 34, 0.55);
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 160ms;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -12px rgba(27, 25, 34, 0.6); }
.btn:active { transform: scale(0.98); }
.btn svg { width: 18px; height: 18px; }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 15px; box-shadow: none; }
.btn.light { background: #ffffff; color: #1a4f8c; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
@media (prefers-color-scheme: dark) {
  .btn { background: #f3f6fa; color: #1b1922; }
  .btn.light { background: #ffffff; color: #0b2a52; }
}

/* ---------- Home: the sky clears as you scroll ---------- */
:root {
  --s0: #c3d9ec; --s1: #b9d4ee; --s2: #afcff0; --s3: #a5c9f0; --s4: #9ac3ee; --s5: #8fbcec;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root { --s0: #183457; --s1: #173862; --s2: #163c6c; --s3: #154076; --s4: #144480; --s5: #13488a; }
}
.sky { position: relative; overflow: hidden; color: var(--band-ink); }
.sky .wrap, .stage .wrap, .diff-intro .wrap, .plans .wrap { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.sky-haze { background: linear-gradient(180deg, var(--haze-1) 0%, var(--haze-2) 58%, var(--haze-3) 100%); }
.sky-mid { background: linear-gradient(180deg, var(--haze-3) 0%, var(--mid-1) 30%, var(--mid-2) 70%, var(--mid-3) 100%); }
.sky-late { background: linear-gradient(180deg, var(--mid-3) 0%, var(--s0) 100%); }
.sky-clear { background: linear-gradient(180deg, var(--clear-2) 0%, var(--clear-1) 55%, var(--clear-1) 100%); color: var(--clear-ink); }
@media (prefers-color-scheme: dark) {
  .sky-clear { background: linear-gradient(180deg, var(--clear-2) 0%, var(--clear-1) 100%); }
}

/* Clouds: authored blur blobs that drift, thinning out as the sky clears. */
.clouds { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.clouds .cg { position: absolute; inset: 0; }
.clouds i {
  position: absolute; display: block; border-radius: 50%;
  background: var(--cloud); filter: blur(28px);
  animation: drift 46s linear infinite;
}
@keyframes drift {
  from { transform: translateX(-6vw); }
  to { transform: translateX(6vw); }
}
@media (prefers-reduced-motion: reduce) { .clouds i { animation: none; } }

/* The real screenshots, always in the same phone. */
.phone {
  --pw: min(260px, 64vw);
  position: relative; width: var(--pw); padding: calc(var(--pw) * 0.03);
  border-radius: calc(var(--pw) * 0.16); background: #121117;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 60px 90px -50px rgba(20, 30, 60, 0.7), 0 20px 40px -28px rgba(20, 30, 60, 0.5);
}
.phone img { width: 100%; border-radius: calc(var(--pw) * 0.13); }

/* Hero: one headline, one line, one button, one phone rising out of the haze. */
.hero-scene .stage { position: relative; overflow: hidden; min-height: 100svh; }
.clearing { position: absolute; inset: 0; z-index: 0; opacity: 0; background: linear-gradient(180deg, var(--haze-2) 0%, var(--haze-3) 70%); }
.hero-copy { text-align: center; padding: 6svh 0 0; }
.hero-copy h1 {
  font: 250 clamp(40px, 6vw, 76px)/1.02 var(--display);
  letter-spacing: -0.03em; margin: 0 auto 20px; max-width: 14em; text-wrap: balance;
}
.hero-copy h1 em { font-style: normal; font-weight: 500; display: block; }
.lead { font-size: 19px; line-height: 1.5; color: var(--band-soft); max-width: 27em; margin: 0 auto 28px; text-wrap: pretty; }
.hero-phone {
  position: absolute; z-index: 1; left: 50%; top: 50%;
  transform: translate(-50%, calc(50svh - 44%));
}
.hero-phone .phone { --pw: clamp(210px, min(64vw, calc((100svh - 120px) / 2.3)), 320px); }

/* Second and third sections */
.band { padding: 88px 0; }
.band h2 {
  font: 300 clamp(32px, 4.4vw, 52px)/1.08 var(--display);
  letter-spacing: -0.02em; margin: 0 0 18px; max-width: 18em; text-wrap: balance;
}
.band p { max-width: 36em; font-size: 18px; color: var(--band-soft); }
.sky-clear p, .sky-clear .soft { color: var(--clear-soft); }
.sky-clear a:not(.btn) { color: #ffffff; }

/* Forecast: the taper plan drawn like a ten-day forecast. */
.forecast { list-style: none; margin: 32px 0 12px; padding: 0; max-width: 640px; }
.forecast li {
  display: grid; grid-template-columns: 4.8em 2.6em 1fr 2.6em; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid rgba(27, 25, 34, 0.18);
  font-variant-numeric: tabular-nums;
}
.forecast li:last-child { border-bottom: 0; }
.forecast .wk { font: 500 16px/1 var(--display); }
.forecast .hi { text-align: right; font-weight: 600; }
.forecast .lo { color: var(--band-soft); }
.track { position: relative; height: 6px; border-radius: 3px; background: rgba(27, 25, 34, 0.12); }
.track b {
  position: absolute; top: 0; bottom: 0; border-radius: 3px;
  background: linear-gradient(90deg, #2b78c9, #7d7590);
}
@media (prefers-color-scheme: dark) {
  .forecast li { border-color: rgba(255, 255, 255, 0.14); }
  .track { background: rgba(255, 255, 255, 0.14); }
  .track b { background: linear-gradient(90deg, #6fa8e6, #b4a9b8); }
}
.forecast-note { font-size: 14px !important; }

.cols { display: grid; gap: 40px; }
@media (min-width: 900px) { .cols { grid-template-columns: 1fr 1fr; gap: 64px; } }
.slope-phone { margin: 0; justify-self: center; text-align: center; }
.slope-phone figcaption { font-size: 15px; margin-top: 16px; color: var(--band-soft); }
.links { list-style: none; padding: 0; margin: 18px 0 0; }
.links li { border-top: 1px solid rgba(255, 255, 255, 0.35); }
.links li:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.35); }
.links a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px 0; text-decoration: none; font: 400 20px/1.3 var(--display);
}
.links a span { font: 15px/1.4 var(--text); opacity: 0.85; text-align: right; }
.links a:hover { text-decoration: underline; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 28px; }

/* ---------- What is different: one scene per difference ---------- */
.diff { color: var(--band-ink); }
.diff-intro { background: linear-gradient(180deg, var(--s0), var(--s1)); padding: 120px 0 72px; text-align: center; }
.diff-intro h2 {
  font: 250 clamp(38px, 6vw, 76px)/1.04 var(--display);
  letter-spacing: -0.03em; margin: 0 auto; max-width: 13em; text-wrap: balance;
}
.diff-intro h2 em { display: block; font-style: normal; font-weight: 500; margin-top: 0.2em; }

.panel .stage { position: relative; overflow: hidden; padding: 72px 0 88px; }
.p1 .stage { background: linear-gradient(180deg, var(--s1), var(--s2)); }
.p2 .stage { background: linear-gradient(180deg, var(--s2), var(--s3)); }
.p3 .stage { background: linear-gradient(180deg, var(--s3), var(--s4)); }
.p4 .stage { background: linear-gradient(180deg, var(--s4), var(--s5)); }
.p5 .stage { background: linear-gradient(180deg, var(--s5) 0, var(--clear-2) 96px, var(--clear-1) 100%); color: var(--clear-ink); padding-top: 136px; }
.p5 .haze { position: absolute; inset: 0; z-index: 0; background: var(--s5); opacity: 0; }
.p5 .clouds i { background: rgba(255, 255, 255, 0.16); }

.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; justify-items: center; text-align: center; }
.panel-copy h3 {
  font: 300 clamp(34px, 5vw, 60px)/1.05 var(--display);
  letter-spacing: -0.025em; margin: 0 auto 14px; max-width: 11em; text-wrap: balance;
}
.panel-copy p { font-size: 19px; line-height: 1.5; color: var(--band-soft); max-width: 24em; margin: 0 auto; text-wrap: pretty; }
.p5 .panel-copy p { color: var(--clear-soft); }
.panel-visual { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; width: 100%; }
.panel-visual .phone { --pw: clamp(200px, min(60vw, calc((100svh - 360px) / 2.3)), 280px); }
@media (min-width: 900px) {
  .panel-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; justify-items: start; text-align: left; }
  .panel-copy h3, .panel-copy p { margin-left: 0; }
  .panel-copy p { font-size: 21px; }
  .p2 .panel-copy, .p4 .panel-copy { order: 2; }
  .panel-visual { justify-self: center; }
  .panel-visual .phone { --pw: clamp(240px, calc((100svh - 140px) / 2.3), 320px); }
}

/* Logging: a tap on the widget's Log button, then a cloud lifts off it. */
.tap, .lift { position: absolute; left: 27%; top: 24.5%; pointer-events: none; opacity: 0; }
.tap { width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; box-shadow: 0 0 0 2px #ffffff, 0 0 18px rgba(255, 255, 255, 0.8); }
.lift { width: 90px; height: 44px; margin: -22px 0 0 -45px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); filter: blur(10px); }

/* Data: a lock drawn in code. */
.lock { margin: 0; text-align: center; color: var(--band-ink); }
.lock svg { width: clamp(150px, 40vw, 220px); height: auto; overflow: visible; }
.lock-shackle, .lock-body, .lock-hole { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lock-glow { fill: rgba(255, 255, 255, 0.45); transform-box: fill-box; transform-origin: center; }
@media (prefers-color-scheme: dark) { .lock-glow { fill: rgba(255, 255, 255, 0.08); } }
.lock figcaption { font: 600 15px/1.3 var(--display); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 18px; }

/* Price: one number, three things it buys. */
.price-card {
  width: 420px; max-width: 100%; padding: 30px 28px; border-radius: 28px; text-align: left;
  background: rgba(255, 255, 255, 0.5); box-shadow: inset 0 0 0 1px rgba(27, 25, 34, 0.08), 0 40px 70px -50px rgba(20, 30, 60, 0.6);
}
@media (prefers-color-scheme: dark) { .price-card { background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); } }
.price-big { margin: 0; font: 200 clamp(60px, 14vw, 88px)/1 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.price-big .once { font: 500 20px/1 var(--display); letter-spacing: 0; vertical-align: 0.9em; margin-left: 6px; }
.price-for { margin: 14px 0 6px; font: 600 16px/1.4 var(--display); }
.price-list { list-style: none; margin: 0; padding: 0; }
.price-list li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(27, 25, 34, 0.12); font-size: 17px; line-height: 1.45; }
@media (prefers-color-scheme: dark) { .price-list li { border-color: rgba(255, 255, 255, 0.14); } }
.price-list svg { width: 20px; height: 20px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.price-fine { margin: 10px 0 0; font-size: 15px; color: var(--band-soft); }

/* A bad day: the week plays out, one day goes over, one is held. */
.wkplay { margin: 0; width: 400px; max-width: 100%; }
.wk-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 200px; margin-bottom: 30px; }
.wkplay .d { position: relative; height: var(--h); }
.wkplay .f { position: absolute; inset: 0; border-radius: 10px 10px 4px 4px; background: rgba(27, 25, 34, 0.16); transform-origin: bottom; }
.wkplay .n { position: absolute; left: 0; right: 0; top: 100%; padding-top: 8px; font: 500 15px/1 var(--display); text-align: center; font-variant-numeric: tabular-nums; }
.wkplay .o { position: absolute; left: 0; right: 0; bottom: 100%; height: 22%; border-radius: 10px 10px 2px 2px; background: #7d7590; transform-origin: bottom; }
.wkplay .held .f { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.wkplay .tag { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); font: 600 13px/1 var(--display); white-space: nowrap; }
.wkplay .over .tag { bottom: calc(122% + 10px); }
.wk-zero { position: relative; height: 44px; }
.wk-zero .line { position: absolute; left: 0; right: 0; top: 7px; border-top: 1.5px dashed currentColor; opacity: 0.45; }
.wk-zero .dot { position: absolute; right: 22%; top: 0; width: 14px; height: 14px; border-radius: 50%; background: currentColor; }
.wk-zero .lbl { position: absolute; right: 0; top: 24px; font: 600 14px/1 var(--display); }
.wk-zero .lbl b { font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .wkplay .f { background: rgba(255, 255, 255, 0.2); }
  .wkplay .o { background: #b4a9b8; }
}

/* ---------- Free vs the plan: two columns, nothing else compared ---------- */
.plans { background: var(--clear-1); color: var(--clear-ink); padding: 112px 0 96px; scroll-margin-top: 0; }
.plans h2 {
  font: 300 clamp(34px, 5vw, 60px)/1.05 var(--display);
  letter-spacing: -0.025em; margin: 0 0 40px; max-width: 14em; text-wrap: balance;
}
.plans-card { max-width: 760px; background: #fbfcfe; border-radius: 28px; padding: 8px 28px 4px; box-shadow: 0 50px 90px -60px rgba(4, 16, 40, 0.8); }
.plans-table { width: 100%; margin: 0; border-collapse: collapse; font-size: 17px; }
.plans-table th, .plans-table td { padding: 20px 0; border-bottom: 1px solid #dde6f0; color: #1b1922; vertical-align: middle; }
.plans-table tbody tr:last-child > * { border-bottom: 0; }
.plans-table tbody th { text-align: left; font-weight: 400; line-height: 1.45; padding-right: 16px; }
.plans-table thead th { width: 7.5em; text-align: center; font: 500 22px/1.2 var(--display); padding-top: 24px; }
.plans-table thead th small { display: block; margin-top: 4px; font: 400 14px/1.3 var(--text); color: #45414c; }
.plans-table td { text-align: center; }
.plans-table .yes { width: 22px; height: 22px; fill: none; stroke: #1f5fa3; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.plans-table .no { display: inline-block; width: 14px; height: 2px; border-radius: 1px; background: #7d8999; vertical-align: middle; }
.plans-note { font-size: 17px; line-height: 1.55; color: var(--clear-soft); max-width: 38em; margin: 26px 0 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.price-link { margin: 12px 0 0; font: 600 16px/1.4 var(--display); }
.price-link a { color: inherit; }
@media (max-width: 560px) {
  .plans-card { padding: 4px 18px 0; border-radius: 22px; }
  .plans-table { font-size: 16px; }
  .plans-table thead th { width: 4.6em; font-size: 19px; }
  .plans-table thead th small { font-size: 13px; }
  .plans-table th, .plans-table td { padding: 16px 0; }
}
@media (prefers-color-scheme: dark) {
  .plans-card { background: #0d2140; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
  .plans-table th, .plans-table td { color: #f3f6fa; border-color: rgba(255, 255, 255, 0.12); }
  .plans-table thead th small { color: #b9c3d1; }
  .plans-table .yes { stroke: #8cc0f0; }
  .plans-table .no { background: #7488a6; }
}

/* ---------- Scroll scenes (CSS scroll timelines; no JavaScript) ----------
   Each scene is taller than the screen and its stage is sticky, so scrolling
   scrubs the scene. At scroll 0 the hero is in its finished state, so nothing
   above the fold waits to paint. Without support, or with reduced motion,
   scenes stay unpinned and show their end state. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .scene { view-timeline: --scene block; }
    .clearing, .cg-l, .cg-r, .hero-copy, .hero-phone,
    .panel-visual, .panel-copy h3, .panel-copy p,
    .tap, .lift, .lock-body, .lock-shackle, .lock-hole, .lock-glow, .lock figcaption,
    .price-list li, .price-list path, .price-fine,
    .wkplay .f, .wkplay .o, .wkplay .n, .wkplay .tag, .wk-zero .dot, .wk-zero b,
    .p5 .haze {
      animation-timing-function: linear; animation-fill-mode: both; animation-timeline: --scene;
    }

    /* Panels. Ranges are in "cover" so the same beats work pinned (desktop) and
       unpinned (phones). Pinned, a 185vh panel holds the screen from cover 35% to 65%.
       Order: visual first, then the headline, then the line. */
    .panel-visual { animation-name: arrive-big; animation-range: cover 9% cover 36%; }
    .panel-copy h3 { animation-name: arrive; animation-range: cover 19% cover 38%; }
    .panel-copy p { animation-name: arrive; animation-range: cover 26% cover 40%; }

    .tap { animation-name: tap; animation-range: cover 41% cover 48%; }
    .lift { animation-name: puff; animation-range: cover 45% cover 59%; }

    .lock-body { stroke-dasharray: 1; animation-name: draw; animation-range: cover 16% cover 40%; }
    .lock-shackle { stroke-dasharray: 1; animation-name: draw, shut; animation-range: cover 24% cover 43%, cover 44% cover 48%; }
    .lock-hole { animation-name: fade-in; animation-range: cover 47% cover 50%; }
    .lock-glow { animation-name: glow; animation-range: cover 47% cover 53%; }
    .lock figcaption { animation-name: arrive; animation-range: cover 49% cover 54%; }

    .price-list path { stroke-dasharray: 1; animation-name: draw; }
    .price-list li { animation-name: arrive; }
    .price-list li:nth-child(1), .price-list li:nth-child(1) path { animation-range: cover 38% cover 42%; }
    .price-list li:nth-child(2), .price-list li:nth-child(2) path { animation-range: cover 43% cover 47%; }
    .price-list li:nth-child(3), .price-list li:nth-child(3) path { animation-range: cover 48% cover 52%; }
    .price-fine { animation-name: fade-in; animation-range: cover 52% cover 55%; }

    .wkplay .f, .wkplay .o { animation-name: grow-up; }
    .wkplay .n, .wkplay .tag, .wk-zero b { animation-name: fade-in; }
    .wkplay .d:nth-child(1) .f, .wkplay .d:nth-child(1) .n { animation-range: cover 35% cover 37%; }
    .wkplay .d:nth-child(2) .f, .wkplay .d:nth-child(2) .n { animation-range: cover 37% cover 39%; }
    .wkplay .d:nth-child(3) .f, .wkplay .d:nth-child(3) .n { animation-range: cover 39% cover 41%; }
    .wkplay .o { animation-range: cover 41.5% cover 44%; }
    .wkplay .over .tag { animation-range: cover 43% cover 45%; }
    .wkplay .d:nth-child(4) .f, .wkplay .d:nth-child(4) .n { animation-range: cover 45% cover 47.5%; }
    .wkplay .held .tag { animation-range: cover 47% cover 49%; }
    .wk-zero .dot { animation-name: step-back; animation-range: cover 47.5% cover 50.5%; }
    .wk-zero b { animation-range: cover 49% cover 51%; }
    .wkplay .d:nth-child(5) .f, .wkplay .d:nth-child(5) .n { animation-range: cover 50.5% cover 53%; }
    .wkplay .d:nth-child(6) .f, .wkplay .d:nth-child(6) .n { animation-range: cover 52.5% cover 55%; }

    /* Weather: the haze over the last scene burns off, then the words arrive. */
    .p5 .haze { animation-name: burn-off; animation-range: cover 0% cover 44%; }
    .p5 .panel-copy h3 { animation-range: cover 43% cover 48%; }
    .p5 .panel-copy p { animation-range: cover 45% cover 51%; }
    .p5 .cg-l { animation-name: part-left; animation-range: cover 18% cover 59%; }
    .p5 .cg-r { animation-name: part-right; animation-range: cover 18% cover 59%; }

    /* Phones: text sits above the visual, so it arrives first. */
    @media (max-width: 899px) {
      .panel-copy h3 { animation-range: cover 4% cover 20%; }
      .panel-copy p { animation-range: cover 8% cover 24%; }
      .panel-visual { animation-range: cover 12% cover 34%; }
      .p5 .haze { animation-range: cover 0% cover 22%; }
      .p5 .panel-copy h3 { animation-range: cover 18% cover 28%; }
      .p5 .panel-copy p { animation-range: cover 20% cover 30%; }
    }

    /* Small reveals that don't pin: the intro answer, the pace phone, the forecast bars. */
    .diff-intro em, .slope-phone {
      animation: arrive linear both; animation-timeline: view(); animation-range: entry 30% cover 45%;
    }
    .forecast li .track b {
      transform-origin: right; animation: grow-left linear both; animation-timeline: view(); animation-range: entry 60% cover 40%;
    }
  }

  /* Hero: pinned wherever the stage fits. At scroll 0 everything is in its
     resting, visible state, so the headline and phone paint at once. */
  @media (prefers-reduced-motion: no-preference) and (min-height: 560px) {
    .hero-scene { height: 170vh; }
    .hero-scene > .stage { position: sticky; top: 0; height: 100svh; }
    .hero-copy { animation-name: lift-away; animation-range: contain 0% contain 45%; }
    .hero-phone { animation-name: phone-rise; animation-range: contain 0% contain 75%; }
    .clearing { animation-name: fade-in; animation-range: contain 10% contain 100%; }
    .hero-scene .cg-l { animation-name: part-left; animation-range: contain 0% contain 90%; }
    .hero-scene .cg-r { animation-name: part-right; animation-range: contain 0% contain 90%; }
  }

  /* Panels pin where text and visual fit side by side on one screen. */
  @media (prefers-reduced-motion: no-preference) and (min-width: 900px) and (min-height: 640px) {
    .panel { height: 185vh; }
    .panel > .stage { position: sticky; top: 0; height: 100svh; padding: 0; display: grid; align-items: center; }
  }
}

@keyframes lift-away { to { opacity: 0; transform: translateY(-14svh); } }
@keyframes phone-rise { to { transform: translate(-50%, -48%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes part-left { to { transform: translateX(-40vw); opacity: 0.15; } }
@keyframes part-right { to { transform: translateX(40vw); opacity: 0.15; } }
@keyframes arrive { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
@keyframes arrive-big { from { opacity: 0; transform: translateY(90px) scale(0.88); } to { opacity: 1; transform: none; } }
@keyframes tap {
  0% { opacity: 0; transform: scale(0.4); }
  35% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.9); }
}
@keyframes puff {
  0% { opacity: 0; transform: translateY(0) scale(0.5); }
  20% { opacity: 0.95; }
  100% { opacity: 0; transform: translateY(-170px) scale(1.7); }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes shut { from { transform: translateY(-16px); } to { transform: none; } }
@keyframes glow { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes grow-up { from { transform: scaleY(0); } to { transform: none; } }
@keyframes grow-left { from { transform: scaleX(0); } to { transform: none; } }
@keyframes step-back { from { transform: translateX(-56px); } to { transform: none; } }
@keyframes burn-off { from { opacity: 1; } to { opacity: 0; } }

/* ---------- Reading pages (guides, tools, legal) ---------- */
.page-sky {
  background: linear-gradient(180deg, var(--haze-1) 0%, var(--haze-2) 55%, var(--ground) 100%);
  color: var(--band-ink);
}
.page-sky.clear { background: linear-gradient(180deg, var(--mid-2) 0%, var(--mid-3) 55%, var(--ground) 100%); }
.page-head { max-width: 760px; margin: 0 auto; padding: 36px 20px 56px; }
.page-head h1 {
  font: 300 clamp(36px, 5.4vw, 58px)/1.06 var(--display);
  letter-spacing: -0.025em; margin: 0 0 16px; text-wrap: balance;
}
.page-head .answer { font-size: 20px; line-height: 1.5; margin: 0; max-width: 34em; }
.page-head .meta { font-size: 14px; color: var(--band-soft); margin-top: 18px; }

main { max-width: 760px; margin: 0 auto; padding: 8px 20px 80px; }
main h1 { font: 300 clamp(34px, 5vw, 48px)/1.1 var(--display); letter-spacing: -0.02em; margin: 32px 0 12px; }
main h2 { font: 500 26px/1.25 var(--display); letter-spacing: -0.01em; margin: 56px 0 12px; text-wrap: balance; }
main h3 { font: 600 19px/1.35 var(--display); margin: 32px 0 6px; }
main p, main li { max-width: 68ch; }
main p, main li, main td { color: var(--ink); }
main .soft, .updated { color: var(--soft); }
main ul, main ol { padding-left: 1.2em; }
main li { margin: 6px 0; }
.updated { font-size: 14px; }
main > header a { color: var(--ink); text-decoration: none; font: 600 18px var(--display); }

.takeaways { margin: 8px 0 40px; padding: 22px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.takeaways h2 { margin: 0 0 10px; font-size: 20px; }
.takeaways ul { margin: 0; }

table { border-collapse: collapse; width: 100%; margin: 20px 0; font-size: 16px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (max-width: 480px) { table { font-size: 15px; } th, td { padding-right: 8px; overflow-wrap: anywhere; } }
th { font: 600 14px/1.4 var(--display); color: var(--soft); }

blockquote { margin: 24px 0; padding: 0 0 0 20px; border-left: 1px solid var(--line); }
blockquote p { font: 300 22px/1.45 var(--display); margin: 0 0 6px; }
blockquote cite { font-size: 14px; font-style: normal; color: var(--soft); }

.sources { margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15px; }
.sources h2 { margin-top: 0; font-size: 20px; }
.sources li { color: var(--soft); }

.app-hand {
  margin: 56px 0 0; padding: 28px; border-radius: 24px;
  background: linear-gradient(160deg, var(--clear-1), #2a6cb4); color: #ffffff;
}
.app-hand h2 { margin: 0 0 8px; color: #ffffff; }
.app-hand p { color: #e6f0fb; margin: 0 0 18px; }
@media (prefers-color-scheme: dark) { .app-hand { background: linear-gradient(160deg, #123866, #1f4f86); } }

.help-line { font-size: 15px; color: var(--soft); }

/* ---------- Tools ---------- */
.tool { margin: 8px 0 24px; }
.field { display: grid; gap: 8px; margin: 0 0 22px; }
.field label, .field legend { font: 600 15px/1.3 var(--display); }
.field input[type="number"], .field input[type="date"] {
  font: 400 22px/1 var(--text); padding: 12px 14px; min-height: 52px; width: 100%; max-width: 260px;
  border: 1.5px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--link); }
fieldset.field { border: 0; padding: 0; margin: 0 0 22px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label {
  display: inline-flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 8px 18px;
  border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; font: 500 16px/1.25 var(--text);
}
.seg label small { font-size: 13px; color: var(--soft); font-weight: 400; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + label { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.seg input:focus-visible + label { outline: 3px solid var(--link); outline-offset: 2px; }
.result { margin-top: 28px; }
.result .big { font: 250 clamp(40px, 7vw, 64px)/1 var(--display); letter-spacing: -0.03em; margin: 0 0 6px; }
.error { color: #b3261e; font-size: 15px; min-height: 1.4em; }
@media (prefers-color-scheme: dark) { .error { color: #ffb4ab; } }

.counter { text-align: center; padding: 28px 0 8px; position: relative; }
.counter .num { font: 200 clamp(96px, 22vw, 168px)/1 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.counter .lbl { font: 500 20px/1.3 var(--display); margin: 4px 0 26px; }
.counter .btn { min-width: 220px; justify-content: center; font-size: 19px; }
.counter .row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 14px; }
.counter .row .btn { min-width: 0; font-size: 15px; }
.puff { position: absolute; left: 50%; top: 40%; width: 120px; height: 60px; border-radius: 50%;
  background: rgba(150, 160, 180, 0.45); filter: blur(14px); pointer-events: none;
  animation: rise 1800ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes rise {
  from { transform: translate(-50%, 0) scale(0.6); opacity: 0.9; }
  to { transform: translate(-50%, -160px) scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .puff { animation-duration: 1ms; } }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 120px; margin: 28px 0 8px; }
.week div { background: var(--line); border-radius: 6px 6px 2px 2px; min-height: 3px; position: relative; }
.week div.today { background: var(--link); }
.week-labels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; font-size: 13px; color: var(--soft); text-align: center; }

/* ---------- Footer ---------- */
footer, .foot {
  margin-top: 0; padding: 32px 20px 48px; font-size: 14px; color: var(--soft);
  max-width: 1120px; margin-left: auto; margin-right: auto;
}
main footer { padding: 24px 0 0; margin-top: 56px; border-top: 1px solid var(--line); max-width: none; }
footer a, .foot p:last-child a { margin-right: 18px; }
.foot p { max-width: 60em; }

@media print {
  .bar, .foot, .app-hand, .no-print, .clouds { display: none !important; }
  body { background: #fff; color: #000; }
  .page-sky { background: none; }
}

.btn:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }

/* Breathing pacer (cravings page): 4 s in, 6 s out, ten times. */
.breathe { margin: 32px 0; padding: 28px 24px; border-radius: 24px; background: linear-gradient(170deg, var(--haze-2), var(--mid-3)); color: var(--band-ink); text-align: center; }
.breathe h3 { margin-top: 0; }
.breathe .soft { color: var(--band-soft); margin: 0 auto 8px; }
.breathe-stage { display: grid; place-items: center; min-height: 230px; }
.breathe-orb { width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffffff, rgba(255,255,255,0.35) 70%); filter: blur(1px); transform: scale(1); transition: transform 4s cubic-bezier(0.37, 0, 0.63, 1); }
.breathe-orb.in { transform: scale(1.9); }
.breathe-orb.out { transform: scale(1); transition-duration: 6s; }
.breathe-orb.still { transition: none; }
.breathe-cue { font: 500 18px/1.4 var(--display); margin: 12px 0 18px; min-height: 1.4em; }

caption { text-align: left; font: 600 14px/1.4 var(--display); color: var(--soft); padding-bottom: 6px; }

/* Real app screenshots in guides: phone on the left, a plain caption beside it. */
.shot { display: grid; grid-template-columns: 128px 1fr; gap: 18px; align-items: center; margin: 36px 0; }
.shot img { border-radius: 18px; box-shadow: 0 18px 36px -24px rgba(20, 30, 60, 0.6); }
.shot figcaption { font-size: 15px; line-height: 1.5; color: var(--soft); max-width: 42ch; }
@media (min-width: 640px) { .shot { grid-template-columns: 168px 1fr; gap: 28px; } }
.app-hand .shot { margin: 4px 0 22px; }
.app-hand .shot figcaption { color: #e6f0fb; }
.app-hand .cta-row { margin-top: 0; }

/* Mid-guide pointer to the free tool that fits the page: a line, not a banner. */
.tool-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin: 36px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tool-cta p { margin: 0; flex: 1 1 20em; }
.tool-cta .btn { min-height: 44px; font-size: 16px; }

/* ---------- Table of contents and guides index ---------- */
.toc { margin: 0 0 40px; }
.toc .toc-title { font: 600 14px/1.4 var(--display); letter-spacing: 0.04em; text-transform: uppercase; color: var(--soft); margin: 0 0 6px; }
.toc ol { margin: 0; }
.toc li { margin: 8px 0; line-height: 1.45; }
.guide-list { list-style: none; padding: 0 !important; }
.guide-list li { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--line); }
.guide-list a { font: 500 19px/1.35 var(--display); }
.guide-list p { margin: 4px 0 0; color: var(--soft); }

/* ---------- Founder: why I built it ---------- */
.founder { background: var(--clear-1); color: var(--clear-ink); padding: 0 0 112px; }
.founder .wrap { position: relative; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.founder-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .founder-grid { grid-template-columns: 360px 1fr; gap: 72px; } }
.founder figure { margin: 0; }
.founder img { display: block; width: 100%; max-width: 360px; height: auto; border-radius: 24px; box-shadow: 0 50px 90px -60px rgba(4, 16, 40, 0.8); }
@media (max-width: 560px) { .founder img { max-width: 300px; } }
.founder figcaption { margin-top: 12px; font-size: 15px; color: var(--clear-soft); }
.founder h2 { font: 300 clamp(34px, 5vw, 60px)/1.05 var(--display); letter-spacing: -0.025em; margin: 0 0 24px; text-wrap: balance; }
.founder p { font-size: 19px; line-height: 1.6; color: var(--clear-soft); max-width: 32em; margin: 0 0 18px; }
.founder .lead { font-size: 22px; line-height: 1.5; color: var(--clear-ink); }
.founder .more { margin-top: 26px; font: 600 17px/1.4 var(--display); }
.founder .more a { color: var(--clear-ink); }
