/* ============================================================
   SIGNAL ROOM — amber phosphor console
   Palette: #050505 black · #FFB000 amber phosphor · dim afterglow
   Type: IBM Plex Mono (weight contrast) · VT323 (one display moment)
   Ease token set: --ez / durations. No springs. No green.
   ============================================================ */

:root {
  --black: #050505;
  --panel: #0A0805;
  --panel-2: #0E0B06;
  --amber: #FFB000;
  --amber-hot: #FFD98A;
  --ink-hi: #FFF3DC;          /* brightest copy */
  --ink: #EFDDB4;             /* body copy — AA+ on black */
  --ink-dim: rgba(255, 214, 140, 0.62);
  --deco: rgba(255, 176, 0, 0.42);   /* decoration only, never copy */
  --line: rgba(255, 176, 0, 0.20);
  --line-strong: rgba(255, 176, 0, 0.45);

  --ez: cubic-bezier(0.22, 0.9, 0.28, 1);   /* the one curve */
  --t-fast: 180ms;
  --t-med: 420ms;
  --t-slow: 900ms;

  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --display: "VT323", "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--amber); color: var(--black); }

a { color: var(--amber); text-decoration: none; }

kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0 5px;
  color: var(--amber);
}

/* focus discipline — visible everywhere */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  animation: rise var(--t-slow) var(--ez) both;
}

.topbar-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.brand-mark { color: var(--amber); animation: pulse 4s var(--ez) infinite; }
.brand-name { color: var(--ink-hi); font-size: 15px; }
.brand-sep { color: var(--deco); font-weight: 400; }
.brand-room { color: var(--amber); font-size: 15px; }

.topbar-spine {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--ink-dim);
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
}
.op-line { white-space: nowrap; }
.utc-clock {
  color: var(--amber);
  font-weight: 600;
  min-width: 9.5ch;
  text-align: right;
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.35);
}

/* ============================================================
   CONSOLE — scope + dossier
   ============================================================ */
.console {
  display: grid;
  grid-template-columns: minmax(0, 54%) minmax(0, 46%);
  gap: 0;
  min-height: calc(100vh - 152px);
  border-bottom: 1px solid var(--line);
}

/* ---------- SCOPE ---------- */
.scope-bay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  border-right: 1px solid var(--line);
  animation: rise var(--t-slow) var(--ez) 0.15s both;
}

.scope-frame { width: min(100%, 70vh); }

.scope-caption, .scope-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  padding: 8px 4px;
}
.scope-caption-mid { color: var(--amber); }
.scope-footer-hint { color: var(--ink-dim); }
#sweepReadout { color: var(--amber); min-width: 9ch; }

.scope-square {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle at 50% 50%, #0C0903 0%, var(--black) 78%);
  overflow: hidden;
}

#radar { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.scope-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

.scope-scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1px,
    transparent 1px, transparent 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.scope-corner {
  position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--amber); border-style: solid; border-width: 0;
}
.scope-corner.tl { top: 6px; left: 6px; border-top-width: 2px; border-left-width: 2px; }
.scope-corner.tr { top: 6px; right: 6px; border-top-width: 2px; border-right-width: 2px; }
.scope-corner.bl { bottom: 6px; left: 6px; border-bottom-width: 2px; border-left-width: 2px; }
.scope-corner.br { bottom: 6px; right: 6px; border-bottom-width: 2px; border-right-width: 2px; }

/* ---------- BLIPS (real buttons over the canvas) ---------- */
.blip-layer { position: absolute; inset: 0; }

.blip {
  position: absolute;
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
}

.blip-dot {
  width: 10px; height: 10px;
  background: var(--amber);
  transform: rotate(45deg);
  box-shadow: 0 0 8px 2px rgba(255, 176, 0, 0.55);
  transition: box-shadow var(--t-fast) var(--ez), transform var(--t-fast) var(--ez);
}

.blip-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--amber);
  text-shadow: 0 0 6px rgba(255, 176, 0, 0.45);
  white-space: nowrap;
}

.blip:hover .blip-dot,
.blip:focus-visible .blip-dot {
  box-shadow: 0 0 14px 5px rgba(255, 176, 0, 0.75);
  transform: rotate(45deg) scale(1.25);
}

.blip[aria-selected="true"] .blip-dot {
  background: var(--ink-hi);
  box-shadow: 0 0 18px 6px rgba(255, 216, 138, 0.8);
}
.blip[aria-selected="true"] .blip-tag { color: var(--ink-hi); }

