/* Prism site — cold ink. The spectrum appears only where it means something
 * (the logo and the waveform's clean output); the UI itself stays near-mono
 * with dusty, desaturated accents. */

:root {
  color-scheme: dark;
  --bg: #0a0c10;
  --bg-raise: #10141a;
  --raise-2: #151a23;
  --line: #1d242e;
  --line-up: #2c3542;
  --text: #e8eaee;
  --muted: #98a1ac;
  --faint: #6b7480;
  --cyan: #7fb4be;     /* dusty teal: "done" status tint */
  --violet: #8a92b8;   /* dusty steel violet: the one interactive accent */
  --magenta: #b39ab8;  /* dusty mauve: rarely used */
  --code-bg: #161b23;
  --pre-bg: #0d1117;
  --pill-bg: rgba(10, 12, 16, .75);
  --accent-border: #424c61;
  --accent-soft: rgba(138, 146, 184, .55);
  --tint-done: rgba(127, 180, 190, .3);
  --tint-next: rgba(138, 146, 184, .35);
  --tint-col: rgba(138, 146, 184, .05);
  --shadow-accent: rgba(138, 146, 184, .3);
  --grain-opacity: .045;
  --mono: ui-monospace, "Cascadia Code", Consolas, "JetBrains Mono", monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --maxw: 880px;
}

/* Light theme: soft paper, same near-mono discipline, accents darkened to
 * keep their contrast. Toggled via data-theme on <html>, saved per visitor. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fa;
  --bg-raise: #ffffff;
  --raise-2: #f1f3f8;
  --line: #e4e8ee;
  --line-up: #c8d0da;
  --text: #1b2027;
  --muted: #525b66;
  --faint: #79828e;
  --cyan: #2c7a87;
  --violet: #5b66a0;
  --magenta: #8a6790;
  --code-bg: #eef1f5;
  --pre-bg: #f1f4f8;
  --pill-bg: rgba(255, 255, 255, .82);
  --accent-border: #aab3cc;
  --accent-soft: rgba(91, 102, 160, .5);
  --tint-done: rgba(44, 122, 135, .3);
  --tint-next: rgba(91, 102, 160, .35);
  --tint-col: rgba(91, 102, 160, .05);
  --shadow-accent: rgba(91, 102, 160, .22);
  --grain-opacity: .025;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

/* Film grain so the dark feels like a material, not a void. */
.grain {
  position: fixed; inset: 0; z-index: 9; pointer-events: none; opacity: var(--grain-opacity);
  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='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mono { font-family: var(--mono); font-size: .82em; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: .88em; }

h1, h2, h3 { font-family: var(--sans); font-weight: 700; letter-spacing: -0.015em; }

a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color .2s ease; }
a:hover { border-color: var(--violet); }

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

.hero {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 36px;
}

nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 72px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-weight: 700; font-size: 1.05rem;
  border: none; letter-spacing: .02em;
}
.navlinks { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.navlinks a { color: var(--muted); border: none; }
.navlinks a:hover { color: var(--text); }
.navlinks a.active {
  color: var(--text);
  border-bottom: 1px solid var(--violet);
}

.theme-toggle {
  width: 30px; height: 30px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line); color: var(--muted);
  font-size: .85rem; line-height: 1; padding: 0;
  transition: border-color .2s ease, color .2s ease;
}
.theme-toggle:hover { border-color: var(--violet); color: var(--text); }

/* Subpage header: same nav, smaller headline. */
.page-head { max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 0; }
.page-title { font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.1; margin: 0 0 14px; }
.page-head .sub { margin-bottom: 10px; }

h1 {
  font-size: clamp(2.7rem, 7.5vw, 4.4rem);
  line-height: 1.04; margin: 0 0 22px;
}

.sub { max-width: 600px; color: var(--muted); margin: 0 0 30px; }

