:root {
  --bg-deep: #060a12;
  --bg-panel: #0c1220;
  --bg-elevated: #111a2e;
  --bg-hover: #162038;
  --bg-glass: rgba(12, 18, 32, 0.75);

  --cyan: #22d3ee;
  --cyan-bright: #67e8f9;
  --cyan-dim: #0891b2;
  --cyan-glow: rgba(34, 211, 238, 0.25);
  --cyan-soft: rgba(34, 211, 238, 0.08);

  --btc: #f7931a;
  --btc-bright: #ffb347;
  --btc-hover: #e8850f;
  --btc-glow: rgba(247, 147, 26, 0.3);
  --btc-soft: rgba(247, 147, 26, 0.1);

  --text-primary: #eef2f8;
  --text-secondary: #a8b4c8;
  --text-dim: #708090;
  --text-mono: #7dd3fc;

  --border: rgba(34, 211, 238, 0.12);
  --border-bright: rgba(34, 211, 238, 0.28);
  --border-orange: rgba(247, 147, 26, 0.35);

  --holo-gradient: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.06) 0%,
    rgba(247, 147, 26, 0.04) 50%,
    rgba(34, 211, 238, 0.06) 100%
  );

  --font-display: 'Exo 2', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --radius: 4px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-secondary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Atmospheric layers ── */

.aurora-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(34, 211, 238, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 10%, rgba(247, 147, 26, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(34, 211, 238, 0.03) 0%, transparent 45%),
    linear-gradient(180deg, #060a12 0%, #0a1020 50%, #060a12 100%);
  pointer-events: none;
  z-index: 0;
}

.grid-atmosphere {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: var(--grid-parallax-x, 0) var(--grid-parallax-y, 0);
  pointer-events: none;
  z-index: 0;
  transition: background-position 0.1s linear;
}

/* ── Tier 2: time-of-day aurora ── */

body[data-time-phase='dawn'] .aurora-bg {
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(247, 147, 26, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 10%, rgba(34, 211, 238, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(247, 147, 26, 0.04) 0%, transparent 45%),
    linear-gradient(180deg, #080a14 0%, #121828 50%, #080a14 100%);
}

body[data-time-phase='day'] .aurora-bg {
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(34, 211, 238, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 10%, rgba(247, 147, 26, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(34, 211, 238, 0.03) 0%, transparent 45%),
    linear-gradient(180deg, #060a12 0%, #0a1020 50%, #060a12 100%);
}

body[data-time-phase='dusk'] .aurora-bg {
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(247, 147, 26, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 10%, rgba(34, 211, 238, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(247, 147, 26, 0.05) 0%, transparent 45%),
    linear-gradient(180deg, #0a0810 0%, #1a1428 50%, #0a0810 100%);
}

body[data-time-phase='night'] .aurora-bg {
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(34, 211, 238, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 10%, rgba(34, 211, 238, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(8, 145, 178, 0.04) 0%, transparent 45%),
    linear-gradient(180deg, #040810 0%, #060a14 50%, #040810 100%);
}

.holo-shimmer {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    125deg,
    transparent 40%,
    rgba(34, 211, 238, 0.008) 45%,
    rgba(247, 147, 26, 0.008) 50%,
    rgba(34, 211, 238, 0.008) 55%,
    transparent 60%
  );
  background-size: 200% 200%;
  animation: holo-drift 16s ease-in-out infinite;
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

@keyframes holo-drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ── Frame ── */

.terminal-frame {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem 2rem;
  isolation: isolate;
}

/* ── Tier 3: curved CRT viewport ── */

.terminal-frame.crt-viewport {
  border-radius: 10px;
  transform: perspective(1500px) rotateX(0.4deg);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.14),
    0 0 30px rgba(34, 211, 238, 0.05),
    0 16px 40px rgba(0, 0, 0, 0.3),
    inset 0 0 40px rgba(0, 0, 0, 0.12);
}

.terminal-frame.crt-viewport::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  pointer-events: none;
  z-index: 51;
  box-shadow:
    inset 0 0 12px rgba(103, 232, 249, 0.04),
    inset 0 1px 0 rgba(103, 232, 249, 0.06),
    inset 0 -1px 0 rgba(247, 147, 26, 0.04);
}

.terminal-frame.crt-viewport .crt-overlay {
  border-radius: 10px;
}

.terminal-frame.crt-viewport .crt-overlay::after {
  background:
    radial-gradient(ellipse 92% 88% at 50% 48%, transparent 62%, rgba(0, 0, 0, 0.14) 88%, rgba(0, 0, 0, 0.28) 100%),
    linear-gradient(180deg, rgba(34, 211, 238, 0.02) 0%, transparent 30%, transparent 70%, rgba(247, 147, 26, 0.02) 100%);
  box-shadow: inset 0 0 40px rgba(34, 211, 238, 0.02);
}

/* ── Tier 2: node sync progress ── */

.node-sync-bar {
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 2px;
  background: rgba(34, 211, 238, 0.08);
  z-index: 60;
  border-radius: 2px 2px 0 0;
  overflow: hidden;
  pointer-events: none;
}

.node-sync-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--btc), var(--cyan-bright));
  box-shadow: 0 0 8px var(--cyan-glow);
  transition: width 0.12s ease-out;
}

/* ── CRT phosphor overlay ── */

.crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  border-radius: var(--radius);
  overflow: hidden;
}

.crt-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.04) 3px,
    rgba(0, 0, 0, 0.04) 4px
  );
  opacity: 0.35;
}

