@font-face { font-family: 'Space Grotesk'; src: url(assets/fonts/SpaceGrotesk-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(assets/fonts/SpaceGrotesk-SemiBold.woff2) format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(assets/fonts/Inter-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(assets/fonts/Inter-Medium.woff2) format('woff2'); font-weight: 500 700; font-display: swap; }

:root {
  --bg: #070A0F; --surface: #0F151D; --border: #1B2733; --text: #F2F6FA; --soft: #C3CEDA; --muted: #7D8CA0;
  --accent: #38BDF8; --accent-strong: #0EA5E9;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: max(16px, 6vw);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* One screen: nothing scrolls. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html { background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Inter', system-ui, sans-serif; background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
::selection { background: rgba(56, 189, 248, 0.35); }

#gl { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; z-index: 0; }
.shade {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 10, 15, 0.72) 0%, rgba(7, 10, 15, 0.42) 32%, transparent 56%),
    radial-gradient(130% 95% at 50% 45%, transparent 55%, rgba(2, 4, 7, 0.6) 100%);
}
.grain {
  position: fixed; inset: -50%; z-index: 30; pointer-events: none; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.9s steps(5) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-1%, 3%); } 80% { transform: translate(3%, 1%); } }

/* ---------------------------------------------------------------- frame: bar, hero, footer */
.page {
  position: relative; z-index: 2; display: grid; grid-template-rows: auto 1fr auto;
  height: 100vh; height: 100dvh;
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: max(18px, env(safe-area-inset-top)) var(--gutter) 0; }
.brand { display: flex; gap: 10px; align-items: center; font: 700 19px/1 'Space Grotesk', sans-serif; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.45)); }
.brand b { color: var(--accent); font-weight: 700; }
.hero { display: flex; align-items: center; min-height: 0; padding: 0 var(--gutter); }
.foot { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 0 var(--gutter) max(16px, env(safe-area-inset-bottom)); font-size: 12px; color: var(--muted); }
.foot a { text-decoration: none; color: var(--soft); }
.foot a:hover { color: var(--accent); }
.credits { opacity: 0.65; }

.sound {
  appearance: none; display: flex; gap: 9px; align-items: center; height: 38px; padding: 0 15px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: rgba(15, 21, 29, 0.6); color: var(--muted); font: 500 13px 'Inter', sans-serif;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: color 0.3s, border-color 0.3s;
}
.sound:hover { color: var(--text); border-color: #2a3b4d; }
.sound .bars { display: flex; gap: 2px; align-items: flex-end; height: 13px; }
.sound .bars i { width: 2px; height: 3px; border-radius: 1px; background: currentColor; transition: height 0.3s; }
.sound[aria-pressed='true'] { color: var(--accent); border-color: rgba(56, 189, 248, 0.45); }
.sound[aria-pressed='true'] .bars i { animation: eq 0.9s ease-in-out infinite alternate; }
.sound[aria-pressed='true'] .bars i:nth-child(2) { animation-delay: -0.3s; }
.sound[aria-pressed='true'] .bars i:nth-child(3) { animation-delay: -0.6s; }
.sound[aria-pressed='true'] .bars i:nth-child(4) { animation-delay: -0.15s; }
@keyframes eq { from { height: 3px; } to { height: 13px; } }

/* ---------------------------------------------------------------- copy */
.copy { max-width: 620px; }
.eyebrow { display: flex; gap: 12px; align-items: center; margin: 0; font: 500 12.5px/1 'Inter', sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ''; width: 30px; height: 1px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
h1 {
  margin: 2.6vh 0 2.8vh; font: 700 min(7.4vw, 11.6vh, 124px)/0.94 'Space Grotesk', sans-serif; letter-spacing: -0.04em;
  text-wrap: balance;
}
.lead { margin: 0; max-width: 31em; font-size: clamp(16px, min(1.35vw, 2.3vh), 21px); line-height: 1.5; color: var(--soft); }
.trust { display: flex; gap: 9px; align-items: center; margin: 0; font-size: 14px; color: var(--muted); }
.trust svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.actions { margin: 3.2vh 0 2.4vh; }

/* the three steps, lit in time with the phone */
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 3vh 0 0; padding: 0; list-style: none; }
.steps li {
  position: relative; display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 15px 0 6px; overflow: hidden;
  border: 1px solid var(--border); border-radius: 999px; background: rgba(15, 21, 29, 0.6); color: var(--muted); font-size: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: color 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.steps b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--border); color: var(--soft); font: 600 13px 'Space Grotesk', sans-serif; transition: background 0.5s, color 0.5s; }
