/* radiohirado.com — one stylesheet, no framework, no webfont.
 *
 * The station has no picture: no presenter, no studio, no video. So the design
 * leans on the three things it does have — the SIGNAL (drawn large, given the
 * whole screen), the CLOCK (radio lives by it) and TYPE set like a masthead.
 * Everything else gets out of the way.
 *
 * No webfont is loaded on purpose. A display face would be the obvious move and
 * it would also be 60-200 KB blocking the first paint of a page whose entire
 * job is to start audio quickly. Heavy weights, very tight tracking and real
 * scale do most of the work a display face would.
 */

:root {
  --bg: #08080a;
  --bg-2: #0d0d11;
  --ink: #f2f2f5;
  --dim: #a0a0b0;
  --faint: #63636f;
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.05);

  --live: #ff2d2d;
  --wave: #ff2d2d;
  --wave-hot: #ffd166;
  --wave-dim: rgba(255, 255, 255, 0.14);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;

  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* `clip` rather than `hidden`: hidden turns the element into a scroll
     container, which breaks position:sticky and scroll-behaviour in its
     descendants. `clip` just clips. */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.05; }
p { margin: 0; }
.muted { color: var(--dim); }

/* ── grain ────────────────────────────────────────────────────────────────────
   A flat near-black page reads as an empty div. One inline SVG turbulence over
   everything gives it a surface — the visual equivalent of the room tone the
   station keeps under its own audio. pointer-events:none so it never eats a
   click. */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 9;
  pointer-events: none;
  opacity: 0.035;
  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='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainshift 6s steps(6) infinite;
}
@keyframes grainshift {
  0%   { transform: translate(0, 0) }
  20%  { transform: translate(-3%, 2%) }
  40%  { transform: translate(2%, -3%) }
  60%  { transform: translate(-2%, -2%) }
  80%  { transform: translate(3%, 1%) }
  100% { transform: translate(0, 0) }
}

/* ── header ───────────────────────────────────────────────────────────────── */
.top {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}

.mark { display: flex; align-items: center; gap: 11px; text-decoration: none; }

/* Four bars — a level meter, not a logo. The station's only native icon. */
.mark__bars { display: flex; align-items: center; gap: 3px; height: 22px; }
.mark__bars i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--live);
  animation: meter 1.6s ease-in-out infinite;
}
.mark__bars i:nth-child(1) { height: 8px;  animation-delay: 0s }
.mark__bars i:nth-child(2) { height: 18px; animation-delay: 0.18s }
.mark__bars i:nth-child(3) { height: 22px; animation-delay: 0.36s }
.mark__bars i:nth-child(4) { height: 11px; animation-delay: 0.54s }
.mark__bars--sm { height: 15px }
.mark__bars--sm i { width: 2px }
.mark__bars--sm i:nth-child(1) { height: 5px }
.mark__bars--sm i:nth-child(2) { height: 12px }
.mark__bars--sm i:nth-child(3) { height: 15px }
.mark__bars--sm i:nth-child(4) { height: 7px }
@keyframes meter { 0%, 100% { transform: scaleY(0.5) } 50% { transform: scaleY(1) } }

.mark__name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.top__nav { margin-left: auto; display: flex; gap: 22px; font-size: 12.5px; }
.top__nav a {
  color: var(--dim);
  text-decoration: none;
  letter-spacing: 0.04em;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}
.top__nav a:hover { color: var(--ink); border-bottom-color: var(--live); }

/* Radio lives by the clock. Tabular figures so it never jitters. */
.clock {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

/* ── the stage ────────────────────────────────────────────────────────────── */
.stage {
  position: relative;
  z-index: 10;
  /* Contains the glow. It is deliberately wider than the viewport (120vw) so the
     ember bleeds off both edges, and without this that width lands in the
     document's scroll extent. */
  overflow: hidden;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(28px, 7vh, 72px) var(--pad) clamp(36px, 8vh, 84px);
}

/* An ember behind the waveform whose opacity is driven from the audio level in
   site.js — the page itself breathes with the voice. */
.stage__glow {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(1100px, 120vw);
  aspect-ratio: 2 / 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 45, 45, 0.30), transparent 72%);
  filter: blur(46px);
  opacity: 0.12;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: -1;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 22px;
}
.eyebrow__sep { color: var(--faint) }

