/* Station log: one long column of prose, with video plates breaking out wider.
   Night-side blue-black ground; amber is the colour burned into the video labels. */
:root {
  --night: #0a0d14;      /* page ground */
  --panel: #0f141d;      /* surfaces behind controls */
  --rule: #1f2733;       /* hairlines and borders */
  --ink: #e3e7ee;        /* primary text */
  --dim: #8b94a5;        /* secondary text */
  --amber: #ffc440;      /* accent, matches the GOES-19 label in the videos */
  --ir: #78b9c9;         /* infrared region of the ruler */
  --tl-night: #121925;   /* timeline: night */
  --tl-day: #57451a;     /* timeline: day */

  --serif: "Spectral", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "Martian Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;

  --step--1: 0.75rem;    /* mono labels */
  --step-0: 1.125rem;    /* body */
  --step-1: 1.4rem;      /* caption titles */
  --step-2: 1.65rem;     /* dek */
  --step-3: 2.25rem;     /* section heads */

  color-scheme: dark;
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-weight: 400;
}

a { color: var(--ink); text-decoration-color: var(--amber); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--amber); }

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

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-block: clamp(32px, 6vw, 72px) 48px;
}

/* ---------- masthead ---------- */

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
  gap: clamp(28px, 5vw, 64px);
  align-items: end;
  padding-bottom: clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--rule);
}

.masthead-main { min-width: 0; }

.logline {
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.rx {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  flex: none;
}

.callsign {
  margin: 0;
  font-family: var(--mono);
  font-weight: 650;
  font-stretch: 82%;
  font-size: clamp(3.6rem, 13vw, 10.5rem);
  line-height: 0.86;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.dek {
  margin: 22px 0 0;
  max-width: 30ch;
  font-size: var(--step-2);
  line-height: 1.32;
  font-weight: 300;
  text-wrap: balance;
}

.station {
  margin: 0;
  display: grid;
  gap: 10px;
  font-family: var(--mono);
  font-size: var(--step--1);
  line-height: 1.45;
}

.station div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
}

.station dt { color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }
.station dd { margin: 0; color: var(--ink); }

/* ---------- plates ---------- */

.plate { margin-top: clamp(48px, 7vw, 88px); }

.plate-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 14px;
}

h2 {
  margin: 0;
  font-size: var(--step-3);
  font-weight: 400;
  line-height: 1.15;
  text-wrap: balance;
}

.meta {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.lead {
  margin: 0 0 22px;
  max-width: 62ch;
  color: var(--dim);
}

.screen {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  background: #000;
  border: 1px solid var(--rule);
  overflow: hidden;
}

.screen video,
.screen .hold {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: cover;
}

/* ---------- transport ---------- */

.transport {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  margin-top: 14px;
}

.play {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.play:hover { border-color: var(--dim); }
.play svg { width: 16px; height: 16px; fill: currentColor; }
.play .icon-play { display: none; }
.play.is-paused .icon-play { display: block; }
.play.is-paused .icon-pause { display: none; }

.timeline {
  position: relative;
  height: 44px;
  min-width: 0;
}

.daylight {
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  width: 100%;
  height: 16px;
  display: block;
  border-radius: 2px;
}

.scrub {
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.scrub::-webkit-slider-runnable-track { height: 28px; background: transparent; }
.scrub::-moz-range-track { height: 28px; background: transparent; }
.scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 3px;
  height: 28px;
  border: 0;
  border-radius: 1px;
  background: var(--amber);
}
.scrub::-moz-range-thumb {
  width: 3px;
  height: 28px;
  border: 0;
  border-radius: 1px;
  background: var(--amber);
}
.scrub:focus-visible { outline: none; }
.scrub:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--night), 0 0 0 5px var(--amber); }
.scrub:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--night), 0 0 0 5px var(--amber); }

.days {
  position: absolute;
  left: 0;
  right: 0;
  top: 28px;
  height: 14px;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--dim);
  pointer-events: none;
}

.days span {
  position: absolute;
  top: 0;
  padding-left: 5px;
  border-left: 1px solid var(--rule);
  white-space: nowrap;
}

