/* ============================================================
   Wilderness Labs — design system
   Palette: deep forest night, aurora green, glacial cyan, ember
   ============================================================ */

:root {
  --bg: #05080a;
  --bg-2: #0a1114;
  --ink: #e9f2ec;
  --ink-dim: #9aa7a0;
  --ink-faint: #57695f;
  --aurora: #6dffa8;
  --glacier: #67e8f9;
  --ember: #f5c66b;
  --line: rgba(233, 242, 236, 0.09);
  --line-strong: rgba(233, 242, 236, 0.18);
  --card: rgba(13, 22, 24, 0.55);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(109, 255, 168, 0.25); }

/* ---------- GPU canvas + grain ---------- */

#gpu-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%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)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(4) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1.4%); }
  50% { transform: translate(1.6%, -1%); }
  75% { transform: translate(-1%, -1.8%); }
  100% { transform: translate(0, 0); }
}

main { position: relative; z-index: 2; }

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10; /* above main (z-index 2) so the hero can't swallow nav clicks */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4vw, 3rem);
  transition: background 0.4s var(--ease-out), backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}

.nav--scrolled {
  background: rgba(5, 8, 10, 0.72);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom-color: var(--line);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.nav__brand-thin { font-weight: 300; color: var(--aurora); margin-left: 0.15rem; }

.nav__mark { width: 26px; height: 26px; color: var(--aurora); }

.nav__links { display: flex; gap: 2rem; }

.nav__links a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  transition: color 0.25s;
  position: relative;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: var(--aurora);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}

.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.72rem 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.btn svg { width: 17px; height: 17px; }

.btn:hover { transform: translateY(-2px); border-color: rgba(233, 242, 236, 0.4); }
.btn:active { transform: translateY(0); }

.btn--solid {
  background: var(--aurora);
  border-color: var(--aurora);
  color: #04120a;
  font-weight: 600;
}

.btn--solid:hover {
  box-shadow: 0 0 34px rgba(109, 255, 168, 0.35);
  border-color: var(--aurora);
}

.btn--ghost:hover { background: rgba(233, 242, 236, 0.05); }

.nav__cta { padding: 0.5rem 1.1rem; font-size: 0.82rem; }

.text-link {
  color: var(--aurora);
  text-decoration: none;
  border-bottom: 1px solid rgba(109, 255, 168, 0.4);
  transition: border-color 0.25s, color 0.25s;
}

.text-link:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem clamp(1.2rem, 6vw, 6rem) 6rem;
  position: relative;
}

/* Soft scrim behind the copy: keeps the particle field visible at the
   edges while guaranteeing text contrast. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 68% 62% at 32% 47%,
    rgba(5, 8, 10, 0.78),
    rgba(5, 8, 10, 0.42) 52%,
    transparent 78%
  );
}

.hero__inner { max-width: 900px; position: relative; z-index: 1; }

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aurora);
  border: 1px solid rgba(109, 255, 168, 0.28);
  background: rgba(109, 255, 168, 0.06);
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 2.2rem;
}

.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--aurora);
  box-shadow: 0 0 10px var(--aurora);
  animation: pulse 2.2s ease-in-out infinite;
  flex: none;
}

.hero__tag--ember {
  color: var(--ember);
  border-color: rgba(245, 198, 107, 0.32);
  background: rgba(245, 198, 107, 0.07);
}

.pulse-dot--ember { background: var(--ember); box-shadow: 0 0 10px var(--ember); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero__title {
  font-size: clamp(2.6rem, 7.2vw, 6rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 1.8rem;
}

.hero__title span { display: block; }


/* Home: the headline shares the hero with the Kea-B console. */
.hero--kea { padding-bottom: clamp(3.5rem, 7vw, 6rem); }
.hero--kea .kea {
  width: 100%;
  max-width: 1088px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
}
.hero--kea .kea__copy { max-width: 530px; }
.hero--kea .hero__tag { margin-bottom: 1.5rem; }
.hero__title--kea { font-size: clamp(2.3rem, 3.5vw, 3.35rem); margin-bottom: 1.6rem; }
.hero--kea .hero__sub { margin-bottom: 0; }

