:root {
  /* Dark tactical — matte black with warm bone text, single amber accent */
  --paper: #0B0B0C;
  --surface: #16161A;
  --ink: #F4EFE6;
  --muted: #8A8A90;
  --accent: #FF7A1A;
  --accent-hover: #FF9447;
  --rule: #2A2A2E;

  --font-display: 'Archivo Black', 'Unbounded', ui-monospace, monospace;
  --font-body: 'EB Garamond', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;

  --unit: 8px;
  --max-w: 1120px;
}

[data-theme="light"] {
  /* Paper variant, retained as an opt-in reading mode */
  --paper: #F4F1EA; --surface: #ECE7DD; --ink: #141414; --muted: #666157;
  --accent: #C24E2A; --accent-hover: #A23F1F; --rule: #D6D0C3;
}
[data-theme="dark"] {
  --paper: #0B0B0C; --surface: #16161A; --ink: #F4EFE6; --muted: #8A8A90;
  --accent: #FF7A1A; --accent-hover: #FF9447; --rule: #2A2A2E;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 120ms ease-out; }
a:hover { border-bottom-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 calc(var(--unit) * 4);
}

/* ---------- masthead ---------- */
.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  padding: calc(var(--unit) * 4) 0 0;
  border-bottom: 1px solid var(--ink);
}
.masthead__tagline {
  grid-column: 1 / -1;
  margin: calc(var(--unit) * 1.2) 0 0;
  padding: calc(var(--unit) * 0.75) 0;
  border-top: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.masthead__ep,
.masthead__date {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.masthead__ep { text-align: left; }
.masthead__date { text-align: right; }
.masthead__title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(18px, 2.6vw, 24px);
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  margin: 0;
  color: var(--ink);
}
.masthead__title a { color: inherit; border-bottom: 0; }
.masthead__title small { font-size: 1em; letter-spacing: inherit; }

/* ---------- now playing (clickable play/pause strip) ---------- */
.now-playing {
  display: flex;
  align-items: center;
  gap: calc(var(--unit) * 1.5);
  margin: calc(var(--unit) * 3) 0 calc(var(--unit) * 2);
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 120ms ease-out;
}
.now-playing:hover { color: var(--accent-hover); }
.now-playing:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.now-playing__sep { opacity: 0.5; }
.now-playing__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(255, 122, 26, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 122, 26, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .now-playing__dot { animation: none; }
}

/* ---------- main grid ---------- */
.episode {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: calc(var(--unit) * 6);
  align-items: start;
}
@media (max-width: 900px) {
  .episode {
    grid-template-columns: 1fr;
    gap: calc(var(--unit) * 4);
  }
}

/* ---------- play-trigger elements (hero question, sub-questions, waveform) ---------- */
.is-playable { cursor: pointer; }
.is-playable:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* ---------- hero question ---------- */
.question {
  font-family: var(--font-display);
  font-weight: 400; /* Archivo Black ships one weight and IS the bold cut */
  font-style: normal;
  font-size: clamp(36px, 7vw, 76px);
  line-height: 1.08;
  letter-spacing: 0;
  color: var(--ink);
  margin: 0;
  padding: 0;
  min-height: 1em;
  outline: none;
  font-feature-settings: "kern";
}

/* ---------- sub-questions list ---------- */
.sub-questions {
  margin: calc(var(--unit) * 4) 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 1.5);
}
.sub-questions__item {
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.35;
  color: var(--muted);
  padding-left: calc(var(--unit) * 3);
  position: relative;
}
.sub-questions__item::before {
  content: "Q";
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  position: absolute;
  left: 0;
  top: 7px;
  font-weight: 700;
}