.cta { display: flex; gap: 14px; margin-bottom: 56px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 11px 22px; border-radius: 10px;
  font-family: var(--sans); font-weight: 500; font-size: .95rem;
  border: 1px solid var(--line); background: var(--bg-raise);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--line-up); }
.btn.primary {
  border-color: var(--accent-border);
  background: var(--raise-2);
}
.btn.primary:hover {
  border-color: var(--violet);
  box-shadow: 0 4px 20px -8px var(--shadow-accent);
}

/* ---- Waveform hero visual --------------------------------------------- */

.wavebox {
  position: relative; border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg-raise); overflow: hidden;
}
#wave { display: block; width: 100%; height: 230px; }
.pill {
  position: absolute; top: 12px; right: 12px;
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  color: var(--text); background: var(--pill-bg);
  border: 1px solid var(--line);
  transition: border-color .2s ease, color .2s ease;
}
.pill:hover { border-color: var(--violet); }
.pill[aria-pressed="false"] { color: var(--faint); }

.pipeline {
  color: var(--faint); text-align: center; margin: 18px 0 0;
}

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

main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

section { margin: 88px 0; }

h2 { font-size: 1.7rem; margin: 0 0 18px; }

.facts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; margin-top: 64px;
}
.fact { background: var(--bg-raise); padding: 18px 20px; display: flex; flex-direction: column; gap: 3px; }
.fact-n { font-family: var(--sans); font-weight: 700; font-size: 1.12rem; }
.fact-d { color: var(--faint); font-size: .82rem; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px;
  transition: border-color .25s ease;
}
.card:hover { border-color: var(--line-up); }
.card h3 { margin: 14px 0 8px; font-size: 1.12rem; }
.card p { margin: 0; color: var(--muted); font-size: .93rem; }

/* Audio demo: two players side by side, before vs. after. */
.demo-cards { grid-template-columns: repeat(2, 1fr); margin-top: 18px; }
.demo-cards audio { width: 100%; margin-top: 6px; }

.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; border: 1px solid var(--line); color: var(--faint);
}
.chip.done { color: var(--cyan); border-color: var(--tint-done); }
.chip.next { color: var(--violet); border-color: var(--tint-next); }

/* ---- Try-it demo: record -> clean -> play -------------------------------- */

.try-card { margin-top: 18px; padding: 26px; }

/* Step 1: the record button + its label/timer. */
.try-record-row { display: flex; align-items: center; gap: 16px; }

.try-mic {
  flex: none; width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  color: var(--text);
  background: var(--raise-2); border: 1px solid var(--line-up);
  transition: transform .15s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.try-mic:hover { border-color: var(--accent-border); transform: translateY(-1px); }
.try-mic:active { transform: translateY(0); }
.try-mic-ico { display: grid; place-items: center; }

/* The square "stop" glyph, swapped in while recording. */
.try-mic-stop {
  display: none; width: 18px; height: 18px; border-radius: 4px;
  background: #e25555;
}
.try-card[data-state="recording"] .try-mic {
  border-color: #e25555;
  background: rgba(226, 85, 85, .12);
  box-shadow: 0 0 0 4px rgba(226, 85, 85, .14);
  animation: try-pulse 1.4s ease-in-out infinite;
}
.try-card[data-state="recording"] .try-mic-ico { display: none; }
.try-card[data-state="recording"] .try-mic-stop { display: block; }

@keyframes try-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(226, 85, 85, .14); }
  50%      { box-shadow: 0 0 0 8px rgba(226, 85, 85, .05); }
}

.try-record-meta { display: flex; flex-direction: column; gap: 2px; }
.try-record-label { font-family: var(--sans); font-weight: 500; }
.try-timer { color: var(--faint); font-size: .85rem; }
.try-card[data-state="recording"] .try-timer { color: #e25555; }

/* Step 2: model picker + clean button. */
.try-action-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line);
}
.try-model {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--faint); font-size: .82rem; margin-right: auto;
}
.try-model select {
  font-family: var(--sans); font-size: .9rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-up); border-radius: 8px; padding: 8px 11px;
  cursor: pointer;
}
.try-model select:hover { border-color: var(--accent-border); }
#try-clean[disabled] { opacity: .5; cursor: not-allowed; }
.try-card[data-state="cleaning"] #try-clean { opacity: .7; cursor: progress; }

