/* ==========================================================================
   Arrival Brief — "ops" theme for the homepage map console.
   Dark navy chart-room: cyan coastlines, mono labels, signal chips.
   Scoped under body.ops so the editorial interior stays untouched.
   ========================================================================== */

body.ops {
  --bg: #0a1120;
  --panel: #0d1728;
  --panel-raise: #111e33;
  --line: #1d2c44;
  --line-bright: #2b4360;
  --coast: #3d6483;
  --txt: #dfe8f2;
  --txt-dim: #8298b0;
  --txt-faint: #55708c;
  --grn: #3ecf8e;
  --amb: #f0a93c;
  --red: #f0625d;
  --cyan: #55b6d8;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 1rem;
}

body.ops ::selection { background: #274060; }

/* masthead / footer re-skin */
body.ops .masthead { background: var(--bg); border-bottom: 1px solid var(--line-bright); }
body.ops .wordmark { color: var(--txt); }
body.ops .site-nav a { color: var(--txt-dim); }
body.ops .site-nav a:hover, body.ops .site-nav a[aria-current] { color: var(--txt); border-bottom-color: var(--amb); }
body.ops .site-footer { background: #081020; border-top: 1px solid var(--line-bright); margin-top: 0; }
body.ops .site-footer .wordmark { color: var(--txt); }
body.ops .footer-tagline, body.ops .footer-note, body.ops .footer-legal { color: var(--txt-faint); }
body.ops .footer-nav a { color: var(--txt-dim); }
body.ops .footer-nav a:hover { color: var(--amb); }

body.ops .kicker { color: var(--txt-dim); }
body.ops .kicker::before { background: var(--amb); }
body.ops a { color: var(--cyan); }
body.ops a:hover { color: var(--amb); }

.ops-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-dim);
}

/* ---------------------------------------------------------------- console */
.console { max-width: 90rem; margin: 0 auto; padding: 1.2rem 1.25rem 2rem; }

.console-intro { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 0.4rem 0.2rem 1rem; }
.console-intro h1 { font-size: 1.15rem; font-weight: 600; margin: 0; letter-spacing: 0; }
.console-intro h1 span { color: var(--txt-dim); font-weight: 400; }

/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.9rem; margin-bottom: 0.9rem; }
.kpi {
  background: var(--panel); border: 1px solid var(--line);
  padding: 0.9rem 1.1rem 1rem; border-radius: 4px;
}
.kpi .num { font-family: var(--mono); font-size: 2rem; font-weight: 700; line-height: 1.1; margin: 0.35rem 0 0.5rem; }
.kpi .num small { font-size: 1rem; color: var(--txt-dim); font-weight: 400; }
.kpi .bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 0.5rem; }
.kpi .bar i { display: block; height: 100%; background: var(--amb); }
.kpi .sub { font-family: var(--mono); font-size: 0.7rem; color: var(--txt-faint); letter-spacing: 0.04em; }

/* map + side panel grid */
.deck { display: grid; grid-template-columns: 1fr 19rem; gap: 0.9rem; align-items: stretch; }
@media (max-width: 62rem) { .deck { grid-template-columns: 1fr; } }

.map-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; }
.map-head {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--line);
}
.map-head h2 { font-size: 0.95rem; font-weight: 600; margin: 0; }
.map-head .count { font-family: var(--mono); font-size: 0.72rem; color: var(--txt-dim); }

/* live status ticker */
.scan-status { display: inline-flex; align-items: center; gap: 0.45rem; min-width: 0; }
.scan-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grn); flex: none; animation: blink 1.6s ease-in-out infinite; box-shadow: 0 0 6px rgba(62, 207, 142, 0.6); }
@keyframes blink { 50% { opacity: 0.25; } }
#scan-text {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em;
  color: var(--txt-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 34rem; transition: opacity 0.25s ease;
}
#scan-text.swap { opacity: 0; }

