/* ============================================================
   Gridiron Room — Podcast Script Studio
   Bright editorial rebrand: pale lavender canvas, deep indigo
   ink, bold golden-yellow accent, soft pastel pops.
   Palette sampled from the reference art direction.
   Mobile-first.
   ============================================================ */

:root {
  /* Canvas + surfaces */
  --bg: #eaeefb;          /* pale lavender page */
  --bg-2: #f3f5fd;
  --paper: #ffffff;       /* card paper */
  --paper-2: #f6f7fe;
  --line: #dfe3f3;
  --line-soft: #e9ecf9;

  /* Ink */
  --ink: #161241;         /* deep indigo, primary text */
  --ink-2: #2c2a5c;       /* secondary navy */
  --ink-dim: #5a5982;
  --ink-faint: #8c8cae;

  /* Dark anchor (navy blocks: hero, footer) */
  --navy: #15113f;
  --navy-2: #211a52;
  --navy-line: #34306a;

  /* Accents */
  --gold: #ffd200;        /* primary punch */
  --gold-deep: #f5b400;
  --gold-ink: #1a1330;    /* text that sits on gold */
  --sky: #6fc3ff;
  --sky-soft: #a8d8ff;
  --mint: #43d2a0;
  --pink: #ff8fd0;
  --red: #ff5d6c;
  --green: #1fae7e;

  --radius: 22px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --shadow: 0 30px 60px -28px rgba(21, 17, 63, 0.35);
  --shadow-sm: 0 12px 30px -16px rgba(21, 17, 63, 0.28);
  --maxw: 980px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 640px at 88% -8%, rgba(111, 195, 255, 0.20), transparent 60%),
    radial-gradient(900px 600px at -8% 6%, rgba(255, 210, 0, 0.16), transparent 55%),
    radial-gradient(700px 500px at 50% 120%, rgba(255, 143, 208, 0.14), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: "Sora", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper grain — kept very faint on the light canvas */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin: clamp(14px, 3vw, 28px) auto 0;
  max-width: calc(var(--maxw) + 48px);
  width: calc(100% - clamp(24px, 6vw, 48px));
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  padding: clamp(22px, 5vw, 56px);
  overflow: hidden;
  border-radius: clamp(20px, 4vw, 34px);
  background: var(--navy);
  box-shadow: var(--shadow);
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.9;
}
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(21, 17, 63, 0.25) 0%, rgba(21, 17, 63, 0.55) 50%, rgba(21, 17, 63, 0.92) 100%),
    linear-gradient(90deg, rgba(21, 17, 63, 0.88) 0%, rgba(21, 17, 63, 0.30) 60%, transparent 100%);
}
.hero__inner {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.kicker {
  font-family: "Sometype Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.7rem;
  color: var(--gold);
  margin: 0 0 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 7px 14px 7px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 210, 0, 0.12);
  border: 1px solid rgba(255, 210, 0, 0.28);
}
.kicker::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(255, 93, 108, 0.7);
  animation: pulse 1.8s infinite;
}
h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(3.4rem, 14vw, 7rem);
  line-height: 0.88;
  letter-spacing: 0.01em;
  margin: 0 0 0.5rem;
  color: #fff;
}
h1 .accent {
  display: inline-block;
  color: var(--navy);
  background: var(--gold);
  padding: 0 0.18em;
  border-radius: 10px;
  transform: rotate(-1.5deg);
}
.hero__sub {
  max-width: 48ch;
  color: rgba(234, 238, 251, 0.82);
  font-size: clamp(0.98rem, 2.5vw, 1.14rem);
  margin: 0 0 1.1rem;
}
.hero__note {
  font-family: "Sometype Mono", monospace;
  font-size: 0.78rem;
  color: rgba(234, 238, 251, 0.6);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
}
.hero__note.is-ok { color: var(--mint); }
.hero__note.is-err { color: #ff9aa6; }

/* ---------- Shell / panels ---------- */
.shell {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(22px, 5vw, 44px) clamp(16px, 5vw, 24px) 0;
  display: grid;
  gap: clamp(18px, 4vw, 28px);
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 30px);
  box-shadow: var(--shadow-sm);
}