.crt-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 88% 75% at 50% 48%, transparent 68%, rgba(0, 0, 0, 0.1) 92%, rgba(0, 0, 0, 0.2) 100%),
    linear-gradient(180deg, rgba(34, 211, 238, 0.015) 0%, transparent 35%, transparent 65%, rgba(247, 147, 26, 0.015) 100%);
}

@keyframes crt-flicker {
  0%, 100% { opacity: 0.35; }
}

/* ── Transmission-active glow (playing audio) ── */

.transmission-panel.transmission-active {
  border-color: rgba(247, 147, 26, 0.38);
  animation: transmission-glow 3.5s ease-in-out infinite;
  box-shadow:
    0 0 18px rgba(247, 147, 26, 0.1),
    0 4px 24px rgba(0, 0, 0, 0.3);
}

@keyframes transmission-glow {
  0%, 100% {
    border-color: rgba(247, 147, 26, 0.3);
    box-shadow:
      0 0 14px rgba(247, 147, 26, 0.08),
      0 4px 24px rgba(0, 0, 0, 0.3);
  }
  50% {
    border-color: rgba(247, 147, 26, 0.45);
    box-shadow:
      0 0 24px rgba(247, 147, 26, 0.14),
      0 4px 24px rgba(0, 0, 0, 0.3);
  }
}

/* ── Holographic card tilt ── */

.holo-tilt {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  transform: perspective(900px) rotateX(var(--tilt-y)) rotateY(var(--tilt-x));
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
  transform-style: preserve-3d;
  will-change: transform;
}

.holo-tilt::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    125deg,
    transparent 30%,
    rgba(34, 211, 238, 0.03) 45%,
    rgba(247, 147, 26, 0.025) 55%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 3;
}

.holo-tilt:hover::after {
  opacity: 0.15;
}

.log-entry.holo-tilt::after {
  display: none;
}

.cmd-type::after {
  content: '▌';
  color: var(--cyan);
  animation: cursor-blink 1s step-end infinite;
  margin-left: 1px;
}

.cmd-type[data-typed='true']::after {
  display: none;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Title bar ── */

.title-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: rgba(12, 18, 32, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-bright);
  border-bottom: none;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  overflow: hidden;
}

.title-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--btc), var(--cyan), transparent);
  opacity: 0.6;
}

.title-bar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: start;
}

.status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-bright);
  box-shadow: 0 0 10px var(--cyan-glow);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.9); }
}

.status-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--cyan);
}

.title-bar-center {
  text-align: center;
}

.title-bar-text {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-primary);
}

.title-bar-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.title-bar-right {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  justify-self: end;
}

.ep-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.ep-count {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--btc);
  text-shadow: 0 0 20px var(--btc-glow);
}

/* ── Navigation ── */

.terminal-nav {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: none;
  padding: 1rem 1.25rem;
}