.steps li::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); opacity: 0; transition: opacity 0.4s; }
.steps li.on { color: var(--text); border-color: rgba(56, 189, 248, 0.55); box-shadow: 0 0 24px -6px rgba(56, 189, 248, 0.55); }
.steps li.on b { background: var(--accent); color: #000; }
.steps li.on::after { opacity: 1; }

/* ---------------------------------------------------------------- button */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; padding: 0 26px;
  border-radius: 999px; font: 600 16px/1 'Space Grotesk', sans-serif; text-decoration: none; white-space: nowrap;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { color: #000; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); box-shadow: 0 10px 34px -8px rgba(56, 189, 248, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 48px -8px rgba(56, 189, 248, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-big { height: 64px; padding: 0 36px; font-size: 19px; }
.btn-big svg { width: 21px; height: 21px; }
@property --a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.btn-run::before {
  content: ''; position: absolute; inset: -3px; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--a), transparent 0 70%, #bfeaff 82%, var(--accent) 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: run 2.8s linear infinite;
}
@keyframes run { to { --a: 360deg; } }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* the second line: solid brand cyan with a soft glow */
.outline { color: var(--accent); text-shadow: 0 0 0.45em rgba(56, 189, 248, 0.35); }

/* ---------------------------------------------------------------- kinetic type */
/* Word masks for the letters' rise. Deep enough for descenders (g, p, y); once the letters have landed the mask is
   dropped altogether so nothing can be clipped. */
.wd { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.1em 0.06em 0.3em; margin: -0.1em -0.06em -0.3em; }
.settled .wd { overflow: visible; }
.ch {
  display: inline-block; transform-origin: 0 100%; opacity: 0; filter: blur(10px);
  transform: translate3d(0, 112%, 0) rotate(7deg);
  transition: transform 1.05s var(--ease), opacity 0.7s var(--ease), filter 0.9s var(--ease);
  transition-delay: calc(var(--i) * 26ms + 150ms);
}
[data-state='in'] .ch { opacity: 1; filter: none; transform: none; }
.reveal {
  opacity: 0; filter: blur(8px); transform: translate3d(0, 24px, 0);
  transition: opacity 0.9s var(--ease), transform 1.05s var(--ease), filter 0.9s var(--ease);
  transition-delay: calc(var(--d) * 120ms + 300ms);
}
[data-state='in'] .reveal { opacity: 1; filter: none; transform: none; }
html:not(.ready) .nav, html:not(.ready) .foot { opacity: 0; }
.nav, .foot { transition: opacity 1s var(--ease) 0.6s; }

/* ---------------------------------------------------------------- fallbacks */
.no-webgl #gl { display: none; }
.no-webgl body { background: radial-gradient(80% 60% at 70% 35%, rgba(14, 165, 233, 0.16), transparent 70%), var(--bg); }

/* ---------------------------------------------------------------- narrow screens: phone on top, copy below */
@media (max-width: 859px), (max-aspect-ratio: 9/10) {
  .shade { background: linear-gradient(to top, rgba(7, 10, 15, 0.96) 0%, rgba(7, 10, 15, 0.82) 38%, rgba(7, 10, 15, 0) 60%), radial-gradient(130% 95% at 50% 40%, transparent 55%, rgba(2, 4, 7, 0.6) 100%); }
  .nav { padding-top: max(14px, env(safe-area-inset-top)); }
  .brand { font-size: 17px; }
  .sound .label { display: none; }
  .sound { padding: 0 12px; }
  .hero { align-items: flex-end; padding: 0 16px 1.6vh; }
  .copy { max-width: 560px; width: 100%; }
  h1 { font-size: min(12.4vw, 6.6vh, 72px); margin: 1.6vh 0 1.6vh; }
  .lead { font-size: clamp(14.5px, 2.1vh, 16.5px); line-height: 1.45; }
  /* steps: numbers only, the lit one shows its words */
  .steps { flex-wrap: nowrap; gap: 6px; margin-top: 2vh; }
  .steps li { height: 34px; padding: 0 4px; font-size: 13.5px; }
  .steps li span { display: none; }
  .steps li.on { padding-right: 13px; }
  .steps li.on span { display: inline; white-space: nowrap; }
  .steps b { width: 24px; height: 24px; }
  .actions { margin: 2.2vh 0 1.6vh; }
  .btn-big { width: 100%; height: min(60px, 7.6vh); font-size: 18px; }
  .trust { font-size: 13px; }
  .foot { padding: 0 16px max(12px, env(safe-area-inset-bottom)); font-size: 11.5px; gap: 4px 14px; }
  .credits { display: none; }
  .grain { display: none; }
  .steps li, .sound { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(15, 21, 29, 0.88); }
}
/* short screens (small phones, landscape laptops) */
@media (max-height: 640px) {
  .eyebrow { display: none; }
  .trust { font-size: 12px; }
}

/* ---------------------------------------------------------------- reduced motion: fades only */
@media (prefers-reduced-motion: reduce) {
  .ch, .reveal { transform: none !important; filter: none !important; }
  .grain, .btn-run::before { animation: none; }
}
