/* =========================================================
   Strange Signal — strangesignal.tv
   The series look, from ~/strange-signal-graphics/src/lib/theme.ts:
   near-black ground, cream serif, ONE teal, mono for anything a
   computer said, typewriter for case-file tags and source lines.
   ========================================================= */

:root {
  --bg:        #04080a;
  --bg-lift:   #0a1418;
  --line:      #1c2f33;
  --cream:     #ece5d3;
  --cream-dim: #a39d8d;
  --teal:      #3fe0d0;
  --teal-dim:  #1e8f87;
  --teal-deep: #0d3f3e;

  --serif: "Playfair Display", "Bodoni 72", Georgia, serif;
  --mono:  "IBM Plex Mono", Menlo, monospace;
  --type:  "Cutive Mono", "American Typewriter", "Courier New", monospace;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

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

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  max-width: var(--wrap); margin: 0 auto; padding: 16px var(--gutter);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--cream); }
.brand:hover { text-decoration: none; }
.brand img { width: 44px; height: 44px; }
.brand-name { font-size: 20px; letter-spacing: 0.14em; text-transform: uppercase; }
.brand-name b { font-weight: 400; color: var(--teal); }
.topnav { display: flex; gap: 24px; font-family: var(--type); font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; }
.topnav a { color: var(--cream-dim); }
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--cream); }

/* ---------- tags and small type ---------- */
.tag {
  display: inline-block; font-family: var(--type); font-size: 13px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--cream-dim);
  border: 1px solid var(--line); padding: 6px 10px 4px;
}
.meta { font-family: var(--mono); font-size: 13px; color: var(--cream-dim); letter-spacing: 0.02em; }
.meta span + span::before { content: "·"; margin: 0 10px; color: var(--teal-dim); }

h1, h2, h3 { font-weight: 500; line-height: 1.15; margin: 0; }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
.lede { font-style: italic; color: var(--cream); font-size: clamp(19px, 2.2vw, 23px); }
p { margin: 0 0 1em; }
.dim { color: var(--cream-dim); }

/* ---------- hero (the channel banner) ---------- */
.hero { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #020507; }
.hero img { width: 100%; max-width: 1672px; margin: 0 auto; aspect-ratio: 1672 / 941; max-height: 68vh; object-fit: cover; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- where to watch / listen ---------- */
.platforms { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.02em;
  color: var(--cream); background: transparent;
  border: 1px solid var(--line); border-radius: 6px; padding: 11px 16px;
  cursor: pointer;
}
.btn:hover, .btn:focus-visible { border-color: var(--teal-dim); text-decoration: none; }
.btn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.btn-solid { background: var(--teal); border-color: var(--teal); color: #02110f; }
.btn-solid:hover { background: #5be8da; border-color: #5be8da; }

.intro { padding: 44px 0 8px; display: grid; gap: 22px; justify-items: start; }

/* ---------- sections ---------- */
section { padding: 56px 0; }
section + section { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }

/* ---------- player (loads YouTube only on click) ---------- */
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); overflow: hidden; }
.player img, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.player button {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: linear-gradient(to top, rgba(2,5,7,0.55), rgba(2,5,7,0) 45%);
  border: 0; cursor: pointer; padding: 0;
}
.player .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 84px; height: 84px; border-radius: 50%;
  border: 2px solid var(--teal); background: rgba(4,8,10,0.72);
  display: grid; place-items: center;
}
.player .play::after {
  content: ""; margin-left: 6px;
  border-left: 24px solid var(--teal); border-top: 15px solid transparent; border-bottom: 15px solid transparent;
}
.player button:hover .play, .player button:focus-visible .play { background: var(--teal-deep); }

.latest { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.latest h3 { font-size: clamp(26px, 3vw, 34px); margin: 14px 0 12px; }
.latest .meta { margin-bottom: 16px; }

/* ---------- episode list ---------- */
.episodes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.ep-card { display: block; color: var(--cream); border: 1px solid var(--line); background: var(--bg-lift); }
.ep-card:hover { border-color: var(--teal-dim); text-decoration: none; }
.ep-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.ep-card .body { padding: 18px 20px 20px; display: grid; gap: 8px; }
.ep-card h3 { font-size: 23px; }
.ep-num { font-family: var(--type); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--teal); }

/* ---------- sign-up ---------- */
.signup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.signup form { display: flex; gap: 10px; flex-wrap: wrap; }
.signup input[type="email"] {
  flex: 1 1 220px; min-width: 0;
  font-family: var(--mono); font-size: 15px; color: var(--cream);
  background: var(--bg-lift); border: 1px solid var(--line); border-radius: 6px; padding: 11px 14px;
}
.signup input::placeholder { color: #6d6a60; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; align-items: start; }
.portrait { border: 1px solid var(--line); background: var(--bg-lift); padding: 8px; }
.portrait img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: 50% 30%; }
.portrait figcaption { font-family: var(--type); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cream-dim); padding: 10px 4px 2px; }
figure { margin: 0; }
.about p { max-width: 62ch; }