/* The Kea family, behind the hero console: copy beside its numbers. */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about__copy .kea__lede { max-width: 56ch; }

.fn-ref { color: var(--aurora); text-decoration: none; font-size: 0.55em; vertical-align: super; margin-left: 0.08em; }
.footnote {
  margin-top: clamp(2rem, 4vw, 3rem);
  max-width: 78ch;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.7;
  color: var(--ink-faint);
}
.about__copy .kea__lede:last-of-type { margin-bottom: 1.9rem; }

.hero__title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--ember) 5%, #ff9d6b 55%, #ff7d5e 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  max-width: 560px;
  color: var(--ink-dim);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  font-weight: 300;
  margin-bottom: 2.6rem;
}

.hero__sub strong { color: var(--ink); font-weight: 500; }

.hero__actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

/* ---------- Ticker ---------- */

.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 0.9rem 0;
  background: rgba(5, 8, 10, 0.5);
  backdrop-filter: blur(6px);
}

.ticker__track {
  display: flex;
  gap: 2.4rem;
  width: max-content;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  animation: ticker 36s linear infinite;
}

.ticker__track i { color: var(--aurora); font-style: normal; font-size: 0.55rem; align-self: center; }

@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */

.section {
  padding: clamp(5rem, 11vw, 9.5rem) clamp(1.2rem, 6vw, 6rem);
  max-width: 1280px;
  margin: 0 auto;
  scroll-margin-top: 4.5rem; /* keep anchored sections clear of the fixed nav */
}

.section__head {
  display: flex;
  gap: clamp(1rem, 3vw, 2.6rem);
  margin-bottom: clamp(2.6rem, 6vw, 4.5rem);
  align-items: baseline;
}

.section__index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--aurora);
  letter-spacing: 0.1em;
  flex: none;
}

.section__head h2 {
  font-size: clamp(1.8rem, 4.2vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.section__head .dim { color: var(--ink-faint); font-weight: 300; }

/* ---------- Technology grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  backdrop-filter: blur(10px);
  padding: 1.7rem 1.6rem 1.5rem;
  overflow: hidden;
  transition: transform 0.45s var(--ease-out), border-color 0.45s, background 0.45s;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(109, 255, 168, 0.35);
  background: rgba(15, 26, 28, 0.7);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(109, 255, 168, 0.09), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.card:hover::before { opacity: 1; }

.card__glyph { width: 44px; height: 44px; margin-bottom: 1.2rem; color: var(--aurora); }
.card__glyph svg { width: 100%; height: 100%; }

.card h3 { font-size: 1.18rem; font-weight: 500; letter-spacing: -0.015em; margin-bottom: 0.6rem; }

.card p { color: var(--ink-dim); font-size: 0.92rem; font-weight: 300; line-height: 1.65; }

.card__tag {
  position: absolute;
  top: 1.2rem; right: 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

/* ---------- Use-case feature ---------- */

.usecase {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(10, 17, 20, 0.85), rgba(6, 10, 12, 0.92));
  backdrop-filter: blur(14px);
  padding: clamp(1.6rem, 4vw, 2.4rem);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(233, 242, 236, 0.06);
  transition: transform 0.45s var(--ease-out), border-color 0.45s;
  max-width: 760px;
}

.usecase:hover {
  transform: translateY(-4px);
  border-color: rgba(109, 255, 168, 0.4);
}

.usecase__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember);
  border: 1px solid rgba(245, 198, 107, 0.32);
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}

.usecase h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
}

.usecase p {
  color: var(--ink-dim);
  font-weight: 300;
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 58ch;
}

.usecase__go {
  display: inline-block;
  margin-top: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--aurora);
}

