/* ───────────────────────────────────────────────────────────────────────
   Voxy · voxy.build — instrument-grade control-room
   Palette mirrors the product's own gate states:
   amber = read-back / pending · green = executed · red = destructive
   ─────────────────────────────────────────────────────────────────────── */
:root {
  --bg:        #0b0c0e;
  --bg-elev:   #131519;
  --bg-elev-2: #181b21;
  --ink:       #ece7df;
  --ink-soft:  #c3c0b8;
  --muted:     #82868f;
  --faint:     #565a63;
  --line:      rgba(236, 231, 223, 0.10);
  --line-soft: rgba(236, 231, 223, 0.06);

  --amber:  #ffb454;
  --amber-d:#c98322;
  --green:  #5ee68a;
  --red:    #ff6b5e;

  /* Unified on Mona Sans (GitHub's neo-grotesque) — Vercel/Supabase/Stainless register. */
  --display: "Mona Sans", ui-sans-serif, system-ui, sans-serif;
  --sans:    "Mona Sans", ui-sans-serif, system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --maxw: 1180px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* atmospheric grain + faint instrument grid */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 18%, #000 0%, transparent 92%);
  opacity: 0.5;
}
.grain::after {
  content: ""; position: absolute; inset: 0;
  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='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

main, .nav, .foot { position: relative; z-index: 1; }
section { padding-inline: clamp(1.25rem, 5vw, 4rem); }

/* ── typography primitives ──────────────────────────────────────────── */
h1, h2 { font-weight: 600; letter-spacing: -0.035em; margin: 0; }
h1 {
  font-family: var(--display);
  font-size: clamp(3rem, 8.2vw, 5.7rem);
  line-height: 0.97;
}
h2 { font-family: var(--display); font-size: clamp(2.1rem, 4.8vw, 3.4rem); line-height: 1.05; }
h3 { font-family: var(--sans); font-weight: 600; font-size: 1.18rem; letter-spacing: -0.01em; margin: 0; }
.ital { font-style: italic; color: var(--amber); }
strong { color: var(--ink); font-weight: 600; }
em { font-style: italic; color: var(--ink-soft); }
a { color: inherit; }

.kicker {
  font-family: var(--mono);
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.22em; color: var(--amber);
  margin: 0 0 1.1rem; text-transform: uppercase;
}
.visually-hidden, .visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }

/* ── buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--mono); font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.04em; text-decoration: none;
  padding: 0.78em 1.3em; border-radius: 7px; border: 1px solid transparent;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn--solid { background: var(--amber); color: #1a1304; font-weight: 700; }
.btn--solid:hover { background: #ffc777; }
.btn--ghost { border-color: var(--line); color: var(--ink); background: rgba(255,255,255,0.015); }
.btn--ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ── nav ────────────────────────────────────────────────────────────── */
.nav {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.1rem clamp(1.25rem, 5vw, 4rem);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(11,12,14,0.85), rgba(11,12,14,0.4));
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--ink); font-family: var(--mono); font-weight: 700; letter-spacing: -0.01em; }
.brand__glyph { color: var(--amber); font-size: 1.05em; }
.brand__tld { color: var(--muted); font-weight: 500; }
.nav__links { display: flex; gap: 1.6rem; margin-left: auto; }
.nav__links a { text-decoration: none; color: var(--ink-soft); font-size: 0.92rem; transition: color 0.2s; }
.nav__links a:hover { color: var(--amber); }
.nav__cta { margin-left: 0.5rem; }
@media (max-width: 760px) { .nav__links { display: none; } .nav__cta { margin-left: auto; } }

