.signal-front,
.receiver-stage {
  --radio-paper: #f5f3eb;
  --radio-ink: #171818;
  --radio-blue: #2639e7;
  --radio-yellow: #f3ea35;
  --radio-edge: clamp(31px, 5.3vw, 104px);
  --radio-nav: 65px;
  --radio-height: max(550px, calc(100svh - var(--radio-nav)));
  display: block;
  overflow: clip;
  min-height: 0;
}

.signal-front { color: var(--radio-ink); background: var(--radio-paper); }
.signal-sheet { background: var(--radio-paper); }
.signal-sheet,
.receiver-poster {
  position: relative;
  isolation: isolate;
  min-height: var(--radio-height);
  max-width: 2060px;
  margin-inline: auto;
}

.signal-plate {
  position: absolute;
  inset: 0 0 10% 21%;
  display: block;
  overflow: hidden;
  mix-blend-mode: multiply;
  clip-path: polygon(4% 0,100% 0,100% 100%,0 100%,0 64%,4% 64%,4% 40%,0 40%,0 17%,4% 17%);
}
.signal-poster { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 65% 49%; filter: brightness(1.105); }

.signal-spine {
  position: absolute;
  top: 10%;
  bottom: 24%;
  left: max(10px, calc(var(--radio-edge) * .4));
  width: 1px;
  background: #17181835;
}
.signal-spine::before,
.signal-spine::after { content: ""; position: absolute; left: 0; }
.signal-spine::before { width: 4px; height: 14%; background: var(--radio-blue); top: 0; }
.signal-spine::after { width: 10px; height: 1px; background: var(--radio-ink); bottom: 0; }

.signal-heading,
.receiver-title {
  position: absolute;
  top: 11%;
  left: var(--radio-edge);
  z-index: 1;
}
.signal-front h1,
.receiver-title h1 {
  width: fit-content;
  margin: 0;
  font-family: var(--display-zh, "Microsoft YaHei", sans-serif);
  font-weight: 840;
  font-size: clamp(91px, min(13.1vw, 22svh), 218px);
  line-height: .94;
  letter-spacing: -.092em;
  color: var(--radio-ink);
}
.signal-front h1 span,
.receiver-title h1 span { display: block; }
.signal-front h1 span {
  position: relative;
  isolation: isolate;
  width: max-content;
}
.signal-front h1 span::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -.012em -.17em -.006em -.06em;
  background: var(--radio-paper);
  clip-path: polygon(0 0,97% 0,97% 13%,100% 13%,100% 78%,98% 78%,98% 100%,0 100%);
}
.signal-front h1 span + span {
  margin-inline-start: .19em;
  color: var(--radio-blue);
}
.signal-heading > p {
  margin: clamp(20px, 3.7vh, 41px) 0 0 3px;
  font-size: clamp(19px, 1.62vw, 29px);
  font-weight: 580;
  letter-spacing: .015em;
}
.signal-issue,
.receiver-desk {
  position: absolute;
  left: var(--radio-edge);
  right: var(--radio-edge);
  bottom: clamp(22px, 4.2vh, 52px);
  z-index: 1;
}
.signal-issue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-top: 1px solid #17181888;
  padding-top: clamp(12px, 2vh, 22px);
}
.signal-actions { display: flex; align-items: center; gap: clamp(17px, 2.7vw, 45px); }
.signal-open,
.signal-actions button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  color: var(--radio-ink);
  font-family: inherit;
  white-space: nowrap;
  font-size: clamp(16px, 1.19vw, 20px);
  font-weight: 650;
}
.signal-open { padding: 0 clamp(18px, 2.1vw, 34px); gap: 12px; color: var(--radio-paper); background: var(--radio-ink); }
.signal-open i { width: 0; height: 0; border-left: 10px solid var(--radio-yellow); border-block: 6px solid transparent; }
.signal-actions button { text-decoration: underline; text-underline-offset: .31em; text-decoration-thickness: 1px; }
.signal-actions :focus-visible { outline: 3px solid var(--radio-blue); outline-offset: 3px; }
.signal-actions button:hover { color: var(--radio-blue); }
.signal-open:hover { background: var(--radio-blue); }

/* The printed trace uses the amplitude envelope from the playable recording. */
.signal-score {
  display: flex;
  align-items: center;
  gap: 7px;
  width: clamp(125px, 26%, 440px);
  height: 31px;
  padding-inline-start: 13px;
  border-left: 1px solid var(--radio-ink);
}
.signal-score i { flex: 1; height: 100%; background: var(--radio-blue); mask: url("assets/radio-case/music-wave.png") center / 100% 100% no-repeat; }
.signal-score b { display: block; width: 4px; height: 62%; background: var(--radio-ink); }