/* ---------- Controls ---------- */
.controls { display: grid; gap: 22px; }
.field { display: grid; gap: 9px; }
.field label {
  font-family: "Sometype Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--ink-2);
  font-weight: 600;
}
.field__hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

input[type="text"],
textarea {
  width: 100%;
  background: var(--paper-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  padding: 14px 16px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
input[type="text"]::placeholder,
textarea::placeholder { color: var(--ink-faint); }
input[type="text"]:focus,
textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 4px rgba(255, 210, 0, 0.22);
}
input[disabled] { opacity: 0.55; cursor: progress; }
textarea { resize: vertical; min-height: 88px; }

/* Typeahead */
.typeahead { position: relative; }
.typeahead__clear {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--line-soft);
  color: var(--ink-dim);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.typeahead__clear:hover { color: var(--ink); background: var(--line); }
.typeahead__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  z-index: 30;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 290px;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.typeahead__menu li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  min-height: 44px;
}
.typeahead__menu li[aria-selected="true"],
.typeahead__menu li:hover {
  background: rgba(255, 210, 0, 0.16);
}
.typeahead__menu li .badge {
  width: 32px; height: 32px;
  flex: 0 0 auto;
  border-radius: 9px;
  display: grid; place-items: center;
  font-family: "Bebas Neue", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: #fff;
}
.typeahead__menu li .tname { font-weight: 600; color: var(--ink); }
.typeahead__menu .none {
  color: var(--ink-faint);
  cursor: default;
  justify-content: center;
}
.typeahead__menu .none:hover { background: none; }

/* Segmented control */
.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.segmented--wrap { flex-wrap: wrap; }
.segmented button {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-dim);
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 9px 15px;
  cursor: pointer;
  min-height: 40px;
  white-space: nowrap;
  transition: all 0.15s;
}
.segmented button:hover { color: var(--ink); background: rgba(21, 17, 63, 0.05); }
.segmented button.is-active {
  color: var(--gold-ink);
  background: var(--gold);
  box-shadow: 0 6px 16px -8px rgba(245, 180, 0, 0.8);
}

/* Select */
.select {
  width: 100%;
  background: var(--paper-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  padding: 13px 16px;
  cursor: pointer;
  min-height: 48px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235a5982' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.select:focus {
  outline: none;
  background-color: #fff;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 4px rgba(255, 210, 0, 0.22);
}

/* Narrative controls grid */
.controls__grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
.ctrl { display: grid; gap: 8px; }
.ctrl__name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-dim);
}
.controls__grid--two { grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .controls__grid--two { grid-template-columns: 1fr 1fr; }
}

/* Per-mode host config card */
.hostcfg {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  position: relative;
  animation: fade 0.28s ease both;
}
.hostcfg[hidden] { display: none; }
.hostcfg.is-active { border-color: rgba(245, 180, 0, 0.55); background: #fffdf3; }
#twoHostCfg.is-active { border-color: rgba(111, 195, 255, 0.55); background: #f3faff; }
.hostcfg__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: "Sometype Mono", monospace;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--gold-deep);
  margin-bottom: 13px;
}
.hostcfg__tag::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold-deep);
  box-shadow: 0 0 8px rgba(245, 180, 0, 0.6);
}
#twoHostCfg .hostcfg__tag { color: var(--sky); }
#twoHostCfg .hostcfg__tag::before { background: var(--sky); box-shadow: 0 0 8px rgba(111, 195, 255, 0.7); }
.hostcfg :disabled { opacity: 0.45; cursor: not-allowed; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.chips button:hover {
  color: var(--gold-ink);
  border-color: var(--gold-deep);
  background: rgba(255, 210, 0, 0.18);
}

/* Generate button */
.generate {
  position: relative;
  font: inherit;
  font-weight: 700;
  font-size: 1.04rem;
  color: var(--gold-ink);
  background: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  box-shadow: 0 16px 34px -16px rgba(245, 180, 0, 0.85);
  transition: transform 0.12s, filter 0.18s, opacity 0.18s, box-shadow 0.18s;
}
.generate:hover:not(:disabled) { filter: brightness(1.04); transform: translateY(-1px); }
.generate:active:not(:disabled) { transform: translateY(1px); }
.generate:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.generate__spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(26, 19, 48, 0.3);
  border-top-color: var(--gold-ink);
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}
.generate.is-busy .generate__spinner { display: inline-block; }
.controls__live {
  margin: 0;
  min-height: 1.2em;
  font-family: "Sometype Mono", monospace;
  font-size: 0.78rem;
  color: var(--ink-faint);
}
.controls__live.is-err { color: var(--red); }
.controls__live.is-ok { color: var(--green); }

