/* Call to Order with Steve Mayo · Look A, On Air. Tokens documented in DESIGN.md. */

:root {
  --walnut: oklch(0.222 0.023 47.7);
  --walnut-deep: oklch(0.188 0.018 50.3);
  --walnut-raised: oklch(0.275 0.029 54.9);
  --walnut-line: oklch(0.351 0.037 56.2);
  --cream: oklch(0.936 0.030 85.6);
  --cream-bright: oklch(0.965 0.020 85.6);
  --cream-dim: oklch(0.880 0.038 84.6);
  --cream-muted: oklch(0.739 0.043 80.2);
  --amber: oklch(0.783 0.156 72.7);
  --brass: oklch(0.743 0.087 79.9);
  --red: oklch(0.596 0.208 28.6);
  --red-deep: oklch(0.510 0.183 28.7);
  --lamp-off: oklch(0.36 0.08 30);
  --ink: var(--walnut);
  --ink-muted: oklch(0.465 0.040 58.0);
  --amber-ink: oklch(0.480 0.109 57.3);
  --red-ink: oklch(0.478 0.170 28.8);
  --field-line-dark: oklch(0.62 0.04 70);

  --display: 'Big Shoulders', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --body: 'Libre Franklin', 'Franklin Gothic Book', 'Helvetica Neue', Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1280px;
  --radius-panel: clamp(20px, 2.4vw, 30px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background-color: var(--walnut);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .95 0 0 0 0 .85 0 0 0 0 .7 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--cream);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.65;
  font-feature-settings: 'kern';
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  transform: translateY(calc(-100% - 24px));
  z-index: 10;
  padding: 10px 16px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
}
.skip:focus { transform: none; }

.preview-bar {
  padding: 9px var(--gutter);
  background: var(--walnut-deep);
  border-bottom: 1px solid var(--walnut-line);
  color: var(--cream-muted);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
}
.preview-bar__short { display: none; }

/* ---------- Shared type ---------- */

/* Labels are brass; full amber is kept for things you press. */
.kicker {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--brass);
}

h2 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.75rem, 6vw, 5.25rem);
  line-height: 0.9;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--cream);
}

.tag {
  display: inline-block;
  padding: 2px 8px 1px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
  vertical-align: 0.15em;
  color: var(--cream-muted);
}

/* Dial scale divider: minor ticks, major ticks every fifth, red station marker at 1490. */
.dial-rule {
  position: relative;
  width: min(100%, 340px);
  height: 16px;
  margin-bottom: 18px;
  color: var(--cream-muted);
  background:
    repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 60px) left top / 100% 100% no-repeat,
    repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 12px) left bottom / 100% 45% no-repeat;
  opacity: 0.7;
}
.dial-rule::after {
  content: '';
  position: absolute;
  left: 89.6%;
  top: -5px;
  width: 3px;
  height: 26px;
  border-radius: 2px;
  background: var(--red);
}

.section-head {
  display: grid;
  gap: 14px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section-head__note,
.section-head__lede {
  max-width: 60ch;
  color: var(--cream-dim);
}
.section-head__lede { font-size: clamp(1.125rem, 1.6vw, 1.375rem); line-height: 1.55; text-wrap: pretty; }
.section-head__note .tag { margin-left: 6px; }
.section-head--split {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px 40px;
}
.section-head__main { display: grid; gap: 14px; }
.section-head__main .dial-rule { margin-bottom: 4px; }
.section-head--split .section-head__note { padding-bottom: 6px; text-align: right; }

/* ---------- Lamp ---------- */

.lamp {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lamp-off);
  box-shadow: inset 0 -1px 0 oklch(0 0 0 / 0.3);
  transition: background-color 0.3s, box-shadow 0.3s;
}
.lamp.is-live {
  background: var(--red);
  box-shadow: 0 0 0 3px oklch(0.596 0.208 28.6 / 0.25), 0 0 14px 2px oklch(0.596 0.208 28.6 / 0.6);
  animation: lamp-pulse 2.4s ease-in-out infinite;
}
@keyframes lamp-pulse {
  50% { box-shadow: 0 0 0 5px oklch(0.596 0.208 28.6 / 0.12), 0 0 18px 4px oklch(0.596 0.208 28.6 / 0.45); }
}