.nav-prompt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-bottom: 0.7rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.nav-command {
  color: var(--cyan);
  margin-left: 0.4rem;
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  list-style: none;
}

.nav-link {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.25rem 0;
  transition: color 0.2s, text-shadow 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--cyan-bright);
  text-shadow: 0 0 10px var(--cyan-glow);
}

.nav-key {
  color: var(--btc);
  margin-right: 0.35rem;
  font-weight: 500;
}

/* ── Prompt styling ── */

.prompt-user { color: var(--cyan); }
.prompt-sep { color: var(--text-dim); }
.prompt-path { color: var(--btc-bright); }
.prompt-symbol { color: var(--text-mono); margin-right: 0.45rem; }
.cmd { color: var(--cyan-bright); }

/* ── Main ── */

main {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: none;
}

/* ── Data panels ── */

.data-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.data-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--holo-gradient);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}

.data-panel > * {
  position: relative;
  z-index: 1;
}

.panel-chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.chrome-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.chrome-dot.cyan {
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan-glow);
  transition: box-shadow 0.2s;
}

.chrome-dot.orange {
  background: var(--btc);
  box-shadow: 0 0 6px var(--btc-glow);
  transition: box-shadow 0.2s;
}

.panel-chrome:hover .chrome-dot.cyan {
  box-shadow:
    2px 0 8px rgba(34, 211, 238, 0.6),
    -2px 0 8px rgba(247, 147, 26, 0.4),
    0 0 6px var(--cyan-glow);
}

.panel-chrome:hover .chrome-dot.orange {
  box-shadow:
    2px 0 8px rgba(247, 147, 26, 0.6),
    -2px 0 8px rgba(34, 211, 238, 0.35),
    0 0 6px var(--btc-glow);
}

.chrome-dot.dim {
  background: var(--text-dim);
  opacity: 0.5;
}

.panel-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-left: 0.35rem;
}

/* ── Hero ── */

.hero {
  padding: 2rem 1.5rem 2.5rem;
  border-bottom: 1px solid var(--border);
}

.hero-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.06em;
}

.brand-s {
  color: var(--cyan-bright);
  text-shadow: 0 0 30px var(--cyan-glow);
}

.brand-lp {
  color: var(--btc);
  text-shadow: 0 0 30px var(--btc-glow);
}

.brand-tagline {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  letter-spacing: 0.04em;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan-bright);
  box-shadow: 0 0 6px var(--cyan-glow);
  animation: pulse 2s ease-in-out infinite;
}

.tag-live {
  color: var(--cyan-bright);
  border-color: rgba(34, 211, 238, 0.3);
}

.tag-btc {
  color: var(--btc);
  border-color: var(--border-orange);
  background: var(--btc-soft);
}

.tag-future {
  color: var(--text-primary);
  border-color: var(--border-bright);
}

/* ── Hero data panel ── */

.hero-terminal {
  padding: 0;
  border-radius: var(--radius);
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.06), 0 4px 24px rgba(0, 0, 0, 0.3);
}

.hero-terminal .terminal-line,
.hero-terminal .hero-output,
.hero-terminal .cursor-line {
  position: relative;
  z-index: 1;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.hero-terminal .terminal-line:first-of-type {
  padding-top: 1rem;
}

.hero-output {
  padding-bottom: 1rem;
}

.hero-episode-id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--btc);
  letter-spacing: 0.14em;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.hero-guest {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.hero-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 62ch;
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-cell {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
}

.stat-key {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-primary);
}

