:root {
  --bakelite: #191210;
  --bakelite-2: #251713;
  --bakelite-3: #0b0807;
  --amber: #ffb54a;
  --amber-hot: #ffd27d;
  --cyan: #67fff0;
  --cyan-deep: #178b8f;
  --paper: #efe1c2;
  --paper-2: #cdbb98;
  --ink: #191210;
  --red: #b8241c;
  --line: rgba(255, 181, 74, 0.24);
  --line-cool: rgba(103, 255, 240, 0.24);
  --shadow: rgba(0, 0, 0, 0.55);
  --max: 1180px;
  --mono: "Chivo Mono", monospace;
  --display: "Abril Fatface", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 68% 10%, rgba(255, 181, 74, 0.18), transparent 25rem),
    radial-gradient(circle at 12% 36%, rgba(103, 255, 240, 0.12), transparent 22rem),
    linear-gradient(145deg, #2b1a15 0%, var(--bakelite) 44%, #080706 100%);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  opacity: 0.23;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 4px),
    repeating-radial-gradient(circle at 30% 20%, rgba(255, 181, 74, 0.08) 0 1px, transparent 1px 7px);
  mix-blend-mode: overlay;
}

body::after {
  background:
    linear-gradient(90deg, rgba(255, 181, 74, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(103, 255, 240, 0.035) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(circle at 50% 15%, black, transparent 72%);
}

a {
  color: inherit;
}

button {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  transform: translateY(-160%);
  padding: 0.8rem 1rem;
  color: #08100f;
  background: var(--cyan);
  border: 2px solid #07100f;
  border-radius: 4px;
  font-weight: 800;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, 1320px);
  min-height: 74px;
  margin: 0 auto;
  padding: 0.7rem 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  min-height: 52px;
  align-content: center;
  color: var(--paper);
  text-decoration: none;
}

.brand-kicker,
.eyebrow,
.section-marker,
.readout span,
.operator-strip,
.panel-topline,
.paper-header,
.apparatus-number,
.site-footer,
.brand-name {
  letter-spacing: 0;
}

.brand-kicker {
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-name {
  font-family: var(--display);
  font-size: 1.55rem;
  line-height: 1;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.62rem 0.78rem;
  border: 1px solid rgba(255, 181, 74, 0.22);
  border-radius: 4px;
  color: var(--paper);
  background: rgba(10, 7, 6, 0.45);
  text-decoration: none;
  font-size: 0.82rem;
}

.site-nav a:hover {
  color: #07100f;
  background: var(--cyan);
  border-color: var(--cyan);
}

.section {
  position: relative;
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 5.5rem 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 2.6rem;
  align-items: center;
  min-height: calc(100vh - 76px);
  padding-top: 3rem;
}

.room-vectors {
  position: absolute;
  inset: 3rem auto auto 0;
  width: 58%;
  max-width: 100%;
  height: 32rem;
  overflow: hidden;
  opacity: 0.45;
  pointer-events: none;
}

.room-vectors span {
  position: absolute;
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 181, 74, 0.8), transparent);
  transform-origin: left center;
}

.room-vectors span:nth-child(1) {
  top: 17%;
  left: 2rem;
  width: 82%;
  transform: rotate(-17deg);
}

.room-vectors span:nth-child(2) {
  top: 56%;
  left: 0;
  width: 70%;
  transform: rotate(13deg);
}

.room-vectors span:nth-child(3) {
  top: 76%;
  left: 7rem;
  width: 60%;
  background: linear-gradient(90deg, transparent, rgba(103, 255, 240, 0.75), transparent);
  transform: rotate(-5deg);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.96;
}

h1 {
  max-width: 9ch;
  margin-bottom: 1.35rem;
  color: var(--paper);
  font-size: 5.45rem;
  text-shadow: 0 0 32px rgba(255, 181, 74, 0.18), 0 2px 0 #050302;
}

h2 {
  margin-bottom: 1rem;
  color: var(--paper);
  font-size: 3.35rem;
  text-wrap: balance;
}

h3 {
  margin-bottom: 0.55rem;
  color: var(--amber-hot);
  font-size: 1.02rem;
  line-height: 1.25;
}

.hero-lede,
.decode-copy p,
.cipher-copy p,
.apparatus-grid p,
.guide-article p,
.guide-article li {
  color: var(--paper-2);
}

.hero-lede {
  max-width: 42rem;
  margin-bottom: 1.55rem;
  font-size: 1rem;
}

.signal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.65rem;
  align-items: stretch;
  margin: 1.6rem 0 1rem;
}

.readout-lock {
  grid-column: 1 / -1;
}

.power-switch,
.readout {
  min-height: 56px;
  border: 1px solid rgba(255, 181, 74, 0.32);
  border-radius: 6px;
  background: rgba(10, 7, 6, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 40px rgba(0, 0, 0, 0.28);
}

.power-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.62rem;
  min-width: 8.4rem;
  color: var(--paper);
  cursor: pointer;
}

.power-switch:hover {
  border-color: var(--cyan);
}

.switch-light {
  width: 1rem;
  height: 1rem;
  border: 1px solid rgba(255, 181, 74, 0.4);
  border-radius: 50%;
  background: #2b120d;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.7);
}

body.powered .switch-light {
  background: var(--amber);
  box-shadow: 0 0 18px rgba(255, 181, 74, 0.88), inset 0 0 8px rgba(255, 255, 255, 0.55);
}

.readout {
  display: grid;
  align-content: center;
  padding: 0.65rem 0.85rem;
}

.readout span {
  color: var(--paper-2);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.readout strong {
  color: var(--cyan);
  font-size: 1rem;
  line-height: 1.25;
}

.readout-lock strong {
  color: var(--amber-hot);
}

.operator-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
  color: #2a1510;
  font-size: 0.74rem;
}

.operator-strip span {
  padding: 0.34rem 0.54rem;
  border: 1px solid rgba(25, 18, 16, 0.16);
  border-radius: 3px;
  background: var(--paper);
  box-shadow: 0 9px 0 rgba(0, 0, 0, 0.16);
}

.receiver-stage {
  position: relative;
  min-width: 0;
  overflow: clip;
}

.receiver-glow {
  position: absolute;
  inset: 9% 7% 20% 12%;
  background: radial-gradient(circle, rgba(255, 181, 74, 0.18), transparent 62%);
  filter: blur(12px);
  pointer-events: none;
}

.radio-svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 820px;
  margin-left: auto;
  overflow: hidden;
}

.radio-case-edge {
  fill: none;
  stroke: rgba(255, 181, 74, 0.24);
  stroke-width: 2;
}