/* ---------- Masthead ---------- */

.masthead {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  gap: 16px 32px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-right: auto;
}
.brand__mark { width: 40px; height: 40px; }
.brand__name {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.625rem;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  font-size: 0.9375rem;
  font-weight: 600;
}
.nav a {
  color: var(--cream-dim);
  text-decoration: none;
  padding: 10px 0;
  background: linear-gradient(var(--amber), var(--amber)) left bottom / 0 2px no-repeat;
  transition: color 0.2s, background-size 0.35s var(--ease-out);
}
.nav a:hover { color: var(--cream); background-size: 100% 2px; }

.onair {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--walnut-line);
  border-radius: 999px;
  background: var(--walnut-deep);
  color: var(--cream-dim);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}
.onair:hover { border-color: var(--cream-muted); color: var(--cream); }
.onair__short { display: none; }
.onair.is-live { border-color: var(--red); color: var(--cream); }

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

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(16px, 2.5vw, 40px) var(--gutter) clamp(48px, 6vw, 88px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: 'head head' 'copy radio';
  gap: clamp(24px, 3vw, 40px) clamp(40px, 5vw, 88px);
  align-items: center;
}

.hero__head {
  grid-area: head;
  container-type: inline-size;
  display: grid;
  gap: clamp(12px, 1.4vw, 20px);
}

/* One line across the full measure on wide screens; two stacked lines on phones. */
.hero__title {
  display: grid;
  gap: clamp(10px, 1.2vw, 18px);
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--cream);
}
/* 16cqi fits "Call to Order" on one line in Big Shoulders; if the font never arrives, the wider
   fallback simply wraps instead of running off the edge. */
.hero__name {
  display: block;
  font-size: 16cqi;
  line-height: 0.82;
  letter-spacing: -0.01em;
}
.hero__with {
  display: block;
  font-weight: 700;
  font-size: clamp(1.375rem, 2.4vw, 2.25rem);
  letter-spacing: 0.16em;
  line-height: 1.1;
  color: var(--cream-dim);
}

.hero__copy {
  grid-area: copy;
  display: grid;
  gap: 24px;
  justify-items: start;
  align-content: center;
}

.hero__lede {
  max-width: 38ch;
  font-size: clamp(1.1875rem, 1.7vw, 1.4375rem);
  line-height: 1.5;
  color: var(--cream-dim);
  text-wrap: pretty;
}

.listen {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.listen__note {
  max-width: 40ch;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--cream-muted);
  text-wrap: pretty;
}

.hero__radio {
  grid-area: radio;
  justify-self: end;
  width: 100%;
  max-width: 600px;
}
.radio { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 30px 40px oklch(0.1 0.02 50 / 0.55)); }
.radio text { font-family: var(--display); font-weight: 700; }
.radio__nums { font-weight: 700; }
.radio__station { font-weight: 800; letter-spacing: 0.06em; }
.radio__label { letter-spacing: 0.16em; }
.radio__plate { font-weight: 900; letter-spacing: 0.12em; }
.radio__needle {
  transform-box: view-box;
  transform-origin: 300px 246px;
  transform: rotate(var(--tune));
}
.radio__lamp-bulb { fill: var(--lamp-off); transition: fill 0.3s; }
.radio__lamp-glow { opacity: 0; transition: opacity 0.4s; }
.radio__lamp.is-live .radio__lamp-bulb,
.is-playing .radio__lamp-bulb { fill: var(--red); }
.radio__lamp.is-live .radio__lamp-glow,
.is-playing .radio__lamp-glow { opacity: 0.9; }
.radio__glow { transition: opacity 0.8s var(--ease-out); }
/* While an episode plays, the tubes warm up and breathe. */
.radio.is-playing .radio__glow { animation: tube 3.2s ease-in-out infinite; }
@keyframes tube { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }

/* ---------- Player ---------- */

.player {
  width: 100%;
  max-width: 560px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 18px 24px 18px 18px;
  background: var(--walnut-raised);
  border: 1px solid var(--walnut-line);
  border-radius: 24px;
  box-shadow: inset 0 1px 0 oklch(0.95 0.03 85 / 0.06), 0 18px 40px oklch(0.12 0.02 50 / 0.35);
}