/* ---------- waveform scrubber ---------- */
.waveform {
  --progress: 0;
  margin-top: calc(var(--unit) * 3);
  position: relative;
  height: 48px;
  cursor: pointer;
  padding-left: calc(var(--unit) * 5); /* reserve space for the toggle icon */
  touch-action: none; /* allow horizontal drag without page scroll interfering */
}
.waveform__canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.waveform__progress {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--unit) * 5);
  right: 0;
  pointer-events: none;
  /* Dim the unplayed portion so the played portion reads as bright amber. */
  background: linear-gradient(
    to right,
    transparent 0,
    transparent calc(var(--progress) * 100%),
    rgba(11, 11, 12, 0.58) calc(var(--progress) * 100%),
    rgba(11, 11, 12, 0.58) 100%
  );
}
[data-theme="light"] .waveform__progress {
  background: linear-gradient(
    to right,
    transparent 0,
    transparent calc(var(--progress) * 100%),
    rgba(244, 241, 234, 0.62) calc(var(--progress) * 100%),
    rgba(244, 241, 234, 0.62) 100%
  );
}
.waveform__toggle {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  cursor: pointer;
  z-index: 2;
  transition: background 120ms ease-out, color 120ms ease-out;
}
.waveform__toggle:hover { background: var(--accent); color: var(--paper); }
.waveform__toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.waveform__icon { width: 12px; height: 12px; fill: currentColor; }
.waveform__icon--play { display: block; margin-left: 1px; /* optical center */ }
.waveform__icon--pause { display: none; }
.waveform__toggle[aria-pressed="true"] .waveform__icon--play { display: none; }
.waveform__toggle[aria-pressed="true"] .waveform__icon--pause { display: block; margin-left: 0; }
.waveform__tick {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--ink);
  opacity: 0.7;
  pointer-events: none;
}

/* ---------- listen row (mp3 + platform links under the waveform) ---------- */
.listen {
  margin-top: calc(var(--unit) * 2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--unit) * 2);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.listen a {
  color: var(--muted);
  border-bottom-color: var(--rule);
}
.listen a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.listen__more {
  position: relative;
  display: inline-block;
}
.listen__more summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 0;
  border-bottom: 1px solid var(--rule);
  transition: color 120ms ease-out, border-color 120ms ease-out;
}
.listen__more summary::-webkit-details-marker { display: none; }
.listen__more summary:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.listen__chev {
  display: inline-block;
  margin-left: 4px;
  transition: transform 120ms ease-out;
}
.listen__more[open] .listen__chev { transform: rotate(180deg); }
.listen__more-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 1);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: calc(var(--unit) * 2) calc(var(--unit) * 2.5);
  min-width: 180px;
  max-width: min(90vw, 260px);
}
@media (max-width: 560px) {
  /* Right-anchor on narrow viewports so the panel stays inside the viewport
     even when the "More" summary is near the right edge. */
  .listen__more-panel { left: auto; right: 0; }
}
.listen__more-panel a {
  border-bottom: 0;
  padding: 2px 0;
}
.listen__more-panel a:hover { color: var(--accent); border-bottom: 0; }

/* ---------- submit cta ---------- */
.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--unit) * 2);
  margin-top: calc(var(--unit) * 6);
  padding: calc(var(--unit) * 3) calc(var(--unit) * 4);
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  border: 0;
  width: 100%;
  cursor: pointer;
  transition: background 120ms ease-out;
  text-decoration: none;
}
.cta:hover { background: var(--accent-hover); border-bottom: 0; }
.cta:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.cta__arrow { font-family: var(--font-mono); font-weight: 700; }

.cta--outline {
  margin-top: calc(var(--unit) * 2);
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: calc(var(--unit) * 2.5) calc(var(--unit) * 4);
}
.cta--outline:hover { background: var(--ink); color: var(--paper); }

/* ---------- host desk ---------- */
.hosts {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 3);
  border-left: 1px solid var(--rule);
  padding-left: calc(var(--unit) * 3);
}
@media (max-width: 900px) {
  /* On narrow viewports the About section (with full bios) sits right below
     the episode content, so the sidebar becomes redundant. Hide it. On
     episode detail pages (/ep/NNN/) the About section doesn't render; the
     sidebar is still hidden to match homepage behavior — host info is
     one click away on the homepage. */
  .hosts { display: none; }
}
.hosts__heading {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: calc(var(--unit) * 1);
}
@media (max-width: 900px) {
  .hosts__heading { flex: 1 1 100%; margin-bottom: 0; }
}
.host {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 1);
  text-align: left;
}
.host--link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
a.host--link { border-bottom: 0; }
.host--link:hover .host__name { color: var(--accent); }
.host--link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
@media (max-width: 900px) {
  .host { flex: 1 1 180px; min-width: 180px; }
}
.host__portrait {
  width: 112px; height: 112px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 24px;
  color: var(--muted);
  letter-spacing: 0.04em;
  overflow: hidden;
}
.host__portrait--img {
  object-fit: cover;
  display: block;
}
.host__name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-transform: uppercase;
  transition: color 120ms ease-out;
}

