/* Methodize site. One pinned canvas; the page's scroll position is the clock. Captions are real
   DOM over it: on wide screens they sit in a side column beside the picture, on phones in the
   lower part of the screen. body.static (reduced motion or ?static) swaps all of it for a plain
   stacked page. Colours, type and radii follow the app (resources/css/app.css, tailwind.config.js). */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/figtree/figtree-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/figtree/figtree-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/figtree/figtree-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/figtree/figtree-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/fraunces/fraunces-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/fraunces/fraunces-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --canvas: 252 252 251; --surface: 255 255 255; --line: 237 235 233;
  --ink: 12 10 9; --copy: 87 83 78; --muted: 120 113 108;
  --accent: 30 58 138; --accent-strong: 23 37 84; --accent-fg: 255 255 255;
  --green: 22 163 74;
  --shadow-card: 0 1px 3px 0 rgb(12 10 9 / 0.06), 0 8px 24px -6px rgb(12 10 9 / 0.1);
  --shadow-raised: 0 4px 6px -1px rgb(12 10 9 / 0.08), 0 12px 32px -8px rgb(12 10 9 / 0.12);
  --sans: Figtree, ui-sans-serif, system-ui, sans-serif;
  --display: Fraunces, Georgia, Cambria, 'Times New Roman', Times, serif;
  --r-control: 0.625rem; --r-card: 1rem;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --side-l: max(20px, calc(env(safe-area-inset-left, 0px) + 16px));
  --side-r: max(20px, calc(env(safe-area-inset-right, 0px) + 16px));
  --low: max(4.5vh, calc(env(safe-area-inset-bottom, 0px) + 16px));
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: rgb(var(--canvas)); }
body {
  margin: 0; background: rgb(var(--canvas)); color: rgb(var(--ink)); font-family: var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; overflow-x: hidden;
}
a { color: inherit; }
:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 2px; }

#stage { position: fixed; left: 0; top: 0; display: block; }
#bloom { position: fixed; z-index: 1; left: 0; top: 0; display: block; pointer-events: none; mix-blend-mode: screen; }
#track { height: calc(var(--screens, 14) * 100vh); height: calc(var(--screens, 14) * 100lvh); }
#lvh { position: fixed; left: 0; top: 0; width: 0; height: 100vh; height: 100lvh; visibility: hidden; pointer-events: none; }

/* skip links: hidden until focused */
.skip { position: fixed; z-index: 20; top: 8px; left: 8px; display: flex; gap: 8px; }
.skip a {
  position: absolute; left: -9999px; padding: 10px 14px; border-radius: var(--r-control);
  background: rgb(var(--accent)); color: rgb(var(--accent-fg)); font: 600 14px/1 var(--sans); text-decoration: none; white-space: nowrap;
}
.skip a:focus { position: static; }

/* header: brand and the always-visible Log in */
.site-head {
  position: fixed; z-index: 10; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--side-r) 12px var(--side-l);
  background: rgb(var(--canvas) / 0.96);
  border-bottom: 1px solid rgb(var(--line) / 0.8);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; font: 700 18px/1 var(--sans); letter-spacing: -0.01em; color: rgb(var(--ink)); border-radius: var(--r-control); }
.brand img { display: block; width: 30px; height: auto; }

/* buttons, as the app's Button variants: primary = accent fill, secondary = surface + line */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r-control); font: 600 15px/1 var(--sans); text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-card); transition: background-color .15s, color .15s;
}
.btn.primary { background: rgb(var(--accent)); color: rgb(var(--accent-fg)); }
.btn.primary:hover { background: rgb(var(--accent-strong)); }
.btn.secondary { background: rgb(var(--surface)); color: rgb(var(--copy)); border-color: rgb(var(--line)); }
.btn.secondary:hover { background: rgb(var(--canvas)); color: rgb(var(--ink)); }
.btn svg, .links svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn em, .links em { font-style: normal; color: rgb(var(--muted)); font-weight: 500; }
.btn.primary em { color: rgb(var(--accent-fg) / 0.75); }

#progress { position: fixed; z-index: 11; left: 0; right: 0; top: 0; height: 2px; pointer-events: none; }
#progress i { display: block; height: 100%; background: rgb(var(--accent)); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
#mark {
  position: fixed; z-index: 3; right: var(--side-r); bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  display: none; align-items: center; gap: 10px; color: rgb(var(--muted)); pointer-events: none;
  font: 600 12px/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
#mark b { color: rgb(var(--accent)); font-weight: 600; }

/* ── captions (opacity/offset written per frame from the film time) ───────────── */
#story { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.cap { position: absolute; left: var(--side-l); right: var(--side-r); bottom: var(--low); margin: 0; opacity: 0; visibility: hidden; will-change: opacity, transform; }
.cap.live { pointer-events: auto; }
.cap h1, .cap h2, .cap p, .cap ol { margin: 0; }

