:root {
  --bg: #08080d;
  --bg-raised: #11121a;
  --card: rgba(255, 255, 255, 0.045);
  --stroke: rgba(255, 255, 255, 0.09);
  --text: #f4f4f8;
  --muted: rgba(244, 244, 248, 0.64);
  --faint: rgba(244, 244, 248, 0.4);
  --pink: #ff5c78;
  --violet: #8c59ff;
  --orange: #ff9a3d;
  --accent: linear-gradient(135deg, var(--pink), var(--violet));
  --radius: 22px;
  --rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

h1, h2, h3 { font-family: var(--rounded); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4.2vw, 3.3rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
p { text-wrap: pretty; }

.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.gradient-text { background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow {
  font-family: var(--rounded); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--pink);
}

/* Ambient glows behind everything */
.glow { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.glow::before, .glow::after {
  content: ""; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(90px); opacity: 0.38;
}
.glow::before { background: radial-gradient(circle, var(--pink), transparent 62%); top: -36vmax; left: -22vmax; }
.glow::after { background: radial-gradient(circle, var(--violet), transparent 62%); top: -30vmax; right: -28vmax; }

/* Navigation */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 8, 13, 0.72); border-color: var(--stroke);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--rounded); font-weight: 800; font-size: 1.2rem; }
.brand img { width: 34px; height: 34px; }
.nav-links { display: flex; gap: 24px; margin-left: auto; font-size: 0.95rem; }
.nav-links a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); }

.button {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 999px;
  font-family: var(--rounded); font-weight: 700; text-decoration: none; color: #fff; background: var(--accent);
  box-shadow: 0 10px 30px -8px rgba(140, 89, 255, 0.6); transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.button:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 16px 40px -8px rgba(140, 89, 255, 0.75); }
.button.small { padding: 8px 16px; font-size: 0.9rem; }
.button.pending { background: var(--card); border: 1px solid var(--stroke); box-shadow: none; color: var(--muted); cursor: default; }
.button.pending:hover { transform: none; }
.button svg { width: 18px; height: 18px; fill: currentColor; }

/* Hero */
.hero { padding: 124px 0 40px; text-align: center; position: relative; }
.hero p.lead { font-size: clamp(1.1rem, 1.9vw, 1.4rem); color: var(--muted); max-width: 640px; margin: 22px auto 34px; }
.hero .meta { margin-top: 16px; font-size: 0.88rem; color: var(--faint); }
.ring-stage { position: relative; width: min(560px, 86vw); aspect-ratio: 1; margin: 34px auto 0; }
.ring-stage canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.ring-hub {
  position: absolute; inset: 0; margin: auto; width: 25%; height: 25%; border-radius: 50%; pointer-events: none;
  display: grid; place-content: center; text-align: center; font-family: var(--rounded);
  background: #151620; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}
.ring-hub b { font-size: clamp(0.95rem, 2.6vw, 1.45rem); line-height: 1.15; }
.ring-hub span { font-size: clamp(0.6rem, 1.5vw, 0.8rem); color: var(--muted); font-weight: 600; max-width: 11ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-inline: auto; }

/* Framed app window */
.window {
  border-radius: 16px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.6);
  background: #0c0c12;
}
.showcase { perspective: 1800px; padding: 30px 0 110px; }
.showcase .window { transform-origin: 50% 0; will-change: transform; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(34px) scale(0.985); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; }

/* Scrollytelling features */
.story { position: relative; padding: 40px 0; }
.story-grid { display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.5fr); gap: 56px; width: min(1360px, 100% - 40px); }
.story-visual { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; order: 2; }
.story-frame { position: relative; width: 100%; aspect-ratio: 16 / 10; }
.story-frame .window {
  position: absolute; inset: 0; opacity: 0; transform: scale(0.94) translateY(24px); filter: blur(6px);
  transition: opacity 0.7s var(--ease), transform 0.9s var(--ease), filter 0.7s var(--ease);
}
.story-frame .window.active { opacity: 1; transform: none; filter: none; }
.story-frame .window img { width: 100%; height: 100%; object-fit: cover; }
.step { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; opacity: 0.28; transition: opacity 0.5s; }
.step.active { opacity: 1; }
.step h2 { margin: 14px 0 18px; }
.step p { color: var(--muted); font-size: 1.12rem; max-width: 46ch; }
.step ul { list-style: none; padding: 0; margin-top: 22px; display: grid; gap: 10px; color: var(--muted); }
.step li { display: flex; gap: 12px; align-items: baseline; }
.step li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
.step .window { display: none; }
.story-progress { position: absolute; left: -26px; top: 50%; translate: 0 -50%; display: grid; gap: 8px; }
.story-progress i { width: 4px; height: 26px; border-radius: 4px; background: var(--stroke); transition: background 0.4s, height 0.4s var(--ease); }
.story-progress i.active { background: var(--pink); height: 44px; }

