:root {
  --bg: #05060a;
  --bg-2: #0b0d14;
  --ink: #eef1f7;
  --ink-2: #b9c0d0;
  --muted: #7d8598;
  --hair: rgba(255, 255, 255, 0.08);
  --hair-2: rgba(255, 255, 255, 0.14);
  --glass: rgba(14, 16, 24, 0.62);
  --cyan: #8fe6ff;
  --lilac: #b8a2ff;
  --pink: #ff9ccc;
  --gold: #ffd27a;
  --iris: linear-gradient(120deg, var(--cyan), var(--lilac) 50%, var(--pink));
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Fixed grain layer: keeps flat blacks from banding without repainting on scroll. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
img, canvas { display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ---------- Floating island nav ---------- */
.nav {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--hair);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 20px 50px -20px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  max-width: calc(100vw - 24px);
  white-space: nowrap;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 0 12px 0 4px; text-decoration: none; font-weight: 600; letter-spacing: -0.02em; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.nav a.link {
  text-decoration: none;
  font-size: 14px;
  color: var(--ink-2);
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.4s var(--ease), background 0.4s var(--ease);
}
.nav a.link:hover, .nav a.link[aria-current='page'] { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.nav .btn { padding: 6px 6px 6px 14px; font-size: 14px; }
.nav .btn .ico { width: 26px; height: 26px; }

/* ---------- Buttons (pill + nested icon) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.5s var(--ease), background 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn .ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: transform 0.5s var(--ease);
}
.btn:hover .ico { transform: translate(2px, -1px) scale(1.05); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--ink); color: #07080c; box-shadow: 0 10px 40px -12px rgba(143, 230, 255, 0.55); }
.btn-primary .ico { background: #07080c; color: var(--ink); }
.btn-primary:hover { box-shadow: 0 14px 50px -10px rgba(184, 162, 255, 0.7); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair-2); }
.btn-ghost .ico { background: rgba(255, 255, 255, 0.08); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.iris { background: var(--iris); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Phone frame (double bezel) ---------- */
.phone {
  --r: 44px;
  position: relative;
  aspect-ratio: 9 / 19.5;
  padding: 7px;
  border-radius: var(--r);
  background: linear-gradient(150deg, #2a2e3a, #0d0f15 40%, #1b1e28);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.18),
    0 40px 80px -30px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.6);
}
.phone .screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--r) - 7px);
  overflow: hidden;
  background: #000;
  isolation: isolate;
}
.phone canvas { width: 100%; height: 100%; }
.phone .screen::before {
  content: '';
  position: absolute;
  top: 2.2%;
  left: 50%;
  width: 4.2%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 2;
}
.phone .screen::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), transparent 30%);
  z-index: 2;
}
.phone.sm { --r: 22px; padding: 4px; }
.phone.sm .screen { border-radius: calc(var(--r) - 4px); }
.phone.sm .screen::before { display: none; }

/* ---------- Chips & controls ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 0;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--hair);
  transition: background 0.4s var(--ease), color 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}
.chip:hover { color: var(--ink); background: rgba(255, 255, 255, 0.09); }
.chip:active { transform: scale(0.96); }
.chip[aria-pressed='true'] { color: #07080c; background: var(--ink); box-shadow: none; }
.chip.premium::after { content: ' \2605'; color: var(--gold); font-size: 10px; }
.chip.premium[aria-pressed='true']::after { color: #b07a00; }

.controls { display: grid; gap: 14px; }
.ctl { display: grid; gap: 8px; font-size: 13px; color: var(--ink-2); }
.ctl-range { grid-template-columns: 1fr auto; }
.ctl-range input { grid-column: 1 / -1; }
.ctl output { font: 500 12px/1 var(--mono); color: var(--muted); align-self: center; }
.ctl-color { grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.ctl-name::first-letter { text-transform: uppercase; }

input[type='range'] {
  --p: 50%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--lilac)) 0 / var(--p) 100% no-repeat, rgba(255, 255, 255, 0.1);
}
input[type='range']::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); }
input[type='range']::-moz-range-progress { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--cyan), var(--lilac)); }
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 4px rgba(184, 162, 255, 0.18), 0 2px 8px rgba(0, 0, 0, 0.6);
}
input[type='range']::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--ink); }
input[type='color'] {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--hair-2);
}
input[type='color']::-webkit-color-swatch-wrapper { padding: 0; }
input[type='color']::-webkit-color-swatch { border: 0; border-radius: 50%; }
input[type='color']::-moz-color-swatch { border: 0; border-radius: 50%; }

/* ---------- Glass card (double bezel) ---------- */
.shell {
  padding: 6px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.core {
  height: 100%;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(22, 25, 36, 0.9), rgba(10, 12, 18, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); filter: blur(6px); transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
}

.footer { padding: 48px 0 56px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--hair); }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer a { text-decoration: none; transition: color 0.4s var(--ease); }
.footer a:hover { color: var(--ink); }

.nogl { padding: 12px 16px; border-radius: 14px; background: rgba(255, 120, 120, 0.08); color: #ffb4b4; font-size: 14px; }