.speaker-sash {
  fill: none;
  stroke: rgba(255, 181, 74, 0.22);
  stroke-width: 6;
  stroke-linecap: round;
}

.frequency-window {
  stroke: rgba(103, 255, 240, 0.32);
  stroke-width: 2;
}

.window-glare {
  fill: none;
  stroke: rgba(255, 255, 255, 0.24);
  stroke-width: 7;
  stroke-linecap: round;
}

.scale line {
  stroke: var(--amber);
  stroke-width: 3;
  stroke-linecap: round;
}

.scale line.minor {
  stroke: rgba(255, 181, 74, 0.42);
  stroke-width: 2;
}

.scale-label,
.band-label,
.svg-frequency,
.meter text,
.pilot-lamps text,
.small-knobs text {
  fill: var(--paper);
  font-family: var(--mono);
  letter-spacing: 0;
}

.scale-label {
  font-size: 20px;
}

.band-label {
  fill: var(--amber);
  font-size: 20px;
  font-weight: 900;
}

.svg-frequency {
  fill: var(--cyan);
  font-size: 24px;
  font-weight: 800;
}

.meter rect {
  fill: #120c0a;
  stroke: rgba(255, 181, 74, 0.3);
}

.meter path {
  stroke: var(--red);
  stroke-width: 5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(184, 36, 28, 0.5));
}

.meter text,
.pilot-lamps text,
.small-knobs text {
  font-size: 15px;
  font-weight: 800;
}

.lamp {
  fill: #2d1711;
  stroke: rgba(255, 181, 74, 0.34);
  stroke-width: 3;
}

body.powered .lamp-hot,
body.station-lock .lamp-cyan {
  fill: var(--amber);
  filter: drop-shadow(0 0 16px rgba(255, 181, 74, 0.9));
}

body.station-lock .lamp-cyan {
  fill: var(--cyan);
  filter: drop-shadow(0 0 18px rgba(103, 255, 240, 0.9));
}

.dial-plate circle:first-child {
  fill: #0c0807;
  stroke: rgba(255, 181, 74, 0.24);
  stroke-width: 3;
}

.dial-plate circle:last-child {
  fill: none;
  stroke: rgba(103, 255, 240, 0.2);
  stroke-width: 2;
  stroke-dasharray: 5 10;
}

.dial-group {
  cursor: grab;
  transform-box: fill-box;
  transform-origin: center;
}

.dial-group:active {
  cursor: grabbing;
}

.dial-knob {
  fill: url(#dialAmber);
  stroke: #3c210f;
  stroke-width: 9;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.45));
}

.dial-inset {
  fill: rgba(25, 18, 16, 0.8);
  stroke: rgba(255, 210, 125, 0.45);
  stroke-width: 3;
}

.dial-ridge {
  fill: none;
  stroke: #fff0bf;
  stroke-width: 8;
  stroke-linecap: round;
}

.dial-notch {
  fill: var(--cyan);
  opacity: 0.88;
  filter: drop-shadow(0 0 10px rgba(103, 255, 240, 0.74));
}

.small-knobs circle {
  fill: #15100d;
  stroke: rgba(255, 181, 74, 0.32);
  stroke-width: 5;
}

.small-knobs path {
  fill: none;
  stroke: var(--amber);
  stroke-width: 6;
  stroke-linecap: round;
}

.case-screws circle {
  fill: #070504;
  stroke: rgba(255, 181, 74, 0.3);
  stroke-width: 4;
}

.spectrum-shell {
  position: relative;
  z-index: 2;
  width: min(100%, 780px);
  margin: -2.2rem 0 0 auto;
  border: 1px solid rgba(103, 255, 240, 0.28);
  border-radius: 6px;
  overflow: hidden;
  background: #061010;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42), inset 0 0 28px rgba(103, 255, 240, 0.08);
}

#waterfall {
  display: block;
  width: 100%;
  height: 210px;
}

.spectrum-grid {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0.65rem 0.72rem;
  color: rgba(239, 225, 194, 0.68);
  font-size: 0.7rem;
  background:
    repeating-linear-gradient(90deg, rgba(103, 255, 240, 0.12) 0 1px, transparent 1px 20%),
    linear-gradient(0deg, rgba(25, 18, 16, 0.86), transparent 38%);
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-marker {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.8rem;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
  color: var(--amber);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.decode-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(20rem, 1fr);
  gap: 1.5rem;
  align-items: end;
}

.decoded-panel,
.cipher-paper,
.apparatus-grid article,
.guide-card {
  border: 1px solid rgba(255, 181, 74, 0.28);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 181, 74, 0.1), transparent 42%),
    rgba(9, 7, 6, 0.72);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
}

.decoded-panel {
  position: relative;
  min-height: 21rem;
  padding: 1.1rem;
  overflow: hidden;
}

.decoded-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background:
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(103, 255, 240, 0.08) 13px 14px),
    radial-gradient(circle at 88% 15%, rgba(103, 255, 240, 0.18), transparent 10rem);
  pointer-events: none;
}

.panel-topline {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--paper-2);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.numbers-ribbon {
  position: relative;
  z-index: 1;
  margin: 2rem 0;
  color: var(--cyan);
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1.12;
  text-shadow: 0 0 22px rgba(103, 255, 240, 0.34);
}

.decode-meter {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.42rem;
  height: 4.5rem;
  align-items: end;
  margin-bottom: 1.4rem;
}

.decode-meter span {
  height: 18%;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--cyan), var(--amber));
  opacity: 0.38;
  transform-origin: bottom;
}

.decode-meter span:nth-child(2) { height: 44%; }
.decode-meter span:nth-child(3) { height: 64%; }
.decode-meter span:nth-child(4) { height: 28%; }
.decode-meter span:nth-child(5) { height: 78%; }
.decode-meter span:nth-child(6) { height: 36%; }

body.station-lock .decode-meter span {
  animation: meterPulse 900ms steps(3, end) infinite;
  opacity: 0.8;
}

body.station-lock .decode-meter span:nth-child(2) { animation-delay: 80ms; }
body.station-lock .decode-meter span:nth-child(3) { animation-delay: 160ms; }
body.station-lock .decode-meter span:nth-child(4) { animation-delay: 240ms; }
body.station-lock .decode-meter span:nth-child(5) { animation-delay: 320ms; }
body.station-lock .decode-meter span:nth-child(6) { animation-delay: 400ms; }

.decoded-note {
  position: relative;
  z-index: 1;
  color: var(--paper-2);
  margin-bottom: 0;
}

.section-heading {
  display: block;
  max-width: 48rem;
  margin-bottom: 1.6rem;
}

.section-heading::after {
  content: "";
  display: block;
  height: 1px;
  width: 100%;
  margin-top: 1.35rem;
  background: linear-gradient(90deg, var(--amber), transparent);
}