.stat-live {
  color: var(--cyan-bright);
  text-shadow: 0 0 10px var(--cyan-glow);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  padding-bottom: 0.25rem;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: linear-gradient(135deg, var(--btc) 0%, var(--btc-hover) 100%);
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.25s;
  box-shadow: 0 0 24px var(--btc-glow);
  position: relative;
  z-index: 1;
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px var(--btc-glow), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.play-icon {
  font-size: 0.65rem;
}

.btn-play.playing {
  background: linear-gradient(135deg, var(--cyan-dim) 0%, var(--cyan) 100%);
  box-shadow: 0 0 24px var(--cyan-glow);
}

.btn-secondary {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
  position: relative;
  z-index: 1;
}

.btn-secondary:hover {
  color: var(--cyan-bright);
  text-shadow: 0 0 12px var(--cyan-glow);
}

/* Cursor */

.cursor-line {
  padding-bottom: 1rem;
  margin-bottom: 0;
}

.cursor {
  display: inline-block;
  width: 0.5em;
  height: 1.05em;
  background: var(--cyan-bright);
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
  box-shadow: 0 0 8px var(--cyan-glow);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.terminal-line {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-bottom: 0.7rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ── Audio player ── */

.audio-player {
  margin-top: 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 0 30px rgba(247, 147, 26, 0.08);
}

.audio-player[hidden] {
  display: none;
}

.audio-player .player-header {
  padding: 0.75rem 1.25rem 0;
  position: relative;
  z-index: 1;
}

.player-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.65rem;
  font-size: 0.75rem;
}

.player-label {
  font-family: var(--font-mono);
  color: var(--btc);
  letter-spacing: 0.08em;
  font-weight: 500;
}

.player-episode {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#audio-element {
  width: calc(100% - 2.5rem);
  margin: 0 1.25rem 1rem;
  height: 36px;
  accent-color: var(--btc);
  position: relative;
  z-index: 1;
}

/* ── Episodes ── */

.episodes {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.section-header {
  margin-bottom: 1.25rem;
}

.section-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

.episode-log {
  border-radius: var(--radius);
  padding-bottom: 0;
}

.episode-log::after,
.transcript-panel::after {
  display: none;
}

/* Keep interactive content above CRT scanlines */
.episodes,
.archive-section {
  position: relative;
  z-index: 51;
}

.log-table-head {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--border-bright);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

.episode-log .log-entry {
  position: relative;
  z-index: 1;
}

.log-entry {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(34, 211, 238, 0.06);
  font-size: 0.85rem;
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
}

.log-entry:hover {
  background: var(--bg-hover);
}

.log-timestamp {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.log-body {
  min-width: 0;
}

.log-id {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--btc);
  letter-spacing: 0.08em;
  margin-bottom: 0.1rem;
}

.log-title {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
  text-shadow: none;
  -webkit-font-smoothing: subpixel-antialiased;
}

.log-title:hover {
  color: var(--cyan-bright);
  text-shadow: none;
}

.log-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.log-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-log-play {
  background: transparent;
  border: 1px solid var(--cyan-dim);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
}

.btn-log-play:hover {
  background: var(--cyan-soft);
  border-color: var(--cyan);
  color: var(--cyan-bright);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.btn-log-open {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
  border: 1px solid var(--border-bright);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-log-open:hover {
  border-color: var(--cyan);
  color: var(--cyan-bright);
  background: var(--cyan-soft);
}

.archive-main {
  min-height: 60vh;
}

.archive-section {
  padding-top: 1.5rem;
}

.archive-log {
  border-radius: 0;
}

/* Archive: flat readable list — no CRT vignette over 700+ rows */

body.archive-page .terminal-frame {
  transform: none;
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

body.archive-page .archive-log .log-entry {
  transform: none;
  overflow: visible;
}

body.archive-page .archive-log .log-id {
  display: block;
}

body.archive-page .archive-log .log-title {
  color: var(--text-primary);
}

body.archive-page .transcript-panel {
  overflow: visible;
}

body.archive-page .transcript-body {
  overflow: visible;
}

.archive-scroll-sentinel {
  height: 1px;
  pointer-events: none;
}

.btn-log-play.playing {
  background: var(--btc-soft);
  border-color: var(--btc);
  color: var(--btc);
  box-shadow: 0 0 12px var(--btc-glow);
}

.log-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.log-dim {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.72rem;
}

.link-accent {
  font-family: var(--font-mono);
  color: var(--btc);
  text-decoration: none;
  font-size: 0.78rem;
  transition: text-shadow 0.2s;
}

.link-accent:hover {
  color: var(--btc-bright);
  text-shadow: 0 0 12px var(--btc-glow);
}

/* ── About ── */

.about {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.about-panel {
  padding: 0;
  border-radius: var(--radius);
}

.about-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 1.5rem 1.25rem 1.25rem;
  align-items: start;
  position: relative;
  z-index: 1;
}

.host-portrait {
  margin: 0;
}

.portrait-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-bright);
  box-shadow:
    0 0 30px var(--cyan-glow),
    0 0 50px rgba(247, 147, 26, 0.08);
  background: var(--bg-deep);
}

.portrait-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

.portrait-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.03) 3px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0.5;
  pointer-events: none;
}

.portrait-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.04) 0%,
    transparent 40%,
    transparent 60%,
    rgba(247, 147, 26, 0.04) 100%
  );
  pointer-events: none;
}