/* ---------- Trace cards ---------- */
.trace { animation: rise 0.5s ease both; }
.trace__title {
  font-family: "Sometype Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-dim);
  margin: 0 0 12px;
}
.trace__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
.tcard {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 15px 17px;
  box-shadow: var(--shadow-sm);
}
.tcard--data { border-left-color: var(--green); }
.tcard--empty { border-left-color: var(--gold-deep); }
.tcard--failed { border-left-color: var(--red); }
.tcard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.tcard__name { font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.tcard__tag {
  font-family: "Sometype Mono", monospace;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.tcard--data .tcard__tag { color: var(--green); background: rgba(31, 174, 126, 0.14); }
.tcard--empty .tcard__tag { color: var(--gold-deep); background: rgba(255, 210, 0, 0.2); }
.tcard--failed .tcard__tag { color: var(--red); background: rgba(255, 93, 108, 0.14); }
.tcard__detail { margin: 0; font-size: 0.82rem; color: var(--ink-dim); }
.tcard__detail.is-err {
  color: var(--red);
  font-family: "Sometype Mono", monospace;
  font-size: 0.74rem;
  word-break: break-word;
}

/* ---------- Output ---------- */
.output__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.output__bar h2 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.1rem;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--ink);
}
.output__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ghost {
  position: relative;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-deep);
  background: rgba(255, 210, 0, 0.16);
  border: 1px solid rgba(245, 180, 0, 0.5);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  cursor: pointer;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}
.ghost:hover:not(:disabled) { background: rgba(255, 210, 0, 0.28); }
.ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.ghost.is-busy { color: var(--ink-faint); }
.ghost .generate__spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(245, 180, 0, 0.3);
  border-top-color: var(--gold-deep);
  display: none;
}
.ghost.is-busy .generate__spinner { display: inline-block; }

/* Host tone dots */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.dot--a { background: var(--gold-deep); }
.dot--b { background: var(--sky); }

/* Share dropdown */
.share { position: relative; display: inline-block; }
.share__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 190px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  animation: rise 0.18s ease both;
}
.share__menu button,
.share__menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  text-decoration: none;
  border-radius: 10px;
  cursor: pointer;
  min-height: 44px;
}
.share__menu button:hover,
.share__menu a:hover { background: rgba(255, 210, 0, 0.16); }
.share__menu .share__ic {
  width: 18px;
  text-align: center;
  flex: 0 0 auto;
}