.band-list {
  display: grid;
  gap: 0.65rem;
}

.band-row {
  display: grid;
  grid-template-columns: 8.5rem 10rem minmax(10rem, 1fr) minmax(10rem, 1.1fr);
  gap: 0.8rem;
  align-items: center;
  min-height: 64px;
  width: 100%;
  padding: 0.78rem 0.9rem;
  border: 1px solid rgba(239, 225, 194, 0.16);
  border-left: 4px solid rgba(255, 181, 74, 0.5);
  border-radius: 4px;
  color: var(--paper);
  background: rgba(9, 7, 6, 0.5);
  text-align: left;
}

button.band-row {
  cursor: pointer;
}

button.band-row:hover,
.band-row.active {
  color: #06100f;
  background: linear-gradient(90deg, var(--cyan), var(--amber-hot));
  border-color: var(--cyan);
}

.hidden-row {
  border-left-color: var(--red);
  background:
    linear-gradient(90deg, rgba(184, 36, 28, 0.18), transparent 46%),
    rgba(9, 7, 6, 0.55);
}

body.found-station .hidden-row {
  color: #06100f;
  background: linear-gradient(90deg, var(--amber-hot), var(--cyan));
  border-color: var(--cyan);
}

.row-frequency,
.row-name {
  font-weight: 900;
}

.row-frequency {
  color: var(--cyan);
}

.row-mode,
.row-note {
  color: var(--paper-2);
  font-size: 0.85rem;
}

button.band-row:hover .row-frequency,
button.band-row:hover .row-mode,
button.band-row:hover .row-note,
.band-row.active .row-frequency,
.band-row.active .row-mode,
.band-row.active .row-note,
body.found-station .hidden-row .row-frequency,
body.found-station .hidden-row .row-mode,
body.found-station .hidden-row .row-note {
  color: #06100f;
}

.logbook {
  display: grid;
  grid-template-columns: repeat(5, minmax(13rem, 1fr));
  gap: 0.8rem;
  align-items: stretch;
}

.log-entry {
  position: relative;
  min-height: 18rem;
  padding: 1rem 0.95rem;
  color: var(--ink);
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.24), transparent 32%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(25, 18, 16, 0.08) 27px 28px),
    var(--paper);
  border: 1px solid rgba(25, 18, 16, 0.24);
  border-radius: 4px;
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.34);
  transform: rotate(-0.8deg);
}

.log-entry:nth-child(even) {
  transform: rotate(0.7deg) translateY(1rem);
}

.log-entry:nth-child(3) {
  transform: rotate(-1.4deg) translateY(-0.3rem);
}

.log-entry time {
  display: block;
  margin-bottom: 0.75rem;
  color: #65311e;
  font-size: 0.78rem;
  font-weight: 900;
}

.log-entry p {
  margin-bottom: 0;
  font-size: 0.9rem;
  line-height: 1.58;
}

.log-hint {
  border: 2px solid rgba(184, 36, 28, 0.65);
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.36), 0 0 0 8px rgba(184, 36, 28, 0.08);
}

.redacted {
  display: inline-block;
  min-width: 7.4rem;
  height: 1.05em;
  color: transparent;
  background: #120b09;
  vertical-align: -0.1em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.redacted.short {
  min-width: 5.1rem;
}

.cipher-section {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(18rem, 1fr);
  gap: 1.5rem;
  align-items: center;
}

.cipher-paper {
  position: relative;
  padding: 1.1rem;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 20%, rgba(184, 36, 28, 0.13), transparent 12rem),
    repeating-linear-gradient(0deg, transparent 0 29px, rgba(25, 18, 16, 0.1) 29px 30px),
    var(--paper);
}

.cipher-paper::before {
  content: "";
  position: absolute;
  inset: 0.55rem;
  border: 1px solid rgba(25, 18, 16, 0.22);
  pointer-events: none;
}

.paper-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  color: #65311e;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pad-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.pad-grid span {
  display: grid;
  min-height: 3rem;
  place-items: center;
  border: 1px solid rgba(25, 18, 16, 0.18);
  color: #2c1710;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.24rem;
  font-weight: 900;
}

.cipher-result {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0.95rem;
  border: 2px solid #251713;
  color: var(--paper);
  background: #120b09;
  font-weight: 900;
}

body.found-station .cipher-result {
  color: #04100f;
  background: var(--cyan);
  border-color: #04100f;
  box-shadow: 0 0 28px rgba(103, 255, 240, 0.55);
}

.apparatus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.apparatus-grid article {
  padding: 1rem;
  min-height: 16rem;
}

.apparatus-number {
  display: inline-grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  margin-bottom: 2rem;
  color: #07100f;
  background: var(--amber);
  border-radius: 50%;
  font-weight: 900;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, var(--max));
  margin: 2rem auto 0;
  padding: 2rem 0 2.6rem;
  border-top: 1px solid var(--line);
  color: var(--paper-2);
  font-size: 0.8rem;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem 1rem;
}

.site-footer a {
  color: var(--amber-hot);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.site-footer a:hover {
  color: var(--cyan);
}

.load-step,
.reveal {
  opacity: 0;
  transform: translateY(18px);
}

body.loaded .load-step,
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 700ms ease, transform 700ms ease;
}

body.loaded .load-step:nth-child(2) {
  transition-delay: 120ms;
}

.spectrum-shell.load-step {
  transition-delay: 260ms;
}

@keyframes meterPulse {
  0%, 100% { transform: scaleY(0.35); }
  45% { transform: scaleY(1); }
}

.guide-main {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
}

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(16rem, 0.5fr);
  gap: 1.2rem;
  align-items: end;
  min-height: 42vh;
  padding: 5rem 0 2rem;
}

.guide-hero h1 {
  max-width: 12ch;
}

.guide-card {
  padding: 1rem;
}

.guide-card dl {
  margin: 0;
}

.guide-card div {
  display: grid;
  grid-template-columns: 5.7rem 1fr;
  gap: 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 181, 74, 0.18);
}

.guide-card div:last-child {
  border-bottom: 0;
}

.guide-card dt {
  color: var(--amber);
  font-weight: 900;
}

.guide-card dd {
  margin: 0;
  color: var(--paper-2);
}

.guide-article {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
  gap: 2rem;
  padding: 3rem 0 5rem;
}

.guide-article h2 {
  font-size: 2.4rem;
}

.guide-article section {
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255, 181, 74, 0.2);
}

.guide-article section:last-child {
  border-bottom: 0;
}

.guide-article ul {
  padding-left: 1.2rem;
  margin: 0;
}