.portrait-caption {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.85rem;
  text-align: center;
}

.portrait-id {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--btc);
}

.portrait-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.portrait-role {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.about-copy p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1rem;
  max-width: 68ch;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.about-bio-secondary {
  font-size: 0.85rem !important;
  color: var(--text-dim) !important;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  padding: 0 1.25rem 1.25rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  position: relative;
  z-index: 1;
}

.about-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: border-color 0.2s;
}

.about-item:hover {
  border-color: var(--border-bright);
}

.about-key {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.about-val {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ── Projects ── */

.projects {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.projects-panel {
  padding: 0;
  border-radius: var(--radius);
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 1;
}

.project-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.project-link:first-child {
  border-top: none;
}

.project-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--holo-gradient);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.project-link:hover {
  background: rgba(34, 211, 238, 0.04);
}

.project-link:hover::before {
  opacity: 0.6;
}

.project-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.project-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.project-blurb {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.project-go {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--cyan);
  position: relative;
  z-index: 1;
  transition: color 0.2s, transform 0.2s;
}

.project-link:hover .project-go {
  color: var(--btc);
  transform: translateX(3px);
}

.project-link:hover .project-title {
  color: var(--cyan-bright);
}

/* ── Subscribe ── */

.subscribe {
  padding: 2rem 1.5rem;
}

.subscribe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
}

.subscribe-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.subscribe-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--holo-gradient);
  opacity: 0;
  transition: opacity 0.25s;
}

.subscribe-link:hover {
  border-color: var(--cyan);
  color: var(--text-primary);
  box-shadow: 0 0 20px var(--cyan-glow);
  transform: translateY(-1px);
}

.subscribe-link:hover::before {
  opacity: 0.5;
}

.sub-icon {
  color: var(--cyan);
  font-size: 0.7rem;
  position: relative;
  z-index: 1;
}

.subscribe-link span:last-child {
  position: relative;
  z-index: 1;
}

.subscribe-link:hover .sub-icon {
  color: var(--btc);
}

/* ── Footer ── */

.terminal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.8rem 1.25rem;
  background: rgba(12, 18, 32, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-top: 1px solid var(--border-bright);
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  position: relative;
}

.terminal-footer::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--btc), var(--cyan), transparent);
  opacity: 0.4;
}

.footer-sep {
  color: var(--border-bright);
}

.footer-btc {
  color: var(--btc-bright);
}

.node-stats-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-dim);
  transition: color 0.3s;
}

.node-stats-wrap.node-stats-live {
  color: var(--cyan);
}

.node-stats-wrap.node-stats-error {
  opacity: 0.6;
}

.node-stat-label {
  color: var(--text-dim);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
}

.node-stat-val {
  color: var(--cyan-bright);
  font-variant-numeric: tabular-nums;
}

.node-stat-val.btc-accent {
  color: var(--btc-bright);
}

.market-stats-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.3s;
}

.market-stats-wrap.market-stats-live {
  color: var(--cyan);
}

.market-stats-wrap.market-stats-error {
  opacity: 0.6;
}

/* ── Tier 3: route transitions ── */

.route-transition {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: var(--bg-deep);
  display: flex;
  align-items: flex-start;
  padding: 2.5rem 2rem;
  overflow: hidden;
}

.route-transition[hidden] {
  display: none;
}

.route-transition-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(34, 211, 238, 0.04) 2px,
    rgba(34, 211, 238, 0.04) 4px
  );
  pointer-events: none;
}

.route-transition-inner {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 2.5vw, 0.9rem);
  line-height: 1.6;
}

.route-transition-cmd {
  color: var(--cyan-bright);
  margin-left: 0.35rem;
}