.blip[aria-selected="true"]::before {
  content: "";
  position: absolute;
  top: 13px; left: 50%;
  width: 26px; height: 26px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1px solid var(--amber-hot);
  box-shadow: 0 0 10px rgba(255, 216, 138, 0.4);
  animation: lockRing 2.6s var(--ez) infinite;
  pointer-events: none;
}
@keyframes lockRing {
  0%, 100% { transform: translate(-50%, -50%) rotate(45deg) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -50%) rotate(45deg) scale(1.12); opacity: 0.65; }
}

/* ---------- DOSSIER ---------- */
.dossier {
  display: flex;
  flex-direction: column;
  padding: 34px 40px 28px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--black) 70%);
  animation: rise var(--t-slow) var(--ez) 0.35s both;
  min-height: 0;
}

.dossier-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.dossier-designation { display: flex; flex-direction: column; gap: 6px; }

.dossier-contact {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
}

.dossier-name {
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-hi);
  text-shadow: 0 0 18px rgba(255, 176, 0, 0.25);
}

.dossier-class {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--amber);
  border: 1px solid var(--line-strong);
  padding: 5px 10px;
  white-space: nowrap;
  margin-top: 4px;
}

.dossier-readout {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.readout-cell {
  flex: 1;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--line);
}
.readout-cell:last-child { border-right: none; }

.readout-cell strong {
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 700;
  color: var(--amber);
  text-shadow: 0 0 14px rgba(255, 176, 0, 0.35);
  line-height: 1.1;
}
.readout-cell span {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
}
.readout-cell.honest strong { color: var(--ink-hi); text-shadow: none; }

.dossier-body {
  padding: 22px 0 18px;
  min-height: 150px;
}

.dossier-status {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 176, 0, 0.12);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
}

/* channel index — fills the dossier column, doubles as text nav */
.channel-index {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0;
  padding-bottom: 18px;
  min-height: 0;
}
.channel-row {
  display: grid;
  grid-template-columns: 3ch 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 10px 2px;
  border: none;
  background: none;
  border-top: 1px dashed rgba(255, 176, 0, 0.12);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  cursor: pointer;
  text-align: left;
  transition: color var(--t-fast) var(--ez), background var(--t-fast) var(--ez);
}
.channel-row:hover { color: var(--ink-hi); background: rgba(255, 176, 0, 0.05); }
.channel-row .ch-num { color: var(--ink-dim); font-weight: 600; }
.channel-row .ch-cls { font-size: 9.5px; color: var(--ink-dim); }
.channel-row[aria-current="true"] { color: var(--amber); }
.channel-row[aria-current="true"] .ch-num { color: var(--amber-hot); }
.channel-row[aria-current="true"] .ch-cls { color: var(--ink-dim); }

.typed {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink);
  max-width: 58ch;
  white-space: pre-wrap;
}

.typed .cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--amber);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}

.dossier-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.dossier-cta {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--black);
  background: var(--amber);
  padding: 12px 20px;
  box-shadow: 0 0 22px rgba(255, 176, 0, 0.35);
  transition: box-shadow var(--t-fast) var(--ez), transform var(--t-fast) var(--ez);
}
.dossier-cta:hover { box-shadow: 0 0 34px rgba(255, 176, 0, 0.6); transform: translateY(-1px); }

.dossier-eof { font-size: 10px; letter-spacing: 0.18em; color: var(--ink-dim); }

/* ============================================================
   STATUS BAR
   ============================================================ */
.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.14em;
  animation: rise var(--t-slow) var(--ez) 0.5s both;
}

.status-ok { display: flex; align-items: center; gap: 8px; color: var(--amber); font-weight: 600; }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px 2px rgba(255, 176, 0, 0.6);
  animation: pulse 2.4s var(--ez) infinite;
}
.status-key-hint { color: var(--ink-dim); display: flex; align-items: center; gap: 6px; }
.status-book { font-weight: 700; }
.status-book:hover { color: var(--amber-hot); }

/* ============================================================
   CONTACT LOG
   ============================================================ */
.log { padding: 90px 28px 40px; max-width: 1180px; margin: 0 auto; }

.log-head { margin-bottom: 56px; }

.log-title {
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-hi);
  text-shadow: 0 0 26px rgba(255, 176, 0, 0.22);
}

.log-sub {
  margin-top: 14px;
  max-width: 62ch;
  color: var(--ink);
  font-size: 15px;
}