@media (max-width: 1060px) {
  .hero {
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
    gap: 1.4rem;
    min-height: 0;
  }

  h1 {
    max-width: 11ch;
    font-size: 3.85rem;
  }

  .hero-lede {
    font-size: 0.93rem;
  }

  .signal-actions {
    grid-template-columns: 1fr;
  }

  .radio-svg,
  .spectrum-shell {
    margin-left: 0;
  }

  .logbook {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .band-row {
    grid-template-columns: 7.8rem minmax(8rem, 0.9fr) minmax(10rem, 1fr);
  }

  .row-note {
    grid-column: 2 / -1;
  }
}

@media (max-width: 780px) {
  body {
    font-size: 15px;
  }

  .site-header {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .site-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .site-nav a {
    flex: 1 1 calc(33.333% - 0.35rem);
    justify-content: center;
    padding-inline: 0.45rem;
  }

  .section {
    padding: 4.25rem 0;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 1.6rem;
    gap: 1.4rem;
  }

  .receiver-stage {
    order: -1;
  }

  h1 {
    font-size: 3.4rem;
  }

  h2 {
    font-size: 2.45rem;
  }

  .hero-lede {
    font-size: 0.95rem;
  }

  .signal-actions,
  .decode-layout,
  .cipher-section,
  .apparatus-grid,
  .guide-hero,
  .guide-article {
    grid-template-columns: 1fr;
  }

  .power-switch,
  .readout {
    min-height: 54px;
  }

  .radio-svg {
    width: 108%;
    margin-left: -4%;
  }

  #waterfall {
    height: 185px;
  }

  .section-heading::after {
    width: 100%;
  }

  .band-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    min-height: 0;
    padding: 0.9rem;
  }

  .row-note {
    grid-column: auto;
  }

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

  .log-entry,
  .log-entry:nth-child(even),
  .log-entry:nth-child(3) {
    min-height: 0;
    transform: none;
  }

  .paper-header,
  .panel-topline,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer nav {
    justify-content: flex-start;
  }
}

@media (max-width: 430px) {
  .site-header,
  .section,
  .site-footer,
  .guide-main {
    width: min(100% - 1rem, var(--max));
  }

  .site-nav a {
    flex-basis: calc(33.333% - 0.35rem);
    font-size: 0.78rem;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.05rem;
  }

  .operator-strip span {
    width: 100%;
  }

  .numbers-ribbon {
    font-size: 1.55rem;
  }

  .pad-grid span {
    min-height: 2.4rem;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .load-step,
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Pass 3 — art direction: darkroom reveal, typographic polish, tactile states. */
::selection {
  color: #06100f;
  background: var(--cyan);
  text-shadow: none;
}

html {
  scrollbar-color: rgba(255, 181, 74, 0.72) #090605;
  scrollbar-width: thin;
}

html::-webkit-scrollbar {
  width: 11px;
}

html::-webkit-scrollbar-track {
  background: #090605;
  box-shadow: inset 1px 0 rgba(255, 181, 74, 0.12);
}

html::-webkit-scrollbar-thumb {
  border: 3px solid #090605;
  border-radius: 99px;
  background: linear-gradient(var(--amber), #7a421a);
}

body {
  font-variant-numeric: tabular-nums slashed-zero;
}

h1,
h2,
.brand-name {
  font-kerning: normal;
  font-optical-sizing: auto;
}

h1 {
  letter-spacing: -0.035em;
}

h2 {
  letter-spacing: -0.022em;
}

.eyebrow,
.brand-kicker,
.section-marker,
.paper-header,
.bench-tags,
.dial-instruction span {
  letter-spacing: 0.045em;
}

.brand,
.power-switch,
.site-footer a {
  transition: color 220ms cubic-bezier(0.2, 0.82, 0.2, 1), transform 220ms cubic-bezier(0.2, 0.82, 0.2, 1);
}

.brand:hover,
.brand:focus-visible {
  color: var(--cyan);
  transform: translateX(0.18rem);
}

.power-switch:hover,
.power-switch:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.08);
}

.power-switch:active,
button.band-row:active,
.exposure-control:active:not(:disabled) {
  transform: translateY(1px) scale(0.992);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  transform: translateY(-1px);
  text-decoration-color: var(--cyan);
}

.dial-instruction {
  position: absolute;
  z-index: 4;
  right: clamp(1rem, 7%, 4.6rem);
  top: 57.5%;
  width: 11.8rem;
  margin: 0;
  padding: 0.52rem 0.65rem;
  border: 1px solid rgba(255, 181, 74, 0.35);
  color: rgba(239, 225, 194, 0.72);
  background: linear-gradient(180deg, rgba(255, 242, 207, 0.04), transparent), rgba(5, 3, 3, 0.9);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.48), 0 10px 28px rgba(0, 0, 0, 0.42);
  font-size: 0.58rem;
  line-height: 1.45;
  text-transform: uppercase;
  transform: rotate(1.2deg);
  pointer-events: none;
}

.dial-instruction span {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--amber);
  font-weight: 900;
}

.dial-group:hover .dial-knob {
  stroke: rgba(103, 255, 240, 0.72);
  filter: drop-shadow(0 0 18px rgba(103, 255, 240, 0.26)) drop-shadow(0 18px 20px rgba(0, 0, 0, 0.45));
}

.cipher-paper {
  overflow: hidden;
  isolation: isolate;
}

.cipher-paper > * {
  transition: opacity 440ms cubic-bezier(0.2, 0.82, 0.2, 1), transform 560ms cubic-bezier(0.2, 0.82, 0.2, 1);
}

.exposure-control {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 48px;
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  border: 2px solid #251713;
  border-radius: 2px;
  color: var(--paper);
  background: linear-gradient(180deg, #2d1b16, #110b09);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), inset 0 -5px rgba(0, 0, 0, 0.26);
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.exposure-control:disabled {
  color: #7b6a58;
  cursor: not-allowed;
}

.exposure-lamp {
  width: 0.85rem;
  height: 0.85rem;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 181, 74, 0.4);
  border-radius: 50%;
  background: #2a100d;
  box-shadow: inset 0 0 8px #000;
}

body.found-station .exposure-control:not(:disabled) {
  color: #07100f;
  border-color: #07100f;
  background: linear-gradient(90deg, var(--amber-hot), var(--cyan));
  box-shadow: 0 0 30px rgba(103, 255, 240, 0.38), inset 0 1px rgba(255, 255, 255, 0.44);
}

body.found-station .exposure-control:not(:disabled):hover,
body.found-station .exposure-control:not(:disabled):focus-visible {
  box-shadow: 0 0 0 4px rgba(103, 255, 240, 0.18), 0 0 42px rgba(103, 255, 240, 0.56);
  transform: translateY(-2px);
}

body.found-station .exposure-control:not(:disabled) .exposure-lamp {
  border-color: #07100f;
  background: var(--red);
  box-shadow: 0 0 15px rgba(184, 36, 28, 0.8);
  animation: exposureReady 1.3s steps(2, end) infinite;
}

.exposure-hint {
  position: relative;
  z-index: 2;
  margin: 0.55rem 0 0;
  color: #65311e;
  font-size: 0.7rem;
  line-height: 1.45;
}

.developed-copy {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: clamp(1.2rem, 5vw, 3rem);
  color: #d9fff9;
  background:
    linear-gradient(105deg, transparent 0 42%, rgba(255, 255, 255, 0.12) 48%, transparent 54%),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(103, 255, 240, 0.13) 23px 24px),
    radial-gradient(circle at 50% 48%, rgba(103, 255, 240, 0.25), transparent 50%),
    #031615;
  clip-path: inset(0 100% 0 0);
  opacity: 0;
  text-align: center;
  pointer-events: none;
}