.eyebrow, .card .label { font: 600 12px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: rgb(var(--accent)); }
.eyebrow { margin-bottom: 14px !important; }
.hero .name { margin-bottom: 14px; font: 600 clamp(40px, 9.6vw, 72px)/1.04 var(--display); letter-spacing: -0.02em; color: rgb(var(--accent)); text-wrap: balance; }
.lede { font: 400 clamp(16px, 1.8vw, 19px)/1.5 var(--sans); color: rgb(var(--copy)); text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 22px !important; }
.hint { display: inline-flex; align-items: center; gap: 12px; font: 500 14px/1 var(--sans); color: rgb(var(--muted)); }
.hint i { display: block; width: 1px; height: 28px; background: rgb(var(--accent) / 0.7); transform-origin: 50% 0; animation: hint 1.9s var(--ease-out) infinite; }
@keyframes hint { 0% { transform: scaleY(0); opacity: 1; } 55% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* caption card: a surface card, like the app's */
.card { padding: 20px 22px 22px; background: rgb(var(--surface) / 0.96); border-radius: var(--r-card); box-shadow: var(--shadow-raised); }
.card .label { margin-bottom: 10px; }
.card .title { font: 600 clamp(22px, 2.4vw, 30px)/1.2 var(--display); letter-spacing: -0.015em; color: rgb(var(--accent)); text-wrap: balance; }
.card .body { margin-top: 8px; font: 400 15.5px/1.55 var(--sans); color: rgb(var(--copy)); }
.card .note { margin-top: 12px !important; padding-top: 10px; border-top: 1px dashed rgb(var(--line)); font: 500 12.5px/1.4 var(--sans); color: rgb(var(--muted)); }
.steps { list-style: none; padding: 0; margin-top: 14px !important; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: 30px 1fr; gap: 1px 12px; opacity: 0.45; transition: opacity .35s var(--ease-out); }
.steps li.on { opacity: 1; }
.steps .k { grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgb(var(--accent) / 0.1); color: rgb(var(--accent)); font: 700 13px/1 var(--sans); }
.steps li.on .k { background: rgb(var(--accent)); color: rgb(var(--accent-fg)); }
.steps b { font: 600 15.5px/1.3 var(--sans); color: rgb(var(--ink)); }
.steps span:not(.k) { font: 400 14px/1.45 var(--sans); color: rgb(var(--copy)); }

/* closing block */
.end { -webkit-user-select: text; user-select: text; }
.end-mark { display: block; width: 48px; height: auto; margin-bottom: 18px; }
.end .thanks { margin-bottom: 10px; font: 600 clamp(34px, 7vw, 56px)/1.05 var(--display); letter-spacing: -0.02em; color: rgb(var(--accent)); text-wrap: balance; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 22px; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin-top: 12px !important; }
.links a, .links button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 2px;
  font: 600 14.5px/1 var(--sans); color: rgb(var(--copy)); text-decoration: none;
  background: none; border: 0; border-radius: 6px; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.links span { text-decoration: underline; text-decoration-color: rgb(var(--accent) / 0.35); text-decoration-thickness: 1.5px; text-underline-offset: 0.35em; }
.links a:hover, .links button:hover { color: rgb(var(--accent)); }
.foot { margin-top: 12px !important; font: 400 12.5px/1.4 var(--sans); color: rgb(var(--muted)); }

/* wide screens: captions in a side column */
@media (orientation: landscape) and (min-width: 720px) {
  :root { --low: max(9vh, calc(env(safe-area-inset-bottom, 0px) + 22px)); }
  .cap.at-left { right: auto; left: max(5vw, var(--side-l)); width: min(400px, 30vw); }
  .cap.at-right { left: auto; right: max(5vw, var(--side-r)); width: min(400px, 30vw); }
  .cap.hero, .cap.end { bottom: auto; top: 50%; translate: 0 -46%; }
  #mark { display: flex; }
}
@media (orientation: landscape) and (max-height: 520px) {
  :root { --low: max(5vh, calc(env(safe-area-inset-bottom, 0px) + 12px)); }
  .hero .name { font-size: 40px; }
  .end .thanks { font-size: 30px; }
  .card { padding: 12px 16px 14px; }
  .card .body { font-size: 14px; }
  .site-head { padding-top: 6px; padding-bottom: 6px; }
}
/* phones: compact cards in the lower part */
@media (orientation: portrait) {
  .card { padding: 15px 17px 17px; }
  .card .title { font-size: 22px; }
  .card .body { font-size: 14.5px; line-height: 1.5; }
  .steps { gap: 7px; margin-top: 10px !important; }
  .steps span:not(.k) { font-size: 13.5px; }
  .site-head .btn { min-height: 40px; padding: 0 14px; }
  .cap.hero { bottom: var(--low); }
  .end .lede { font-size: 15.5px; }
}

/* ── static page (reduced motion / ?static) ───────────────────────────────────── */
body.static #stage, body.static #bloom, body.static #progress, body.static #mark, body.static #story, body.static #track { display: none; }
#static { max-width: 1120px; margin: 0 auto; padding: 96px 20px 80px; }
#static .sec { margin: 0 0 64px; }
#static figure { margin: 0 0 22px; }
#static canvas { display: block; width: 100%; border-radius: var(--r-card); background: rgb(var(--canvas)); box-shadow: inset 0 0 0 1px rgb(var(--line)); }
#static .cap { position: static; opacity: 1; visibility: visible; transform: none; translate: none; pointer-events: auto; max-width: 640px; }
#static .card { box-shadow: none; padding: 0; background: none; }
#static .steps li { opacity: 1; }
#static .banner { margin-bottom: 28px; font: 500 13px/1.5 var(--sans); color: rgb(var(--muted)); }
#static .banner a { color: rgb(var(--accent)); }
.noscript { padding: 110px 24px 40px; max-width: 640px; color: rgb(var(--ink)); font-family: var(--sans); }
.noscript h1 { font: 600 40px/1.1 var(--display); color: rgb(var(--accent)); }

@media (prefers-reduced-motion: reduce) { .hint i { animation: none; } .steps li, .btn { transition: none; } }
