/* JAFO wall: "pulse" — ambient city pulse.
   Everything is laid out on a fixed 1920x1080 stage and scaled to the
   screen, so 1366x768 and 3840x2160 are exact scalings of the same picture. */
:root {
  --night: #05070b;
  --night-2: #0a0f17;
  --bone: #dde2ea;      /* primary text — never pure white (burn-in) */
  --mist: #8d97a7;      /* secondary text */
  --haze: #566072;      /* tertiary text, scaffolding labels */
  --hair: rgba(150, 170, 200, .10);
  --sodium: #e3a857;    /* radio traffic magnitude (single hue) */
  --k-danger: #eb6263;
  --k-medical: #00a888;
  --k-general: #338ced;
  --k-other: #8a93a0;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "Fragment Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); }
body { color: var(--bone); font-family: var(--sans); -webkit-font-smoothing: antialiased; cursor: none; }
body.mouse { cursor: default; }

#stage {
  position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px;
  transform-origin: 0 0;
  background:
    radial-gradient(1100px 700px at 30% 42%, rgba(227, 168, 87, .045), transparent 70%),
    radial-gradient(900px 900px at 76% 46%, rgba(80, 110, 160, .06), transparent 70%),
    var(--night);
}
#drift { position: absolute; inset: 0; will-change: transform; }

/* ---------- top corners */
.top { position: absolute; left: 72px; right: 72px; top: 52px; display: flex; justify-content: space-between; align-items: flex-start; }
.region { font: 400 22px/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--mist); }
.sub { margin-top: 12px; font: 300 italic 22px/1 var(--serif); color: var(--haze); letter-spacing: .01em; }
.sky { text-align: right; }
.wx { font: 300 24px/1.2 var(--sans); color: var(--mist); letter-spacing: .02em; }
.wx b { font-weight: 400; color: var(--bone); }
.wx .alert { display: block; margin-top: 10px; font: 400 20px/1.2 var(--sans); color: var(--k-danger); letter-spacing: .04em; }
.conn { margin-top: 12px; font: 400 15px/1 var(--mono); color: var(--haze); letter-spacing: .08em; text-transform: uppercase; }
.conn i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--sodium); margin-right: 9px; vertical-align: 1px; animation: blink 2.4s ease-in-out infinite; }
.lag { margin-top: 14px; font: 400 15px/1 var(--mono); color: var(--haze); letter-spacing: .06em; }
.demo-tag { margin-top: 12px; font: 400 15px/1 var(--mono); color: var(--sodium); letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- map field */
.map { position: absolute; left: 72px; top: 150px; width: 1000px; height: 500px; }
.map canvas { position: absolute; inset: -40px; width: 1080px; height: 580px; }
.caption {
  position: absolute; width: max-content; max-width: 600px; opacity: 0; transform: translateY(8px);
  transition: opacity 1.6s ease, transform 1.6s ease;
  pointer-events: none;
}
.caption::before { content: ""; position: absolute; inset: -40px -60px; z-index: -1;
  background: radial-gradient(closest-side, rgba(5, 7, 11, .82), rgba(5, 7, 11, .5) 60%, transparent); }
.caption.on { opacity: 1; transform: none; }
.caption .eyebrow { display: inline-flex; align-items: center; gap: 12px; font: 400 18px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--mist); }
.caption .eyebrow .when { margin-left: auto; letter-spacing: .06em; font-family: var(--mono); font-size: 16px; color: var(--haze); text-transform: none; }
.caption h2 { margin: 14px 0 10px; font: 300 46px/1.08 var(--serif); text-shadow: 0 0 30px #05070b, 0 0 12px #05070b; letter-spacing: -.005em; color: var(--bone); text-wrap: balance; }
.caption .where { font: 400 22px/1.35 var(--sans); color: var(--mist); text-shadow: 0 0 14px #05070b; }
.caption .where .st { color: var(--bone); }
.caption.r { text-align: right; }
.caption.r .eyebrow { flex-direction: row-reverse; }
.caption.r .eyebrow .when { margin-left: 0; margin-right: auto; }
.glyph { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.glyph svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.k-violence, .k-fire { color: var(--k-danger); }
.k-medical { color: var(--k-medical); }
.k-traffic, .k-property, .k-suspicious { color: var(--k-general); }
.k-other { color: var(--k-other); }
.glyph { box-shadow: inset 0 0 0 1.5px currentColor; }

/* ---------- 24h dial */
.dial { position: absolute; left: 1028px; top: 52px; width: 880px; height: 880px; }
.dial canvas { position: absolute; inset: 0; width: 880px; height: 880px; }
.dial-center { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-54%); text-align: center; }
.clock { font: 300 104px/1 var(--serif); letter-spacing: -.02em; color: var(--bone); opacity: .86; font-variant-numeric: lining-nums tabular-nums; }
.clock small { font: 400 22px/1 var(--sans); letter-spacing: .2em; margin-left: 8px; color: var(--mist); vertical-align: 52px; }
.date { margin-top: 14px; font: 400 18px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--haze); }

/* ---------- voice: latest transmissions */
.voice {
  position: absolute; left: 72px; top: 676px; width: 1000px; height: 352px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 34%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 34%);
}
.lines { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 22px; }
.line { transition: opacity 2.4s ease, transform 2.4s ease; }
.line .text { font: 300 52px/1.16 var(--serif); color: var(--bone); letter-spacing: -.004em; text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  transition: font-size 2.2s ease, color 2.2s ease, line-height 2.2s ease; }
.line .text .w { opacity: 0; filter: blur(6px); display: inline-block; transform: translateY(.18em);
  animation: wordIn 1.5s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes wordIn { to { opacity: 1; filter: blur(0); transform: none; } }
.line .meta { margin-top: 16px; display: flex; align-items: center; gap: 18px; font: 400 20px/1 var(--mono); color: var(--mist); letter-spacing: .02em; transition: opacity 1.6s ease, max-height 2s ease; max-height: 60px; }
.line .meta > * { white-space: nowrap; flex: none; }
.line .meta .ch { color: var(--sodium); opacity: .9; }
.line .meta .inc { flex: 0 1 auto !important; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 10px; font-family: var(--sans); font-size: 21px; color: var(--bone); opacity: .82; }
.line .meta .inc .glyph { width: 28px; height: 28px; flex: none; }
.line .meta .inc .tt { overflow: hidden; text-overflow: ellipsis; }
.line .meta .inc .glyph svg { width: 18px; height: 18px; }
.line .meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--haze); }
.line.past .text { font-size: 28px; line-height: 1.25; color: var(--haze); -webkit-line-clamp: 1; }
.line.past .meta { opacity: 0; max-height: 0; margin-top: 0; }
.line.new { opacity: 0; }
.redacted { display: inline-block; vertical-align: .12em; margin: 0 .12em; padding: .02em .5em; border-radius: 999px;
  background: rgba(141, 151, 167, .18); color: transparent; font: 400 .42em/1.6 var(--sans); letter-spacing: .16em; text-transform: uppercase; position: relative; }