.developed-copy::before,
.developed-copy::after {
  content: "";
  position: absolute;
  inset: 0.8rem;
  border: 1px solid rgba(103, 255, 240, 0.38);
}

.developed-copy::after {
  inset: 1.15rem;
  border-color: rgba(255, 181, 74, 0.24);
}

.developed-kicker,
.developed-tail {
  position: relative;
  z-index: 1;
  color: var(--amber-hot);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.developed-copy strong {
  position: relative;
  z-index: 1;
  margin: 1rem 0;
  color: var(--cyan);
  font-family: var(--display);
  font-size: clamp(2.25rem, 6vw, 4.8rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.9;
  text-shadow: 0 0 32px rgba(103, 255, 240, 0.48);
}

body.copy-developed .developed-copy {
  opacity: 1;
  clip-path: inset(0);
  animation: developSweep 1.15s steps(12, end) both;
}

body.copy-developed .cipher-paper {
  box-shadow: 0 0 0 1px rgba(103, 255, 240, 0.5), 0 0 70px rgba(103, 255, 240, 0.32), 0 35px 80px rgba(0, 0, 0, 0.58);
}

body.copy-developed .cipher-paper::after {
  content: "OT-36 / developed";
  z-index: 10;
  color: rgba(255, 181, 74, 0.72);
}

@keyframes exposureReady {
  50% { opacity: 0.4; }
}

@keyframes developSweep {
  0% { opacity: 0; clip-path: inset(0 100% 0 0); filter: brightness(2.4); }
  34% { opacity: 1; filter: brightness(1.7); }
  100% { opacity: 1; clip-path: inset(0); filter: brightness(1); }
}

@media (max-width: 900px) {
  .dial-instruction {
    right: 7%;
    top: 55%;
  }
}

@media (max-width: 430px) {
  h1 {
    letter-spacing: -0.045em;
    line-height: 0.88;
  }

  h2 {
    letter-spacing: -0.03em;
    line-height: 0.96;
  }

  .dial-instruction {
    right: 4.5%;
    top: 53.5%;
    width: 9.4rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.49rem;
  }

  .exposure-control {
    min-height: 52px;
    font-size: 0.78rem;
  }

  .developed-copy strong {
    font-size: 2.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.found-station .exposure-control:not(:disabled) .exposure-lamp,
  body.copy-developed .developed-copy {
    animation: none !important;
  }

  body.copy-developed .developed-copy {
    clip-path: inset(0);
    opacity: 1;
  }
}

/* Pass 2 external critique: make the listening post feel physical, not templated. */
:root {
  --max: 1280px;
  --paper-bright: #fff2cf;
  --deep-room: #070504;
  --resin-red: #3a1710;
}

html {
  color-scheme: dark;
  scroll-padding-top: 1rem;
}

body {
  isolation: isolate;
  background:
    radial-gradient(circle at 74% 16%, rgba(255, 181, 74, 0.21), transparent 27rem),
    radial-gradient(circle at 18% 52%, rgba(103, 255, 240, 0.13), transparent 19rem),
    linear-gradient(120deg, #120b09 0%, #2b1711 34%, var(--bakelite) 62%, #050403 100%);
  text-rendering: optimizeLegibility;
}

body::before {
  opacity: 0.34;
  background:
    repeating-linear-gradient(0deg, rgba(255, 242, 207, 0.035) 0 1px, transparent 1px 3px),
    radial-gradient(circle at 52% 18%, rgba(255, 181, 74, 0.14), transparent 21rem),
    radial-gradient(circle at 16% 78%, rgba(103, 255, 240, 0.1), transparent 18rem),
    repeating-radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 8px);
}

body::after {
  opacity: 0.9;
  background:
    linear-gradient(90deg, rgba(255, 181, 74, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 181, 74, 0.05) 1px, transparent 1px),
    linear-gradient(115deg, transparent 0 47%, rgba(103, 255, 240, 0.08) 47% 47.2%, transparent 47.2% 100%);
  background-size: 96px 96px, 96px 96px, 100% 100%;
  mask-image: radial-gradient(circle at 48% 19%, black, rgba(0, 0, 0, 0.7) 42%, transparent 82%);
}

.site-header {
  width: min(100% - 2rem, 1320px);
  padding-top: 1rem;
  backdrop-filter: none;
}

.brand {
  transform-origin: left center;
}

.brand-kicker,
.eyebrow,
.section-marker,
.paper-header,
.apparatus-number {
  color: var(--amber);
  font-weight: 900;
}

.brand-name {
  color: var(--paper-bright);
  text-shadow: 0 2px 0 #050302;
}

.site-nav a {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 181, 74, 0.32);
  background: rgba(8, 5, 4, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 242, 207, 0.04);
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.site-nav a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(103, 255, 240, 0.22), transparent);
  opacity: 0;
  transform: translateX(-70%);
  transition: opacity 180ms ease, transform 420ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  transform: translateY(-1px);
}

.site-nav a:hover::before,
.site-nav a:focus-visible::before {
  opacity: 1;
  transform: translateX(70%);
}

.hero {
  width: min(100% - 2rem, 1300px);
  grid-template-columns: minmax(18rem, 0.56fr) minmax(0, 1.44fr);
  gap: clamp(1.1rem, 3vw, 4rem);
  align-items: center;
  min-height: calc(100svh - 76px);
  padding: 3.4rem 0 6rem;
}

.hero::before {
  content: "RECEIVER 36-A / sealed cabinet / hand copy only";
  position: absolute;
  right: clamp(0rem, 4vw, 3rem);
  top: 1.2rem;
  color: rgba(255, 181, 74, 0.38);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.room-vectors {
  width: min(72rem, 92%);
  height: 38rem;
  opacity: 0.58;
}

.room-vectors span {
  box-shadow: 0 0 18px rgba(255, 181, 74, 0.2);
}

h1 {
  max-width: 7.25ch;
  color: var(--paper-bright);
  font-size: clamp(5.2rem, 7.25vw, 8.55rem);
  line-height: 0.86;
  text-wrap: balance;
  text-shadow: 0 0 46px rgba(255, 181, 74, 0.18), 0 4px 0 #050302;
}

h2 {
  color: var(--paper-bright);
  line-height: 0.94;
  text-shadow: 0 2px 0 #050302;
}

.hero-lede,
.decode-copy p,
.cipher-copy p,
.apparatus-grid p,
.guide-article p,
.guide-article li {
  color: #d6c7a8;
}

.hero-lede {
  max-width: 35rem;
  font-size: 1.02rem;
  line-height: 1.72;
}

.signal-actions {
  max-width: 36rem;
  grid-template-columns: minmax(9rem, 0.85fr) minmax(11rem, 1fr);
}

.power-switch,
.readout {
  border-color: rgba(255, 181, 74, 0.46);
  background:
    linear-gradient(180deg, rgba(255, 242, 207, 0.035), transparent),
    rgba(6, 4, 3, 0.86);
}

.power-switch {
  position: relative;
  text-transform: uppercase;
}

.power-switch::after {
  content: "";
  width: 2.7rem;
  height: 0.3rem;
  border-radius: 999px;
  background: rgba(255, 181, 74, 0.28);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

body.powered .power-switch {
  color: #08100f;
  background: linear-gradient(90deg, var(--amber), var(--cyan));
  border-color: var(--cyan);
  box-shadow: 0 0 30px rgba(103, 255, 240, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.readout strong {
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 16px rgba(103, 255, 240, 0.42);
}

.carbon-slip {
  width: min(100%, 26rem);
  margin-top: 1.2rem;
  padding: 0.7rem 0.82rem;
  color: #2a1510;
  background:
    repeating-linear-gradient(0deg, transparent 0 21px, rgba(25, 18, 16, 0.12) 21px 22px),
    var(--paper);
  border: 1px solid rgba(25, 18, 16, 0.28);
  box-shadow: 0 18px 0 rgba(0, 0, 0, 0.16);
  transform: rotate(-1.2deg);
}

.carbon-slip span {
  display: block;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.carbon-slip span + span {
  margin-top: 0.2rem;
  color: #7b2d20;
}

.receiver-stage {
  overflow: visible;
  transform-origin: center;
}

.bench-shadow {
  position: absolute;
  inset: 18% -1% 10% 4%;
  border-radius: 46%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.82), transparent 67%);
  filter: blur(12px);
  transform: rotate(-2deg);
}

.receiver-glow {
  inset: 0% 1% 13% 0%;
  background:
    radial-gradient(circle at 61% 42%, rgba(255, 181, 74, 0.24), transparent 22rem),
    radial-gradient(circle at 75% 71%, rgba(103, 255, 240, 0.15), transparent 14rem);
  filter: blur(18px);
}

.radio-svg {
  max-width: 930px;
  margin-left: -1.3rem;
  filter: saturate(1.08) contrast(1.08);
  transform: rotate(0.45deg);
  transform-origin: 55% 60%;
}

.radio-svg .radio-case {
  stroke: rgba(255, 181, 74, 0.2);
  stroke-width: 2;
}

.frequency-window,
.dial-knob,
.small-knobs circle {
  transition: filter 240ms ease, stroke 240ms ease, transform 240ms ease;
}

.dial-group:focus-visible .dial-knob {
  stroke: var(--cyan);
  filter: drop-shadow(0 0 20px rgba(103, 255, 240, 0.82));
}

.spectrum-shell {
  width: min(100%, 900px);
  margin: -3.65rem 0 0 1.1rem;
  border-color: rgba(103, 255, 240, 0.44);
  border-radius: 3px;
  transform: rotate(-0.35deg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.54), inset 0 0 36px rgba(103, 255, 240, 0.12);
}

#waterfall {
  height: 240px;
}

.spectrum-grid {
  color: rgba(255, 242, 207, 0.78);
  background:
    repeating-linear-gradient(90deg, rgba(103, 255, 240, 0.16) 0 1px, transparent 1px 20%),
    repeating-linear-gradient(0deg, transparent 0 12px, rgba(103, 255, 240, 0.08) 12px 13px),
    linear-gradient(0deg, rgba(3, 7, 7, 0.92), transparent 42%);
}

.bench-tags {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  width: min(100%, 900px);
  margin: 0.65rem 0 0 auto;
  color: rgba(255, 242, 207, 0.72);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bench-tags span {
  padding: 0.34rem 0.5rem;
  border: 1px solid rgba(103, 255, 240, 0.28);
  background: rgba(5, 11, 11, 0.72);
}

.decoded-panel,
.cipher-paper,
.apparatus-grid article,
.guide-card {
  border-radius: 3px;
}

.decoded-panel {
  min-height: 24rem;
  padding: 1.35rem;
  background:
    linear-gradient(145deg, rgba(103, 255, 240, 0.12), transparent 38%),
    linear-gradient(0deg, rgba(6, 4, 3, 0.96), rgba(16, 10, 8, 0.82));
}

.numbers-ribbon {
  font-size: clamp(2.15rem, 4vw, 4.2rem);
  line-height: 1;
  word-break: break-word;
}

.band-map {
  position: relative;
  height: clamp(5.2rem, 8vw, 7rem);
  margin: -0.35rem 0 1rem;
  overflow: hidden;
  border: 1px solid rgba(103, 255, 240, 0.34);
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(255, 181, 74, 0.08), transparent 21%, rgba(103, 255, 240, 0.08) 44%, transparent 68%, rgba(255, 181, 74, 0.06)),
    repeating-linear-gradient(90deg, rgba(103, 255, 240, 0.12) 0 1px, transparent 1px 3.5rem),
    #05100f;
  box-shadow: inset 0 0 34px rgba(103, 255, 240, 0.12), 0 24px 50px rgba(0, 0, 0, 0.22);
}

.band-map::before {
  content: "4.5 MHz                               filed carriers                               12.2 MHz";
  position: absolute;
  inset: auto 0.85rem 0.55rem;
  color: rgba(255, 242, 207, 0.58);
  font-size: 0.66rem;
  font-weight: 900;
  white-space: pre;
}

.band-noise {
  position: absolute;
  inset: 0;
  opacity: 0.62;
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(103, 255, 240, 0.12) 4px 5px),
    radial-gradient(circle at 44% 50%, rgba(103, 255, 240, 0.2), transparent 8rem);
}

.band-map i,
.band-map b {
  position: absolute;
  bottom: 1.15rem;
  left: var(--pos);
  transform: translateX(-50%);
}

.band-map i {
  width: 0.22rem;
  height: var(--height);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 242, 207, 0), var(--amber), var(--cyan));
  box-shadow: 0 0 24px rgba(255, 181, 74, 0.55);
}

