/* Tokens from brand/README.md and clients/ios/.../UI/Theme/Theme.swift. Always dark, like the app. */
@font-face {
  font-family: "Unbounded";
  src: url("assets/fonts/unbounded-var.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0B0D10;
  --surface: #15181D;
  --surface2: #1F242B;
  --stroke: #2A3038;
  --text: #F2F4F7;
  --dim: #8A93A0;
  --accent: #C6FF3D;
  --on-accent: #0B0D10;
  --warn: #FFB020;
  --radius: 20px;
  --gutter: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --display: "Unbounded", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
}
@media (min-width: 720px) { :root { --gutter: max(40px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 clamp(1rem, 0.96rem + 0.2vw, 1.125rem)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, canvas { display: block; max-width: 100%; }
a { color: inherit; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.6vw, 3.25rem); }
h3 { margin: 0; font-size: 1.25rem; line-height: 1.3; }
p { margin: 0; }
em { font-style: normal; color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.kicker { color: var(--accent); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.lead { color: var(--dim); font-size: clamp(1.0625rem, 1rem + .4vw, 1.3rem); max-width: 40em; }
.fine { color: var(--dim); font-size: .92em; }
.section-head { display: grid; gap: 14px; max-width: 900px; margin-bottom: clamp(32px, 6vw, 72px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 14px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; text-decoration: none;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn-ghost { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--stroke); }
.btn-small { min-height: 38px; padding: 0 14px; border-radius: 10px; font-size: .9rem; background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--stroke); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter) 10px;
  background: rgba(11, 13, 16, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.bar-logo img { height: 24px; width: auto; }
.bar-logo { margin-right: auto; }

/* Hero */
.hero {
  position: relative;
  min-height: min(100svh, 880px);
  display: grid;
  align-items: center;
  padding: 96px var(--gutter) 56px;
  overflow: clip;
}
.hero-mark { width: min(46vw, 30svh); aspect-ratio: 1; overflow: visible; }
.hero-mark-ring { fill: none; stroke: var(--text); stroke-width: 26; stroke-linecap: round; transition: opacity 1.1s ease .15s; }
.hero-mark-spark { fill: var(--accent); filter: drop-shadow(0 0 7px var(--accent)); transition: opacity .7s ease; }
.js .hero-mark-ring { opacity: .1; }
.js .hero-mark-spark { opacity: 0; }
.js .lit .hero-mark-ring, .js .lit .hero-mark-spark { opacity: 1; }
@media (min-width: 900px) {
  .hero-mark { position: absolute; width: min(33vw, 62svh); right: 7vw; top: 50%; translate: 0 -50%; }
}
.hero-copy { position: relative; display: grid; gap: 22px; max-width: 700px; }
@media (max-width: 899px) { .hero { align-content: center; gap: 28px; } }
h1 { font-size: clamp(2.3rem, 1.3rem + 5vw, 5rem); }
h1 span, h1 em { display: block; }
.js h1 em { opacity: .14; transition: opacity .9s ease; }
.js .lit h1 em { opacity: 1; }

/* Story */
.story { padding: clamp(40px, 10vw, 140px) var(--gutter); }
.story-list { list-style: none; margin: 0 auto; padding: 0; max-width: 900px; display: grid; gap: clamp(40px, 8vw, 96px); }
.story-list time { display: block; color: var(--dim); font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.story-list p { font-size: clamp(1.3rem, 1.05rem + 1.3vw, 2.1rem); line-height: 1.32; letter-spacing: -.01em; }
.story-list strong { color: var(--accent); font-weight: 600; }

/* Chapters: the stage sticks while the steps scroll past it */
.chapters, .better, .noserver, .open { padding: clamp(56px, 10vw, 130px) var(--gutter); max-width: 1240px; margin-inline: auto; }
.chapter-grid { display: grid; grid-template-columns: 1fr; }
.stage {
  position: sticky; top: 56px; z-index: 2;
  display: flex; justify-content: center; align-items: center; gap: 16px;
  height: 44svh; min-height: 300px;
  margin-inline: calc(var(--gutter) * -1);
  background: linear-gradient(var(--bg) 88%, transparent);
}
.phone { height: 92%; aspect-ratio: 402 / 874; padding: 5px; border-radius: 26px; background: #000; box-shadow: 0 0 0 1px var(--stroke); }
.phone-screen { position: relative; height: 100%; overflow: hidden; border-radius: 21px; background: var(--surface); }
.phone-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s ease; }
.phone-screen img.on { opacity: 1; }
.stage-side { display: grid; justify-items: center; gap: 6px; }
.stage-ring { width: min(40vw, 26svh); aspect-ratio: 1; }
.stage-caption { min-height: 3em; width: min(40vw, 240px); text-align: center; color: var(--dim); font: 500 .74rem/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.steps { position: relative; }
.step { display: grid; align-content: end; gap: 12px; min-height: 72svh; padding-bottom: 7svh; }
.js .step { opacity: .22; transition: opacity .4s ease; }
.js .step.active { opacity: 1; }
.tag { justify-self: start; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .04em; }
.tag-back { background: var(--surface2); color: var(--text); }
.tag-new { background: var(--accent); color: var(--on-accent); }

@media (min-width: 900px) {
  .chapter-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 56px; }
  .stage { order: 2; top: 0; height: 100svh; margin: 0; background: none; gap: 32px; }
  .phone { height: min(76svh, 720px); padding: 7px; border-radius: 38px; }
  .phone-screen { border-radius: 31px; }
  .stage-ring { width: min(23vw, 300px); }
  .stage-caption { font-size: .82rem; width: min(23vw, 300px); }
  .step { align-content: center; min-height: 100svh; padding-bottom: 0; }
  h3 { font-size: 1.6rem; }
}

/* Better */
.bento { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
@media (min-width: 900px) { .bento { grid-template-columns: repeat(3, 1fr); } }
.tile { margin: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--stroke); border-radius: var(--radius); overflow: hidden; }
.tile img { width: 100%; aspect-ratio: 402 / 620; object-fit: cover; object-position: top; background: var(--surface2); }
.tile img.tile-fit { object-fit: contain; }
.tile figcaption { padding: 16px 18px 18px; color: var(--dim); }
.tile figcaption strong, .tile-text strong { display: block; color: var(--text); font-size: 1.05rem; }
.tile-text { padding: 20px 18px; color: var(--dim); display: grid; gap: 6px; align-content: start; }

/* No server */
.chain { display: grid; gap: 14px; margin-bottom: 36px; }
.chain-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  padding: 18px; border-radius: var(--radius);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--stroke);
}
.chain-row span { padding: 6px 12px; border-radius: 10px; background: var(--surface2); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.chain-row b { flex-basis: 100%; color: var(--dim); font-weight: 500; font-size: .9rem; }
.chain-row i { flex: 1 1 24px; min-width: 24px; height: 2px; }
.chain-then i { background: repeating-linear-gradient(90deg, var(--stroke) 0 6px, transparent 6px 12px); }
.chain-then span:last-of-type { color: var(--dim); text-decoration: line-through; }
.chain-now i { background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 16px); background-size: 16px 2px; animation: flow 1s linear infinite; }
.chain-now b { color: var(--accent); }
@keyframes flow { to { background-position-x: 16px; } }

.deps { width: 100%; border-collapse: collapse; font-size: .95rem; }
.deps th, .deps td { padding: 12px 12px 12px 0; text-align: left; vertical-align: top; border-top: 1px solid var(--stroke); }
.deps thead th { border-top: 0; color: var(--dim); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.deps tbody th { font-weight: 600; }
.deps td { color: var(--dim); }
.deps td:last-child, .deps th:last-child { padding-right: 0; white-space: nowrap; }
@media (max-width: 599px) { .deps td:last-child, .deps thead th:last-child { display: none; } }

/* Status panel */
.panel { background: var(--surface); box-shadow: inset 0 0 0 1px var(--stroke); border-radius: var(--radius); padding: clamp(18px, 3vw, 36px); display: grid; gap: 32px; }
.stats { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dd { margin: 0; font: 800 clamp(1.5rem, 1.2rem + 2vw, 2.75rem)/1.1 var(--display); letter-spacing: -.03em; color: var(--accent); }
.stats dt { color: var(--dim); font-size: .85rem; }
.status { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 24px; }
.status h3 { display: flex; align-items: center; gap: 10px; font-size: 1rem; margin-bottom: 10px; }
.status ul { margin: 0; padding: 0; list-style: none; color: var(--dim); display: grid; gap: 4px; }
.led { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.led-on { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.led-half { background: linear-gradient(90deg, var(--warn) 50%, var(--surface2) 50%); box-shadow: 0 0 0 1px var(--warn); }
.led-off { box-shadow: inset 0 0 0 2px var(--dim); }

/* CTA */
.cta { display: grid; justify-items: center; text-align: center; gap: 20px; padding: clamp(56px, 10vw, 120px) var(--gutter); }
.cta-ring { width: min(64vw, 280px); aspect-ratio: 1; }
.cta .actions { justify-content: center; }

/* FAQ, footer */
.faq { max-width: 780px; margin-inline: auto; padding: 32px var(--gutter) 72px; }
.faq h2 { font-size: 1.4rem; margin-bottom: 18px; }
details { border-top: 1px solid var(--stroke); }
details:last-of-type { border-bottom: 1px solid var(--stroke); }
summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
details p { color: var(--dim); padding-bottom: 16px; }
.foot { display: grid; gap: 10px; padding: 36px var(--gutter) 48px; border-top: 1px solid var(--stroke); color: var(--dim); font-size: .85rem; }
.foot img { height: 22px; width: auto; margin-bottom: 6px; }
.foot p { max-width: 62em; }

.js .reveal { translate: 0 14px; transition: translate .7s ease; }
.js .reveal.in { translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveal { translate: 0 0; }
}