/* ── hero ───────────────────────────────────────────────────────────── */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding-top: clamp(3rem, 8vw, 6rem); padding-bottom: clamp(3rem, 7vw, 5rem);
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center; position: relative;
}
.hero__glow {
  position: absolute; inset: -20% -10% auto auto; width: 60%; height: 120%;
  background: radial-gradient(closest-side, rgba(255,180,84,0.16), transparent 70%);
  filter: blur(8px); z-index: -1; pointer-events: none;
}
.hero__claim { font-family: var(--display); font-weight: 500; font-size: clamp(1.25rem, 2.2vw, 1.6rem); letter-spacing: -0.02em; color: var(--amber); margin: 0.9rem 0 0; }
.lede { font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--ink-soft); max-width: 36ch; margin: 1.2rem 0 2rem; }
.hero__cta { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.hero__note { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-soft); margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 0.4rem; box-shadow: 0 0 8px currentColor; }
.dot--amber { background: var(--amber); color: var(--amber); }
.dot--green { background: var(--green); color: var(--green); }
.dot--red { background: var(--red); color: var(--red); }
@media (max-width: 940px) { .hero { grid-template-columns: 1fr; } }

/* ── the console centerpiece ────────────────────────────────────────── */
.console {
  background: linear-gradient(180deg, var(--bg-elev), var(--bg));
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.04);
}
.console__bar { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line-soft); background: rgba(255,255,255,0.015); }
.console__dots { display: inline-flex; gap: 0.35rem; }
.console__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.console__title { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); }
.console__badge { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; color: var(--amber); border: 1px solid var(--amber-d); border-radius: 4px; padding: 0.12rem 0.4rem; }
.console__live { margin-left: auto; display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.16em; color: var(--green); }
.console__pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: livepulse 1.6s var(--ease) infinite; }
@keyframes livepulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
.console__cue { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); margin: 0; }
.console__body { padding: 1.3rem 1.2rem 1.1rem; min-height: 248px; display: flex; flex-direction: column; gap: 1rem; position: relative; }
.console__foot { margin: 0; padding: 0.7rem 1.1rem; border-top: 1px solid var(--line-soft); font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.console__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line-soft); overflow: hidden; opacity: 0; transition: opacity 0.25s; }
.console__progress.is-live { opacity: 1; }
.console__progress i { display: block; height: 100%; width: 100%; background: var(--amber); transform-origin: left; transform: scaleX(1); }
.console__progress.is-running i { transform: scaleX(0); transition: transform var(--gate-ms, 4200ms) linear; }

.line--mic { display: flex; align-items: center; gap: 0.8rem; }
.wave { display: inline-flex; align-items: center; gap: 3px; height: 26px; }
.wave i { width: 3px; height: 6px; background: var(--amber); border-radius: 2px; opacity: 0.55; }
.wave.is-live i { animation: pulse 0.9s var(--ease) infinite; }
.wave.is-live i:nth-child(2){animation-delay:.08s} .wave.is-live i:nth-child(3){animation-delay:.16s}
.wave.is-live i:nth-child(4){animation-delay:.24s} .wave.is-live i:nth-child(5){animation-delay:.32s}
.wave.is-live i:nth-child(6){animation-delay:.4s} .wave.is-live i:nth-child(7){animation-delay:.48s}
.wave.is-live i:nth-child(8){animation-delay:.56s} .wave.is-live i:nth-child(9){animation-delay:.64s}
@keyframes pulse { 0%,100%{height:6px;opacity:.4} 50%{height:24px;opacity:1} }
.line__said { font-size: 1.02rem; color: var(--ink); }
.line__said::after { content: "▏"; color: var(--amber); animation: blink 1s steps(1) infinite; }
.line__said.is-done::after { content: ""; }
@keyframes blink { 50% { opacity: 0; } }

.parsed { display: flex; flex-direction: column; gap: 0.6rem; animation: rise 0.4s var(--ease) both; }
.parsed__row { display: flex; align-items: center; gap: 0.6rem; }
.tag { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.16em; color: var(--bg); background: var(--muted); padding: 0.12rem 0.4rem; border-radius: 3px; }
.parsed__row code { font-family: var(--mono); font-size: 0.86rem; color: var(--ink); }
.parsed__args { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); background: var(--bg); border: 1px solid var(--line-soft); border-radius: 8px; padding: 0.7rem 0.8rem; margin: 0; white-space: pre-wrap; line-height: 1.5; }
.readback { display: flex; gap: 0.55rem; align-items: baseline; font-size: 0.95rem; color: var(--ink-soft); border-left: 2px solid var(--amber); padding-left: 0.7rem; }
.readback__flag { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em; padding: 0.1rem 0.4rem; border-radius: 3px; white-space: nowrap; }
.flag--destructive { color: var(--red); border: 1px solid var(--red); }
.flag--safe { color: var(--green); border: 1px solid var(--green); }