/* ---------- episode page ---------- */
.ep-head { padding: 36px 0 28px; display: grid; gap: 14px; justify-items: start; }
.ep-head h1 { font-size: clamp(32px, 5vw, 54px); }
.ep-body { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 48px; padding: 44px 0 56px; align-items: start; }
.ep-body .prose p { max-width: 66ch; }
.side { display: grid; gap: 28px; }
.panel { border: 1px solid var(--line); background: var(--bg-lift); padding: 20px; }
.panel h2 { font-family: var(--type); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cream-dim); font-weight: 400; margin-bottom: 14px; }
.panel .platforms { flex-direction: column; }
.panel .btn { justify-content: flex-start; }
.panel p { font-size: 15px; color: var(--cream-dim); margin: 0; }

.sources h2 { margin-bottom: 8px; }
.source-group { border-top: 1px solid var(--line); padding: 22px 0; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.source-group h3 { font-family: var(--type); font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cream); font-weight: 400; line-height: 1.5; }
.source-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.source-group li { font-family: var(--mono); font-size: 14px; line-height: 1.5; color: var(--cream-dim); overflow-wrap: anywhere; }
.source-group li a { color: var(--cream); border-bottom: 1px solid var(--teal-dim); }
.source-group li a:hover { color: var(--teal); text-decoration: none; }

.ep-nav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 14px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 36px 0 48px; }
.foot { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 36px; }
.foot p { font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--cream-dim); max-width: 60ch; }
.foot nav { display: grid; gap: 8px; font-family: var(--mono); font-size: 13px; justify-items: start; }
.foot nav a { color: var(--cream-dim); }
.foot nav a:hover { color: var(--cream); }

/* ---------- narrow screens ---------- */
@media (max-width: 820px) {
  body { font-size: 17px; }
  .latest, .signup, .about, .ep-body, .foot, .source-group { grid-template-columns: minmax(0, 1fr); }
  .episodes { grid-template-columns: minmax(0, 1fr); }
  .about .portrait { max-width: 240px; }
  .source-group { gap: 12px; }
  section { padding: 40px 0; }
  .topnav { gap: 18px; font-size: 13px; }
  .player .play { width: 64px; height: 64px; }
  .player .play::after { border-left-width: 18px; border-top-width: 11px; border-bottom-width: 11px; margin-left: 5px; }
}

/* ---------- small helpers (no inline styles: the CSP forbids them) ---------- */
.gap-top { margin-top: 12px; }
.gap-bottom { margin-bottom: 18px; }
.narrow { max-width: 66ch; }

/* ---------- plain pages ---------- */
.page-head { padding: 40px 0 32px; display: grid; gap: 14px; justify-items: start; }
.page-head h1 { font-size: clamp(32px, 5vw, 54px); }
.page-head .lede { max-width: 60ch; margin: 0; }
.prose p { max-width: 66ch; }
.small-head { font-family: var(--type); font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cream-dim); font-weight: 400; margin: 34px 0 14px; }
.episodes-all { padding-bottom: 56px; }
.about-page { padding-bottom: 64px; }
.prose.narrow { padding-bottom: 64px; }

/* ---------- chapters ---------- */
.chapters { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-width: 66ch; }
.chapters li { border-bottom: 1px solid var(--line); }
.chapters a { display: flex; gap: 18px; align-items: baseline; padding: 10px 0; color: var(--cream); font-size: 17px; }
.chapters a:hover { color: var(--teal); text-decoration: none; }
.chapters .stamp { font-family: var(--mono); font-size: 14px; color: var(--teal); min-width: 3.2em; }

/* ---------- forms ---------- */
.contact { max-width: 720px; padding-bottom: 64px; }
.stack { display: grid; gap: 10px; }
.stack label { font-family: var(--type); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cream); margin-top: 12px; }
.stack label .dim { text-transform: none; letter-spacing: 0.02em; font-family: var(--mono); }
.stack input[type="text"], .stack input[type="email"], .stack textarea {
  width: 100%; font-family: var(--mono); font-size: 15px; line-height: 1.5; color: var(--cream);
  background: var(--bg-lift); border: 1px solid var(--line); border-radius: 6px; padding: 11px 14px;
}
.stack textarea { resize: vertical; }
.stack .pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.stack .pair > div { display: grid; gap: 10px; align-content: start; }
.stack button { margin-top: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.note { font-family: var(--mono); font-size: 13px; color: var(--cream-dim); margin: 12px 0 0; min-height: 1.4em; }
.note.ok { color: var(--teal); }
.btn[disabled] { opacity: 0.6; cursor: default; }
form.sent { display: none; }

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