.try-status { margin: 14px 0 0; min-height: 1.2em; }

/* Step 3: result players, revealed only once they hold audio. */
.try-results {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin-top: 16px;
}
.try-take {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px;
}
.try-take[hidden] { display: none; }
.try-take-head { display: flex; align-items: center; justify-content: space-between; }
.try-take audio { width: 100%; }
.try-download { color: var(--cyan); text-decoration: none; border: none; }
.try-download:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .try-results { grid-template-columns: 1fr; }
}

/* ---- How it works -------------------------------------------------------- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px;
}
.step-n { color: var(--faint); font-size: .8rem; padding-top: 4px; }
.steps h3 { margin: 0 0 6px; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); font-size: .92rem; }
.steps code {
  font-family: var(--mono); font-size: .85em;
  background: var(--code-bg); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px;
}

/* ---- Comparison table ----------------------------------------------------- */

.compare-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare {
  width: 100%; border-collapse: collapse; font-size: .9rem;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.compare th, .compare td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line);
  color: var(--muted); font-weight: 400;
}
.compare thead th {
  font-family: var(--sans); font-weight: 700; color: var(--text);
  background: var(--bg-raise); font-size: .88rem;
}
.compare tbody th { color: var(--faint); font-size: .82rem; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: none; }
.compare .prism-col { color: var(--text); background: var(--tint-col); }
.compare thead .prism-col { color: var(--text); }
#why .small { margin-top: 14px; }

/* ---- Requirements ---------------------------------------------------------- */

.reqs { margin: 0; padding-left: 22px; color: var(--muted); }
.reqs li { margin-bottom: 8px; font-size: .95rem; }
.reqs code {
  font-family: var(--mono); font-size: .85em;
  background: var(--code-bg); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px;
}

/* ---- Bottom teaser + CTA ---------------------------------------------------- */

.teaser {
  text-align: center; border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg-raise); padding: 44px 24px;
}
.teaser p { color: var(--muted); margin: 0 0 22px; }
.teaser a:not(.btn) { border-bottom: 1px solid var(--line); }

/* ---- Rendered markdown (roadmap, devlog, release notes) ----------------- */