.player__play {
  position: relative;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--amber);
  color: var(--ink);
  box-shadow: 0 0 0 6px oklch(0.783 0.156 72.7 / 0.14), inset 0 -3px 0 oklch(0.55 0.12 60 / 0.45);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.player__play:hover { transform: scale(1.04); box-shadow: 0 0 0 9px oklch(0.783 0.156 72.7 / 0.18), inset 0 -3px 0 oklch(0.55 0.12 60 / 0.45); }
.player__play:active { transform: scale(0.97); }
.player__play .icon { width: 30px; height: 30px; fill: currentColor; }
.icon--play { margin-left: 4px; }
.icon--pause,
.player.is-playing .icon--play { display: none; }
.player.is-playing .icon--pause { display: block; }

.player__info { display: grid; gap: 6px; min-width: 0; }
.player__label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
}
.player__label [data-player-label] { white-space: nowrap; }
.player__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  line-height: 1.02;
  color: var(--cream);
  text-wrap: balance;
}
.player__meta {
  font-size: 1rem;
  color: var(--cream-muted);
  font-variant-numeric: tabular-nums;
}
/* The sample notice swaps in for the time line, so the player never changes height. */
.player__meta { display: grid; }
/* Both lines share one cell, so it's always as tall as the longer one; they wrap freely at large text sizes. */
.player__meta > span { grid-area: 1 / 1; min-width: 0; }
.player__meta-note { visibility: hidden; color: var(--cream-dim); }
.player.is-noting .player__meta-main { visibility: hidden; }
.player.is-noting .player__meta-note { visibility: visible; animation: fade 0.3s var(--ease-out) both; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.player__seek {
  --p: 0%;
  width: 100%;
  height: 28px;
  margin: 2px 0 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.player__seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--amber) var(--p), var(--walnut-line) var(--p));
}
.player__seek::-moz-range-track { height: 4px; border-radius: 2px; background: var(--walnut-line); }
.player__seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--amber); }
.player__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--cream);
  border: 0;
  box-shadow: 0 2px 6px oklch(0.1 0.02 50 / 0.5);
}
.player__seek::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--cream); }

/* ---------- Preset key (a radio preset button that presses down) ---------- */

.preset {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 22px 0 18px;
  border-radius: 10px;
  background: var(--cream-dim);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 0 var(--cream-muted), 0 10px 18px oklch(0.1 0.02 50 / 0.35), inset 0 1px 0 var(--cream-bright);
  transition: transform 0.18s var(--ease-quart), box-shadow 0.18s var(--ease-quart), background-color 0.2s;
}
.preset:hover { background: var(--cream); }
.preset:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cream-muted), 0 4px 8px oklch(0.1 0.02 50 / 0.3), inset 0 1px 0 var(--cream-bright); }

/* ---------- Episodes log ---------- */

.episodes {
  padding: clamp(64px, 7vw, 104px) 0;
  background: var(--walnut-deep);
  border-block: 1px solid var(--walnut-line);
}

.log { list-style: none; margin: 0; padding: 0; }
.log__row {
  position: relative;
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) 5rem 56px;
  gap: 8px clamp(16px, 3vw, 40px);
  align-items: center;
  padding: 28px 0;
  border-top: 1px solid var(--walnut-line);
}
.log__row:last-child { border-bottom: 1px solid var(--walnut-line); }
.log__row::before {
  content: '';
  position: absolute;
  inset: 0 calc(var(--gutter) * -0.5);
  border-radius: 16px;
  background: var(--walnut-raised);
  opacity: 0;
  transition: opacity 0.25s;
  z-index: -1;
}
.log__row { isolation: isolate; }
.log__row:hover::before,
.log__row:focus-within::before { opacity: 1; }

.log__date { display: grid; line-height: 1; font-family: var(--display); }
.log__day {
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
}
.log__md { margin-top: 6px; font-weight: 800; font-size: 1.75rem; color: var(--cream); }