.band-map i.secret {
  opacity: 0.38;
  background: linear-gradient(180deg, transparent, var(--red), rgba(103, 255, 240, 0.82));
  filter: blur(0.2px);
}

.band-map b {
  width: 1.1rem;
  height: 1.1rem;
  bottom: 0.72rem;
  border: 2px solid var(--paper-bright);
  border-radius: 50%;
  background: #050403;
  box-shadow: 0 0 0 5px rgba(255, 181, 74, 0.16), 0 0 22px rgba(103, 255, 240, 0.55);
  transition: left 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

body.station-lock .band-map b {
  border-color: var(--cyan);
  box-shadow: 0 0 0 8px rgba(103, 255, 240, 0.2), 0 0 32px rgba(103, 255, 240, 0.82);
}

body.found-station .band-map i.secret {
  opacity: 1;
  box-shadow: 0 0 42px rgba(103, 255, 240, 0.9);
}

.band-row {
  position: relative;
  overflow: hidden;
  border-left-width: 1px;
  background:
    linear-gradient(90deg, rgba(255, 181, 74, 0.1), transparent 36%),
    rgba(6, 4, 3, 0.74);
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.band-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.28rem;
  background: linear-gradient(180deg, var(--amber), rgba(103, 255, 240, 0.64));
  opacity: 0.75;
}

button.band-row:hover,
button.band-row:focus-visible {
  transform: translateX(0.36rem);
}

.hidden-row::before {
  background: linear-gradient(180deg, var(--red), var(--amber));
}

.logbook {
  perspective: 1200px;
  align-items: center;
}

.log-entry {
  overflow: hidden;
}

.log-entry::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #7b2d20;
  box-shadow: 0 0 0 0.24rem rgba(123, 45, 32, 0.13);
}