.usecase__go::after { content: " →"; }

/* ---------- Corpus page: spec strip ---------- */

.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.1rem;
}

.spec {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  backdrop-filter: blur(10px);
  padding: 1.4rem 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.spec__v {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--aurora);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.spec__k { font-size: 0.8rem; color: var(--ink-faint); line-height: 1.5; }

.specs__note {
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-faint);
  max-width: 640px;
  line-height: 1.7;
}

/* ---------- CTA ---------- */

.section--cta { text-align: center; }

.cta {
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.4rem, 5vw, 4rem);
  background:
    radial-gradient(600px 300px at 50% -10%, rgba(109, 255, 168, 0.12), transparent 70%),
    var(--card);
  backdrop-filter: blur(12px);
}

.cta h2 { font-size: clamp(2.2rem, 5.5vw, 4rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 1.2rem; }

.cta p { color: var(--ink-dim); font-weight: 300; max-width: 480px; margin: 0 auto 2.2rem; }

.cta__form { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }

.cta__form input {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink);
  background: rgba(5, 8, 10, 0.6);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.75rem 1.3rem;
  width: min(320px, 100%);
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.cta__form input:focus { border-color: var(--aurora); box-shadow: 0 0 0 3px rgba(109, 255, 168, 0.15); }

.cta__ok {
  display: block;
  margin-top: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--aurora);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s, transform 0.5s var(--ease-out);
}

.cta__ok--show { opacity: 1; transform: none; }

/* ---------- Footer ---------- */

.footer {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 2rem;
  padding: 3.5rem clamp(1.2rem, 6vw, 6rem) 3rem;
  border-top: 1px solid var(--line);
  max-width: 1280px;
  margin: 0 auto;
}

.footer__col { display: flex; flex-direction: column; gap: 0.55rem; }

.footer__brand { font-weight: 600; font-size: 1.05rem; }

.footer__line { color: var(--ink-faint); font-size: 0.85rem; font-weight: 300; line-height: 1.6; }

.footer__head {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}

.footer__col a { color: var(--ink-dim); text-decoration: none; font-size: 0.88rem; transition: color 0.25s; }
.footer__col a:hover { color: var(--aurora); }

.footer__col--right { text-align: left; }

.footer__mono { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-faint); }

/* ---------- Kea-B live demo ---------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#gpu-canvas { transition: opacity 0.8s var(--ease-out); }
/* Kea-B has the GPU: the frozen field steps back. */
.field-paused #gpu-canvas { opacity: 0.5; }

.kea {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5.5vw, 5rem);
  align-items: start;
}

.kea__copy { max-width: 500px; }


.nowrap { white-space: nowrap; }

.kea__lede {
  color: var(--ink-dim);
  font-weight: 300;
  font-size: clamp(1.02rem, 1.35vw, 1.13rem);
  line-height: 1.72;
  margin-bottom: 2.3rem;
}

.kea__lede--name { margin-bottom: 1.1rem; }
.kea__set { white-space: nowrap; }
.kea__t { color: var(--ink); font-weight: 600; }

.kea__lede strong { color: var(--ink); font-weight: 500; }

.kea__tern {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--ink);
  background: rgba(233, 242, 236, 0.05);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.04em 0.36em;
  white-space: nowrap;
}

.kea__tern--neg { color: var(--glacier); border-color: rgba(103, 232, 249, 0.25); background: rgba(103, 232, 249, 0.06); }
.kea__tern--pos { color: var(--aurora); border-color: rgba(109, 255, 168, 0.25); background: rgba(109, 255, 168, 0.06); }

.kea__stats { list-style: none; border-top: 1px solid var(--line); margin-bottom: 1.9rem; }

.kea__stats li {
  display: grid;
  grid-template-columns: 7.4rem minmax(0, 1fr);
  align-items: baseline;
  gap: 1.2rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line);
}