.log__body { display: grid; gap: 6px; }
.log__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.625rem, 2.6vw, 2.25rem);
  line-height: 1;
  color: var(--cream);
  text-wrap: balance;
  transition: color 0.2s;
}
.log__row:hover .log__title,
.log__row.is-current .log__title { color: var(--amber); }
.log__desc { max-width: 62ch; font-size: 1rem; line-height: 1.55; color: var(--cream-dim); text-wrap: pretty; }
.log__len { font-size: 1rem; color: var(--cream-muted); font-variant-numeric: tabular-nums; text-align: right; }

.log__play {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--cream-muted);
  border-radius: 50%;
  background: transparent;
  color: var(--cream);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.25s var(--ease-out);
}
.log__play svg { width: 22px; height: 22px; fill: currentColor; }
.log__play .icon--play { margin-left: 3px; }
.log__play:hover { background: var(--amber); border-color: var(--amber); color: var(--ink); transform: scale(1.05); }
.log__play[aria-pressed='true'] { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.log__play[aria-pressed='true'] .icon--play { display: none; }
.log__play[aria-pressed='true'] .icon--pause { display: block; }
/* Whole row is the click target for pointer users; the button stays the accessible control. */
.log__play::after { content: ''; position: absolute; inset: 0; border-radius: 16px; }

/* ---------- Two doors ---------- */

.doors { padding: clamp(64px, 8vw, 120px) 0 clamp(48px, 6vw, 80px); }

.doors__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}

.door {
  border-radius: var(--radius-panel);
  padding: clamp(24px, 4vw, 52px);
  scroll-margin-top: 24px;
}
.door--three {
  background: var(--cream);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.4), 0 30px 60px oklch(0.1 0.02 50 / 0.4);
}
.door--guest {
  background: var(--walnut-raised);
  border: 1px solid var(--walnut-line);
}
.door--three :focus-visible { outline-color: var(--ink); }

.door__kicker {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
}
.door--three .door__kicker { color: var(--amber-ink); }
.door__title {
  margin-top: 10px;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.5rem, 4.4vw, 3.75rem);
  line-height: 0.9;
  text-transform: uppercase;
}
.door__lede {
  margin-top: 16px;
  max-width: 46ch;
  font-size: 1.0625rem;
  line-height: 1.6;
  text-wrap: pretty;
}
.door--three .door__lede { color: var(--ink-muted); }
.door--guest .door__lede { color: var(--cream-dim); }

.form { display: grid; gap: 20px; margin-top: 32px; }

/* Recorder */
.recorder { display: grid; gap: 16px; }
.recorder__display {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  padding: 20px clamp(18px, 3vw, 28px);
  border-radius: 20px;
  background: var(--walnut);
  box-shadow: inset 0 2px 10px oklch(0.08 0.02 50 / 0.7), 0 1px 0 var(--cream-bright);
  color: var(--amber);
  overflow: hidden;
}
.recorder__clock { flex: none; display: grid; }
.recorder__time {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3.75rem, 7vw, 5.5rem);
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
  color: var(--amber);
}
.recorder__caption {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-muted);
}
/* The meter needs about 140px to read as bars; with less room (very narrow phones, large text)
   it drops below the clock at full width instead of shrinking to hairlines. */
.recorder__display { flex-wrap: wrap; }
.recorder__meter {
  flex: 1 1 140px;
  min-width: 0;
  height: 72px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.recorder__meter span {
  flex: 1;
  height: 100%;
  border-radius: 3px;
  background: var(--amber);
  opacity: 0.32;
  transform: scaleY(0.08);
  transform-origin: bottom;
  transition: transform 0.08s linear;
}
.recorder[data-state='recording'] .recorder__meter span { opacity: 1; }
.recorder[data-state='recorded'] .recorder__meter span { opacity: 0.6; }

.recorder__rec {
  display: none;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--cream);
}
.recorder__rec::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  animation: rec-blink 1.2s steps(2, jump-none) infinite;
}
@keyframes rec-blink { 50% { opacity: 0.25; } }
.recorder[data-state='recording'] .recorder__rec { display: inline-flex; }
.recorder[data-state='recording'] .recorder__time { color: var(--cream); }