.log-entry::after {
  content: "";
  position: absolute;
  inset: auto -1rem 0.45rem;
  height: 1.6rem;
  background: linear-gradient(90deg, transparent, rgba(101, 49, 30, 0.11), transparent);
  transform: rotate(-2deg);
}

.log-hint::before {
  background: var(--red);
  box-shadow: 0 0 0 0.28rem rgba(184, 36, 28, 0.14), 0 0 24px rgba(184, 36, 28, 0.34);
}

.cipher-paper {
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34), 0 0 0 10px rgba(255, 181, 74, 0.045);
  transform: rotate(0.55deg);
}

.cipher-paper::after {
  content: "redaction intact";
  position: absolute;
  right: 1.1rem;
  bottom: 1.1rem;
  color: rgba(123, 45, 32, 0.42);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

body.found-station .cipher-paper::after {
  content: "plain text leak";
  color: rgba(5, 16, 15, 0.58);
}

.apparatus-grid {
  grid-template-columns: 1.1fr 0.95fr 1fr;
  align-items: stretch;
}

.apparatus-grid article {
  position: relative;
  overflow: hidden;
  min-height: 19rem;
  padding: 1.3rem;
  background:
    radial-gradient(circle at 88% 8%, rgba(103, 255, 240, 0.12), transparent 9rem),
    linear-gradient(145deg, rgba(255, 181, 74, 0.1), transparent 44%),
    rgba(5, 4, 3, 0.84);
}

.apparatus-grid article::after {
  content: "";
  position: absolute;
  inset: auto 1.1rem 1.1rem;
  height: 1px;
  background: linear-gradient(90deg, var(--amber), transparent, var(--cyan));
  opacity: 0.55;
}

.apparatus-spec {
  position: relative;
  z-index: 1;
  margin: 1.25rem 0 0;
  border-top: 1px solid rgba(255, 181, 74, 0.18);
  color: var(--paper-2);
  font-size: 0.74rem;
}

.apparatus-spec div {
  display: grid;
  grid-template-columns: 5.8rem 1fr;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 181, 74, 0.1);
}

.apparatus-spec dt {
  color: var(--amber);
  font-weight: 900;
  text-transform: uppercase;
}

.apparatus-spec dd {
  margin: 0;
}

.site-footer {
  width: min(100% - 2rem, 1280px);
  margin-top: 3rem;
}

code {
  color: var(--cyan);
  background: rgba(103, 255, 240, 0.08);
  border: 1px solid rgba(103, 255, 240, 0.16);
  border-radius: 2px;
  padding: 0.04rem 0.2rem;
  font-family: var(--mono);
  font-size: 0.92em;
}

.guide-hero {
  position: relative;
  grid-template-columns: minmax(0, 0.75fr) minmax(14rem, 0.26fr) minmax(18rem, 0.44fr);
  min-height: 52vh;
  padding: 5.8rem 0 3rem;
}

.guide-hero h1 {
  max-width: 10ch;
}

.guide-diagram {
  position: relative;
  min-height: 15rem;
  border: 1px solid rgba(103, 255, 240, 0.32);
  background:
    repeating-linear-gradient(0deg, transparent 0 14px, rgba(103, 255, 240, 0.09) 14px 15px),
    linear-gradient(145deg, rgba(255, 181, 74, 0.12), transparent 42%),
    #06100f;
  box-shadow: inset 0 0 34px rgba(103, 255, 240, 0.1), 0 22px 50px rgba(0, 0, 0, 0.28);
  transform: rotate(-1.2deg);
}

.diagram-dial,
.diagram-window,
.diagram-waterfall,
.diagram-pin {
  position: absolute;
  display: block;
}

.diagram-dial {
  right: 1.1rem;
  bottom: 1.1rem;
  width: 5.2rem;
  height: 5.2rem;
  border: 0.8rem solid rgba(255, 181, 74, 0.82);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(255, 181, 74, 0.28);
}

.diagram-window {
  left: 1rem;
  top: 1rem;
  right: 1rem;
  height: 3.2rem;
  border: 1px solid rgba(103, 255, 240, 0.42);
  background: linear-gradient(90deg, rgba(103, 255, 240, 0.12), rgba(255, 181, 74, 0.18));
}

.diagram-waterfall {
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  height: 4rem;
  background:
    linear-gradient(90deg, transparent 18%, var(--amber) 18.6%, transparent 20%, transparent 48%, var(--cyan) 49%, transparent 50%),
    repeating-linear-gradient(0deg, rgba(103, 255, 240, 0.18) 0 1px, transparent 1px 4px);
}