.lamp {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--faint);
  flex: 0 0 auto;
}
.lamp.on {
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(255, 45, 45, 0.6);
  animation: ping 2s cubic-bezier(0.2, 0, 0.2, 1) infinite;
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(255, 45, 45, 0.55) }
  70%  { box-shadow: 0 0 0 9px rgba(255, 45, 45, 0) }
  100% { box-shadow: 0 0 0 0 rgba(255, 45, 45, 0) }
}

/* The masthead. Three lines, staggered in, tight tracking, optical scale. */
.display {
  font-size: clamp(38px, 8.4vw, 104px);
  letter-spacing: -0.038em;
  font-weight: 800;
  margin-bottom: clamp(24px, 4vh, 44px);
}
/* DIRECT children only. A descendant selector here also catches the nested
   .dotpulse and turns the full stop into a full-size block on its own line. */
.display > span { display: block }
.display__l2 { color: var(--dim) }
.display__l3 { color: var(--ink) }

.display > span {
  opacity: 0;
  transform: translateY(0.22em);
  animation: rise 900ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.display__l1 { animation-delay: 60ms }
.display__l2 { animation-delay: 160ms }
.display__l3 { animation-delay: 260ms }
@keyframes rise { to { opacity: 1; transform: none } }

/* The full stop keeps blinking — a carrier that says the sentence has not
   finished, because the station has not finished. */
.dotpulse { display: inline; color: var(--live); animation: blink 1.4s steps(1) infinite }
@keyframes blink { 0%, 60% { opacity: 1 } 61%, 100% { opacity: 0.15 } }

.stage__note {
  margin-top: 20px;
  color: var(--faint);
  font-size: 12.5px;
  max-width: 46ch;
}

.stage__links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.28); transform: translateY(-1px) }
.btn--primary { background: var(--live); border-color: var(--live); font-weight: 600 }
.btn--primary:hover { background: #ff4343; border-color: #ff4343 }
.btn--quiet { color: var(--faint); font-family: var(--mono); font-size: 11.5px }

/* ── the player ───────────────────────────────────────────────────────────── */
.wfp--live { position: relative }

.wfp--live .wfp__canvas {
  display: block;
  width: 100%;
  height: clamp(120px, 22vh, 210px);
}

.wfp__bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.wfp__play {
  flex: 0 0 auto;
  width: 68px; height: 68px;
  border: none;
  border-radius: 50%;
  background: var(--live);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms ease;
  box-shadow: 0 0 0 0 rgba(255, 45, 45, 0.4);
}
.wfp__play svg { width: 26px; height: 26px; fill: currentColor }
.wfp__play:hover { transform: scale(1.06) }
.wfp__play:active { transform: scale(0.95) }
.wfp__play:focus-visible { outline: 2px solid #fff; outline-offset: 4px }
.wfp--live.is-playing .wfp__play { box-shadow: 0 0 34px 0 rgba(255, 45, 45, 0.42) }

.wfp__meta { min-width: 0; flex: 1 1 auto }

.wfp--live .wfp__title {
  font-size: clamp(15px, 2.1vw, 21px);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.35em;
}
/* Each new headline fades up rather than swapping — the only motion on the page
   that carries information: the station just changed item. */
.wfp__title.is-in { animation: rise 520ms cubic-bezier(0.16, 1, 0.3, 1) both }

.wfp__sub {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

/* ── crawl ────────────────────────────────────────────────────────────────── */
.crawl {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
  padding: 12px 0;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.crawl__track {
  display: flex;
  gap: 44px;
  width: max-content;
  animation: crawl 64s linear infinite;
}
.crawl:hover .crawl__track { animation-play-state: paused }
.crawl__item {
  font-size: 12.5px;
  color: var(--dim);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.crawl__item::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--live);
  flex: 0 0 auto;
}
/* -50% exactly, because the track holds the list twice — see index.html. */
@keyframes crawl { from { transform: translateX(0) } to { transform: translateX(-50%) } }

/* ── sections ─────────────────────────────────────────────────────────────── */
.section {
  position: relative;
  z-index: 10;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 10vh, 104px) var(--pad);
}
.section--rule { border-top: 1px solid var(--line-soft) }

.section__head { max-width: 60ch; margin-bottom: clamp(28px, 5vh, 48px) }
.section__head h2 {
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.section__head p { color: var(--dim); font-size: 15px }

.episodes { display: grid; gap: 14px }

.ep {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent);
  transition: border-color 200ms ease, transform 200ms ease;
}
.ep:hover { border-color: var(--line); transform: translateY(-2px) }

.ep__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.ep__kind { color: var(--live) }
.ep__when { margin-left: auto; white-space: nowrap }

.wfp--episode { display: flex; align-items: center; gap: 16px }
.wfp--episode .wfp__play { width: 44px; height: 44px }
.wfp--episode .wfp__play svg { width: 17px; height: 17px }
.wfp--episode .wfp__body { flex: 1 1 auto; min-width: 0 }
.wfp--episode .wfp__canvas { display: block; width: 100%; height: 44px; cursor: pointer }
.wfp--episode .wfp__title {
  font-size: 14px;
  line-height: 1.45;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── steps ────────────────────────────────────────────────────────────────── */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
}
.step { position: relative; padding-top: 30px; border-top: 1px solid var(--line) }
.step__n {
  position: absolute;
  top: -1px;
  left: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--live);
  background: var(--bg);
  padding-right: 12px;
  transform: translateY(-50%);
}
.step h3 { font-size: 17px; letter-spacing: -0.015em; margin-bottom: 10px }
.step p { color: var(--dim); font-size: 14px }
.step em { color: var(--ink); font-style: italic }

/* Scroll reveal. Elements start hidden ONLY once the observer is armed (site.js
   adds .reveal--armed), so with JS off nothing is ever invisible. */
.reveal--armed { opacity: 0; transform: translateY(16px) }
.reveal--armed.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── footer ───────────────────────────────────────────────────────────────── */
.foot {
  position: relative;
  z-index: 10;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px var(--pad) 56px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 14px;
}
.foot__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.foot__line { color: var(--dim); font-size: 13px; max-width: 52ch }
.foot__links { display: flex; gap: 18px; font-family: var(--mono); font-size: 11.5px }
.foot__links a { color: var(--faint); text-decoration: none }
.foot__links a:hover { color: var(--ink) }
.foot__copy { color: var(--faint); font-size: 11.5px }

/* ── narrow ───────────────────────────────────────────────────────────────── */
@media (max-width: 620px) {
  .top { gap: 12px; padding: 16px var(--pad) }
  .top__nav { gap: 14px; font-size: 12px }
  .clock { display: none } /* the first thing to go: a phone already has one */
  .wfp__bar { gap: 14px }
  .wfp__play { width: 56px; height: 56px }
  .wfp__play svg { width: 22px; height: 22px }
  .wfp--live .wfp__canvas { height: clamp(96px, 16vh, 140px) }
  .display { font-size: clamp(34px, 11vw, 56px) }
}

/* ── reduced motion ───────────────────────────────────────────────────────────
   Everything decorative stops. The waveform keeps drawing while playing, because
   it is the content — but its at-rest carrier is frozen (see waveform-player). */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  .grain { animation: none }
  .mark__bars i { animation: none }
  .lamp.on { animation: none }
  .dotpulse { animation: none }
  .crawl__track { animation: none }
  .display span { animation: none; opacity: 1; transform: none }
  .wfp__title.is-in { animation: none }
  .reveal--armed { opacity: 1; transform: none }
  .btn:hover, .ep:hover, .wfp__play:hover { transform: none }
}