.gate { display: flex; align-items: center; gap: 0.8rem; margin-top: auto; animation: rise 0.4s var(--ease) both; }
.confirm {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  font-family: var(--mono); cursor: pointer; border: 1px solid var(--amber);
  background: rgba(255,180,84,0.08); color: var(--amber);
  border-radius: 9px; padding: 0.7rem; transition: all 0.18s var(--ease);
}
.confirm:hover { background: rgba(255,180,84,0.16); }
.confirm:active { transform: translateY(1px); }
.confirm:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.confirm__label { font-weight: 700; letter-spacing: 0.16em; font-size: 0.92rem; }
.confirm__hint { font-size: 0.62rem; color: var(--muted); letter-spacing: 0.04em; }
.cancel { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 9px; padding: 0.7rem 1rem; cursor: pointer; transition: color 0.2s, border-color 0.2s; }
.cancel:hover { color: var(--ink); border-color: var(--ink-soft); }

.result { display: flex; align-items: center; gap: 0.6rem; margin-top: auto; font-family: var(--mono); font-size: 0.9rem; color: var(--green); animation: rise 0.35s var(--ease) both; }
.result__tick { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(94,230,138,0.14); border: 1px solid var(--green); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── problem strip ──────────────────────────────────────────────────── */
.strip { border-block: 1px solid var(--line-soft); padding-block: clamp(3rem, 7vw, 5rem); margin-top: 1rem; }
.strip__text { max-width: 860px; margin: 0 auto; font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.3; color: var(--ink-soft); text-align: center; }
.strip__hl { color: var(--ink); display: block; margin-top: 0.4rem; }

/* ── generic section ────────────────────────────────────────────────── */
.section { max-width: var(--maxw); margin: 0 auto; padding-block: clamp(4rem, 9vw, 7rem); }
.section__head { margin-bottom: clamp(2.2rem, 5vw, 3.5rem); max-width: 44ch; }
.section__lede { color: var(--muted); font-size: 1.05rem; margin: 1rem 0 0; }

/* steps */
.steps { list-style: none; padding: 0; margin: 0 0 clamp(2.5rem,5vw,3.5rem); display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; counter-reset: s; }
.step { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.step__no { font-family: var(--mono); font-size: 0.74rem; color: var(--amber-d); letter-spacing: 0.06em; }
.step h3 { margin: 0.7rem 0 0.5rem; }
.step p { color: var(--muted); font-size: 0.98rem; margin: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

/* terminal */
.terminal { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-elev); box-shadow: 0 30px 70px -45px rgba(0,0,0,0.9); }
.terminal__bar { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line-soft); font-family: var(--mono); font-size: 0.74rem; color: var(--muted); }
.terminal__body { font-family: var(--mono); font-size: 0.74rem; line-height: 1.55; color: var(--ink-soft); padding: 1.1rem 1.2rem; margin: 0; overflow-x: auto; font-feature-settings: "liga" 0, "calt" 0; }
.t-dim { color: var(--faint); } .t-cmd { color: var(--amber); } .t-amber { color: var(--amber); } .t-red { color: var(--red); } .t-green { color: var(--green); }

/* safety pillars */
.section--safety { position: relative; }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.pillar { background: linear-gradient(180deg, var(--bg-elev), var(--bg)); border: 1px solid var(--line-soft); border-radius: 12px; padding: 1.5rem 1.3rem; transition: border-color 0.25s, transform 0.25s var(--ease); }
.pillar:hover { border-color: var(--amber-d); transform: translateY(-3px); }
.pillar__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,180,84,0.22); background: rgba(255,180,84,0.05); color: var(--amber); margin-bottom: 1.1rem; }
.pillar__icon svg { width: 20px; height: 20px; }
.pillar__icon--warn { color: var(--red); border-color: rgba(255,107,94,0.3); background: rgba(255,107,94,0.05); }
.pillar h3 { margin-bottom: 0.5rem; }
.pillar p { color: var(--muted); font-size: 0.92rem; margin: 0; }
@media (max-width: 980px) { .pillars { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pillars { grid-template-columns: 1fr; } }

/* proof callout — the trading-demo credibility point, surfaced */
.proof { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem 0.7rem; margin: 1.8rem 0 0; padding: 1rem 1.2rem; border: 1px solid var(--line-soft); border-left: 2px solid var(--green); border-radius: 10px; background: rgba(94,230,138,0.04); font-size: 0.95rem; color: var(--ink-soft); }
.proof__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); flex: none; }
.proof a { color: var(--green); text-decoration: none; font-weight: 600; white-space: nowrap; }
.proof a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* modes */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.mode { border: 1px solid var(--line); border-radius: 14px; padding: 1.8rem 1.6rem; background: var(--bg-elev); }
.mode header { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1rem; }
.mode__tag { width: fit-content; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.16em; padding: 0.18rem 0.5rem; border-radius: 4px; }
.mode__tag--a { color: var(--amber); border: 1px solid var(--amber-d); }
.mode__tag--b { color: var(--ink-soft); border: 1px solid var(--line); }
.mode p { color: var(--ink-soft); font-size: 0.98rem; }
.ticks { list-style: none; padding: 0; margin: 1.1rem 0 0; display: grid; gap: 0.5rem; }
.ticks li { position: relative; padding-left: 1.5rem; font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.ticks li::before { content: "→"; position: absolute; left: 0; color: var(--amber); }
@media (max-width: 820px) { .modes { grid-template-columns: 1fr; } }

/* apis */
.apis { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.api { background: var(--bg); padding: 1.5rem 1.3rem; display: flex; flex-direction: column; gap: 0.3rem; transition: background 0.25s; }
.api:hover { background: var(--bg-elev-2); }
.api__name { font-family: var(--display); font-size: 1.5rem; }
.api__role { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.api--live .api__role { color: var(--green); }
.api--soon .api__name { color: var(--muted); }
@media (max-width: 820px) { .apis { grid-template-columns: repeat(2, 1fr); } }

/* cta */
.cta { padding-block: clamp(4.5rem, 10vw, 8rem); border-top: 1px solid var(--line-soft); background: radial-gradient(120% 100% at 50% 0%, rgba(255,180,84,0.07), transparent 60%); }
.cta__inner { max-width: 640px; margin: 0 auto; text-align: center; }
.cta h2 { font-size: clamp(2.4rem, 6vw, 4rem); }
.cta p { color: var(--muted); margin: 1.2rem auto 2rem; max-width: 46ch; }
.cta__form { display: flex; gap: 0.6rem; max-width: 460px; margin: 0 auto; }
.cta__form input { flex: 1; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 8px; padding: 0.85rem 1rem; color: var(--ink); font-family: var(--mono); font-size: 0.9rem; transition: border-color 0.2s; }
.cta__form input::placeholder { color: var(--muted); }
.cta__form input:focus-visible { border-color: var(--amber); outline: 2px solid var(--amber); outline-offset: 2px; }
.cta__hint { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); margin: 0.9rem 0 0; }
.cta__msg { font-family: var(--mono); font-size: 0.8rem; min-height: 1.2em; margin: 1rem 0 0; }
.cta__msg.is-ok { color: var(--green); }
.cta__msg.is-err { color: var(--red); }
@media (max-width: 520px) { .cta__form { flex-direction: column; } }

/* footer */
.foot { max-width: var(--maxw); margin: 0 auto; padding: 2.5rem clamp(1.25rem,5vw,4rem) 3.5rem; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 1rem; }
.foot__row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand--sm { font-size: 0.95rem; }
.foot__tag { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); }
.foot__meta { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); }
.foot__meta a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.foot__meta a:hover { color: var(--amber); }

/* ── reveal on scroll ───────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .wave.is-live i { animation: none; height: 14px; }
  .line__said::after { animation: none; }
}