.kea__v {
  font-family: var(--font-mono);
  font-size: clamp(1.45rem, 2.3vw, 1.8rem);
  color: var(--aurora);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.kea__k { font-size: 0.88rem; color: var(--ink-dim); font-weight: 300; }

.kea__card {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--aurora);
  text-decoration: none;
  transition: color 0.25s;
}

.kea__cards { display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; }
.kea__card::after { content: " ↗"; }
.kea__card:hover { color: var(--ink); }

/* The console: an opaque instrument panel, so it needs no quiet zone. */
.demo {
  --lvl: 0;
  --accent: 109, 255, 168;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(11, 19, 22, 0.95), rgba(5, 9, 11, 0.97));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 50px 120px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(233, 242, 236, 0.07);
  overflow: hidden;
  isolation: isolate;
}

.demo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(520px 240px at 50% -12%, rgba(var(--accent), 0.11), transparent 72%);
  transition: background 0.6s;
}

.demo[data-state="loading"], .demo[data-state="transcribing"] { --accent: 103, 232, 249; }
.demo[data-state="recording"] { --accent: 255, 125, 94; }
.demo[data-state="unsupported"], .demo[data-state="error"] { --accent: 245, 198, 107; }

.demo__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.demo__id { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); white-space: nowrap; min-width: 0; }
.demo__spec { color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; }
.demo__spec::before { content: "/"; margin-right: 0.6rem; color: var(--line-strong); }

.demo__led {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex: none;
  background: rgb(var(--accent));
  box-shadow: 0 0 10px rgba(var(--accent), 0.9);
  transition: background 0.4s, box-shadow 0.4s;
}

.demo[data-state="idle"] .demo__led { background: var(--ink-faint); box-shadow: none; }
.demo[data-state="loading"] .demo__led,
.demo[data-state="transcribing"] .demo__led,
.demo[data-state="recording"] .demo__led { animation: pulse 1.1s ease-in-out infinite; }

.demo__state {
  flex: none;
  padding: 0.28rem 0.65rem;
  border: 1px solid rgba(var(--accent), 0.3);
  border-radius: 999px;
  color: rgb(var(--accent));
  background: rgba(var(--accent), 0.06);
  font-variant-numeric: tabular-nums;
  transition: color 0.4s, border-color 0.4s, background 0.4s;
}

.demo[data-state="idle"] .demo__state { color: var(--ink-dim); border-color: var(--line-strong); background: transparent; }

.demo__viz {
  position: relative;
  height: 148px;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(233, 242, 236, 0.035) 1px, transparent 1px) 0 50% / 100% 50%,
    linear-gradient(180deg, rgba(3, 6, 7, 0.55), rgba(3, 6, 7, 0.15));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.demo__viz canvas { display: block; width: 100%; height: 100%; }

.demo__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-height: 372px;
  padding: clamp(1.4rem, 3vw, 2rem) clamp(1.2rem, 3vw, 2rem) clamp(1.2rem, 2.4vw, 1.6rem);
}

.demo__panel { flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.demo__panel[hidden] { display: none; }
.demo__panel--center { align-items: center; text-align: center; }
.demo__panel--in { animation: demo-in 0.55s var(--ease-out) both; }

@keyframes demo-in { from { opacity: 0; transform: translateY(8px); } }

.demo__help { margin-top: 1.1rem; font-size: 0.84rem; color: var(--ink-faint); max-width: 34ch; line-height: 1.55; }

.demo__note {
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--ember);
  border: 1px solid rgba(245, 198, 107, 0.28);
  background: rgba(245, 198, 107, 0.06);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  max-width: 36ch;
}

.demo__load { padding: 0.85rem 1.5rem; font-size: 0.95rem; }

.demo__link {
  font: inherit;
  color: var(--ink-dim);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  cursor: pointer;
  padding: 0;
  transition: color 0.25s, border-color 0.25s;
}