.clock {
  margin: 4px 0 0;
  display: grid;
  gap: 2px;
  justify-items: end;
  font-family: var(--mono);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.clock .local { color: var(--dim); }

/* ---------- wavelength chips and ruler ---------- */

.views {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.views:empty { display: none; }

.chip {
  display: grid;
  gap: 2px;
  min-width: 84px;
  padding: 8px 12px 9px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--step--1);
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.chip small { font-size: 0.625rem; color: var(--dim); letter-spacing: 0.04em; }
.chip:hover { border-color: var(--dim); }
.chip[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); }
.chip[aria-pressed="true"] small { color: var(--amber); opacity: 0.8; }

.ruler {
  position: relative;
  height: 74px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.ruler .axis {
  position: absolute;
  left: 0;
  right: 0;
  top: 34px;
  height: 1px;
  background: var(--rule);
}

.ruler .region {
  position: absolute;
  top: 28px;
  height: 13px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--ir) 16%, transparent);
}

.ruler .region.visible {
  background: linear-gradient(90deg, #7a4dbf, #3f6fe0, #3fae6a, #e3d14a, #e8893a, #d8443a);
  opacity: 0.55;
}

.ruler .region-label {
  position: absolute;
  top: 8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.ruler .tick {
  position: absolute;
  top: 44px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ruler .tick::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -10px;
  width: 1px;
  height: 6px;
  background: var(--dim);
}

.ruler .band {
  position: absolute;
  top: 26px;
  width: 1px;
  height: 17px;
  background: var(--dim);
}

.ruler .marker {
  position: absolute;
  top: 25px;
  width: 11px;
  height: 11px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--night);
  transition: left 420ms cubic-bezier(0.3, 0.7, 0.2, 1), opacity 200ms;
}

.ruler .marker[hidden] { display: block !important; opacity: 0; }

.ruler .unit {
  position: absolute;
  right: 0;
  top: 58px;
  text-transform: none;
}

/* ---------- captions ---------- */

.caption {
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  gap: 12px clamp(24px, 4vw, 56px);
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.caption-id { min-width: 0; }
.caption-id p { margin: 0; }

.cap-title {
  margin: 0 0 4px;
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.2;
}

.cap-wave {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.cap-name {
  margin-top: 2px !important;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.pill {
  display: inline-block;
  margin-top: 12px !important;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.pill[data-terminator="yes"] { border-color: var(--amber); color: var(--amber); }
.pill[data-terminator="faint"] { border-color: color-mix(in srgb, var(--amber) 45%, var(--rule)); color: color-mix(in srgb, var(--amber) 70%, var(--dim)); }
.pill[hidden] { display: none; }

.cap-text { margin: 0; max-width: 62ch; min-width: 0; }

/* ---------- prose and notes ---------- */

.prose { max-width: 62ch; margin-top: 28px; }
.prose p { margin: 0 0 1em; }

.notes {
  margin-top: clamp(56px, 8vw, 96px);
  padding-top: clamp(28px, 4vw, 40px);
  border-top: 1px solid var(--rule);
}

.notes .prose { margin-top: 18px; }

.fine {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  max-width: 62ch;
  display: grid;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--dim);
}

.fine li { padding-left: 18px; position: relative; }
.fine li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 1px;
  background: var(--amber);
}

.colophon {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--dim);
}

.colophon p { margin: 0; max-width: 72ch; }

/* ---------- narrow screens ---------- */

@media (max-width: 860px) {
  .masthead { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .caption { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  /* The videos carry their labels in black side panels; on a phone, crop to the square
     centre so the picture fills the width. The caption and clock carry the labels. */
  .screen { aspect-ratio: 1 / 1; }
  .dek { font-size: 1.45rem; }
  .transport { grid-template-columns: 44px minmax(0, 1fr); }
  .clock { grid-column: 1 / -1; justify-items: start; grid-auto-flow: column; justify-content: start; gap: 14px; margin-top: 0; }
  [data-player="fulldisk"] .views { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .chip { min-width: 0; flex: 1 1 0; padding: 7px 8px 8px; font-size: 0.6875rem; }
  .chip small { font-size: 0.5625rem; letter-spacing: 0; white-space: nowrap; }
  .ruler .region-label { display: none; }
  .ruler .region-label.keep { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .ruler .marker { transition: none; }
}