/* Stats */
.stats { padding: 110px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat { padding: 34px 30px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--stroke); }
.stat b { display: block; font-family: var(--rounded); font-weight: 800; font-size: clamp(2.6rem, 5vw, 4rem); line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 12px; color: var(--muted); }

/* Appearance slider */
.appearance { padding: 60px 0 110px; text-align: center; }
.appearance p { color: var(--muted); max-width: 560px; margin: 16px auto 44px; }
.compare { position: relative; aspect-ratio: 16 / 10; --split: 50%; touch-action: pan-y; user-select: none; cursor: ew-resize; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .light { clip-path: inset(0 0 0 var(--split)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; translate: -1px 0; background: #fff; box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); }
.compare .handle::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-content: center; background: #fff; color: #111; font-weight: 800; letter-spacing: 2px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

/* Detail cards */
.details { padding: 40px 0 110px; }
.details header { text-align: center; margin-bottom: 50px; }
.details header p { color: var(--muted); max-width: 600px; margin: 16px auto 0; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  padding: 28px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--stroke);
  transition: transform 0.5s var(--ease), border-color 0.3s, background 0.3s, opacity 0.9s var(--ease);
}
.card.in:hover { transform: translateY(-6px); border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.07); }
.card .icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-content: center; background: var(--accent); margin-bottom: 18px; }
.card .icon svg { width: 24px; height: 24px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card p { color: var(--muted); margin-top: 8px; font-size: 0.98rem; }

/* Closing call to action */
.cta { padding: 40px 0 130px; text-align: center; }
.cta-box {
  padding: 70px 30px; border-radius: 34px; border: 1px solid var(--stroke); position: relative; overflow: hidden;
  background: radial-gradient(circle at 20% 0%, rgba(255, 92, 120, 0.28), transparent 55%),
              radial-gradient(circle at 85% 100%, rgba(140, 89, 255, 0.32), transparent 55%), var(--bg-raised);
}
.cta-box img { width: 96px; margin: 0 auto 22px; filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.5)); }
.cta-box p { color: var(--muted); margin: 14px auto 30px; max-width: 520px; }

footer { border-top: 1px solid var(--stroke); padding: 34px 0 50px; color: var(--faint); font-size: 0.92rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
footer nav { display: flex; gap: 22px; margin-left: auto; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* Text pages (privacy, support) */
.page { padding: 140px 0 100px; }
.page .wrap { width: min(760px, 100% - 40px); }
.page h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.page .updated { color: var(--faint); margin: 14px 0 40px; }
.page h2 { font-size: 1.5rem; margin: 46px 0 12px; letter-spacing: -0.01em; }
.page p, .page li { color: var(--muted); }
.page p + p { margin-top: 14px; }
.page ul, .page ol { padding-left: 22px; margin-top: 10px; display: grid; gap: 8px; }
.page a { color: var(--text); text-decoration-color: var(--pink); text-underline-offset: 3px; }
.page strong { color: var(--text); }
.callout { margin: 30px 0; padding: 24px 26px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--stroke); }
.callout p { color: var(--text); }
details { border-bottom: 1px solid var(--stroke); }
details summary {
  cursor: pointer; list-style: none; padding: 20px 34px 20px 0; position: relative; font-family: var(--rounded);
  font-weight: 700; font-size: 1.1rem; color: var(--text);
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font-size: 1.5rem; color: var(--pink); transition: rotate 0.35s var(--ease); }
details[open] summary::after { rotate: 45deg; }
details > div { padding: 0 0 22px; animation: drop 0.45s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav .button { margin-left: auto; }
  .story-grid { display: block; }
  .story-visual, .story-progress { display: none; }
  .step { min-height: 0; opacity: 1; padding: 50px 0; }
  .step .window { display: block; margin-top: 30px; }
  .stats-grid, .cards { grid-template-columns: 1fr; }
  .stats, .appearance, .details { padding-bottom: 70px; }
}
@media (min-width: 901px) and (max-width: 1100px) { .cards { grid-template-columns: repeat(2, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .story-frame .window, .step { transition: none; opacity: 1; transform: none; filter: none; }
  .story-frame .window:not(.active) { opacity: 0; }
}

code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em; padding: 2px 7px; border-radius: 7px; background: var(--card); border: 1px solid var(--stroke); color: var(--text); word-break: break-all; }
details div p + p { margin-top: 12px; }
