@font-face {
  font-family: "Sora";
  src: url("/assets/fonts/Sora-Variable.ttf") format("truetype");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --bg-raised: #111;
  --bg-input: #0d0d0d;
  --fg: #ededed;
  --fg-muted: #a1a1a1;
  --fg-faint: #8b8b8b;
  --line: #262626;
  --line-strong: #3a3a3a;
  --accent: #3b8ef0;
  --accent-soft: rgb(59 142 240 / 0.16);
  --danger: #ff6b6b;
  --ok: #ededed;
  --radius: 12px;
  --radius-sm: 8px;
  --sans: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 140ms;
  --t-med: 320ms;
  --t-slow: 720ms;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[data-i="1"] { --i: 1; } [data-i="2"] { --i: 2; } [data-i="3"] { --i: 3; } [data-i="4"] { --i: 4; } [data-i="5"] { --i: 5; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--fg-muted); }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 20;
  background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 8px;
  transition: top var(--t-fast) var(--ease-out);
}
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  --btn-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border: 1px solid var(--btn-line); border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font: 500 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { --btn-line: #555; background: #161616; }
.btn:active { transform: scale(0.97); }
.btn .arrow { transition: transform var(--t-med) var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary { --btn-bg: var(--fg); --btn-fg: #0a0a0a; --btn-line: var(--fg); }
.btn-primary:hover { background: #fff; --btn-line: #fff; }
.btn-primary:focus-visible { outline-color: var(--accent); }
.btn-ghost { --btn-line: transparent; color: var(--fg-muted); }
.btn-ghost:hover { color: var(--fg); background: transparent; --btn-line: transparent; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; height: 48px; }
.btn[disabled] { cursor: progress; opacity: 0.6; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgb(10 10 10 / 0.72);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med) ease;
}
/* A live blur behind the nav re-samples the moving frame every frame: solid while the morph is near the screen. */
body:has(.morph.on-screen) .nav { background: rgb(10 10 10 / 0.96); backdrop-filter: none; -webkit-backdrop-filter: none; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark { width: 26px; height: 26px; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.nav-links > a:not(.btn) { color: var(--fg-muted); text-decoration: none; transition: color var(--t-fast) ease; }
.nav-links > a:not(.btn):hover { color: var(--fg); }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; }
.hero-inner { padding-block: clamp(56px, 12vw, 128px) clamp(56px, 9vw, 104px); text-align: center; display: flex; flex-direction: column; align-items: center; }

/* Hero sky (James, 11-01): sky.js draws the slowed, darkened mosaic shader here. It reaches up behind the sticky nav.
   Without WebGL this gradient stays. The shade keeps the text on near-black (contrast >= 7:1, measured) and fades
   the sky into the page at the bottom. */
.sky {
  position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; top: calc(-60px - env(safe-area-inset-top, 0px));
  overflow: hidden; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 45%, #15171c, transparent 70%), #070708;
}
.sky-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; max-width: none; opacity: 0; transition: opacity 1.6s ease; }
.sky[data-sky="webgl"] .sky-canvas { opacity: 1; }
.sky-shade {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse 46% 40% at 50% 54%, rgb(7 7 8 / 0.78), rgb(7 7 8 / 0.5) 60%, transparent 100%),
    linear-gradient(180deg, rgb(10 10 10 / 0.35), transparent 26%, transparent 66%, var(--bg) 100%);
}
.hero-mark { width: 76px; height: 76px; color: var(--fg); margin-bottom: 36px; overflow: visible; }
.mark-lines path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 900ms var(--ease-in-out) forwards; }
.mark-lines path:nth-child(2) { animation-delay: 260ms; }
.mark-lines path:nth-child(3) { animation-delay: 380ms; }
.mark-nodes circle:nth-child(2), .mini-mark circle:nth-child(2) { --n: 1; }
.mark-nodes circle:nth-child(3), .mini-mark circle:nth-child(3) { --n: 2; }
.mark-nodes circle:nth-child(4), .mini-mark circle:nth-child(4) { --n: 3; }
.mark-nodes circle:nth-child(5), .mini-mark circle:nth-child(5) { --n: 4; }
.mark-nodes circle { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: pop 420ms var(--ease-out) forwards; animation-delay: calc(420ms + var(--n, 0) * 60ms); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { 60% { transform: scale(1.25); } to { transform: scale(1); } }

.hero-title { font-size: clamp(38px, 7.4vw, 76px); line-height: 1.04; letter-spacing: -0.045em; font-weight: 600; }
.hero-title .line { display: block; }
.hero-title { color: #f5f5f5; }
.hero-title .line:last-child { color: #cdcdcd; }
.hero-sub { margin-top: 26px; max-width: 34em; color: #cccccc; font-size: clamp(16px, 2vw, 18px); }
.hero-cta { margin-top: 34px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hero-note { margin-top: 18px; font: 400 13px/1.4 var(--mono); color: #b4b4b4; }
.hero .btn-ghost { color: #d0d0d0; }

.hero .line, .hero-sub, .hero-cta, .hero-note {
  opacity: 0; transform: translateY(14px);
  animation: rise 800ms var(--ease-out) forwards;
  animation-delay: calc(140ms + var(--i, 0) * 80ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Phone to desktop (James, 11-01): morph.js morphs the frame as the section scrolls past; no pinning ---------- */
.morph { position: relative; padding-bottom: clamp(56px, 9vw, 112px); }
.morph-pin { display: flex; flex-direction: column; align-items: center; padding-inline: var(--gutter); }
.morph-captions { position: relative; height: 72px; width: 100%; max-width: 1100px; }
.morph-cap { position: absolute; left: 0; right: 0; top: 50%; translate: 0 -50%; text-align: center; text-wrap: balance; color: var(--fg-muted); font-size: clamp(15px, 1.8vw, 18px); }
.morph-cap b { color: var(--fg); font-weight: 600; margin-right: 0.4em; }
.morph-stage { position: relative; width: 100%; max-width: 1100px; }
.device {
  position: relative; width: 100%; aspect-ratio: 1440 / 934; overflow: hidden; contain: layout paint;
  border: 1px solid var(--line-strong); border-radius: 14px; background: #050505;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.02); /* no big blur: the frame changes size every frame, and it would repaint */
}
.device-bar { position: absolute; top: 0; left: 0; right: 0; height: 34px; display: flex; align-items: center; gap: 6px; padding-inline: 14px; border-bottom: 1px solid var(--line); overflow: hidden; }
.device-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a2a2a; flex: none; }
.device-screen { position: absolute; inset: 34px 0 0 0; overflow: hidden; background: #0f0f0f; }
.scr { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; }
.morph.on-screen .scr { will-change: opacity, transform; }
.scr-desktop { width: 100%; height: auto; }
.scr-phone { display: none; }
.cap-desktop { opacity: 0; }
/* With JS: the stage reserves its final height (set by morph.js) and the frame is centred in it, so the page below
   never moves while the frame changes size. */
.morph.morph-ready .morph-stage { contain: layout size; }
.morph.morph-ready .device { position: absolute; left: 50%; top: 50%; translate: -50% -50%; aspect-ratio: auto; width: auto; }
.morph.morph-ready .scr-phone { display: block; }
/* Reduced motion: a plain crossfade once it is in view. */
.morph-still .scr-phone { left: 50%; transform: translateX(-50%); height: 100% !important; width: auto !important; opacity: 1; transition: opacity 700ms ease !important; }
.morph-still .scr-desktop { transform: none !important; opacity: 0; transition: opacity 700ms ease !important; }
.morph-still .cap-phone, .morph-still .cap-desktop { transition: opacity 700ms ease !important; }
.morph-still.shown .scr-phone { opacity: 0 !important; transition-delay: 300ms !important; }
.morph-still.shown .scr-desktop { opacity: 1 !important; transition-delay: 300ms !important; }
.morph-still.shown .cap-phone { opacity: 0 !important; transition-delay: 300ms !important; }
.morph-still.shown .cap-desktop { opacity: 1 !important; transition-delay: 300ms !important; }

/* ---------- Features ---------- */
.features { padding-bottom: clamp(64px, 10vw, 120px); }
.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature-grid li { padding: 28px; }
.feature-grid li + li { border-left: 1px solid var(--line); }
.feature-grid .h3 { font-size: 17px; margin-bottom: 8px; letter-spacing: -0.02em; }
.feature-grid p { color: var(--fg-muted); font-size: 15px; }

/* ---------- How it works ---------- */
.how { padding-bottom: clamp(64px, 10vw, 120px); }
.how h2, .access h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.035em; }
.steps { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { display: flex; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
.steps h3 { font-size: 17px; margin-bottom: 6px; }
.steps p { color: var(--fg-muted); font-size: 15px; }
.step-n {
  flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px;
  border: 1px solid var(--line-strong); border-radius: 50%;
  font: 500 13px/1 var(--mono); color: var(--fg);
}
.step-n.sm { width: 22px; height: 22px; font-size: 12px; }

/* ---------- Access card ---------- */
.access { padding-bottom: clamp(72px, 12vw, 144px); scroll-margin-top: 72px; }
.access:focus { outline: none; }
.card { max-width: 520px; margin-inline: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-raised); }
.card-body { position: relative; padding: clamp(24px, 5vw, 36px); overflow: hidden; }
.panel h2 { font-size: 28px; }
.lede { margin-top: 8px; color: var(--fg-muted); font-size: 15px; }
.lede strong { color: var(--fg); font-weight: 500; font-family: var(--mono); font-size: 14px; }

.field { margin-top: 22px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.input {
  display: flex; align-items: center; height: 46px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg-input);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-med) var(--ease-out);
}
.input:hover { border-color: #4a4a4a; }
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.prefix { padding-left: 14px; color: var(--fg-faint); font: 400 15px/1 var(--mono); transition: color var(--t-fast) ease; }
.prefix-gh svg { width: 16px; height: 16px; }
.input:focus-within .prefix { color: var(--fg-muted); }
.input input {
  flex: 1; min-width: 0; height: 100%; padding: 0 14px 0 8px;
  border: 0; outline: 0; background: transparent; color: var(--fg);
  font: 400 15px/1 var(--mono); caret-color: var(--accent);
}
.input input::placeholder { color: #4d4d4d; }
.hint { margin-top: 8px; color: var(--fg-faint); font-size: 13px; line-height: 1.5; }
.err { margin-top: 8px; color: var(--danger); font-size: 13px; line-height: 1.5; animation: nudge 360ms var(--ease-out); }
.err a, .banner a { color: inherit; }
.field.invalid .input { border-color: var(--danger); }
.field.invalid .input:focus-within { box-shadow: 0 0 0 4px rgb(255 107 107 / 0.14); }
.field.invalid .hint { display: none; }
.banner {
  margin-top: 20px; padding: 12px 14px; border: 1px solid rgb(255 107 107 / 0.35); border-radius: var(--radius-sm);
  background: rgb(255 107 107 / 0.06); color: #ffb3b3; font-size: 14px; line-height: 1.5;
  animation: fade-up 320ms var(--ease-out);
}
@keyframes nudge { 0% { opacity: 0; transform: translateX(-4px); } 100% { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.panel-form .btn-block { margin-top: 26px; }

/* panel swap */
.panel { animation: panel-in 460ms var(--ease-out); }
@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.panel.leaving { animation: panel-out 200ms ease forwards; }
@keyframes panel-out { to { opacity: 0; transform: translateY(-6px); } }

/* progress */
.panel-progress { text-align: center; padding-block: 28px 8px; }
.mini-mark { width: 64px; height: 64px; margin: 0 auto 26px; color: var(--fg); overflow: visible; }
.mini-base { opacity: 0.18; }
.mini-trace path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.mini-mark.working .mini-trace path { animation: trace 1800ms var(--ease-in-out) infinite; }
.mini-mark.working .mini-trace path:nth-child(2) { animation-delay: 300ms; }
.mini-mark.working .mini-trace path:nth-child(3) { animation-delay: 450ms; }
.mini-mark circle { transform-box: fill-box; transform-origin: center; fill: var(--fg-faint); }
.mini-mark.working circle { animation: blink 1800ms ease-in-out infinite; animation-delay: calc(var(--n, 0) * 160ms); }
@keyframes trace { 0% { stroke-dashoffset: 1; } 55% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
@keyframes blink { 0%, 100% { fill: var(--fg-faint); transform: scale(0.85); } 30% { fill: var(--accent); transform: scale(1.15); } }
.progress-title { font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.progress-sub { margin-top: 8px; color: var(--fg-muted); font-size: 14px; }
.bar { margin: 26px auto 0; width: min(240px, 70%); height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar i { display: block; width: 40%; height: 100%; border-radius: inherit; background: var(--accent); animation: slide 1400ms var(--ease-in-out) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* done */
.done-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.done-head h2:focus { outline: none; }
.check { flex: none; width: 44px; height: 44px; color: var(--accent); margin-top: 2px; }
.check circle, .check path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.panel-done:not([hidden]) .check circle { animation: draw 620ms var(--ease-out) 80ms forwards; }
.panel-done:not([hidden]) .check path { animation: draw 420ms var(--ease-out) 520ms forwards; }
.next { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.next-label { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; font-weight: 500; line-height: 1.45; }
.next-label .step-n { margin-top: 0; }
.next-label .muted { font-weight: 400; }
.prompt { position: relative; margin-top: 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg-input); }
.prompt-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.prompt-label { font: 400 12px/1 var(--mono); color: var(--fg-faint); }
.prompt pre {
  margin: 0; padding: 14px 16px 16px; white-space: pre-wrap; word-break: break-word;
  font: 400 13px/1.65 var(--mono); color: #d6d6d6;
}
.btn-copy { position: relative; height: 32px; padding: 0 14px; font-size: 13px; background: #161616; }
.btn-copy svg { width: 15px; height: 15px; }
.btn-copy > span { display: inline-flex; align-items: center; gap: 7px; transition: opacity var(--t-fast) ease, transform var(--t-med) var(--ease-out); }
.btn-copy .copy-done { position: absolute; inset: 0; justify-content: center; opacity: 0; transform: translateY(6px); color: var(--fg); }
.btn-copy.copied .copy-idle { opacity: 0; transform: translateY(-6px); }
.btn-copy.copied .copy-done { opacity: 1; transform: none; }
.btn-copy.copied { border-color: var(--accent); }
.btn-copy .copy-done path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.btn-copy.copied .copy-done path { animation: draw 300ms var(--ease-out) 80ms forwards; }
.next .hint { margin-top: 12px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.footer-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 28px; font-size: 14px; }
.footer-inner .muted { flex: 1; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--fg-muted); text-decoration: none; transition: color var(--t-fast) ease; }
.footer-links a:hover { color: var(--fg); }

/* ---------- Scroll reveal ---------- */
@media (scripting: enabled) { [data-reveal]:not(.in) { opacity: 0; transform: translateY(18px); } }
[data-reveal] { transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- Narrow ---------- */
@media (max-width: 760px) {
  .sky-shade {
    background:
      radial-gradient(ellipse 90% 46% at 50% 52%, rgb(7 7 8 / 0.82), rgb(7 7 8 / 0.55) 65%, transparent 100%),
      linear-gradient(180deg, rgb(10 10 10 / 0.35), transparent 26%, transparent 66%, var(--bg) 100%);
  }
  .nav-links > a:not(.btn) { display: none; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid li + li { border-left: 0; border-top: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; }
  .morph-captions { height: 64px; }
  .device-bar { padding-inline: 10px; }
  /* Phones only: tall enough that the card can scroll to the top of the screen when its state changes. */
  .access { min-height: calc(100svh - 60px); }
  .device-bar i { width: 8px; height: 8px; }
  .footer-inner .muted { flex: none; }
  .footer-links { width: 100%; }
}

/* queued (more than 50 invites today) */
.queue-n {
  flex: none; display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; margin-top: 2px;
  border: 1.5px solid var(--accent); border-radius: 999px; color: var(--fg); font: 500 16px/1 var(--mono);
}
.panel-queued .hint { margin-top: 4px; }

/* ---------- Reduced motion: keep fades, drop travel and loops ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  [data-reveal]:not(.in) { transform: none !important; }
  .mini-mark.working .mini-trace path { stroke-dashoffset: 0; }
  .mini-mark.working circle { fill: var(--fg-muted); }
  .bar i { width: 100%; transform: none; opacity: 0.5; }
}