.md { overflow-wrap: break-word; }
.md h1 { font-size: 1.35rem; margin: 0 0 14px; }
.md h2 { font-size: 1.15rem; margin: 34px 0 6px; }
.md h3 { font-size: 1rem; margin: 24px 0 6px; }
.md p, .md li { color: var(--muted); font-size: .95rem; }
.md ul { padding-left: 22px; }
.md code {
  font-family: var(--mono); font-size: .85em;
  background: var(--code-bg); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px;
}
.md pre {
  background: var(--pre-bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto;
}
.md pre code { background: none; border: none; padding: 0; font-size: .82rem; line-height: 1.6; }
.md a { border-bottom: 1px solid var(--line); }

.badge {
  display: inline-block; padding: 2px 11px; border-radius: 999px;
  font-family: var(--mono); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; border: 1px solid var(--line); color: var(--faint);
}
.badge.done { color: var(--cyan); border-color: var(--tint-done); }
.badge.next { color: var(--violet); border-color: var(--tint-next); }

/* ---- Roadmap: phase list + detail panel ---------------------------------- */

.roadmap-grid {
  display: grid; grid-template-columns: 252px 1fr; gap: 16px;
  align-items: start;
}

.phase-list { display: flex; flex-direction: column; gap: 8px; }

.phase-item {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; border-radius: 10px; cursor: pointer;
  background: var(--bg-raise); border: 1px solid var(--line);
  color: var(--muted); font: inherit; font-size: .92rem; text-align: left;
  transition: border-color .2s ease, color .2s ease;
}
.phase-item:hover { border-color: var(--line-up); color: var(--text); }
.phase-item.active {
  color: var(--text);
  border-color: var(--accent-soft);
  background: var(--raise-2);
}

.phase-ico { width: 16px; text-align: center; flex: none; }
.phase-item.done .phase-ico::before { content: "\2713"; color: var(--cyan); }
.phase-item.next .phase-ico::before { content: "\25B8"; color: var(--violet); }
.phase-item.planned .phase-ico::before { content: "\25CB"; color: var(--faint); }

.phase-label { line-height: 1.3; }
.phase-num { display: block; font-size: .68rem; color: var(--faint); text-transform: lowercase; }

.phase-go { margin-left: auto; color: var(--faint); opacity: 0; transition: opacity .2s ease; }
.phase-item:hover .phase-go, .phase-item.active .phase-go { opacity: 1; }

.phase-panel {
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px 26px; min-height: 240px;
}
.phase-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.phase-head h3 { margin: 0; font-size: 1.18rem; }

/* ---- Releases ----------------------------------------------------------- */

#releases-body { display: flex; flex-direction: column; gap: 18px; }

.release-date { color: var(--faint); font-size: .8rem; }
.assets { margin: 14px 0 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.asset {
  font-family: var(--mono); font-size: .8rem; padding: 7px 14px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--pre-bg);
  overflow-wrap: anywhere;
}
.asset:hover { border-color: var(--cyan); }

details.devlog { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
details.devlog summary {
  cursor: pointer; font-family: var(--mono); font-size: .82rem;
  color: var(--violet); list-style: none;
}
details.devlog summary::before { content: "▸ "; }
details.devlog[open] summary::before { content: "▾ "; }
details.devlog summary:hover { color: var(--magenta); }
details.devlog .md { margin-top: 14px; }

.buildbox pre {
  background: var(--pre-bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; font-size: .82rem; line-height: 1.7;
}
.buildbox code { font-family: var(--mono); }

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

footer {
  max-width: var(--maxw); margin: 110px auto 0; padding: 28px 24px 44px;
  border-top: 1px solid var(--line);
}
.footrow { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.footrow a, .footrow span { color: var(--muted); border: none; overflow-wrap: anywhere; }
.footrow a:hover { color: var(--text); }

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

@media (max-width: 720px) {
  body { font-size: 16px; }

  .hero, .page-head, main { padding-left: 18px; padding-right: 18px; }
  footer { margin-top: 72px; padding: 24px 18px 36px; }

  /* The nav is the usual phone-width overflow culprit: let it wrap and
   * tighten the gaps instead of forcing a horizontal scrollbar. */
  nav { flex-wrap: wrap; row-gap: 12px; margin-bottom: 44px; }
  .navlinks { gap: 14px; }

  h1 { font-size: clamp(2.2rem, 10.5vw, 3.4rem); }
  h2 { font-size: 1.45rem; }
  .cta { margin-bottom: 40px; }
  .cta .btn { flex: 1 1 auto; text-align: center; }
  #wave { height: 170px; }

  section { margin: 60px 0; }

  .facts { grid-template-columns: repeat(2, 1fr); margin-top: 44px; }
  .fact { padding: 14px 16px; }
  .cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }

  .roadmap-grid { grid-template-columns: 1fr; }
  .phase-panel { padding: 18px 16px; }

  /* Keep the comparison table readable and let the wrapper scroll sideways
   * rather than crushing five columns into a phone width. */
  .compare { min-width: 620px; }
  .compare th, .compare td { padding: 10px 12px; }

  .teaser { padding: 32px 18px; }
}

@media (max-width: 380px) {
  .facts { grid-template-columns: 1fr; }
  .navlinks { gap: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card, .pill { transition: none; }
}