.route-transition-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: var(--cyan-bright);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursor-blink 1s step-end infinite;
  box-shadow: 0 0 8px var(--cyan-glow);
}

.route-transition.route-exit {
  animation: route-exit-wipe 0.52s ease-in forwards;
}

.route-transition.route-enter {
  animation: route-enter-wipe 0.58s ease-out forwards;
}

@keyframes route-exit-wipe {
  0% {
    clip-path: inset(0 0 100% 0);
    opacity: 0;
  }
  18% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

@keyframes route-enter-wipe {
  0% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
  100% {
    clip-path: inset(0 0 100% 0);
    opacity: 0;
  }
}

/* ── Tier 2: checksum badges ── */

.checksum-badge {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(34, 211, 238, 0.12);
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
  opacity: 0.75;
  transition: opacity 0.2s, border-color 0.2s;
}

.log-entry:hover .checksum-badge,
.episode-checksum:hover {
  opacity: 1;
  border-color: rgba(247, 147, 26, 0.3);
  color: var(--btc-bright);
}

.episode-checksum {
  display: inline-block;
  margin-top: 0.35rem;
}

/* ── Tier 2: lightning flash ── */

.lightning-flash {
  position: fixed;
  width: 120px;
  height: 120px;
  margin-left: -60px;
  margin-top: -60px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  background: radial-gradient(
    circle,
    rgba(103, 232, 249, 0.55) 0%,
    rgba(247, 147, 26, 0.35) 35%,
    transparent 70%
  );
  animation: lightning-burst 0.45s ease-out forwards;
}

@keyframes lightning-burst {
  0% {
    transform: scale(0.2);
    opacity: 1;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ── Safe areas (notched phones) ── */

@supports (padding: env(safe-area-inset-bottom)) {
  .terminal-frame {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .title-bar {
    padding-top: calc(0.75rem + env(safe-area-inset-top));
  }

  .terminal-footer {
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom));
  }
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .terminal-frame {
    margin: 0;
    padding: 0;
  }

  /* Perspective CRT transform causes subpixel overflow / janky scroll on phones */
  .terminal-frame.crt-viewport {
    border-radius: 0;
    transform: none;
    box-shadow:
      0 0 0 1px rgba(34, 211, 238, 0.18),
      inset 0 0 60px rgba(0, 0, 0, 0.35);
  }

  .terminal-frame.crt-viewport::before,
  .terminal-frame.crt-viewport .crt-overlay {
    border-radius: 0;
  }

  .node-sync-bar {
    left: 0;
    right: 0;
  }

  .title-bar {
    border-radius: 0;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    text-align: center;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .title-bar-left,
  .title-bar-right {
    justify-self: center;
  }

  .title-bar-text {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
  }

  .terminal-nav {
    padding: 0.85rem 1rem 1rem;
  }

  .nav-menu {
    gap: 0.15rem 0.85rem;
  }

  .nav-key {
    margin-right: 0.2rem;
  }

  .terminal-footer {
    border-radius: 0;
    font-size: 0.72rem;
    gap: 0.45rem 0.65rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    justify-content: center;
  }

  .tag {
    font-size: 0.68rem;
  }

  .status-label {
    font-size: 0.7rem;
  }

  .nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 0.2rem;
    min-height: 44px;
    font-size: 0.84rem;
  }

  .btn-log-play,
  .btn-log-open {
    padding: 0.65rem 1rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .btn-play {
    min-height: 48px;
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.25rem;
  }

  .btn-secondary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.5rem 0;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .log-title {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: anywhere;
  }

  .hero,
  .episodes,
  .about,
  .projects,
  .subscribe,
  .archive-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .data-grid {
    grid-template-columns: 1fr;
  }

  .log-table-head {
    display: none;
  }

  .log-entry {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .log-actions {
    justify-content: flex-start;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    justify-items: center;
    text-align: center;
  }

  .about-copy p {
    max-width: none;
  }

  .host-portrait {
    width: min(100%, 280px);
  }

  .subscribe-grid {
    grid-template-columns: 1fr;
  }

  .subscribe-link,
  .project-link {
    min-height: 48px;
  }

  .project-title,
  .project-blurb {
    overflow-wrap: anywhere;
  }

  /* Avoid iOS zoom-on-focus (needs ≥16px) */
  .transcript-search-input {
    font-size: 16px;
    min-height: 44px;
  }

  .btn-transcript {
    min-height: 44px;
  }

  audio.episode-audio,
  #audio-element {
    width: 100%;
    max-width: 100%;
  }
}

/* ── Episode detail page ── */

.title-bar-link {
  text-decoration: none;
  color: inherit;
}

.title-bar-link:hover .title-bar-text {
  color: var(--cyan-bright);
}

.episode-main {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: none;
}

.episode-hero {
  padding: 1.75rem 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.episode-panel {
  margin-top: 0.75rem;
  border-radius: var(--radius);
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.06);
}

.episode-panel-body {
  padding: 1.25rem 1.5rem 1.5rem;
  position: relative;
  z-index: 1;
}

.episode-page-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.episode-guest-line {
  font-size: 0.95rem;
  color: var(--cyan);
  margin-bottom: 1.25rem;
}

.episode-stats {
  margin-bottom: 1.25rem;
}

.episode-summary {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 72ch;
  margin-bottom: 1.5rem;
  white-space: pre-line;
}

.episode-player-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.episode-audio {
  width: 100%;
  accent-color: var(--btc);
}

.episode-columns {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  padding: 2rem 1.5rem;
}

.episode-section {
  min-width: 0;
}

.episode-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-panel::after {
  display: none;
}

.timestamp-list {
  list-style: none;
  padding: 0.5rem 0;
  position: relative;
  z-index: 1;
}

.timestamp-item {
  border-bottom: 1px solid rgba(34, 211, 238, 0.06);
  font-size: 0.85rem;
  padding: 0;
}

.timestamp-seek {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 1.25rem;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.timestamp-seek:disabled {
  cursor: default;
  opacity: 0.7;
}

.timestamp-item--seek .timestamp-seek:hover {
  background: var(--bg-hover);
}

.timestamp-item--seek .timestamp-seek:hover .timestamp-time {
  color: var(--btc-bright);
}

.timestamp-item--seek .timestamp-seek:hover .timestamp-label {
  color: var(--text-primary);
}

.timestamp-item--seek .timestamp-seek:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: -1px;
}

.timestamp-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--btc);
  font-variant-numeric: tabular-nums;
}

.timestamp-label {
  color: var(--text-secondary);
}

.reference-list {
  list-style: none;
  padding: 0.75rem 0;
  position: relative;
  z-index: 1;
}

.reference-list li {
  border-bottom: 1px solid rgba(34, 211, 238, 0.06);
}

.reference-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.reference-link:hover {
  color: var(--cyan-bright);
  background: var(--cyan-soft);
}

.adjacent-list {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.adjacent-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1.25rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(34, 211, 238, 0.06);
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
}

.adjacent-card:hover {
  background: var(--bg-hover);
}

.adjacent-id {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--btc);
  letter-spacing: 0.08em;
}

