/*
 * Team Walk website: a 3D story with words laid over it.
 * No cards. The words sit on a soft shaded edge of the screen whose colour
 * follows the time of day: morning mist by day, dusk by night.
 * --t is "how night it is" (0 day, 1 night), set by story.js as the clock moves (in steps of 0.02).
 */

:root {
  --t: 0.85;
  --pct: calc(var(--t) * 100%);

  /* brand: mobile/lib/app/app_theme.dart and the app icon */
  --sky: #0ea5e9;
  --sky-hi: #38bdf8;
  --violet: #7c3aed;
  --amber: #ffbe43;
  --green: #22c55e;
  --red: #ef4444;
  --trail: linear-gradient(90deg, #ffbe43 0%, #e39bd9 45%, #c384fb 70%, #9925ff 100%);

  --f-display: "Bricolage Grotesque", "Lexend", system-ui, sans-serif;
  --f-ui: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* words and the shade behind them, by day and by night */
  --ink: color-mix(in oklab, #f6f8fc var(--pct), #0d1c22);
  --ink-soft: color-mix(in oklab, rgba(236, 241, 248, 0.78) var(--pct), rgba(13, 28, 34, 0.74));
  --ink-faint: color-mix(in oklab, rgba(236, 241, 248, 0.55) var(--pct), rgba(13, 28, 34, 0.5));
  --shade: color-mix(in oklab, rgba(6, 9, 28, 0.86) var(--pct), rgba(250, 247, 240, 0.9));
  --shade-mid: color-mix(in oklab, rgba(6, 9, 28, 0.5) var(--pct), rgba(250, 247, 240, 0.55));
  --line: color-mix(in oklab, rgba(255, 255, 255, 0.16) var(--pct), rgba(13, 28, 34, 0.14));

  --gutter-l: max(24px, env(safe-area-inset-left, 0px));
  --gutter-r: max(24px, env(safe-area-inset-right, 0px));
  --col: min(520px, 42vw);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #0b1230;
  color: var(--ink);
  font-family: var(--f-ui);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--sky-hi); outline-offset: 3px; border-radius: 8px; }

.skip { position: fixed; left: 16px; top: -80px; z-index: 60; background: #fff; color: #0d1c22; padding: 10px 16px; border-radius: 12px; }
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

/* ---------- scene layers ---------- */
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; display: block; z-index: 0; }
.scrim {
  position: fixed; inset: 0 auto 0 0; z-index: 1; pointer-events: none;
  width: min(1000px, 70vw);
  background: linear-gradient(90deg, var(--shade) 0%, var(--shade) 22%, var(--shade-mid) 52%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent 92%); mask-image: linear-gradient(90deg, #000 40%, transparent 92%);
  transition: width .8s ease, background .8s ease;
  will-change: opacity;
}
.scrim.centered {
  inset: 0; width: 100vw;
  background: radial-gradient(60% 55% at 50% 48%, var(--shade-mid) 0%, transparent 75%);
  -webkit-mask-image: none; mask-image: none;
}
.bubbles { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
main, .footer { position: relative; z-index: 3; }
body.no-webgl #gl { display: none; }
body.no-webgl {
  background:
    radial-gradient(80% 60% at 75% 25%, color-mix(in oklab, #2a2160 var(--pct), #ffe2bf), transparent 70%),
    linear-gradient(180deg, color-mix(in oklab, #060a1f var(--pct), #58aeee), color-mix(in oklab, #141a42 var(--pct), #cbe8fb));
  background-attachment: fixed;
}

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-content: center; justify-items: center; gap: 22px;
  background: radial-gradient(60% 50% at 50% 45%, #1d2457 0%, #0b1230 60%, #060a1f 100%);
  color: #e8f1f2;
  transition: opacity 1s ease .2s, visibility 0s linear 1.2s;
}
.ready .loader { opacity: 0; visibility: hidden; }
.loader-mark { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.loader-mark img { border-radius: 22px; box-shadow: 0 0 50px rgba(153, 37, 255, .45); }
.loader-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: #ffbe43; border-right-color: #c384fb; animation: spin 1.4s linear infinite; }
.loader-text { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: #a8b8c4; }
.loader-bar { width: 180px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; background: var(--trail); transition: width .4s ease; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- nav ---------- */
.nav {
  position: fixed; z-index: 30; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 24px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) var(--gutter-r) 16px var(--gutter-l);
  color: var(--ink);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.brand img { border-radius: 9px; box-shadow: 0 0 22px rgba(153, 37, 255, .4); }
.nav-link { margin-left: auto; font-size: 15px; font-weight: 400; text-decoration: none; opacity: .8; }
.nav-link:hover { opacity: 1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 26px; border-radius: 999px;
  font: 500 16px/1 var(--f-ui); text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .25s ease, background .25s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn-primary { background: var(--sky); color: #031018; box-shadow: 0 8px 24px -10px rgba(14, 165, 233, .8), 0 0 calc(var(--t) * 30px) rgba(14, 165, 233, .5); }
.btn-primary:hover { background: var(--sky-hi); }
.btn-ghost { border-color: color-mix(in srgb, currentColor 40%, transparent); color: inherit; background: transparent; }

/* ---------- the step widget ---------- */
.hud {
  position: fixed; z-index: 25; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 14px;
  padding: 8px 20px 8px 8px; border-radius: 999px;
  /* no backdrop blur: blurring the 3D canvas behind it would have to be redone every frame */
  background: rgba(10, 16, 28, 0.88); color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  opacity: 0; transition: opacity .8s ease 1.2s;
}
.ready .hud { opacity: 1; }
.hud-ring { width: 48px; height: 48px; transform: rotate(-90deg); flex: none; }
.hud-ring circle { fill: none; stroke-width: 5.5; }
.hud-ring-bg { stroke: rgba(255, 255, 255, .12); }
.hud-ring-fg { stroke: url(#hudGrad); stroke-linecap: round; stroke-dasharray: 119.38; stroke-dashoffset: 119.38; filter: drop-shadow(0 0 4px rgba(168, 85, 247, .6)); }
.hud-ring-fg.done { stroke: #22c55e; }
.hud-steps { display: flex; flex-direction: column; line-height: 1.15; min-width: 118px; }
.hud-steps b { font-family: var(--f-mono); font-weight: 600; font-size: 20px; font-variant-numeric: tabular-nums; }
.hud-steps span { font-size: 11px; color: #a8b8c4; letter-spacing: .02em; }
.hud-sep { width: 1px; height: 30px; background: rgba(255, 255, 255, .14); }
.hud-time { display: flex; align-items: center; gap: 8px; }
.hud-time b { font-family: var(--f-mono); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.hud-orb { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 38% 38%, #fff3c4, #ffbe43 55%, #f59e0b); box-shadow: 0 0 12px rgba(255, 190, 67, .8); transition: background .6s, box-shadow .6s; }
.hud-orb.moon { background: radial-gradient(circle at 35% 35%, #ffffff, #cbd5e1 60%, #94a3b8); box-shadow: 0 0 12px rgba(226, 232, 240, .6); }
.hud-track { position: relative; width: 110px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .14); }
.hud-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 3px; background: var(--trail); transform-origin: 0 50%; transform: scaleX(0); will-change: transform; }

/* ---------- Sam's phone, with the app on it ---------- */
.phone {
  position: fixed; z-index: 6; right: max(4vw, var(--gutter-r)); bottom: 13vh;
  width: 268px; height: 548px; transform-origin: 100% 100%;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(40px) rotate(4deg) scale(var(--ps, 1));
  transition: opacity .5s ease, transform .7s cubic-bezier(.2, .9, .25, 1.1), visibility 0s linear .5s;
}
.phone.on { opacity: 1; visibility: visible; transform: translateY(0) rotate(-3deg) scale(var(--ps, 1)); transition: opacity .5s ease, transform .7s cubic-bezier(.2, .9, .25, 1.1), visibility 0s; }
.phone-body {
  position: absolute; inset: 0; border-radius: 42px; padding: 14px 12px;
  background: #0f1a1c; color: #e8f1f2; overflow: hidden;
  border: 7px solid #0a0d12; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .08), inset 0 0 0 1px rgba(255, 255, 255, .05);
  font-family: var(--f-ui);
}
.phone-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 10px; font-size: 12px; }
.phone-bar b { font-family: var(--f-mono); font-weight: 600; }
.phone-island { width: 72px; height: 20px; border-radius: 12px; background: #000; }
.phone-icons { display: flex; gap: 3px; align-items: flex-end; }
.phone-icons i { width: 4px; background: #e8f1f2; border-radius: 1px; }
.phone-icons i:nth-child(1) { height: 5px; } .phone-icons i:nth-child(2) { height: 8px; } .phone-icons i:nth-child(3) { height: 11px; }
.ps { display: none; flex-direction: column; gap: 12px; padding: 4px 8px; }
.phone[data-show="today"] .ps[data-screen="today"], .phone[data-show="league"] .ps[data-screen="league"], .phone[data-show="promo"] .ps[data-screen="promo"] { display: flex; }
.ps-kicker { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #94a3b8; }
.ps-hello { font-size: 19px; font-weight: 600; margin-top: -6px; }
.ps-ring { position: relative; width: 196px; height: 196px; margin: 2px auto 0; }
.ps-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ps-ring circle { fill: none; stroke-width: 15; }
.ps-ring .r-bg { stroke: rgba(255, 255, 255, .07); }
.ps-ring .r-fg { stroke: url(#phGrad); stroke-linecap: round; stroke-dasharray: 515.2; stroke-dashoffset: 515.2; filter: drop-shadow(0 0 8px rgba(124, 58, 237, .55)); }
.ps-ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ps-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #94a3b8; font-weight: 600; }
.ps-ring-in b { font-family: var(--f-mono); font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ps-goal { font-size: 12px; color: #94a3b8; }
.ps-chips { display: flex; gap: 8px; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px; background: #17292d; font-size: 11.5px; color: #cbd5e1; }
.chip svg { width: 13px; height: 13px; fill: #f59e0b; }
.chip b { color: #fff; font-weight: 600; }
.medal { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff2a8, #ffd700 45%, #b8860b); }
.medal.big { width: 30px; height: 30px; flex: none; }
.medal.silver { background: radial-gradient(circle at 35% 30%, #ffffff, #cbd5e1 45%, #64748b); }
.trophy { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff2a8, #ffd700 45%, #b8860b); }
.trophy svg { width: 19px; height: 19px; fill: #7c4a03; }
/* the streak chip pops when the count goes up */
.chip.bump { animation: chipBump .9s cubic-bezier(.2, .9, .25, 1.4); }
.chip.bump b { color: #fbbf24; }
@keyframes chipBump { 0% { transform: scale(1); } 30% { transform: scale(1.25); box-shadow: 0 0 0 4px rgba(245, 158, 11, .35); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }
.ps-card { padding: 11px 12px; border-radius: 16px; background: #17292d; display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
.ps-card .row { display: flex; justify-content: space-between; align-items: center; }
.ps-card .row b { font-size: 13.5px; font-weight: 600; }
.ps-card .row span { color: #94a3b8; }
.ps-card .row span.done { color: #4ade80; font-weight: 500; }
.ps-card .bar { height: 7px; border-radius: 9px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.ps-card .bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #0ea5e9, #7c3aed); transition: width .3s; }
.ps-card .sub { font-size: 11px; }
.ps-team { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 0 2px; color: #cbd5e1; }
.ps-team .avas { display: flex; }
.ps-team .avas i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 700; color: #fff; border: 2px solid #0f1a1c; margin-left: -6px; }
.ps-team .avas i:first-child { margin-left: 0; }
.ps-team:not(.on) .avas i:not(:first-child) { opacity: .25; }
.ps-team.on span:last-child { color: #fff; font-weight: 600; }
.ps-lhead { display: flex; align-items: center; gap: 10px; padding: 4px 2px 2px; }
.ps-lhead h3 { font-size: 18px; font-weight: 700; }
.ps-lhead p { font-size: 11.5px; color: #ffbe43; }
.ps-tablewrap { position: relative; height: 262px; margin-top: 4px; }
.ps-zone { position: absolute; left: 0; right: 0; top: 0; height: 52px; border-radius: 14px; background: rgba(34, 197, 94, .08); border: 1px dashed rgba(34, 197, 94, .35); }
.ps-zone span { position: absolute; right: 8px; bottom: -9px; padding: 1px 6px; border-radius: 6px; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; background: #0f1a1c; color: #4ade80; }
.ps-table { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.ps-table li {
  position: absolute; left: 4px; right: 4px; height: 46px; top: 4px;
  display: grid; grid-template-columns: 18px 26px 1fr auto; gap: 8px; align-items: center;
  padding: 0 10px; border-radius: 12px; background: #17292d; font-size: 12.5px;
  transition: transform .8s cubic-bezier(.3, .8, .3, 1), background .4s;
}
.ps-table li .rk { font-family: var(--f-mono); color: #94a3b8; font-weight: 600; }
.ps-table li .cr { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; }
.ps-table li .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-table li .st { font-family: var(--f-mono); font-size: 12px; font-variant-numeric: tabular-nums; color: #e2e8f0; }
.ps-table li.me { background: linear-gradient(90deg, rgba(14, 165, 233, .35), rgba(124, 58, 237, .28)); box-shadow: 0 0 0 1px rgba(56, 189, 248, .45); }
.ps-table li.me .nm { font-weight: 600; }
.ps-foot { font-size: 11px; color: #94a3b8; text-align: center; }

/* The app in its light theme, used while the scene is in daylight (the page adds .light) */
.phone-body, .chip, .ps-card, .ps-table li, .ps-stats div, .ping { transition: background-color .6s ease, color .6s ease, border-color .6s ease; }
.phone.light .phone-body { background: #f6f8fb; color: #0f172a; }
.phone.light .phone-icons i { background: #0f172a; }
.phone.light .ps-kicker, .phone.light .ps-label, .phone.light .ps-goal, .phone.light .ps-card .row span, .phone.light .ps-foot { color: #64748b; }
.phone.light .ps-ring .r-bg { stroke: #e2e8f0; }
.phone.light .ps-ring .r-fg { filter: drop-shadow(0 0 6px rgba(124, 58, 237, .25)); }
.phone.light .chip { background: #ffffff; color: #475569; box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 0 0 1px #e2e8f0; }
.phone.light .chip b { color: #0f172a; }
.phone.light .chip.bump b { color: #d97706; }
.phone.light .ps-card { background: #ffffff; box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 0 0 1px #e2e8f0; }
.phone.light .ps-card .row span.done { color: #16a34a; }
.phone.light .ps-card .bar { background: #e2e8f0; }
.phone.light .ps-team { color: #475569; }
.phone.light .ps-team.on span:last-child { color: #0f172a; }
.phone.light .ps-team .avas i { border-color: #f6f8fb; }
.phone.light .ps-lhead p { color: #b45309; }
.phone.light .ps-zone { background: rgba(34, 197, 94, .08); border-color: rgba(22, 163, 74, .35); }
.phone.light .ps-zone span { background: #f6f8fb; color: #16a34a; }
.phone.light .ps-table li { background: #ffffff; box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 0 0 1px #e2e8f0; }
.phone.light .ps-table li .rk { color: #64748b; }
.phone.light .ps-table li .st { color: #334155; }
.phone.light .ps-table li.me { background: linear-gradient(90deg, rgba(14, 165, 233, .16), rgba(124, 58, 237, .14)); box-shadow: 0 0 0 1px rgba(124, 58, 237, .35); }
.phone.light .ps[data-screen="promo"] p { color: #475569; }
.phone.light .ps-stats div { background: #ffffff; box-shadow: 0 0 0 1px #e2e8f0; }
.phone.light .ps-stats span { color: #64748b; }
.ps[data-screen="promo"] { align-items: center; text-align: center; padding-top: 40px; position: relative; }
.ps-badge { width: 120px; height: 134px; display: grid; place-items: center; clip-path: polygon(50% 0, 100% 16%, 100% 58%, 50% 100%, 0 58%, 0 16%); background: linear-gradient(160deg, #ffffff, #cbd5e1 45%, #94a3b8); filter: drop-shadow(0 0 20px rgba(195, 132, 251, .6)); animation: badgeIn 1s cubic-bezier(.2, .9, .25, 1.4) both paused; }
.phone.on .ps-badge { animation-play-state: running; }
.ps-badge span { font-family: var(--f-display); font-weight: 800; font-size: 54px; color: #475569; }
.ps-badge.gold { background: linear-gradient(160deg, #fff6c9, #ffd700 45%, #b8860b); filter: drop-shadow(0 0 22px rgba(255, 190, 67, .65)); }
.ps-badge.gold span { color: #7c4a03; }
@keyframes badgeIn { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.ps[data-screen="promo"] h3 { font-family: var(--f-display); font-size: 30px; font-weight: 800; margin-top: 6px; }
.ps[data-screen="promo"] p { font-size: 13px; color: #cbd5e1; padding: 0 10px; }
.ps-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 10px; }
.ps-stats div { padding: 10px 8px; border-radius: 14px; background: #17292d; display: flex; flex-direction: column; gap: 2px; }
.ps-stats b { font-family: var(--f-mono); font-size: 16px; }
.ps-stats span { font-size: 10.5px; color: #94a3b8; }
.ps-confetti i { position: absolute; top: 10px; width: 7px; height: 12px; border-radius: 2px; animation: fall 2.6s linear infinite; }
.ps-confetti i:nth-child(1) { left: 12%; background: #ffbe43; animation-delay: 0s; } .ps-confetti i:nth-child(2) { left: 26%; background: #c384fb; animation-delay: .5s; }
.ps-confetti i:nth-child(3) { left: 40%; background: #38bdf8; animation-delay: 1.1s; } .ps-confetti i:nth-child(4) { left: 55%; background: #4ade80; animation-delay: .3s; }
.ps-confetti i:nth-child(5) { left: 68%; background: #f472b6; animation-delay: 1.6s; } .ps-confetti i:nth-child(6) { left: 80%; background: #ffbe43; animation-delay: .8s; }
.ps-confetti i:nth-child(7) { left: 90%; background: #38bdf8; animation-delay: 2s; } .ps-confetti i:nth-child(8) { left: 5%; background: #c384fb; animation-delay: 1.4s; }
@keyframes fall { from { transform: translateY(-20px) rotate(0); opacity: 0; } 15% { opacity: 1; } to { transform: translateY(470px) rotate(540deg); opacity: 0; } }

/* ---------- the story ---------- */
.beat { position: relative; min-height: var(--len, 170vh); }
.words {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; flex-direction: column; justify-content: center; gap: 20px;
  width: calc(var(--col) + var(--gutter-l) + 40px);
  padding: 90px 0 110px max(var(--gutter-l), 6vw);
  will-change: opacity, transform;
}
.words > * { max-width: var(--col); }
.when { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-soft); }
.when time { font-family: var(--f-mono); font-weight: 600; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 8px; }
.when time::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 38% 38%, #fff3c4, #ffbe43 60%, #f59e0b); box-shadow: 0 0 10px rgba(255, 190, 67, .8); }
.when span { letter-spacing: .16em; text-transform: uppercase; font-weight: 500; font-size: 12px; }
.when time + span::before { content: ""; display: inline-block; width: 26px; height: 1px; margin: 0 12px 3px 0; background: currentColor; opacity: .5; vertical-align: middle; }
.words h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(38px, 4.4vw, 66px); line-height: .98; letter-spacing: -.03em; }
.words > p { font-size: clamp(17px, 1.3vw, 20px); line-height: 1.6; color: var(--ink-soft); max-width: min(var(--col), 40ch); }
.fact {
  position: relative; margin-top: 10px; padding: 2px 0 2px 20px;
  font-size: 15px; line-height: 1.55; color: var(--ink-soft); max-width: min(var(--col), 44ch);
}
.fact::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, #ffbe43, #c384fb, #9925ff); }
.fact-k { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.fact-k::before { content: "♥"; margin-right: 8px; color: #f472b6; }
.fact p { color: var(--ink-soft); }
.fact cite { display: block; margin-top: 6px; font-style: normal; font-size: 12px; color: var(--ink-faint); }

/* hero */
.hero .words { width: min(980px, 74vw); }
.hero .words > .lede, .hero .words > .when { max-width: min(560px, 42vw); }
.hero .words h1 { display: flex; flex-direction: column; font-family: var(--f-ui); font-weight: 700; font-size: clamp(48px, 6.6vw, 100px); line-height: .98; letter-spacing: -.045em; max-width: none; }
.hero .words h1 .l2 { background: var(--trail); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 26px rgba(195, 132, 251, .45)); padding-bottom: .08em; }
.hero .lede { font-size: clamp(18px, 1.5vw, 22px); max-width: 32ch; }
.scroll-hint { display: inline-flex; align-items: center; gap: 12px; margin-top: 18px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.wheel { width: 20px; height: 32px; border: 2px solid currentColor; border-radius: 11px; position: relative; }
.wheel::after { content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; border-radius: 2px; background: currentColor; transform: translateX(-50%); animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 10px); } }
.hero .words > * { animation: rise 1.1s cubic-bezier(.2, .8, .2, 1) both; animation-play-state: paused; }
.ready .hero .words > * { animation-play-state: running; }
.hero .words > :nth-child(2) { animation-delay: .14s; }
.hero .words > :nth-child(3) { animation-delay: .3s; }
.hero .words > :nth-child(4) { animation-delay: .7s; }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* the promotion moment, centred */
.beat.center .words { width: 100%; align-items: center; text-align: center; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.beat.center .words > * { max-width: 34ch; }
.beat.center .when { justify-content: center; }
.beat.center .fact { text-align: left; }
.words h2.big { font-size: clamp(64px, 10vw, 150px); background: linear-gradient(180deg, #ffffff 20%, #d6dde8 60%, #9aa7b8); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 40px rgba(195, 132, 251, .5)); max-width: none; }

/* closing beat with the form: it and the footer fill the last screen exactly (story.js measures the footer into --footer-h) */
.beat.final { min-height: 0; --col: min(660px, 52vw); }
.beat.final .words {
  position: relative; height: auto;
  min-height: calc(100vh - var(--footer-h, 110px)); min-height: calc(100svh - var(--footer-h, 110px));
  padding-top: clamp(78px, 12vh, 140px); padding-bottom: clamp(18px, 4vh, 44px); gap: clamp(10px, 1.8vh, 18px);
}
.beat.final .words h2 { font-size: clamp(36px, 3.7vw, 58px); }
.beat.final .words > p { font-size: clamp(16px, 1.15vw, 18px); line-height: 1.55; max-width: var(--col); }
.beat.final .contact { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(8px, 1.4vh, 14px) 20px; margin-top: 4px; }
.beat.final .field { grid-column: span 2; }
.beat.final .field.f-msg { grid-column: span 4; }
.beat.final .form-foot { grid-column: 1 / -1; margin-top: 2px; }
.beat.final .field input, .beat.final .field select, .beat.final .field textarea { min-height: 42px; padding: 8px 0; font-size: 16px; }
.beat.final .field textarea { field-sizing: content; max-height: 132px; }
/* at the end the story is over: the step widget steps aside for the form and footer */
body.at-end .hud { opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .4s ease, transform .4s ease; }
.proof { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; color: var(--ink-soft); }
.proof li { display: inline-flex; align-items: center; gap: 8px; }
.live { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--green); animation: live 2s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 100% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } }
.contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; margin-top: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.full, .form-foot.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.opt { text-transform: none; letter-spacing: 0; font-weight: 300; color: var(--ink-faint); }
.field input, .field select, .field textarea {
  font: 400 17px/1.4 var(--f-ui); color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 10px 0; min-height: 46px; width: 100%;
}
.field select { color: var(--ink); }
.field select option { color: #0d1c22; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--sky-hi); box-shadow: 0 1px 0 var(--sky-hi); }
.field [aria-invalid="true"] { border-bottom-color: var(--red); }
.form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.form-status { font-size: 14px; color: var(--ink-soft); }
.form-status.ok { color: #86efac; }
.form-status.err { color: #fca5a5; }
.stores { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 14px; color: var(--ink-soft); }

/* ---------- things that happen in the scene ---------- */
.speech, .label, .ping { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
.speech {
  padding: 11px 17px; border-radius: 20px 20px 20px 6px;
  background: #ffffff; color: #0d1c22; font: 600 16px/1.25 var(--f-ui); white-space: nowrap;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .45);
}
.speech::after { content: ""; position: absolute; left: 14px; bottom: -9px; border: 10px solid transparent; border-top-color: #ffffff; border-left-color: #ffffff; border-bottom: 0; border-right-width: 6px; }
.label { font: 800 20px/1 var(--f-display); letter-spacing: .04em; color: #fde047; text-shadow: 0 2px 0 #b45309, 0 6px 20px rgba(0, 0, 0, .4); transform-origin: 50% 100%; }
.ping {
  width: 300px; padding: 11px 14px 13px; border-radius: 20px;
  background: rgba(18, 24, 38, .97); color: #f1f5f9;   /* no backdrop blur (it would be redone every frame), so nearly opaque */
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .7);
  font-size: 13px; line-height: 1.35;
}
.ping-app { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #a8b8c4; }
.ping-app img { width: 16px; height: 16px; border-radius: 4px; }
.ping-app time { margin-left: auto; text-transform: none; letter-spacing: 0; }
.ping b { display: block; font-weight: 600; font-size: 14.5px; }
.ping span { color: #b8c4d0; }
.ping.tone-red b { color: #fca5a5; }
.ping.tone-green b { color: #86efac; }
.ping.tone-amber b { color: #fcd34d; }
.ping.tone-violet b { color: #d8b4fe; }
/* notifications follow the app's theme: light while the scene is in daylight */
body.daylight .ping { background: rgba(255, 255, 255, .985); color: #0f172a; border-color: rgba(15, 23, 42, .08); box-shadow: 0 24px 50px -22px rgba(15, 23, 42, .45); }
body.daylight .ping-app { color: #64748b; }
body.daylight .ping span { color: #475569; }
body.daylight .ping.tone-red b { color: #dc2626; }
body.daylight .ping.tone-green b { color: #16a34a; }
body.daylight .ping.tone-amber b { color: #b45309; }
body.daylight .ping.tone-violet b { color: #7c3aed; }
body.daylight .ping.tone-sky b { color: #0369a1; }
.ping.docked { position: fixed; left: auto; right: var(--gutter-r); top: calc(78px + env(safe-area-inset-top, 0px)); }
.speech, .label, .ping { opacity: 0; scale: .7; transition: opacity .35s ease, scale .5s cubic-bezier(.2, .9, .25, 1.45); }
.speech.in, .label.in, .ping.in { opacity: 1; scale: 1; }
.speech.out, .label.out, .ping.out { opacity: 0 !important; scale: .92; }

/* ---------- footer ---------- */
.footer { background: linear-gradient(180deg, rgba(5, 8, 22, .7), rgba(5, 8, 22, .94)); color: #a8b8c4; border-top: 1px solid rgba(255, 255, 255, .08); }
.footer-inner {
  padding: 16px var(--gutter-r) calc(16px + env(safe-area-inset-bottom, 0px)) max(var(--gutter-l), 6vw);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 32px;
}
.footer-brand { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; min-width: 0; }
.footer .brand { color: #e8f1f2; flex: none; }
.footer-tag { font-size: 14px; color: #cbd5e1; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 500; color: #e8f1f2; text-decoration: none; }
.footer-links a:hover { color: var(--sky-hi); }
.footer-links a:focus-visible { outline: 2px solid var(--sky-hi); outline-offset: 4px; border-radius: 6px; }
.footer-small { grid-column: 1 / -1; margin: 0; font-size: 12px; line-height: 1.5; color: #8d9db2; }

/* ---------- phones: the shade rises from the bottom, the scene sits above ---------- */
@media (max-width: 760px) {
  :root { --col: calc(100vw - 48px); }
  .nav-link { display: none; }
  .nav .btn { margin-left: auto; }
  .scrim { inset: auto 0 0 0; width: 100vw; height: 72vh; background: linear-gradient(0deg, var(--shade) 0%, var(--shade) 30%, var(--shade-mid) 62%, transparent 100%); -webkit-mask-image: linear-gradient(0deg, #000 45%, transparent 95%); mask-image: linear-gradient(0deg, #000 45%, transparent 95%); }
  .words { width: 100%; justify-content: flex-end; gap: 14px; padding: 80px var(--gutter-r) calc(84px + env(safe-area-inset-bottom, 0px)) var(--gutter-l); }
  .words h2 { font-size: 34px; }
  .words > p { font-size: 16px; }
  .fact { font-size: 14px; }
  .hero .words { width: 100%; justify-content: flex-start; padding-top: 16vh; }
  .hero .words > .lede, .hero .words > .when { max-width: none; }
  .hero .words h1 { font-size: 48px; }
  .contact { grid-template-columns: 1fr; }
  .beat.final { --col: calc(100vw - 48px); }
  .beat.final .words { justify-content: center; padding-top: calc(76px + env(safe-area-inset-top, 0px)); padding-bottom: 24px; }
  .beat.final .words { gap: 10px; }
  .beat.final .when { display: none; }
  .beat.final .proof li + li { display: none; }
  .beat.final .contact { grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .beat.final .field { grid-column: span 1; }
  .beat.final .field.f-msg { grid-column: 1 / -1; }
  .beat.final .field label { font-size: 11px; letter-spacing: .08em; }
  .footer-inner { padding-top: 6px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); gap: 0 16px; }
  .footer-tag { display: none; }
}
/* phones: at the end the form sits over the planet, so the shade covers it */
@media (max-width: 760px) {
  body.at-end .scrim { height: 100vh; height: 100lvh; background: linear-gradient(0deg, var(--shade) 0%, var(--shade) 72%, var(--shade-mid) 90%, transparent 100%); -webkit-mask-image: none; mask-image: none; }
}
/* short phones: tighten the last screen a little more so it still fits */
@media (max-width: 760px) and (max-height: 720px) {
  .beat.final .words { padding-top: calc(64px + env(safe-area-inset-top, 0px)); gap: 8px; }
  .beat.final .words h2 { font-size: 28px; }
  .beat.final .words > p { font-size: 15px; line-height: 1.45; }
  .beat.final .proof { display: none; }
  .beat.final .field input, .beat.final .field select, .beat.final .field textarea { min-height: 38px; padding: 6px 0; }
  .beat.final .form-foot .btn { min-height: 44px; }
  .hud { gap: 10px; padding: 6px 14px 6px 6px; }
  .hud-ring { width: 40px; height: 40px; }
  .hud-steps b { font-size: 17px; }
  .hud-steps span { font-size: 10px; }
  .hud-track { display: none; }
  .phone { --ps: 0.5; right: 10px; bottom: auto; top: calc(64px + env(safe-area-inset-top, 0px)); transform-origin: 100% 0; }
  .speech { font-size: 14px; }
  .ping { width: 260px; }
  .ping.docked { right: 50%; transform: translateX(50%) !important; }
}

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

/* Honeypot: invisible to people and screen readers, filled in by bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
