:root {
  --bg: #070708;
  --ink: #f5f5f7;
  --muted: #a3a3ad;
  --dim: #6e6e78;
  --line: #2a2a32;
  --lime: #d4ff00;
  --cyan: #7aefff;
  --hot: #ff5a5a;
  --card: #121216;
  --sans: "Noto Sans", "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", sans-serif;
  --mono: "Liberation Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  background:
    radial-gradient(880px 520px at 72% 42%, rgba(212, 255, 0, 0.09), transparent 62%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}

::selection { background: var(--lime); color: #141408; }

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.play:focus-visible { outline-color: #fff; }

.app {
  display: grid;
  grid-template-columns: minmax(260px, 400px) minmax(300px, 420px);
  gap: 48px;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  padding:
    max(28px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}

.mark {
  margin: 0 0 18px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.mark span { color: var(--lime); }

h1 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2rem, 4vw, 3.15rem);
  font-weight: 900;
  letter-spacing: -0.048em;
  line-height: 0.92;
}

.lede {
  margin: 16px 0 22px;
  max-width: 36ch;
  color: var(--muted);
  font-size: 1.02rem;
}

#clip-nav { display: grid; gap: 8px; }

.clip-btn {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px;
}

.clip-btn:hover { background: #121214; }

.clip-btn.on {
  background: #14160c;
  border-color: rgba(212, 255, 0, 0.45);
}

.clip-n {
  color: var(--lime);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.clip-name-lg { display: block; font-weight: 800; letter-spacing: -0.02em; }
.clip-len { display: block; margin-top: 2px; color: var(--dim); font-size: 0.8rem; }

.hint {
  margin: 18px 0 0;
  color: var(--dim);
  font-size: 0.82rem;
  max-width: 36ch;
}

.phone {
  position: relative;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  width: min(400px, 100%);
  height: min(720px, calc(100dvh - 64px));
  margin: 0 auto;
  padding: 18px 18px 14px;
  background: #0c0c10;
  border: 1px solid #2c2c34;
  border-radius: 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.tick {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--lime);
  pointer-events: none;
}

.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 8px 8px;
}

.who {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.rec {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--lime);
}

.playing .rec { animation: pulse 1.6s ease-out infinite; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(212, 255, 0, 0.55); }
  100% { box-shadow: 0 0 0 8px rgba(212, 255, 0, 0); }
}

#clip-name {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
}

.meter { display: flex; gap: 4px; padding: 0 8px 8px; }

.seg {
  position: relative;
  flex: 1;
  height: 22px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.seg::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 9px;
  height: 3px;
  border-radius: 99px;
  background: #2a2a32;
}

.seg i {
  position: absolute;
  left: 0;
  top: 9px;
  height: 3px;
  width: 0;
  border-radius: 99px;
  background: var(--lime);
}

.seg.done i, .seg.on i { width: 100%; }

.seg.play i { animation: fill var(--hold, 3.8s) linear; }

@keyframes fill { from { width: 0; } to { width: 100%; } }

.stage {
  flex: 1;
  overflow: auto;
  padding: 12px 8px 8px;
  display: flex;
  flex-direction: column;
}

.stage.center { justify-content: center; }

.kicker {
  margin: 0 0 8px;
  color: var(--lime);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.title {
  margin: 0;
  font-size: clamp(2.4rem, 16cqi, 4.05rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.86;
  text-transform: uppercase;
}

.title.long { font-size: clamp(1.7rem, 9cqi, 2.35rem); letter-spacing: -0.045em; }

h1, .sub, .say { text-wrap: balance; }

.sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.visual {
  margin-top: 22px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.visual:empty { display: none; }

.say {
  margin: 0;
  min-height: 4.6em;
  padding: 12px 8px 4px;
  border-top: 1px solid #24242c;
  color: #dedee6;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  padding: 8px 4px 0;
}

.controls button, .clip-switch button, .idea {
  border-radius: 999px;
  border: 1px solid #34343c;
  background: #141418;
}

.controls button {
  min-height: 44px;
  padding: 0 12px;
  font-size: 0.86rem;
  font-weight: 700;
}

.controls .play {
  background: var(--lime);
  color: #141408;
  border-color: var(--lime);
  padding: 0 18px;
}

.clip-switch {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 4px 6px;
}

.clip-switch button {
  min-height: 36px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

button:active { transform: translateY(1px); }

.chips, .tok-out, .flow, .steps, .ideas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip, .step, .vec-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--lime);
  color: #141408;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.chip.alt { background: #f5f5f7; }

.chip.raw {
  background: transparent;
  color: #c8c8d0;
  border: 1px dashed #555560;
}

.chip.mark {
  min-height: 0;
  padding: 0 2px;
  background: transparent;
  color: var(--dim);
}

.step { background: transparent; color: var(--ink); min-height: 0; padding: 0; font-size: 1.2rem; }
.step.hot { color: var(--lime); }
.arrow { color: var(--lime); font-weight: 800; }

.bits, .vecs li, .vec-pill {
  font-family: var(--mono);
  font-weight: 500;
}

.word-lg {
  margin: 0;
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.85;
  text-transform: uppercase;
}

.bits {
  margin: 0;
  color: var(--lime);
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.vecs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.vecs li {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #10141a;
  color: var(--cyan);
  font-size: 0.92rem;
}

.vec-pill {
  background: #10141a;
  color: var(--cyan);
  border-radius: 12px;
}

.prompt {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(212, 255, 0, 0.75);
  background: #12140c;
}

.prompt-l { font-weight: 700; letter-spacing: -0.02em; }

.blank {
  padding: 6px 10px;
  border-radius: 10px;
  background: #1c2408;
  color: var(--lime);
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 1.25rem;
}

.bars { display: grid; gap: 8px; }

.bar {
  display: grid;
  grid-template-columns: 5.2rem 1fr 3.2rem;
  gap: 8px;
  align-items: center;
}

.bar-l { white-space: nowrap; }

.bar-l { font-weight: 800; letter-spacing: -0.03em; }
.bar-p { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.85rem; text-align: right; }
.bar.hot .bar-l, .bar.hot .bar-p { color: var(--lime); }

.track {
  display: block;
  height: 14px;
  border-radius: 99px;
  background: #222228;
  overflow: hidden;
}

.fill {
  display: block;
  height: 100%;
  width: 0;
  background: #3c3c46;
  transition: width 0.45s ease;
}

.bar.hot .fill { background: var(--lime); }

.struck {
  margin: 0;
  color: #6d6d76;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.9;
  text-transform: uppercase;
  text-decoration: line-through;
  text-decoration-color: var(--hot);
  text-decoration-thickness: 3px;
}

.huge {
  margin: 0;
  color: var(--lime);
  font-size: 3.4rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.88;
  text-transform: uppercase;
}

.stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.stack li {
  padding: 10px 12px;
  border-left: 3px solid var(--lime);
  background: #141418;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.duo { display: grid; gap: 10px; }

.slab {
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  background: #f5f5f7;
  color: #141408;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 1.3rem;
}

.slab.hot { background: var(--lime); }

.field { display: grid; gap: 6px; }

.field-label {
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

input[type="text"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #34343c;
  background: #08080c;
  font-weight: 700;
  letter-spacing: -0.02em;
}

input[type="text"]:focus { border-color: var(--lime); outline: none; }

.idea {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.idea[aria-pressed="true"] {
  background: var(--lime);
  color: #141408;
  border-color: var(--lime);
}

.meta { margin: 0; color: var(--muted); font-size: 0.85rem; font-weight: 600; }

.noscript {
  margin: 0;
  padding: 12px 16px;
  text-align: center;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas: "phone" "rail";
    gap: 18px;
    align-items: stretch;
  }

  .rail { grid-area: rail; }
  main { grid-area: phone; }

  h1 { max-width: 18ch; font-size: 2rem; }

  .phone {
    height: auto;
    min-height: 640px;
  }

  .stage { flex: none; min-height: 280px; overflow: visible; }
}

@media (max-width: 420px) {
  .app { gap: 12px; }

  h1 { font-size: 1.7rem; }

  .lede { font-size: 0.95rem; margin-bottom: 12px; }

  .phone {
    border-radius: 22px;
    min-height: 0;
    padding: 14px 12px 10px;
  }

  .title { font-size: clamp(2.5rem, 14cqi, 3.3rem); }
  .title.long { font-size: 1.65rem; }
  .word-lg { font-size: 3.2rem; }
  .huge { font-size: 2.8rem; }
  .say { font-size: 0.92rem; min-height: 4.8em; }
  .bar { grid-template-columns: 4.2rem 1fr 2.8rem; gap: 6px; }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