.adjacent-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
}

.adjacent-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.external-archive-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
  text-align: center;
  padding: 0.5rem;
  transition: color 0.2s;
}

.external-archive-link:hover {
  color: var(--btc);
}

.episode-nav .nav-link.active {
  color: var(--text-secondary);
  text-shadow: none;
}

/* ── Transcript ── */

.episode-transcript-section {
  padding: 0 1.5rem 2rem;
  border-top: 1px solid var(--border);
}

.transcript-panel {
  border-radius: var(--radius);
}

.transcript-panel .panel-chrome {
  justify-content: flex-start;
}

.transcript-status {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.transcript-status.decoded {
  color: var(--cyan-bright);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.transcript-status.unavailable {
  color: var(--text-dim);
  border-color: var(--border);
}

.transcript-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 220px;
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.transcript-unavailable-icon {
  font-size: 1.5rem;
  color: var(--text-dim);
  opacity: 0.5;
}

.transcript-unavailable-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.transcript-unavailable-desc {
  margin: 0;
  max-width: 36ch;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.transcript-body {
  position: relative;
  z-index: 1;
}

.transcript-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

.transcript-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 200px;
}

.search-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--btc);
  font-weight: 500;
}

.transcript-search-input {
  flex: 1;
  max-width: 360px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  background: var(--bg-deep);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.transcript-search-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.transcript-search-input::placeholder {
  color: var(--text-dim);
}

.search-results {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--cyan);
  white-space: nowrap;
}