.demo__link:hover { color: var(--ink); border-bottom-color: var(--ink-dim); }
.demo__link[hidden] { display: none; }

.demo__label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.demo__msg { font-size: 1.02rem; line-height: 1.6; color: var(--ink); max-width: 48ch; }
.demo__msg--center { margin-bottom: 1.3rem; }

.demo__notice {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ember);
  text-align: center;
  border: 1px solid rgba(245, 198, 107, 0.24);
  background: rgba(245, 198, 107, 0.05);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  animation: demo-in 0.45s var(--ease-out) both;
}

.demo__notice[hidden] { display: none; }

/* Loading */

.load__row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }

.load__phase { font-size: 1.08rem; font-weight: 500; letter-spacing: -0.01em; }

.load__count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.load__bar {
  position: relative;
  height: 3px;
  margin: 1rem 0 0.85rem;
  border-radius: 99px;
  background: rgba(233, 242, 236, 0.08);
  overflow: hidden;
}

.load__bar span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--glacier), var(--aurora));
  box-shadow: 0 0 14px rgba(109, 255, 168, 0.7);
  transition: transform 0.25s linear;
}

.demo[data-phase="verify"] .load__bar span::after,
.demo[data-phase="compile"] .load__bar span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  background-size: 30% 100%;
  background-repeat: no-repeat;
  animation: shimmer 1.1s linear infinite;
}

@keyframes shimmer { from { background-position: -40% 0; } to { background-position: 140% 0; } }

.load__row--sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* Record button */

.rec {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  color: #04120a;
  background: var(--aurora);
  box-shadow: 0 0 0 7px rgba(109, 255, 168, 0.1), 0 0 44px rgba(109, 255, 168, 0.28);
  transition: transform 0.35s var(--ease-out), background 0.35s, color 0.35s, box-shadow 0.35s;
}

.rec > * { grid-area: 1 / 1; }
.rec:hover { transform: scale(1.04); box-shadow: 0 0 0 9px rgba(109, 255, 168, 0.14), 0 0 60px rgba(109, 255, 168, 0.42); }
.rec:active { transform: scale(0.97); }
.rec:disabled { cursor: progress; }

.rec__mic { width: 30px; height: 30px; }
.rec__stop { display: none; width: 22px; height: 22px; border-radius: 5px; background: currentColor; }

.rec__ring {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px solid rgba(109, 255, 168, 0.26);
  pointer-events: none;
  animation: rec-breathe 3.2s ease-in-out infinite;
}

@keyframes rec-breathe {
  0%, 100% { transform: scale(0.94); opacity: 0.35; }
  50% { transform: scale(1.06); opacity: 1; }
}

.rec__spin {
  display: none;
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(103, 232, 249, 0.12);
  border-top-color: var(--glacier);
  animation: spin 0.85s linear infinite;
}

@keyframes spin { to { transform: rotate(1turn); } }

.demo[data-state="recording"] .rec {
  color: #1d0804;
  background: #ff7d5e;
  box-shadow:
    0 0 0 calc(7px + var(--lvl) * 14px) rgba(255, 125, 94, 0.13),
    0 0 calc(34px + var(--lvl) * 54px) rgba(255, 125, 94, 0.38);
  transition: transform 0.35s var(--ease-out), background 0.35s, color 0.35s, box-shadow 0.09s linear;
}

.demo[data-state="recording"] .rec__ring {
  border-color: rgba(255, 125, 94, 0.4);
  animation: none;
  transform: scale(calc(1 + var(--lvl) * 0.3));
  opacity: calc(0.35 + var(--lvl) * 0.65);
  transition: transform 0.09s linear, opacity 0.09s linear;
}

.demo[data-state="recording"] .rec__mic { display: none; }
.demo[data-state="recording"] .rec__stop { display: block; }

.demo[data-state="transcribing"] .rec,
.demo[data-state="arming"] .rec {
  color: var(--glacier);
  background: rgba(103, 232, 249, 0.07);
  box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.22);
  transform: none;
}