/* Custom audio player */
.player {
  margin-bottom: 18px;
  padding: 18px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 210, 0, 0.12), transparent 55%),
    var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: rise 0.4s ease both;
}
.player__row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.player__play {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--gold);
  box-shadow: 0 12px 26px -12px rgba(245, 180, 0, 0.9);
  display: grid;
  place-items: center;
  transition: transform 0.12s, filter 0.18s;
}
.player__play:hover { filter: brightness(1.05); }
.player__play:active { transform: scale(0.95); }
.player__icon { display: block; }
.player__icon--play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--gold-ink);
  margin-left: 3px;
}
.player__icon--pause {
  width: 14px;
  height: 16px;
  border: 0;
  border-left: 5px solid var(--gold-ink);
  border-right: 5px solid var(--gold-ink);
  box-sizing: border-box;
  margin: 0;
}
.player__body { flex: 1 1 auto; min-width: 0; }
.player__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.player__title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player__tag {
  font-family: "Sometype Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-deep);
  white-space: nowrap;
  flex: 0 0 auto;
}
.player__scrubrow {
  display: flex;
  align-items: center;
  gap: 10px;
}
.player__time {
  font-family: "Sometype Mono", monospace;
  font-size: 0.72rem;
  color: var(--ink-faint);
  flex: 0 0 auto;
  width: 38px;
  text-align: center;
}
.player__seek {
  flex: 1 1 auto;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  outline: none;
}
.player__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-deep);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}
.player__seek::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-deep);
  border: 2px solid #fff;
  cursor: pointer;
}
.player__rate {
  flex: 0 0 auto;
  font: inherit;
  font-family: "Sometype Mono", monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-dim);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  min-width: 44px;
  min-height: 40px;
}
.player__rate:hover { color: var(--ink); border-color: var(--gold-deep); }
.player__foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.audio__dl {
  font-size: 0.78rem;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
}
.audio__dl:hover { color: var(--gold-deep); }

.copy {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  cursor: pointer;
  min-height: 40px;
  transition: all 0.15s;
}
.copy:hover:not(:disabled) { border-color: var(--ink-2); color: var(--ink-2); background: #fff; }
.copy:disabled { opacity: 0.45; cursor: not-allowed; }
.copy.is-done { color: var(--green); border-color: var(--green); background: rgba(31, 174, 126, 0.1); }

/* Markdown / script body */
.markdown { font-size: 0.99rem; color: var(--ink); }
.markdown h2 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin: 1.6em 0 0.6em;
  padding-bottom: 0.35em;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}
.markdown h2:first-child { margin-top: 0; }
.markdown .turn {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  margin: 0.8em 0;
  animation: rise 0.4s ease both;
}
.markdown .turn .who {
  font-family: "Sometype Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 8px;
  height: fit-content;
  white-space: nowrap;
}
.markdown .turn.a .who { color: var(--gold-ink); background: var(--gold); }
.markdown .turn.b .who { color: #fff; background: var(--sky); }
.markdown .turn p { margin: 0; color: var(--ink-dim); }

/* Empty state */
.empty {
  text-align: center;
  padding: 44px 16px;
  color: var(--ink-faint);
}
.empty--warn { color: var(--gold-deep); }
.empty__mic { font-size: 2.8rem; margin-bottom: 8px; }
.empty__head {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.03em;
  color: var(--ink-2);
  margin: 0 0 6px;
}
.empty--warn .empty__head { color: var(--gold-deep); }
.empty__body { margin: 0 auto; max-width: 42ch; font-size: 0.9rem; }
.empty__body code {
  font-family: "Sometype Mono", monospace;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.85em;
  color: var(--ink-2);
}

/* ---------- Footer ---------- */
.foot {
  position: relative;
  z-index: 2;
  max-width: calc(var(--maxw) + 48px);
  width: calc(100% - clamp(24px, 6vw, 48px));
  margin: clamp(28px, 5vw, 48px) auto clamp(20px, 4vw, 36px);
  padding: clamp(22px, 4vw, 32px);
  background: var(--navy);
  border-radius: clamp(18px, 3vw, 26px);
  box-shadow: var(--shadow-sm);
}
.foot p {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(234, 238, 251, 0.7);
  max-width: 74ch;
}

/* ---------- Animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 93, 108, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(255, 93, 108, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 93, 108, 0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive bump ---------- */
@media (min-width: 640px) {
  .trace__grid { grid-template-columns: repeat(3, 1fr); }
  .controls__grid { grid-template-columns: 1fr 1fr; }
  .controls__grid > .ctrl:has(#styleSwitch) { grid-column: 1 / -1; }
}
@media (min-width: 760px) {
  .hero { min-height: 54vh; }
}