.recorder__status { min-height: 1.6em; font-size: 1rem; line-height: 1.5; color: var(--ink-muted); }
.recorder__status.is-error { color: var(--red-ink); font-weight: 600; }

.recorder__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.recorder [data-rec-stop],
.recorder [data-rec-preview],
.recorder [data-rec-reset] { display: none; }
.recorder[data-state='requesting'] [data-rec-start] { opacity: 0.6; }
.recorder[data-state='recording'] [data-rec-start] { display: none; }
.recorder[data-state='recording'] [data-rec-stop] { display: inline-flex; }
.recorder[data-state='recorded'] [data-rec-start] { display: none; }
.recorder[data-state='recorded'] [data-rec-preview],
.recorder[data-state='recorded'] [data-rec-reset] { display: inline-flex; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.2s var(--ease-out), background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { opacity: 0.6; pointer-events: none; }

.btn--record { background: var(--walnut); color: var(--cream); padding-left: 20px; }
.btn--record:hover { background: oklch(0.3 0.03 50); }
.btn__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px oklch(0.596 0.208 28.6 / 0.3); }
.btn--stop { background: var(--red-deep); color: var(--cream); }
.btn--stop:hover { background: oklch(0.46 0.17 28.7); }
.btn__square { width: 12px; height: 12px; border-radius: 2px; background: var(--cream); }
.btn--outline { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--outline:hover { box-shadow: inset 0 0 0 2.5px currentColor; }
.btn--text {
  min-height: 44px;
  padding: 0 8px;
  background: transparent;
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.btn--text:hover { color: var(--ink); }
.btn--send { justify-self: start; background: var(--walnut); color: var(--cream); min-height: 56px; padding: 0 30px; font-size: 1.0625rem; }
.btn--send:hover { background: oklch(0.3 0.03 50); }
.btn--pitch { justify-self: start; background: var(--amber); color: var(--ink); min-height: 56px; padding: 0 30px; font-size: 1.0625rem; }
.btn--pitch:hover { background: oklch(0.82 0.15 75); }

.disclose {
  justify-self: start;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--amber-ink);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.disclose:hover { color: var(--ink); }

/* Fields */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: grid; gap: 8px; align-content: start; }
.field--wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.9375rem; line-height: 1.3; }
.optional { font-weight: 400; opacity: 0.8; }

.field input,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 1.0625rem;
  line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.field textarea { resize: vertical; min-height: 132px; }
.field input:focus,
.field textarea:focus { outline: none; }

.door--three .field input,
.door--three .field textarea {
  background: var(--cream-bright);
  border: 1.5px solid var(--ink-muted);
  color: var(--ink);
}
.door--three .field input::placeholder,
.door--three .field textarea::placeholder { color: oklch(0.6 0.03 65); }
.door--three .field input:focus,
.door--three .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--amber-ink); }

.door--guest .field input,
.door--guest .field textarea {
  background: var(--walnut-deep);
  border: 1.5px solid var(--field-line-dark);
  color: var(--cream);
}
.door--guest .field input::placeholder,
.door--guest .field textarea::placeholder { color: oklch(0.6 0.035 70); }
.door--guest .field input:focus,
.door--guest .field textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px oklch(0.783 0.156 72.7 / 0.25); }

.field__hint { font-size: 1rem; line-height: 1.45; }
.door--three .field__hint { color: var(--ink-muted); }
.door--guest .field__hint { color: var(--cream-muted); }

.field__error:empty,
.form__error:empty { display: none; }
.field__error,
.form__error { font-size: 1rem; font-weight: 600; line-height: 1.4; }
.door--three .field__error,
.door--three .form__error { color: var(--red-ink); }
.door--guest .field__error,
.door--guest .form__error { color: oklch(0.78 0.12 35); }
[aria-invalid='true'] { border-color: var(--red-ink) !important; }
.door--guest [aria-invalid='true'] { border-color: oklch(0.72 0.14 33) !important; }

.check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: start;
}
.check input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--walnut);
}
.check label { font-size: 1rem; line-height: 1.45; }
.check .field__error,
.check .field__hint { grid-column: 2; }