.redacted::after { content: "hidden"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--mist); filter: blur(.4px); }
.quiet-note { font: 300 italic 40px/1.2 var(--serif); color: var(--haze); }

/* ---------- tally under the dial */
.tally { position: absolute; left: 1100px; width: 736px; top: 918px; text-align: center; }
.sentence { margin: 0; font: 300 30px/1.3 var(--serif); color: var(--mist); }
.sentence b { font-weight: 400; color: var(--bone); font-variant-numeric: lining-nums; }
.kinds { margin-top: 14px; display: flex; justify-content: center; gap: 22px; font: 400 20px/1 var(--sans); color: var(--mist); min-height: 30px; }
.kinds span { display: inline-flex; align-items: center; gap: 9px; }
.kinds .glyph { width: 28px; height: 28px; }
.kinds .glyph svg { width: 17px; height: 17px; }
.kinds b { color: var(--bone); font-weight: 400; }
.key { margin: 14px 0 0; font: 400 15px/1 var(--sans); letter-spacing: .06em; color: var(--haze); }

/* ---------- nav, only on mouse movement */
.nav { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px; padding: 10px 20px; border-radius: 999px;
  background: rgba(10, 15, 23, .82); box-shadow: 0 0 0 1px var(--hair);
  font: 400 14px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  opacity: 0; pointer-events: none; transition: opacity .5s ease; z-index: 5; }
body.mouse .nav { opacity: 1; pointer-events: auto; }
.nav a, .nav button { color: var(--mist); text-decoration: none; background: none; border: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; padding: 4px 2px; }
.nav a:hover, .nav button:hover, .nav a[aria-current] { color: var(--bone); }
.nav a:focus-visible, .nav button:focus-visible { outline: 2px solid var(--sodium); outline-offset: 3px; border-radius: 4px; }
.nav button.on { color: var(--sodium); }
.nav .sep { width: 1px; height: 14px; background: var(--hair); }

@media (prefers-reduced-motion: reduce) {
  .line .text .w { animation-duration: .01s; }
  .caption, .line, .line .text { transition-duration: .3s; }
}

/* Sensitive tag (wall opened with ?sensitive=show) */
.sens-tag { display: inline-block; vertical-align: 0.18em; font: 700 clamp(11px, 0.42em, 22px)/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .08em; text-transform: uppercase; color: #c26a00; border: 1.5px solid currentColor;
  border-radius: 0.5em; padding: 0.32em 0.6em; margin-right: 0.45em; white-space: nowrap; }

/* JAFO helicopter brand mark */
.heli-mark { height: 1.5em; width: auto; vertical-align: -0.3em; margin-right: 0.6em; opacity: .9; filter: drop-shadow(0 0 10px rgba(60,110,255,.35)); animation: heli-bob 7s ease-in-out infinite; }
@keyframes heli-bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-3px) rotate(1deg); } }
@media (prefers-reduced-motion: reduce) { .heli-mark { animation: none; } }