.receiver-stage { background: #101214; color: var(--radio-paper); }
.receiver-poster { overflow: hidden; }
.receiver-frame {
  position: absolute;
  overflow: hidden;
  left: 27%;
  right: 0;
  top: 1%;
  bottom: 17%;
}
.receiver-frame span { pointer-events: none; position: absolute; display: block; }
.receiver-orbit {
  width: 82%;
  aspect-ratio: 1;
  left: 13%;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--radio-blue);
}
.receiver-window {
  inset: 5% 0% 5% 8%;
  isolation: isolate;
  background: #1937aa;
  clip-path: polygon(0 24%,13% 24%,13% 0,67% 0,67% 11%,100% 11%,100% 83%,82% 83%,82% 100%,3% 100%,3% 70%,0 70%);
}
.receiver-window::before,
.receiver-window::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--scene) 52% 49% / cover no-repeat;
}
.receiver-window::before {
  filter: grayscale(1) brightness(1.92) contrast(1.18);
  mix-blend-mode: luminosity;
}
.receiver-window::after {
  filter: saturate(.78) brightness(1.38);
  clip-path: polygon(0 66%,64% 66%,64% 60%,100% 60%,100% 84%,76% 84%,76% 88%,0 88%);
}
.receiver-strip {
  width: 8%;
  height: 48%;
  left: 9%;
  top: 15%;
  background: #b9b9a8 var(--scene) 18% 39% / auto 240% no-repeat;
  filter: grayscale(1) brightness(1.43);
}
.receiver-cross {
  width: 124%;
  height: 38%;
  left: -13%;
  top: 41%;
  transform: rotate(-15deg);
  border: 1px solid #f3f5ff79;
  border-radius: 50%;
}
.receiver-cross::before,
.receiver-cross::after { content: ""; position: absolute; top: 50%; }
.receiver-cross::before { left: 0; right: 0; height: 1px; background: #f2f4fd4f; }
.receiver-cross::after { width: 16px; height: 5px; left: 76%; background: var(--radio-yellow); }
.receiver-title { top: 13%; }
.receiver-title > p { margin: 0 0 22px 4px; font-size: clamp(17px, 1.6vw, 26px); font-weight: 620; }
.receiver-title h1 { color: var(--radio-paper); font-size: clamp(88px, min(12.5vw, 21.5svh), 214px); }
.receiver-title h1 span + span { margin-inline-start: .18em; }
.receiver-title h1:focus { outline: 0; }

.receiver-desk { border-top: 1px solid #c6cad477; padding-top: clamp(12px, 2.4vh, 24px); }
.receiver-controls.sound-controls { margin: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: clamp(22px, 5vw, 90px); align-items: center; }
.receiver-play.sound-pill {
  height: auto;
  display: grid;
  grid-template-columns: auto minmax(40px, 1fr) auto;
  gap: clamp(14px, 2.5vw, 48px);
  align-items: center;
  padding: 0;
  background: transparent;
  color: var(--radio-paper);
  border-radius: 0;
}
.receiver-play .receiver-key {
  min-width: clamp(100px, 10vw, 166px);
  min-height: 52px;
  margin: 0;
  gap: 11px;
  padding: 0 20px;
  font-size: clamp(17px, 1.3vw, 22px);
  color: #161814;
  background: var(--radio-yellow);
}
.receiver-play .receiver-clock,
.receiver-play.sound-pill #position {
  font-family: var(--display-latin, "Arial Narrow", sans-serif);
  font-size: clamp(19px, 1.8vw, 29px);
  font-weight: 570;
  letter-spacing: .035em;
  word-spacing: .06em;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  white-space: nowrap;
}
.receiver-wave {
  position: relative;
  display: block;
  width: 100%;
  height: 39px;
  overflow: hidden;
  background: #717690;
  mask: url("assets/radio-case/music-wave.png") center / 100% 100% no-repeat;
}
.receiver-wave .timer-track { inset: 0; width: 100%; height: 100%; border-radius: 0; background: transparent; }
.receiver-wave .timer-track i { border-radius: 0; background: var(--radio-yellow); }
.receiver-rain.rain-control {
  display: inline-flex;
  gap: 12px;
  padding: 0 7px;
  min-height: 48px;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--radio-paper);
  backdrop-filter: none;
  font-weight: 570;
}
.receiver-rain-switch { position: relative; width: 34px; height: 18px; border: 1px solid #b0b4bb; }
.receiver-rain-switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; background: #a4a8ae; }
.receiver-rain[aria-checked="true"] .receiver-rain-switch { border-color: var(--radio-yellow); }
.receiver-rain[aria-checked="true"] .receiver-rain-switch::before { transform: translateX(16px); background: var(--radio-yellow); }
.receiver-controls button:focus-visible { outline: 3px solid var(--radio-yellow); outline-offset: 4px; }

.radio-print-turn { position: fixed; z-index: 7; inset: 0; overflow: hidden; contain: strict; pointer-events: none; isolation: isolate; }
.radio-print-face,
.radio-print-ink { position: absolute; inset: 0; overflow: hidden; }
.radio-print-face:first-child { background: #f5f3eb; }
.radio-print-ink { background: #2639e7; }
.radio-print-ink::after { content: ""; position: absolute; top: 66%; left: 0; width: 100%; height: 5%; background: #f3ea35; }
.radio-print-face:last-child { background: #101214; }

@media (max-width: 640px), (max-width: 850px) and (orientation: portrait) {
  .signal-front,
  .receiver-stage { --radio-edge: clamp(19px, 5.7vw, 45px); --radio-height: max(450px, calc(100svh - var(--radio-nav))); }
  .signal-sheet,
  .receiver-poster {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: auto minmax(200px,1fr) auto;
    min-height: var(--radio-height);
  }
  .signal-spine { display: none; }
  .signal-heading,
  .receiver-title {
    position: relative;
    top: auto;
    left: auto;
    grid-area: 1 / 1;
    margin: clamp(22px, 4.1svh, 44px) var(--radio-edge) clamp(12px, 2svh, 20px);
  }
  .signal-front h1,
  .receiver-title h1 { display: flex; gap: .075em; font-size: clamp(60px, 19.4vw, 135px); line-height: .99; }
  .signal-front h1 span + span,
  .receiver-title h1 span + span { margin-inline-start: 0; }
  .signal-front h1 span::before { display: none; }
  .signal-heading > p { margin: 12px 0 0 2px; font-size: clamp(16px, 4.3vw, 24px); }
  .signal-plate {
    position: relative;
    grid-area: 2 / 1;
    inset: auto;
    min-height: 0;
    clip-path: polygon(0 8%,7% 8%,7% 0,100% 0,100% 91%,93% 91%,93% 100%,0 100%);
  }
  .signal-poster { position: absolute; inset: 0; object-position: 70% 50%; }
  .signal-issue,
  .receiver-desk { position: relative; grid-area: 3 / 1; inset: auto; margin: 15px var(--radio-edge) max(17px, env(safe-area-inset-bottom)); padding-top: 12px; }
  .signal-issue { gap: 13px; }
  .signal-actions { gap: clamp(15px, 4vw, 26px); }
  .signal-open { min-height: 46px; padding-inline: 15px; gap: 8px; }
  .signal-score { width: 18%; min-width: 35px; height: 22px; padding-left: 6px; gap: 4px; }
  .signal-score b { width: 2px; }
  .receiver-frame { position: relative; inset: auto; grid-area: 2 / 1; min-height: 0; }
  .receiver-orbit { width: 89%; left: 4%; }
  .receiver-window { inset: 2% 0 3% 3%; }
  .receiver-strip { left: 4%; height: 51%; }
  .receiver-title > p { margin: 0 0 10px 2px; font-size: clamp(16px, 3.8vw, 22px); }
  .receiver-controls.sound-controls { grid-template-columns: minmax(0,1fr); gap: 4px; align-items: start; }
  .receiver-play.sound-pill { gap: 14px; }
  .receiver-play .receiver-key { min-width: 86px; min-height: 46px; padding-inline: 12px; }
  .receiver-wave { height: 29px; }
  .receiver-rain.rain-control { min-height: 44px; padding-inline: 0; justify-content: start; gap: 9px; font-size: 16px; justify-self: start; }
}

/* A portrait crop keeps the visor large. This second crop returns the hand
   and its record to the composition at phone widths. */
@media (max-width: 520px) and (orientation: portrait) {
  .signal-plate::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 54%;
    height: 23%;
    border-block-start: 2px solid var(--radio-paper);
    border-inline-end: 2px solid var(--radio-paper);
    background: var(--radio-paper) url("assets/print/radio-poster.webp") 2% 99% / auto 385% no-repeat;
    filter: brightness(1.105);
    clip-path: polygon(0 0,84% 0,84% 12%,100% 12%,100% 100%,0 100%);
  }
}

@media (min-width: 641px) and (max-height: 540px) and (orientation: landscape) {
  .signal-front,.receiver-stage { --radio-height: max(316px, calc(100svh - var(--radio-nav))); }
  .signal-front h1,.receiver-title h1 { font-size: min(11.5vw, 22.3svh); }
  .signal-heading,.receiver-title { top: 6%; }
  .receiver-title > p,.signal-heading > p { margin-block: 9px; }
  .signal-issue,.receiver-desk { bottom: 13px; padding-top: 9px; }
}

@media (max-width: 700px) {
  .signal-front,.receiver-stage { --radio-nav: 57px; }
}

@media (prefers-reduced-motion: no-preference) {
  .signal-open { transition: background-color .16s; }
  .receiver-rain-switch::before { transition: transform .18s; }
}
@media (forced-colors: active) {
  .signal-spine,.signal-score,.receiver-cross,.receiver-orbit { display: none; }
  .signal-open,.receiver-rain,.receiver-key { border: 1px solid ButtonText; }
  .receiver-rain[aria-checked="true"] { outline: 2px dotted Highlight; }
  .radio-print-turn { display:none; }
}