.demo[data-state="transcribing"] .rec__ring,
.demo[data-state="arming"] .rec__ring { display: none; }
.demo[data-state="transcribing"] .rec__spin,
.demo[data-state="arming"] .rec__spin { display: block; }

.rec__label { margin-top: 1.55rem; font-size: 1.06rem; font-weight: 500; letter-spacing: -0.01em; }

.rec__timer {
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.demo[data-state="recording"] #kea-elapsed { color: #ff9d85; }

.rec__limit {
  margin-top: 0.75rem;
  visibility: hidden;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  opacity: 0;
  transition: opacity 0.4s;
}

.demo[data-state="recording"] .rec__limit { opacity: 1; visibility: visible; }

/* Result */

.demo__panel[data-panel="result"] { justify-content: flex-start; }

.result__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }

.result__src {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result__text {
  font-size: clamp(1.14rem, 1.75vw, 1.4rem);
  font-weight: 300;
  line-height: 1.55;
  letter-spacing: -0.012em;
  color: var(--ink);
  overflow-wrap: break-word;
}

.result__text .w {
  display: inline-block;
  animation: word-in 0.6s var(--ease-out) both;
  animation-delay: var(--t, 0ms);
}

@keyframes word-in {
  from { opacity: 0; transform: translateY(0.4em); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

.result__empty { color: var(--ink-faint); }

.result__stats {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.25rem;
  margin-top: 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.6;
  color: var(--ink-faint);
  animation: demo-in 0.6s var(--ease-out) both;
  animation-delay: var(--t, 0ms);
}

.result__stats span:not(:last-child)::after { content: "·"; margin: 0 0.6rem; color: var(--ink-faint); }
.result__stats b { color: var(--ink); font-weight: 500; }
.result__stats span:nth-child(3) b { color: var(--aurora); }

.result__credit {
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.6;
  color: var(--ink-faint);
  opacity: 0.8;
  animation: demo-in 0.6s var(--ease-out) both;
  animation-delay: var(--t, 0ms);
}

.result__credit[hidden] { display: none; }
.result__credit a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.result__credit a:hover { color: var(--ink-dim); }

.result__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }

.btn--sm { padding: 0.55rem 1.05rem; font-size: 0.82rem; }
.btn--sm svg { width: 15px; height: 15px; }

/* Loading pipeline: three steps that light up as each phase completes */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: auto;
}

.steps[hidden] { display: none; }

.steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 0.85rem;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  transition: color 0.4s;
}

/* Track + fill on top of each step. */
.steps li::before,
.steps li::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
}

.steps li::after {
  background: var(--aurora);
  box-shadow: 0 0 10px rgba(109, 255, 168, 0.5);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out), background 0.3s;
}

.steps__n { font-size: 0.6rem; letter-spacing: 0.14em; }
.steps__t { font-family: var(--font-display); font-size: 0.86rem; color: var(--ink-dim); transition: color 0.4s; }
.steps__d { font-size: 0.62rem; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.steps li[data-s="active"] { color: var(--glacier); }
.steps li[data-s="active"] .steps__t { color: var(--ink); }
.steps li[data-s="active"]::after {
  background: var(--glacier);
  box-shadow: 0 0 10px rgba(103, 232, 249, 0.6);
  transform: scaleX(var(--p, 0.08));
}

.steps li[data-s="done"] { color: var(--aurora); }
.steps li[data-s="done"] .steps__t { color: var(--ink); }
.steps li[data-s="done"]::after { transform: scaleX(1); }

/* Sample chips */

.samples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 0.75rem;
  margin-top: auto;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.samples[hidden] { display: none; }
.demo[data-state="result"] .samples { justify-content: flex-start; }

.samples__label { font-size: 0.8rem; color: var(--ink-faint); }
.samples__chips { display: flex; flex-wrap: wrap; justify-content: inherit; gap: 0.5rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: 0.8rem;
  line-height: 1;
  color: var(--ink-dim);
  background: rgba(233, 242, 236, 0.03);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.5rem 0.8rem 0.5rem 0.65rem;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s, opacity 0.25s, transform 0.3s var(--ease-out);
}

.chip > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; line-height: 1.25; margin: -0.15em 0; }
.chip svg { width: 9px; height: 9px; flex: none; color: var(--aurora); }
.chip__len { font-family: var(--font-mono); font-size: 0.64rem; color: var(--ink-faint); }
.chip:hover { color: var(--ink); border-color: rgba(109, 255, 168, 0.45); background: rgba(109, 255, 168, 0.06); transform: translateY(-1px); }
.chip--on { color: var(--ink); border-color: rgba(109, 255, 168, 0.55); background: rgba(109, 255, 168, 0.08); }
.chip:disabled { opacity: 0.35; cursor: default; pointer-events: none; }