/* Sent state */
.sent { display: grid; gap: 14px; margin-top: 32px; padding: 28px; border-radius: 20px; }
.sent:focus { outline: none; }
.door--three .sent { background: var(--cream-dim); }
.door--guest .sent { background: var(--walnut-deep); }
.sent__title { font-family: var(--display); font-weight: 900; font-size: 2.25rem; line-height: 1; text-transform: uppercase; }
.sent__preview { font-size: 1rem; opacity: 0.85; }
.sent .btn { justify-self: start; }

/* ---------- Host ---------- */

.host {
  padding: clamp(64px, 7vw, 104px) 0;
  border-top: 1px solid var(--walnut-line);
}
.host__grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: clamp(40px, 5vw, 72px);
  align-items: center;
}
.host__portrait {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  border-radius: var(--radius-panel);
  background:
    radial-gradient(120% 80% at 50% 100%, oklch(0.783 0.156 72.7 / 0.35), transparent 60%),
    var(--cream);
  overflow: hidden;
}
.host__mic { width: 52%; height: auto; }
.host__portrait figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.host__copy { display: grid; gap: 18px; justify-items: start; }
.host__lede { max-width: 40ch; font-size: clamp(1.25rem, 2vw, 1.625rem); line-height: 1.45; color: var(--cream); text-wrap: pretty; }
.placeholder-note {
  max-width: 52ch;
  padding: 14px 18px;
  border: 1px dashed var(--walnut-line);
  border-radius: 12px;
  font-size: 1rem;
  color: var(--cream-muted);
}
/* ---------- Footer ---------- */