.search-results.no-matches {
  color: var(--text-dim);
}

.transcript-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn-transcript {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--bg-deep);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-transcript:hover {
  color: var(--cyan-bright);
  border-color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.transcript-scroll {
  padding: 0.5rem 0;
  max-height: min(68vh, 42rem);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 211, 238, 0.35) rgba(0, 0, 0, 0.25);
}

.transcript-scroll::-webkit-scrollbar {
  width: 8px;
}

.transcript-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.transcript-scroll::-webkit-scrollbar-thumb {
  background: rgba(34, 211, 238, 0.28);
  border-radius: 4px;
}

.transcript-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 211, 238, 0.42);
}

/* Episode pages: flat layout — CRT vignette/scanlines break on long transcripts */
body.episode-page .terminal-frame.crt-viewport {
  transform: none;
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

body.episode-page .terminal-frame.crt-viewport::before,
body.episode-page .crt-overlay {
  display: none;
}

body.episode-page .episode-main,
body.episode-page .title-bar,
body.episode-page .terminal-nav,
body.episode-page .terminal-footer {
  position: relative;
  z-index: 1;
}

body.episode-page .transcript-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.episode-page .transcript-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

body.episode-page .transcript-scroll {
  flex: 1 1 auto;
  min-height: 0;
  height: clamp(32rem, 78vh, 56rem);
  max-height: clamp(32rem, 78vh, 56rem);
}

.transcript-entry {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.25rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(34, 211, 238, 0.06);
  transition: background 0.2s;
}

.transcript-entry:hover {
  background: rgba(22, 32, 56, 0.5);
}

.transcript-entry-hidden {
  display: none;
}

.transcript-entry-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  padding-top: 0.15rem;
}

.speaker-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--cyan);
}

.speaker-tag.guest {
  color: var(--btc);
}

.transcript-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: right;
}

.transcript-time:hover {
  color: var(--cyan-bright);
}

.transcript-text {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0;
}

.search-hit {
  background: rgba(247, 147, 26, 0.25);
  color: var(--btc-bright);
  padding: 0 2px;
  border-radius: 2px;
}

@media (max-width: 900px) {
  .episode-columns {
    grid-template-columns: 1fr;
  }

  /* Keep chapter index above references on narrow layouts (listen-first). */
  .episode-sidebar {
    order: 0;
  }
}

@media (max-width: 640px) {
  .episode-hero,
  .episode-columns,
  .episode-transcript-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .episode-page-title {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .transcript-entry {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 1rem;
  }

  .transcript-entry-meta {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .transcript-time {
    min-height: 44px;
    min-width: 44px;
    padding: 0.35rem 0.5rem;
    text-align: left;
    display: inline-flex;
    align-items: center;
  }

  .transcript-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .transcript-search-input {
    max-width: none;
  }

  .episode-panel-body {
    padding: 1rem;
  }

  .timestamp-seek {
    grid-template-columns: 64px 1fr;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    min-height: 48px;
    align-items: center;
  }

  .reference-link {
    min-height: 48px;
    padding: 0.85rem 1rem;
    overflow-wrap: anywhere;
  }

  .adjacent-card {
    min-height: 48px;
  }

  .episode-player-wrap {
    gap: 0.85rem;
  }

  body.episode-page .transcript-scroll {
    height: min(70vh, 36rem);
    max-height: min(70vh, 36rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .holo-shimmer,
  .status-pulse,
  .tag-dot,
  .cursor,
  .crt-overlay::before,
  .transmission-panel.transmission-active {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }

  .btn-play:hover,
  .subscribe-link:hover,
  .holo-tilt,
  .terminal-frame.crt-viewport {
    transform: none;
  }

  .route-transition.route-exit,
  .route-transition.route-enter {
    animation: none;
  }

  .cmd-type::after {
    display: none;
  }

  .lightning-flash {
    animation: none;
  }

  .grid-atmosphere {
    transition: none;
  }

}