/* Unsupported: precomputed transcripts */

.pre { margin-top: 1.5rem; }
.pre[hidden] { display: none; }

.pre__list {
  list-style: none;
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.pre__item { border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem 1rem; background: rgba(233, 242, 236, 0.02); }
.pre__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem 1rem; margin-bottom: 0.45rem; }
.pre__title { font-size: 0.9rem; font-weight: 500; }
.pre__meta { font-family: var(--font-mono); font-size: 0.62rem; color: var(--ink-faint); }
.pre__text { font-size: 0.92rem; font-weight: 300; line-height: 1.6; color: var(--ink-dim); }
.pre__credit { margin-top: 0.5rem; font-family: var(--font-mono); font-size: 0.6rem; line-height: 1.6; color: var(--ink-faint); opacity: 0.8; }

/* Footer */

.demo__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.demo__private { display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; }
.demo__private svg { width: 12px; height: 12px; color: var(--aurora); }
.demo__adapter { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0.04em; }

/* Focus */

.demo :focus-visible,
.kea__copy a:focus-visible,
.hero__actions .btn:focus-visible {
  outline: 2px solid var(--glacier);
  outline-offset: 3px;
}

.rec:focus-visible { outline-offset: 22px; }
.demo:focus { outline: none; }

/* ---------- Reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0s);
}

.reveal--in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker__track, .grain, .pulse-dot { animation: none; }
  html { scroll-behavior: auto; }
  .demo__led, .rec__ring, .demo__panel--in, .demo__notice, .result__stats,
  .result__text .w, .load__bar span::after { animation: none !important; }
  .rec__spin { animation-duration: 2.4s; }
  .result__credit { animation: none !important; }
  #gpu-canvas, .load__bar span { transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .kea, .hero--kea .kea, .about { grid-template-columns: minmax(0, 1fr); }
  .kea__copy { max-width: 620px; }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .footer { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .hero__tag--long { font-size: 0.66rem; letter-spacing: 0.08em; white-space: nowrap; }
  .kea__stats li { grid-template-columns: 5.6rem minmax(0, 1fr); gap: 0.9rem; }
  .demo { border-radius: 18px; }
  .demo__bar, .demo__foot { padding-left: 1rem; padding-right: 1rem; }
  .demo__spec { display: none; }
  .demo__viz { height: 116px; padding: 0 0.8rem; }
  .demo__body { min-height: 270px; }
  .rec { width: 76px; height: 76px; }
  .demo__private { letter-spacing: 0.1em; }
  .demo__foot { flex-wrap: wrap; row-gap: 0.35rem; }
  .demo__adapter { white-space: normal; }
  .steps { gap: 0.7rem; }
  .steps__d { white-space: normal; line-height: 1.45; }
  .result__head { flex-direction: column; gap: 0.35rem; }
  .result__src { white-space: normal; }
}

@media (max-width: 400px) {
  .hero__title--kea { font-size: 2.1rem; }
}
