/* Oddwave Foundry — Observatory HUD Runtime · styles.css
   Locked tokens: 00_CORE/BRAND_MASTER.md. Bundled Observatory typefaces. */
@font-face {
  font-family: "Observatory Mono";
  src: url("fonts/ObservatoryMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Observatory Mono";
  src: url("fonts/ObservatoryMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Observatory Sans";
  src: url("fonts/ObservatorySans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Observatory Sans";
  src: url("fonts/ObservatorySans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
:root {
  --void: #0B0D12;
  --slate: #13161E;
  --border: #2A2F3E;
  --starlight: #F2EEE3;
  --muted: #9198AA;
  --ember: #FF5A2A;
  --ice: #6ED4FF;
  --panel: rgba(19, 22, 30, 0.84);
  --ink: var(--starlight);
  --sub: var(--muted);
  --line: var(--border);
  --accent: var(--ice);
  --sans: "Observatory Sans", "Futura", "Century Gothic", "Avenir Next", "Avenir", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --mono: "Observatory Mono", ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gap: 10px;
  color-scheme: dark;
}
.blackout {
  --panel: rgba(11, 13, 18, 0.96);
  --ink: #FF5A2A;
  --sub: rgba(255, 90, 42, 0.82);
  --line: rgba(255, 90, 42, 0.24);
  --accent: #FF5A2A;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--void); }
html { scrollbar-width: thin; scrollbar-color: var(--border) transparent; -webkit-text-size-adjust: 100%; }
html.embed { scrollbar-width: none; }
html.embed::-webkit-scrollbar { display: none; }
::-webkit-scrollbar { width: 6px; height: 0; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
body {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.blackout { background: var(--void); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.tl-back { color: var(--sub); text-decoration: none; font-weight: 500; }
.tl-back:hover { color: var(--ink); text-decoration: underline; }
button, select { font: inherit; color: inherit; }
kbd {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  border: 1px solid currentColor; border-radius: 3px; padding: 1px 5px; opacity: 0.7;
}

#backdrop { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; z-index: 0; }

.hud {
  position: relative; z-index: 1;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: var(--gap);
  height: 100vh; height: 100dvh;
  min-height: 600px;
  padding: 12px 14px 8px;
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
  max-width: 100vw;
}

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark { width: 40px; height: 40px; flex: none; overflow: visible; }
.mark-orbit { fill: none; stroke: var(--ink); stroke-opacity: 0.22; stroke-width: 1; }
.mark-wave { fill: none; stroke: var(--ink); stroke-width: 4.8; stroke-linecap: round; stroke-linejoin: round; }
.mark-dot { fill: var(--ember); transform-origin: 50px 50px; animation: orbit 14s linear infinite; }
.blackout .mark-dot circle { filter: drop-shadow(0 0 3px var(--ember)); }
@keyframes orbit { to { transform: rotate(360deg); } }
.brand-text { min-width: 0; }
.wordmark {
  margin: 0; font-size: 15px; font-weight: 500; letter-spacing: 0.34em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.wordmark .sep { color: var(--ember); letter-spacing: 0.1em; }
.wordmark .product { color: var(--ink); }
.mission { margin: 3px 0 0; font-family: var(--mono); font-size: 11px; color: var(--sub); letter-spacing: 0.14em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.clocks { display: flex; gap: 22px; flex: none; }
.clock { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.clock .lbl, .ro dt, .select .lbl { font-size: 10.5px; letter-spacing: 0.2em; color: var(--sub); }
.clock .val { font-size: 16.5px; color: var(--ink); white-space: nowrap; }
.clock.lastpkt .val { color: var(--sub); font-size: 13.5px; padding-top: 2px; }
.clock.lastpkt.frozen .val { color: var(--ember); font-size: 16.5px; padding-top: 0; text-shadow: 0 0 10px rgba(255, 90, 42, 0.45); }
.clock.lastpkt.frozen .lbl { color: var(--ember); }
.clock.lastpkt.reacq .val { color: var(--accent); font-size: 16.5px; padding-top: 0; }
.clock.lastpkt.reacq .lbl { color: var(--accent); }

/* ---------- cold-buyer subtitle strip (one line at desktop) ---------- */
.tagline {
  margin: -2px 0 0; padding: 0 2px; font-size: 14px; line-height: 20px; letter-spacing: 0.015em; color: var(--sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.tagline b { color: var(--ink); font-weight: 600; }
.tagline .tl-key { color: var(--ember); font-weight: 600; letter-spacing: 0.06em; white-space: nowrap; }
.tagline .tl-cta {
  display: inline-block; color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap;
  padding: 1px 8px; border: 1px solid rgba(110, 212, 255, 0.45); border-radius: 4px; margin-left: 4px;
}
.tagline .tl-cta:hover { background: rgba(110, 212, 255, 0.12); text-decoration: none; }

/* ---------- control bar ---------- */
.controlbar {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px;
  min-width: 0;
}
.ctrl-row { display: flex; align-items: center; gap: 9px; min-width: 0; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 13px; border-radius: 4px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  font-size: 12px; letter-spacing: 0.16em; white-space: nowrap; text-decoration: none;
  transition: background-color 80ms linear, border-color 80ms linear, color 80ms linear;
  touch-action: manipulation; user-select: none;
}
.btn:hover { border-color: var(--sub); }
.btn:focus-visible, select:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }
.btn.drop {
  height: 46px; padding: 0 20px; gap: 12px;
  background: var(--ember); border-color: var(--ember); color: #0B0D12;
  font-weight: 700; font-size: 14px; letter-spacing: 0.2em;
  box-shadow: 0 0 0 1px rgba(255, 90, 42, 0.3), 0 0 22px rgba(255, 90, 42, 0.28);
}
.btn.drop kbd { border-color: rgba(11, 13, 18, 0.55); opacity: 0.85; }
.btn.drop:hover { background: rgba(255, 90, 42, 0.86); box-shadow: 0 0 0 1px rgba(255, 90, 42, 0.5), 0 0 26px rgba(255, 90, 42, 0.4); }
.btn.drop.small { height: 38px; font-size: 12px; }
.drop-dot { width: 8px; height: 8px; border-radius: 50%; background: #0B0D12; }
.btn.drop[aria-pressed="true"] {
  background: transparent; color: var(--ember);
  box-shadow: inset 0 0 0 1px var(--ember), 0 0 18px rgba(255, 90, 42, 0.35);
  animation: losPulse 1s ease-in-out infinite;
}
.btn.drop[aria-pressed="true"] .drop-dot { background: var(--ember); }
.btn.drop[aria-pressed="true"] kbd { border-color: var(--ember); }
@keyframes losPulse { 50% { box-shadow: inset 0 0 0 1px var(--ember), 0 0 4px rgba(255, 90, 42, 0.1); } }
.led { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--sub); }
.btn.sw[aria-pressed="true"] .led { background: var(--ember); border-color: var(--ember); box-shadow: 0 0 8px var(--ember); }
.btn.ghost { color: var(--accent); border-color: var(--line); }
.guide-btn { width: auto; padding: 0 12px; gap: 6px; font-size: 11.5px; letter-spacing: 0.14em; color: var(--sub); }
.guide-btn .q { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.guide-btn:hover, .guide-btn[aria-expanded="true"] { color: var(--accent); }
.guide-btn .gtxt { display: inline; }
.select { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 0 0 12px; border: 1px solid var(--line); border-radius: 4px; }
.select select {
  height: 36px; background: transparent; border: 0; color: var(--ink); padding: 0 28px 0 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 13px) 16px, calc(100% - 9px) 16px; background-size: 4px 4px; background-repeat: no-repeat;
}
.select select option { background: #13161E; color: #F2EEE3; padding: 6px 12px; }

.readouts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; margin: 0; min-width: 0; border-top: 1px solid var(--line); padding-top: 9px; }
.ro:first-child { border-left: 0; }
.ro { padding: 0 9px; border-left: 1px solid var(--line); min-width: 0; }
.ro dt { margin: 0 0 3px; white-space: nowrap; }
.ro dd { margin: 0; font-size: clamp(13px, 1.02vw, 15px); font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ro.extra dd { color: var(--accent); }
.stale .ro dd { color: var(--ember); opacity: 0.78; }
.stale .ro dd:not(.live):not(.static)::after { content: " ▪"; font-size: 9px; vertical-align: middle; opacity: 0.8; }
.stale .ro dd.live { opacity: 1; }
.stale .ro.extra dd { color: var(--accent); opacity: 1; }
.stale .ro.extra dd::after { content: none; }

/* ---------- instrument grid ---------- */
.grid {
  display: grid; gap: var(--gap); min-height: 0; min-width: 0;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "radar chart" "radar scope";
}
.p-radar { grid-area: radar; } .p-chart { grid-area: chart; } .p-scope { grid-area: scope; }
.panel {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 32px; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; }
.ph h2 { margin: 0; font-size: 10.5px; font-weight: 500; letter-spacing: 0.3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph h2 span { color: var(--sub); }
.chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--accent);
  border: 1px solid currentColor; border-radius: 3px; padding: 2px 6px; white-space: nowrap; opacity: 0.9;
}
.chip.warn { color: var(--ember); animation: chipPulse 0.9s steps(2, jump-none) infinite; }
@keyframes chipPulse { 50% { opacity: 0.45; } }
.pb { position: relative; flex: 1 1 auto; min-height: 0; }
.pb canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
#cvRadar { cursor: crosshair; outline: none; }
#cvRadar:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
.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; }
.hint { position: absolute; left: 12px; bottom: 8px; margin: 0; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--sub); pointer-events: none; }
.lockcard {
  position: absolute; right: 10px; top: 10px; width: 236px; max-width: calc(100% - 20px);
  background: rgba(11, 13, 18, 0.9); border: 1px solid var(--accent); border-radius: 4px; padding: 9px 11px;
  font-family: var(--mono); font-size: 10.5px; line-height: 1.55; color: var(--ink); pointer-events: none;
}
.blackout .lockcard { background: rgba(11, 13, 18, 0.94); }
.lockcard .lk-h { display: flex; justify-content: space-between; color: var(--accent); letter-spacing: 0.14em; margin-bottom: 4px; }
.lockcard .lk-k { color: var(--sub); }
.lockcard .lk-n { color: var(--sub); margin-top: 4px; font-size: 9.5px; letter-spacing: 0.04em; }
.lockcard.coast { border-color: var(--ember); }
.lockcard.coast .lk-h { color: var(--ember); }

/* ---------- footer ---------- */
.credit { display: flex; justify-content: space-between; gap: 12px; color: var(--sub); font-size: 10.5px; letter-spacing: 0.06em; padding: 0 2px; min-width: 0; }
.credit > span:first-child { min-width: 0; }
.credit .build { white-space: nowrap; opacity: 0.75; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgba(11, 13, 18, 0.82); backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal-card {
  width: min(860px, 100%); max-height: calc(100dvh - 32px); overflow: auto; scrollbar-width: none;
  background: #13161E; border: 1px solid var(--border); border-radius: 8px; padding: 18px 20px 16px; color: #F2EEE3;
}
.blackout .modal-card { background: var(--void); border-color: rgba(255, 90, 42, 0.35); color: var(--ember); }
.mh { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mh h2 { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: 0.3em; line-height: 1.5; padding-top: 6px; min-width: 0; }
.mh h2 .nw { white-space: nowrap; }
.mh h2 .sub { color: var(--sub); }
.x { flex: none; }
.x { background: none; border: 1px solid var(--border); border-radius: 4px; width: 32px; height: 32px; cursor: pointer; color: var(--sub); }
.mlead { color: var(--sub); margin: 8px 0 12px; font-size: 13px; letter-spacing: 0.02em; }
.code {
  margin: 0; padding: 12px 14px; background: #0B0D12; border: 1px solid var(--border); border-radius: 5px;
  font-family: var(--mono); font-size: 12px; line-height: 1.75; color: #F2EEE3; white-space: pre-wrap; overflow-wrap: anywhere;
}
.code:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.code code { display: block; }
.code .cl { display: grid; grid-template-columns: 26px minmax(0, 1fr); }
.code .cx { min-width: 0; }
.blackout .code { background: var(--void); color: var(--ember); border-color: rgba(255, 90, 42, 0.3); }
.code .ln { color: rgba(145, 152, 170, 0.55); user-select: none; -webkit-user-select: none; }
.blackout .code .ln { color: rgba(255, 90, 42, 0.55); }
.code .k { color: #FF5A2A; } .code .t { color: #6ED4FF; } .code .f { color: #F2EEE3; font-weight: 600; } .code .c { color: #9198AA; }
.facts { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.facts li { border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; font-size: 11px; color: var(--sub); letter-spacing: 0.04em; }
.facts b { display: block; color: var(--ice); font-weight: 500; font-size: 13px; letter-spacing: 0.06em; }
.blackout .facts b { color: var(--ember); }
.cta { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
#copyCode.manual { color: var(--ember); border-color: var(--ember); }
#copyCode.ok { color: var(--ice); border-color: var(--ice); }
.blackout #copyCode.ok { color: var(--ember); border-color: var(--ember); }
.mfoot { margin: 12px 0 0; font-size: 10px; letter-spacing: 0.16em; color: var(--sub); text-align: right; }

/* ---------- package guide ---------- */
.guide-card { width: min(820px, 100%); }
.guide-list { margin: 16px 0 18px; padding: 0; list-style: none; counter-reset: g; display: grid; gap: 16px; }
.guide-list > li { counter-increment: g; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; font-size: 14.5px; line-height: 1.58; color: var(--sub); }
.guide-list > li::before {
  content: counter(g); grid-row: 1 / span 2; width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 50%;
  display: grid; place-items: center; font-family: var(--mono); font-size: 12px; color: var(--ice); margin-top: 2px;
}
.guide-list b { color: #F2EEE3; font-size: 15.5px; font-weight: 600; letter-spacing: 0.03em; margin-bottom: 4px; }
.guide-list em { font-style: normal; color: var(--ice); font-weight: 500; }
.guide-list strong { color: var(--ember); font-weight: 600; }
.guide-list code { font-family: var(--mono); font-size: 13px; color: #F2EEE3; }
.guide-intro { margin: 0 0 6px; }
.guide-bullets { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 5px; list-style: disc; }
.guide-bullets li { display: list-item; padding-left: 2px; }
.blackout .guide-list b, .blackout .guide-list em, .blackout .guide-list > li::before { color: var(--ember); }
.blackout .guide-list > li { color: rgba(255, 90, 42, 0.82); }

/* ---------- tablet ---------- */
@media (max-width: 1180px) {
  .readouts { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 8px; }
  .ro:nth-child(4n + 1) { border-left: 0; }
  .clock.wall { display: none; }
}

/* ---------- mobile (390 x 844) ---------- */
@media (max-width: 760px) {
  :root { --gap: 8px; }
  .hud { height: auto; min-height: 100dvh; grid-template-rows: auto auto auto auto auto; padding: 8px 10px 10px; }
  .tagline { margin: -2px 0 0; white-space: normal; font-size: 12px; line-height: 1.4; }
  .ctrl-row .guide-btn { grid-column: 1 / -1; width: 100%; font-size: 10px; letter-spacing: 0.14em; color: var(--accent); gap: 8px; }
  .ctrl-row .guide-btn .gtxt { display: inline; }
  .ctrl-row .guide-btn .q { width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; letter-spacing: 0; }
  .guide-list li { font-size: 14px; line-height: 1.55; }
  .topbar { gap: 8px; }
  .mark { width: 32px; height: 32px; }
  .wordmark { font-size: 12px; letter-spacing: 0.26em; }
  .wordmark .sep, .wordmark .product { display: none; }
  .mission { font-size: 9.5px; letter-spacing: 0.08em; }
  .clocks { gap: 10px; }
  .clock .val { font-size: 12.5px; }
  .clock.lastpkt.frozen .val, .clock.lastpkt.reacq .val { font-size: 12.5px; }
  .clock .lbl { font-size: 8.5px; letter-spacing: 0.18em; }
  .clock:first-child .val { font-size: 12.5px; }
  .clock .val .d { display: none; }
  .controlbar { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px; }
  .btn.drop { width: 100%; height: 52px; font-size: 14px; }
  .ctrl-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .ctrl-row .btn, .ctrl-row .select { width: 100%; min-width: 0; padding: 0 8px; font-size: 10px; letter-spacing: 0.14em; height: 38px; }
  .ctrl-row .select select { width: 100%; min-width: 0; font-size: 10px; }
  .ctrl-row .select .lbl { display: none; }
  .ctrl-row kbd { display: none; }
  .readouts { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px; }
  .ro { padding: 0 8px; border-left: 1px solid var(--line); }
  .ro:nth-child(3n + 1) { border-left: 0; }
  .ro.x34 { display: none; }
  .ro dd { font-size: 12.5px; }
  .grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "radar" "scope" "chart"; }
  .p-radar .pb { aspect-ratio: 1 / 1; }
  .p-chart .pb { aspect-ratio: 4 / 3; }
  .p-scope .pb { aspect-ratio: 16 / 11; }
  .lockcard { width: 200px; font-size: 9.5px; }
  .ph { padding: 0 10px; gap: 8px; }
  .ph h2 { letter-spacing: 0.2em; }
  .credit { flex-direction: column; gap: 4px; font-size: 10px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .code { font-size: 10.5px; padding: 10px; }
  .code .cl { grid-template-columns: 20px minmax(0, 1fr); }
  .mh h2 { font-size: 12px; letter-spacing: 0.22em; }
  .modal-card { padding: 14px; }
  .cta .btn { flex: 1 1 auto; }
}
@media (max-width: 360px) { .clock.lastpkt .lbl { letter-spacing: 0.1em; } }

@media (prefers-reduced-motion: reduce) {
  .mark-dot, .btn.drop[aria-pressed="true"], .chip.warn { animation: none; }
}