/* ---------- about section (homepage bottom) ---------- */
/* scroll offset so the About heading isn't jammed against the top on anchor nav;
   smooth-scroll itself is opt-in via JS (site.js honors prefers-reduced-motion). */
html { scroll-padding-top: calc(var(--unit) * 4); }
.about {
  margin-top: calc(var(--unit) * 10);
  padding-top: calc(var(--unit) * 6);
  border-top: 1px solid var(--rule);
}
.about__heading {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 calc(var(--unit) * 4);
}
.about__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--unit) * 5);
}
@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; gap: calc(var(--unit) * 5); }
}
.about__card {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 1.5);
}
.about__portrait {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  display: block;
}
.about__name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-transform: uppercase;
  margin-top: calc(var(--unit) * 1);
}
.about__cred {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-transform: uppercase;
}
.about__bio {
  margin: calc(var(--unit) * 1) 0 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
}

/* ---------- archive list page ---------- */
.archive {
  margin-top: calc(var(--unit) * 4);
}
.archive__toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: calc(var(--unit) * 2);
  margin: 0 0 calc(var(--unit) * 3);
  flex-wrap: wrap;
}
.archive__heading {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.archive__search-input {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: calc(var(--unit)) calc(var(--unit) * 1.5);
  width: 240px;
  max-width: 100%;
  outline: none;
  transition: border-color 120ms ease-out;
}
.archive__search-input::placeholder { color: var(--muted); }
.archive__search-input:focus { border-color: var(--accent); }
.archive__item[hidden] { display: none; }
.archive__empty {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
  padding: calc(var(--unit) * 3) 0;
  text-align: center;
}
.archive__list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.archive__item {
  display: grid;
  grid-template-columns: 70px 120px minmax(0, 1fr);
  gap: calc(var(--unit) * 3);
  align-items: baseline;
  padding: calc(var(--unit) * 2) 0;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 640px) {
  .archive__item {
    grid-template-columns: 60px 1fr;
  }
  .archive__item .archive__date { display: none; }
}
.archive__ep {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.archive__date {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.archive__title {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
  font-weight: 600;
  border-bottom: 0;
}
.archive__title:hover { color: var(--accent); border-bottom: 0; }

/* ---------- ask form ---------- */
.ask {
  max-width: 640px;
  margin-top: calc(var(--unit) * 4);
}
.ask__intro {
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 calc(var(--unit) * 4);
}
.ask__field {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit));
  margin-bottom: calc(var(--unit) * 3);
}
.ask__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ask__input, .ask__textarea {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: calc(var(--unit) * 1.5) calc(var(--unit) * 2);
  outline: none;
  transition: border-color 120ms ease-out;
}
.ask__input:focus, .ask__textarea:focus { border-color: var(--accent); }
.ask__textarea { min-height: 180px; resize: vertical; }
.ask__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---------- footer ---------- */
.footer {
  margin-top: calc(var(--unit) * 10);
  padding: calc(var(--unit) * 4) 0;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: calc(var(--unit) * 2);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  flex-wrap: wrap;
}
.footer__links { display: flex; align-items: center; gap: calc(var(--unit) * 3); flex-wrap: wrap; }
.footer a { color: var(--muted); border-bottom-color: transparent; }
.footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.footer__more { position: relative; display: inline-block; }
.footer__more summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  transition: color 120ms ease-out;
}
.footer__more summary::-webkit-details-marker { display: none; }
.footer__more summary:hover { color: var(--accent); }
.footer__more[open] .listen__chev { transform: rotate(180deg); }
.footer__more-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 1);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: calc(var(--unit) * 2) calc(var(--unit) * 2.5);
  min-width: 180px;
  max-width: min(90vw, 260px);
}
.footer__more-panel a { border-bottom: 0; padding: 2px 0; }

/* ---------- theme toggle — hidden for launch (light mode deferred) ---------- */
.theme-toggle { display: none; }

/* ---------- smaller viewports: collapse masthead ---------- */
@media (max-width: 560px) {
  .masthead {
    grid-template-columns: 1fr;
    gap: calc(var(--unit));
    text-align: center;
  }
  .masthead__ep, .masthead__date { text-align: center; }
  .masthead__title { order: -1; }
  .now-playing { margin-top: calc(var(--unit) * 2); }
}