.log-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 240px;
  gap: 28px;
  padding: 40px 12px;
  border-top: 1px solid var(--line);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--t-slow) var(--ez), transform var(--t-slow) var(--ez),
              background var(--t-fast) var(--ez);
}
.log-row.lit { opacity: 1; transform: none; }
.log-row:hover { background: rgba(255, 176, 0, 0.03); }

.log-callsign { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.log-num {
  font-size: 26px; font-weight: 700; color: var(--amber);
  text-shadow: 0 0 12px rgba(255, 176, 0, 0.35);
}
.log-blipdot {
  width: 8px; height: 8px; background: var(--amber);
  transform: rotate(45deg);
  box-shadow: 0 0 8px 2px rgba(255, 176, 0, 0.5);
}

.log-name {
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-hi);
}
.log-class {
  margin-top: 6px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.16em;
  color: var(--amber);
}
.log-copy { margin-top: 14px; max-width: 60ch; color: var(--ink); text-wrap: pretty; }
.log-cta {
  display: inline-block;
  margin-top: 16px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 3px;
  transition: color var(--t-fast) var(--ez), border-color var(--t-fast) var(--ez);
}
.log-cta:hover { color: var(--amber-hot); border-color: var(--amber-hot); }

.log-figures { display: flex; flex-direction: column; gap: 18px; }
.fig strong {
  display: block;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 700;
  color: var(--amber);
  text-shadow: 0 0 16px rgba(255, 176, 0, 0.35);
  line-height: 1.15;
}
.fig span {
  display: block; margin-top: 4px;
  font-size: 9.5px; letter-spacing: 0.14em; color: var(--ink-dim);
  max-width: 22ch;
}
.fig-honest strong { color: var(--ink-hi); text-shadow: none; }

/* ============================================================
   BOOK — the one VT323 display moment
   ============================================================ */
.book {
  padding: 130px 28px 90px;
  text-align: center;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(60% 55% at 50% 45%, rgba(255, 176, 0, 0.07) 0%, transparent 70%),
    var(--black);
}

.book-pre {
  font-size: 11px; letter-spacing: 0.3em; color: var(--ink-dim);
  margin-bottom: 34px;
}

.book-display {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(56px, 11vw, 170px);
  line-height: 0.92;
  color: var(--amber);
  text-shadow:
    0 0 12px rgba(255, 176, 0, 0.55),
    0 0 60px rgba(255, 176, 0, 0.25);
}
.book-line { display: block; }
.book-line-key { color: var(--ink-hi); }

.book-copy { margin-top: 40px; font-size: 16px; color: var(--ink); }

.book-cta {
  display: inline-block;
  margin-top: 28px;
  font-size: 15px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--black);
  background: var(--amber);
  padding: 18px 44px;
  box-shadow: 0 0 30px rgba(255, 176, 0, 0.4);
  transition: box-shadow var(--t-med) var(--ez), transform var(--t-fast) var(--ez);
}
.book-cta:hover { box-shadow: 0 0 50px rgba(255, 176, 0, 0.65); transform: translateY(-2px); }

.book-sig {
  margin-top: 70px;
  font-size: 10.5px; letter-spacing: 0.2em; color: var(--ink-dim);
}
.book-guide-link { color: var(--ink-dim); border-bottom: 1px solid var(--line); }
.book-guide-link:hover { color: var(--amber); }

/* ============================================================
   MOTION
   ============================================================ */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .log-row { opacity: 1; transform: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1020px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar-spine { display: none; }

  .console { grid-template-columns: 1fr; min-height: 0; }
  .scope-bay { border-right: none; border-bottom: 1px solid var(--line); padding: 20px; }
  .scope-frame { width: min(100%, 62vh); margin: 0 auto; }
  .dossier { padding: 26px 20px; }

  .status-key-hint { display: none; }

  .log { padding: 64px 20px 24px; }
  .log-row { grid-template-columns: 56px minmax(0, 1fr); }
  .log-figures { grid-column: 2; flex-direction: row; flex-wrap: wrap; gap: 26px; }
}

@media (max-width: 560px) {
  body { font-size: 14px; }
  .channel-index { display: none; } /* the contact log sits directly below on phones */
  .dossier-sqk { display: none; }   /* instrument chrome, not content */
  .log-figures { grid-column: auto; } /* kill the implicit 2nd column from the tablet query */
  .topbar { padding: 12px 16px; }
  .op-line { display: none; }
  .scope-footer-hint { display: none; }
  .dossier-foot { flex-direction: column; align-items: flex-start; }
  .log-row { grid-template-columns: 1fr; gap: 14px; }
  .log-callsign { flex-direction: row; align-items: center; }
  .book { padding: 90px 16px 70px; }
}
