:root {
  --bg: #07060b;
  --bg2: #0e0c16;
  --ink: #f3f1fa;
  --mute: #9b97ad;
  --line: rgba(255, 255, 255, 0.08);
  --violet: #7c5cff;
  --cyan: #22d3ee;
  --coral: #ff7a59;
  --grad: linear-gradient(100deg, var(--violet), var(--cyan) 55%, var(--coral));
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
em { font-style: italic; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.grad {
  background: var(--grad);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradShift 8s ease-in-out infinite alternate;
  padding-right: 0.08em;
}
.grad-bg { background: var(--grad); color: #0a0810 !important; }
@keyframes gradShift { to { background-position: 100% 0; } }

/* ambient layers */
.grain {
  position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: 0.06;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) 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%); } 100% { transform: translate(0, 0); }
}
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px;
  border-radius: 50%; pointer-events: none; z-index: 1; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.16), rgba(34, 211, 238, 0.06) 40%, transparent 70%);
  transform: translate3d(-999px, -999px, 0); transition: opacity 0.4s;
}
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 60;
  background: var(--grad); transform-origin: 0 50%; transform: scaleX(0);
}

/* nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 48px);
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.4s;
}
.nav.scrolled {
  background: rgba(7, 6, 11, 0.6); backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line); padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-word { font-weight: 600; letter-spacing: -0.03em; font-size: 20px; }
.brand-mark { width: 26px; height: 26px; transition: transform 1.2s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-360deg); }
.nav-links { display: flex; gap: 32px; font-size: 14px; color: var(--mute); }
.nav-links a { position: relative; transition: color 0.3s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--grad);
  transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer;
  font: 500 15px/1 var(--sans); padding: 14px 22px; border-radius: 999px;
  transition: transform 0.3s var(--ease), box-shadow 0.4s, background 0.3s;
  will-change: transform;
}
.btn-primary {
  color: #0a0810; background: var(--grad); background-size: 200% 100%;
  box-shadow: 0 8px 40px -8px rgba(124, 92, 255, 0.6);
}
.btn-primary:hover { box-shadow: 0 12px 60px -6px rgba(34, 211, 238, 0.6); background-position: 100% 0; }
.btn-ghost { color: var(--ink); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); }
.mic-ico {
  width: 10px; height: 10px; border-radius: 50%; background: #0a0810; position: relative;
}
.mic-ico::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #0a0810; opacity: 0;
}
.listening .mic-ico { background: #e11d48; }
.listening .mic-ico::after { animation: ping 1.2s ease-out infinite; border-color: #e11d48; }
@keyframes ping { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }

/* hero */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; overflow: hidden;
}
#terrain { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 60% at 22% 55%, rgba(7, 6, 11, 0.92), rgba(7,6,11,.5) 55%, transparent 80%),
              linear-gradient(to bottom, transparent 70%, var(--bg));
}
.hero-inner { position: relative; z-index: 2; padding: 110px clamp(20px, 6vw, 96px) 90px; max-width: 900px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font: 500 12px var(--mono);
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--mute);
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.02);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
.hero-title {
  font-size: clamp(56px, 9vw, 132px); line-height: 0.92; letter-spacing: -0.055em; font-weight: 500;
  margin: 24px 0 24px;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero-title .word { display: inline-block; transform: translateY(110%); transition: transform 1.2s var(--ease); }
.hero-title .serif { font-weight: 400; letter-spacing: -0.03em; }
.loaded .hero-title .word { transform: none; }
.loaded .hero-title .line:nth-child(1) .word:nth-child(2) { transition-delay: 0.08s; }
.loaded .hero-title .line:nth-child(2) .word { transition-delay: 0.18s; }
.hero-sub { font-size: clamp(17px, 1.6vw, 21px); color: #c9c5d8; max-width: 560px; font-weight: 300; }
.hero-sub em { font-family: var(--serif); font-size: 1.15em; color: var(--ink); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.mic-note { font-size: 12px; color: var(--mute); margin-top: 14px; font-family: var(--mono); }
.hero-scale {
  position: absolute; z-index: 2; left: clamp(20px, 6vw, 96px); right: clamp(20px, 6vw, 96px); bottom: 28px;
  display: flex; justify-content: space-between; font: 11px var(--mono); color: rgba(255,255,255,.3);
  border-top: 1px solid var(--line); padding-top: 10px;
}

/* marquee */
.marquee {
  border-block: 1px solid var(--line); overflow: hidden; padding: 26px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex; gap: 40px; width: max-content; align-items: center;
  animation: marquee 40s linear infinite;
  font-family: var(--serif); font-size: clamp(32px, 4vw, 56px); font-style: italic; white-space: nowrap;
}
.marquee-track span { color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.35); transition: color .4s; }
.marquee-track span:hover { color: var(--ink); -webkit-text-stroke-color: transparent; }
.marquee-track b { font-size: 14px; color: var(--violet); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* sections */
.section { position: relative; padding: clamp(100px, 14vw, 180px) clamp(20px, 6vw, 96px); }
.section-head { max-width: 860px; margin-bottom: 64px; }
.kicker { font: 500 12px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 20px; }
h2 { font-size: clamp(40px, 6vw, 88px); line-height: 1; letter-spacing: -0.045em; font-weight: 500; }
h2 .serif { letter-spacing: -0.02em; }
.lede { font-size: clamp(17px, 1.5vw, 20px); color: #b9b5c9; font-weight: 300; max-width: 620px; margin-top: 24px; }
.lede em { font-family: var(--serif); font-size: 1.15em; color: var(--ink); }

/* reveal */
.reveal { opacity: 0; transform: translateY(40px); filter: blur(6px); transition: opacity 1s var(--ease), transform 1.2s var(--ease), filter 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; filter: none; }

/* signal compare */
.compare {
  border: 1px solid var(--line); border-radius: 28px; padding: clamp(20px, 4vw, 48px);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
}
.compare-row { display: grid; grid-template-columns: 120px 1fr; gap: 24px; align-items: center; padding: 22px 0; }
.compare-row + .compare-row { border-top: 1px dashed var(--line); }
.compare-tag {
  justify-self: start; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .12em;
  padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line); color: var(--mute);
}
.transcript { font: 400 clamp(18px, 2.2vw, 28px) var(--mono); color: var(--mute); letter-spacing: -0.02em; }
.prosody { position: relative; height: 220px; }
.prosody svg { position: absolute; inset: 0 0 50px; width: 100%; height: calc(100% - 50px); overflow: visible; }
.pitch {
  fill: none; stroke: url(#pg); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 2200; stroke-dashoffset: 2200; transition: stroke-dashoffset 3.2s var(--ease);
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, .5));
}
.compare.in .pitch { stroke-dashoffset: 0; }
.words { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; }
.words span {
  position: absolute; left: var(--x); bottom: 0; font-size: clamp(14px, 1.6vw, 22px); font-weight: 500;
  opacity: 0; transform: translateY(12px); transition: opacity .6s, transform .8s var(--ease);
  white-space: nowrap;
}
.compare.in .words span { opacity: 1; transform: none; }
.compare.in .words span:nth-child(1) { transition-delay: .2s; }
.compare.in .words span:nth-child(2) { transition-delay: .5s; }
.compare.in .words span:nth-child(3) { transition-delay: 1s; }
.compare.in .words span:nth-child(4) { transition-delay: 1.3s; }
.compare.in .words span:nth-child(5) { transition-delay: 1.6s; }
.compare.in .words span:nth-child(6) { transition-delay: 2s; }
.compare.in .words span:nth-child(7) { transition-delay: 2.3s; }
.compare.in .words span:nth-child(8) { transition-delay: 2.7s; }
.words .gap {
  width: var(--w); text-align: center; font: 11px var(--mono); color: var(--coral);
  border-top: 1px dashed var(--coral); padding-top: 6px; bottom: 6px;
}
.words .stress { font-weight: 700; color: var(--cyan); letter-spacing: .02em; }
.words .rise { font-family: var(--serif); font-style: italic; font-size: clamp(18px, 2vw, 30px); color: var(--coral); }
.annotations { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.anno {
  display: grid; grid-template-columns: 10px 1fr; gap: 4px 12px; align-items: center; font-size: 14px;
  padding: 16px; border-radius: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--line);
}
.anno i { width: 10px; height: 10px; border-radius: 50%; }
.anno .a1 { background: var(--coral); } .anno .a2 { background: var(--cyan); } .anno .a3 { background: var(--violet); }
.anno span { grid-column: 2; color: var(--mute); font-size: 13px; }

/* tonotopy map */
.map { background: radial-gradient(ellipse 50% 60% at 75% 50%, rgba(124,92,255,.08), transparent 70%); }
.map-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.map-visual { aspect-ratio: 1; position: relative; }
#cochlea { width: 100%; height: 100%; display: block; }
.freq-legend { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 32px; font: 12px var(--mono); color: var(--mute); }
.freq-legend span { display: inline-flex; align-items: center; gap: 8px; }
.freq-legend i { width: 18px; height: 3px; border-radius: 2px; }

/* products */
.card {
  position: relative; border: 1px solid var(--line); border-radius: 28px; overflow: hidden;
  padding: clamp(24px, 4vw, 48px); background: var(--bg2);
  transform-style: preserve-3d; transition: border-color .4s;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(124, 92, 255, .14), transparent 40%);
}
.card:hover { border-color: rgba(255,255,255,.16); }
.card:hover::before { opacity: 1; }
.card h3 { font-size: clamp(26px, 3vw, 42px); letter-spacing: -0.035em; line-height: 1.05; font-weight: 500; margin: 24px 0 16px; max-width: 720px; }
.card p { color: var(--mute); max-width: 620px; }
.card .fine { font: 11px var(--mono); margin-top: 10px; opacity: .6; }
.card-top { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; background: var(--grad); color: #0a0810; }
.badge.muted { background: rgba(255,255,255,.05); color: var(--mute); border: 1px solid var(--line); }
.card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }

.pipeline { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 48px; position: relative; z-index: 1; }
.pipeline li {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 14px; font-size: 14px; font-weight: 500;
  background: rgba(7,6,11,.7); backdrop-filter: blur(4px);
  opacity: 0; transform: translateY(20px); transition: opacity .6s, transform .8s var(--ease), border-color .4s;
}
.pipeline li span { display: block; font: 11px var(--mono); color: var(--cyan); margin-bottom: 18px; }
.studio.in .pipeline li { opacity: 1; transform: none; }
.studio.in .pipeline li:nth-child(2) { transition-delay: .1s; } .studio.in .pipeline li:nth-child(3) { transition-delay: .2s; }
.studio.in .pipeline li:nth-child(4) { transition-delay: .3s; } .studio.in .pipeline li:nth-child(5) { transition-delay: .4s; }
.studio.in .pipeline li:nth-child(6) { transition-delay: .5s; }
.pipeline li.active { border-color: var(--cyan); box-shadow: 0 0 0 1px rgba(34,211,238,.3), 0 0 30px -6px rgba(34,211,238,.6); }
.pipe-wire { position: relative; height: 2px; margin-top: 20px; background: var(--line); border-radius: 2px; overflow: hidden; }
.pipe-wire i { position: absolute; inset: 0; width: 18%; background: var(--grad); animation: wire 3.6s linear infinite; border-radius: 2px; }
@keyframes wire { from { transform: translateX(-100%); } to { transform: translateX(560%); } }

.eq { display: flex; align-items: flex-end; gap: 6px; height: 90px; margin-top: 40px; }
.eq i { flex: 1; border-radius: 6px 6px 2px 2px; background: var(--grad); background-size: 100% 300%; height: 30%; animation: eq 1.4s ease-in-out infinite alternate; opacity: .85; }
.eq i:nth-child(odd) { animation-duration: 1.1s; }
.eq i:nth-child(3n) { animation-duration: 1.7s; }
.eq i:nth-child(1) { animation-delay: -.3s; } .eq i:nth-child(2) { animation-delay: -.9s; } .eq i:nth-child(3) { animation-delay: -.1s; }
.eq i:nth-child(4) { animation-delay: -.6s; } .eq i:nth-child(5) { animation-delay: -1.2s; } .eq i:nth-child(6) { animation-delay: -.4s; }
.eq i:nth-child(7) { animation-delay: -.8s; } .eq i:nth-child(8) { animation-delay: -.2s; } .eq i:nth-child(9) { animation-delay: -1s; }
.eq i:nth-child(10) { animation-delay: -.5s; } .eq i:nth-child(11) { animation-delay: -.7s; } .eq i:nth-child(12) { animation-delay: -1.3s; }
@keyframes eq { to { height: 100%; } }

.bars { display: grid; gap: 14px; margin-top: 40px; }
.bars div { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 14px; font: 12px var(--mono); color: var(--mute); }
.bars i { height: 8px; border-radius: 8px; background: rgba(255,255,255,.06); position: relative; overflow: hidden; }
.bars i::after { content: ""; position: absolute; inset: 0; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform 1.6s var(--ease) .3s; border-radius: 8px; }
.models.in .bars i::after { transform: scaleX(var(--v)); }

/* principles */
.pgrid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.pcell { padding: 36px 28px 36px 0; border-right: 1px solid var(--line); margin-right: 28px; }
.pcell:last-child { border-right: 0; margin-right: 0; }
.pnum { font-family: var(--serif); font-style: italic; font-size: 28px; color: var(--violet); }
.pcell h4 { font-size: 20px; letter-spacing: -0.02em; font-weight: 500; margin: 18px 0 10px; }
.pcell p { color: var(--mute); font-size: 15px; }
.pcell:nth-child(2) { transition-delay: .1s; } .pcell:nth-child(3) { transition-delay: .2s; } .pcell:nth-child(4) { transition-delay: .3s; }

/* CTA */
.cta { min-height: 90vh; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
#ripple { position: absolute; inset: 0; width: 100%; height: 100%; }
.cta-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.cta h2 { font-size: clamp(48px, 8vw, 128px); }
.cta .lede { margin-inline: auto; }
.cta-form {
  display: flex; gap: 8px; margin-top: 40px; padding: 6px; border-radius: 999px; width: min(480px, 100%);
  background: rgba(255,255,255,.04); border: 1px solid var(--line); backdrop-filter: blur(10px);
}
.cta-form input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--ink); font: 15px var(--sans); padding: 0 18px; }
.cta-form input::placeholder { color: var(--mute); }
.form-msg { margin-top: 16px; font: 13px var(--mono); color: var(--cyan); min-height: 1.4em; }

.foot {
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center;
  padding: 32px clamp(20px, 6vw, 96px); border-top: 1px solid var(--line); color: var(--mute); font-size: 13px;
}
.foot-logo { height: 28px; width: auto; }
.foot a:hover { color: var(--ink); }

/* responsive */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .map-grid, .card-row { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .pgrid { grid-template-columns: 1fr 1fr; }
  .pcell { border-right: 0; margin-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); }
  .annotations { grid-template-columns: 1fr; }
  .compare-row { grid-template-columns: 1fr; gap: 14px; }
  .cursor-glow { display: none; }
}
@media (max-width: 560px) {
  .pgrid { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .words span { font-size: 12px; }
  .words .gap { font-size: 9px; }
  .words .rise { font-size: 16px; }
  .nav .btn { padding: 10px 16px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
}