.region-chips { display: flex; gap: 0.4rem; margin-left: auto; }
.region-chips button {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--amb); background: transparent;
  border: 1px solid #6a5423; border-radius: 3px;
  padding: 0.28rem 0.6rem; cursor: pointer;
}
.region-chips button:hover { border-color: var(--amb); }
.region-chips button[aria-pressed="true"] { background: #2a2312; border-color: var(--amb); }

.map-legend { display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: center; padding: 0.55rem 1rem; border-top: 1px solid var(--line); }
.map-legend span { font-family: var(--mono); font-size: 0.68rem; color: var(--txt-dim); display: inline-flex; align-items: center; gap: 0.45rem; }
.map-legend .lg-group { color: var(--txt-faint); letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }
.map-legend .lg-group:not(:first-child) { margin-left: 0.9rem; padding-left: 1.1rem; border-left: 1px solid var(--line); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.grn { background: var(--grn); } .dot.amb { background: var(--amb); } .dot.red { background: var(--red); }
.sq { width: 8px; height: 8px; display: inline-block; border: 1.5px solid var(--cyan); }
.rng { width: 10px; height: 10px; display: inline-block; border-radius: 50%; border: 1.5px solid var(--txt); }
.halo-sw { width: 11px; height: 11px; display: inline-block; border-radius: 50%; }
.halo-sw.watch { border: 1.5px dashed var(--amb); }
.halo-sw.elev { border: 1.5px solid var(--red); box-shadow: 0 0 0 2.5px rgba(240, 98, 93, 0.25); }

.map-stage { position: relative; flex: 1; display: flex; overflow: hidden; }
/* framing vignette: darkens the corners so the lit continents sit forward */
.map-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 90px 20px rgba(5, 10, 20, 0.75);
}
#scam-map { display: block; width: 100%; height: auto; background: var(--bg); flex: 1; }
#scam-map .graticule { fill: none; stroke: #1b2c49; stroke-width: 0.6; vector-effect: non-scaling-stroke; animation: grat-breathe 9s ease-in-out infinite alternate; }
@keyframes grat-breathe { from { opacity: 0.4; } to { opacity: 0.8; } }

/* edge-lit continents: a soft outer halo + a crisp bright coastline over a raised gradient fill */
#scam-map .coastglow { fill: none; stroke: var(--cyan); stroke-width: 3.5; vector-effect: non-scaling-stroke; opacity: 0.32; filter: blur(2.5px); }
#scam-map .land { fill: url(#landfill); stroke: #6cbfe0; stroke-width: 1.05; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#scam-map .borders { fill: none; stroke: #274a72; stroke-width: 0.65; vector-effect: non-scaling-stroke; opacity: 0.7; }
#scam-map .arc { fill: none; stroke: var(--amb); stroke-width: 1.3; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; opacity: 0.85; animation: dashflow 1.4s linear infinite; }
#scam-map .arc.ambient { stroke: var(--cyan); stroke-width: 1; opacity: 0.18; animation-duration: 3s; }
#scam-map.filtered .arc.ambient { opacity: 0; }
@keyframes dashflow { to { stroke-dashoffset: -20; } }

.marker { cursor: pointer; }
.marker .core { stroke: #08101e; stroke-width: 1.5; vector-effect: non-scaling-stroke; transition: r 120ms ease; }
.marker:hover .core, .marker.selected .core { r: 7.2; }
.marker.p-high .core { fill: var(--red); }
.marker.p-moderate .core { fill: var(--amb); }
.marker.p-low .core { fill: var(--grn); }

/* breathing ping: every marker emits a slow expanding ring, staggered per city */
.marker .ping {
  fill: none; stroke-width: 1.2; vector-effect: non-scaling-stroke;
  opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: ping 3.6s ease-out infinite;
}
.marker.p-high .ping { stroke: var(--red); }
.marker.p-moderate .ping { stroke: var(--amb); }
.marker.p-low .ping { stroke: var(--grn); }
.marker.selected .ping { animation-duration: 1.6s; }
@keyframes ping {
  0%   { transform: scale(0.5); opacity: 0.65; }
  70%  { transform: scale(2.5); opacity: 0; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* soft under-glow tinted by scam pressure */
.marker .glow { opacity: 0.16; filter: blur(5px); }
.marker.p-high .glow { fill: var(--red); }
.marker.p-moderate .glow { fill: var(--amb); }
.marker.p-low .glow { fill: var(--grn); }
.marker:hover .glow, .marker.selected .glow { opacity: 0.3; }

/* street-crime halos: amber = watch, red pulsing double = elevated */
.marker .halo { fill: none; vector-effect: non-scaling-stroke; }
.marker .halo-watch { stroke: var(--amb); stroke-width: 1.3; stroke-dasharray: 3 3; opacity: 0.85; }
.marker .halo-elev { stroke: var(--red); stroke-width: 1.4; opacity: 0.9; }
.marker .halo-elev.outer {
  stroke-width: 1.1;
  transform-box: fill-box; transform-origin: center;
  animation: threat 2.2s ease-out infinite;
}
@keyframes threat {
  0%   { transform: scale(0.7); opacity: 0.9; }
  75%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .marker .halo-elev.outer { animation: none; transform: scale(1.35); opacity: 0.45; }
  .marker .ping, #scam-map .arc, #scam-map .graticule, .scan-dot { animation: none; }
  .marker .ping { opacity: 0; }
  #scam-map .graticule { opacity: 0.8; }
}

.marker .ring { fill: none; stroke: var(--txt); stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: 0.9; }
.marker .apt { fill: none; stroke: var(--cyan); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.marker text {
  font-family: var(--mono); font-weight: 600; letter-spacing: 0.08em;
  fill: var(--txt-dim); text-anchor: middle; text-transform: uppercase;
  paint-order: stroke; stroke: #0a1120; stroke-width: 3px; stroke-linejoin: round;
}
.marker.selected text, .marker:hover text { fill: var(--txt); }
.marker.selected .core { stroke: var(--txt); }
#scam-map.filtered .marker { opacity: 0.18; }
#scam-map.filtered .marker.hit { opacity: 1; }
#scam-map:not(.zoomed) .marker text { display: none; }
#scam-map:not(.zoomed) .marker.selected text, #scam-map:not(.zoomed) .marker:hover text { display: block; }

/* side panel: the scripts */
.scripts-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.scripts-panel h2 { font-size: 0.95rem; font-weight: 600; margin: 0; }
.scripts-panel .sub { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-faint); margin: -0.2rem 0 0.3rem; }
.script {
  text-align: left; width: 100%;
  background: var(--panel-raise); border: 1px solid var(--line); border-radius: 4px;
  padding: 0.65rem 0.8rem; cursor: pointer; color: var(--txt);
  font-family: var(--sans);
}
.script:hover { border-color: var(--line-bright); }
.script[aria-pressed="true"] { border-color: var(--amb); background: #1a1c22; }
.script strong { display: block; font-size: 0.92rem; font-weight: 600; }
.script span { display: block; font-family: var(--mono); font-size: 0.68rem; color: var(--txt-faint); margin-top: 0.2rem; }
.script.soon { cursor: default; opacity: 0.55; }
.script .go { font-family: var(--mono); font-size: 0.68rem; color: var(--cyan); margin-top: 0.3rem; display: none; }
.script[aria-pressed="true"] .go { display: block; }

/* bottom info: the whenrome-style detail strip */
.detail {
  margin-top: 0.9rem; background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  padding: 1rem 1.2rem 1.1rem; min-height: 7.5rem;
}
.detail .placeholder { color: var(--txt-faint); font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.05em; padding-top: 1.4rem; text-align: center; }
.detail-head { display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap; }
.detail-head h3 { margin: 0; font-size: 1.3rem; font-weight: 650; font-family: var(--serif); letter-spacing: 0; }
.detail-head .where { font-family: var(--mono); font-size: 0.72rem; color: var(--txt-dim); letter-spacing: 0.1em; text-transform: uppercase; }
.pill {
  font-family: var(--mono); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 3px;
}
.pill.p-high, .pill.s-elevated { color: var(--red); background: #2a1516; border: 1px solid #55282a; }
.pill.p-moderate, .pill.s-watch { color: var(--amb); background: #2a2312; border: 1px solid #5a4a22; }
.pill.p-low, .pill.s-low { color: var(--grn); background: #12271e; border: 1px solid #235240; }
.detail p { color: var(--txt-dim); margin: 0.5rem 0 0.7rem; max-width: 70ch; }
.detail .risks { font-family: var(--mono); font-size: 0.72rem; color: var(--txt-dim); letter-spacing: 0.03em; }
.detail .risks b { color: var(--txt); font-weight: 600; }
.detail .cta { display: inline-block; margin-top: 0.7rem; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.05em; color: var(--amb); text-decoration: none; border: 1px solid #6a5423; border-radius: 3px; padding: 0.4rem 0.8rem; }
.detail .cta:hover { border-color: var(--amb); color: var(--amb); }
.detail .soon-note { font-family: var(--mono); font-size: 0.72rem; color: var(--txt-faint); margin-top: 0.7rem; }

/* below-console sections */
.ops-section { max-width: 90rem; margin: 0 auto; padding: 1.6rem 1.25rem 2.4rem; border-top: 1px solid var(--line); }
.ops-section h2 { font-size: 1.15rem; margin: 0 0 1rem; }
.ops-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.9rem; }
.ops-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  padding: 1rem 1.1rem 1.1rem; text-decoration: none; display: block;
}
.ops-card:hover { border-color: var(--line-bright); }
.ops-card .idx { font-family: var(--mono); font-size: 0.68rem; color: var(--amb); letter-spacing: 0.12em; }
.ops-card strong { display: block; color: var(--txt); font-size: 1.05rem; margin: 0.35rem 0 0.25rem; }
.ops-card span { display: block; color: var(--txt-dim); font-size: 0.9rem; line-height: 1.45; }
.ops-method { color: var(--txt-dim); max-width: 75ch; font-size: 0.95rem; line-height: 1.6; }