.footer {
  padding: clamp(64px, 7vw, 104px) 0 40px;
  background: var(--walnut-deep);
  border-top: 1px solid var(--walnut-line);
}
.footer__adjourn {
  max-width: 17ch;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 7.5rem);
  line-height: 0.86;
  text-transform: uppercase;
  text-wrap: balance;
}
.footer__when { color: var(--amber); }
.footer__adjourn a { color: var(--amber); text-decoration-thickness: 0.06em; text-underline-offset: 0.08em; }
.footer__sub { margin: 24px 0 28px; max-width: 52ch; color: var(--cream-dim); }
.footer__base {
  margin-top: clamp(56px, 8vw, 96px);
  padding-top: 24px;
  border-top: 1px solid var(--walnut-line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 1rem;
  color: var(--cream-muted);
}

/* ---------- Docked player (appears while an episode plays and the hero player is off screen) ---------- */

.dock {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 15;
  width: min(560px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 10px;
  border: 1px solid var(--walnut-line);
  border-radius: 999px;
  background: var(--walnut-raised);
  box-shadow: 0 18px 40px oklch(0.1 0.02 50 / 0.55);
  translate: -50% 0;
  animation: dock-in 0.5s var(--ease-out) both;
}
@keyframes dock-in { from { opacity: 0; transform: translateY(18px); } }
/* Keep the end of the page and any notice clear of the docked player. */
body:has(.dock:not([hidden])) { padding-bottom: 96px; }
body:has(.dock:not([hidden])) .toast { bottom: 96px; }
.dock__play {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--amber);
  color: var(--ink);
}
.dock__play .icon { width: 20px; height: 20px; fill: currentColor; }
.dock.is-playing .icon--play { display: none; }
.dock.is-playing .icon--pause { display: block; }
.dock__title {
  overflow: hidden;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dock__time { font-size: 1rem; color: var(--cream-muted); font-variant-numeric: tabular-nums; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 14px 20px;
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 16px 40px oklch(0.1 0.02 50 / 0.5);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.4s var(--ease-out);
}
.toast:empty { display: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Load choreography (only with JS, only without reduced motion) ---------- */

/* The wordmark waits for its own font (see the inline script in index.html), then rises. */
.js:not(.fonts-ready) .hero__name { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .js .hero__line { animation: none; }
  .fonts-ready .hero__line { animation: rise 0.9s var(--ease-out) both; }
  .js .hero__with,
  .js .hero__lede,
  .js .player,
  .js .hero .listen { animation: rise 0.9s var(--ease-out) both; }
  .js .hero__line { display: inline-block; }
  .fonts-ready .hero__line:nth-child(2) { animation-delay: 0.08s; }
  .js .hero__with { animation-delay: 0.16s; }
  .js .hero__lede { animation-delay: 0.24s; }
  .js .player { animation-delay: 0.32s; }
  .js .hero .listen { animation-delay: 0.4s; }
  .js .hero__radio { animation: fade 1.2s var(--ease-out) 0.1s both; }
  .js .radio__needle { animation: tune 2.4s var(--ease-out) 0.45s both; }
  .js .radio__glow { animation: warm 2.6s var(--ease-quart) 0.2s both; }
}

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes tune { from { transform: rotate(-180deg); } }
@keyframes warm { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

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

@media (max-width: 1080px) {
  .doors__grid { grid-template-columns: minmax(0, 1fr); }
}

/* Two-column guest form when the doors stack but there's still room: name | email, role | link, then the pitch. */
@media (min-width: 641px) and (max-width: 1080px) {
  .door--guest .form { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
  .door--guest .form > .field:has(textarea) { grid-column: 1 / -1; order: 1; }
  .door--guest .form > .form__error,
  .door--guest .form > .btn { grid-column: 1 / -1; order: 2; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'head' 'copy' 'radio'; }
  .hero__radio { justify-self: center; max-width: 560px; }
  .nav { order: 3; width: 100%; }
  .host__grid { grid-template-columns: 240px minmax(0, 1fr); gap: 40px; }
}

@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .preview-bar { padding-block: 8px; font-size: 0.875rem; }
  .preview-bar__long { display: none; }
  .preview-bar__short { display: inline; }

  .masthead { flex-wrap: wrap; gap: 8px 16px; padding-top: 14px; padding-bottom: 6px; }
  /* The hero wordmark sits right below, so the masthead keeps only the dial mark on phones. */
  .brand__name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .brand__mark { width: 34px; height: 34px; }
  .onair { min-height: 44px; padding: 0 14px; gap: 8px; font-size: 0.9375rem; }
  .onair__long { display: none; }
  .onair__short { display: inline; }
  /* One swipeable row of section links that runs to the screen edge, with a fade that says "more". */
  .nav {
    flex-wrap: nowrap;
    gap: 22px;
    width: calc(100% + var(--gutter) * 2);
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
    font-size: 1rem;
    white-space: nowrap;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .nav::-webkit-scrollbar { display: none; }

  .hero { padding-top: 12px; }
  .hero__name { font-size: 30cqi; line-height: 0.84; }
  .hero__line, .js .hero__line { display: block; }
  .hero__with { font-size: 1.25rem; }

  .player { gap: 16px; padding: 14px 18px 14px 14px; border-radius: 20px; }
  .player__play { width: 64px; height: 64px; }
  .player__title { font-size: 1.375rem; }
  .host__lede { text-wrap: wrap; }
  .listen__note { max-width: none; }

  .section-head--split { grid-template-columns: minmax(0, 1fr); }
  .section-head--split .section-head__note { text-align: left; padding-bottom: 0; }

  .log__row {
    grid-template-columns: minmax(0, 1fr) 52px;
    grid-template-areas: 'date play' 'body play';
    gap: 10px 16px;
    padding: 24px 0;
  }
  .log__date { grid-area: date; display: flex; align-items: baseline; gap: 10px; }
  .log__md { margin: 0; font-size: 1.125rem; color: var(--cream-dim); }
  .log__body { grid-area: body; }
  .log__len { display: none; }
  .log__play { grid-area: play; width: 52px; height: 52px; align-self: center; }

  .fields { grid-template-columns: minmax(0, 1fr); }
  .door--guest .form { grid-template-columns: minmax(0, 1fr); }
  .recorder__display { gap: 16px; padding: 18px; }
  .recorder__meter { height: 56px; gap: 3px; }
  .btn--send, .btn--pitch { justify-self: stretch; }

  .host__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .host__portrait { aspect-ratio: 1; max-width: 200px; border-radius: 22px; }
  .host__mic { width: 44%; margin-bottom: 26px; }
  .host__portrait figcaption { bottom: 12px; font-size: 0.75rem; letter-spacing: 0.12em; }

  .dock { bottom: 10px; }
}