.diagram-pin {
  left: 44%;
  bottom: 3.3rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 24px rgba(184, 36, 28, 0.65);
}

.guide-card {
  position: relative;
  z-index: 2;
  background:
    linear-gradient(145deg, rgba(255, 181, 74, 0.1), transparent 38%),
    rgba(6, 4, 3, 0.82);
  transform: rotate(0.8deg);
}

.guide-article {
  grid-template-columns: minmax(0, 0.56fr) minmax(0, 0.72fr);
  gap: clamp(2rem, 5vw, 4rem);
  padding-top: 2rem;
}

.guide-article section {
  border-color: rgba(255, 181, 74, 0.24);
}

body.loaded .site-header {
  animation: stationHeaderIn 720ms cubic-bezier(0.2, 0.82, 0.2, 1) both;
}

body.loaded .radio-svg {
  animation: receiverWake 900ms cubic-bezier(0.2, 0.82, 0.2, 1) 120ms both;
}

body.loaded .spectrum-shell {
  animation: traceWake 980ms steps(8, end) 360ms both;
}

body.loaded .carbon-slip,
.reveal.is-visible .log-entry {
  animation: paperLift 620ms cubic-bezier(0.2, 0.82, 0.2, 1) both;
}

body.station-lock .frequency-window {
  filter: drop-shadow(0 0 14px rgba(103, 255, 240, 0.56));
}

body.station-lock .dial-notch {
  animation: lockBlink 680ms steps(2, end) infinite;
}

body.found-station .redacted {
  background: linear-gradient(90deg, var(--red), var(--cyan));
  box-shadow: 0 0 20px rgba(103, 255, 240, 0.38);
}

@keyframes stationHeaderIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes receiverWake {
  0% {
    opacity: 0;
    transform: translateY(16px) rotate(0.45deg) scale(0.985);
  }
  68% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0.45deg) scale(1);
  }
}

@keyframes traceWake {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes paperLift {
  from {
    opacity: 0;
    transform: translateY(14px) rotate(-2deg);
  }
  to {
    opacity: 1;
  }
}

@keyframes lockBlink {
  0%, 100% {
    opacity: 0.9;
  }
  50% {
    opacity: 0.35;
  }
}

@media (max-width: 1180px) {
  .hero {
    width: min(100% - 2rem, var(--max));
    grid-template-columns: minmax(16rem, 0.64fr) minmax(0, 1.18fr);
    gap: 1.3rem;
  }

  h1 {
    font-size: clamp(4.1rem, 7vw, 6.7rem);
  }

  .radio-svg {
    max-width: 800px;
    margin-left: -0.8rem;
  }

  .spectrum-shell {
    width: min(100%, 790px);
    margin-top: -2.8rem;
  }
}

@media (max-width: 900px) {
  .hero {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    min-height: 0;
    padding: 1.6rem 0 4.5rem;
  }

  .hero::before {
    display: none;
  }

  .receiver-stage {
    order: -1;
    width: 100%;
    overflow: clip;
  }

  .radio-svg {
    width: 104%;
    max-width: none;
    margin-left: -2%;
    transform: rotate(0.25deg);
  }

  .spectrum-shell {
    width: 100%;
    margin: -2.7rem 0 0;
    transform: none;
  }

  .bench-tags {
    width: 100%;
    margin-left: 0;
  }

  .hero-copy {
    width: 100%;
  }

  .signal-actions {
    max-width: none;
  }

  .guide-hero,
  .guide-article {
    grid-template-columns: 1fr;
  }

  .guide-hero {
    min-height: 0;
    padding-top: 3.5rem;
  }

  .guide-hero h1 {
    max-width: 11ch;
  }

  .guide-diagram {
    min-height: 13rem;
    order: 2;
  }

  .guide-card {
    order: 3;
    transform: none;
  }
}

@media (max-width: 780px) {
  .site-header {
    padding-top: 0.65rem;
  }

  .hero {
    display: flex;
    flex-direction: column;
    gap: 1.55rem;
    min-height: 0;
    padding: 1.35rem 0 4.25rem;
  }

  .hero::before,
  .bench-tags {
    display: none;
  }

  .receiver-stage {
    order: -1;
    width: 100%;
    overflow: clip;
  }

  .bench-shadow {
    inset: 19% 0 19%;
  }

  .radio-svg {
    width: 112%;
    max-width: none;
    margin-left: -6%;
    transform: rotate(0.25deg);
  }

  .spectrum-shell {
    width: 100%;
    margin: -2.4rem 0 0;
    transform: none;
  }

  #waterfall {
    height: 190px;
  }

  h1 {
    max-width: 8.6ch;
    font-size: clamp(3rem, 14vw, 4.6rem);
  }

  .signal-actions {
    max-width: none;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  }

  .readout-lock {
    grid-column: 1 / -1;
  }

  .carbon-slip {
    width: 100%;
    transform: rotate(-0.5deg);
  }

  .band-map::before {
    content: "4.5 MHz        7.770 hidden        12.2 MHz";
  }

  .apparatus-grid,
  .guide-hero,
  .guide-article {
    grid-template-columns: 1fr;
  }

  .guide-hero {
    min-height: 0;
    padding-top: 3.5rem;
  }

  .guide-diagram {
    min-height: 12rem;
    order: 2;
  }

  .guide-card {
    order: 3;
    transform: none;
  }
}

@media (max-width: 430px) {
  .site-header,
  .section,
  .site-footer,
  .guide-main {
    width: min(100% - 1rem, var(--max));
  }

  .guide-page .site-nav a {
    flex-basis: calc(50% - 0.35rem);
    font-size: 0.72rem;
  }

  .radio-svg {
    width: 116%;
    margin-left: -8%;
  }

  .spectrum-shell {
    margin-top: -2rem;
  }

  .signal-actions {
    gap: 0.5rem;
  }

  .power-switch,
  .readout {
    min-height: 52px;
  }

  .power-switch::after {
    display: none;
  }

  .band-map {
    height: 5.6rem;
  }

  .band-map::before {
    inset-inline: 0.55rem;
    font-size: 0.58rem;
  }

  .apparatus-spec div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.loaded .site-header,
  body.loaded .radio-svg,
  body.loaded .spectrum-shell,
  body.loaded .carbon-slip,
  .reveal.is-visible .log-entry,
  body.station-lock .dial-notch {
    animation: none !important;
  }
}

body.copy-developed .cipher-paper::after {
  content: "OT-36 / developed";
  z-index: 10;
  color: rgba(255, 181, 74, 0.72);
}
