/* Site backdrop, shared by the homepage and the personnel site.
   ODST night-drop feel: a city at night (deep navy, amber streetlight glow), a faint
   hexagonal VISR overlay, visor scanlines and grain, and drop-pod
   telemetry in amber HUD text. Everything sits fixed behind the content and ignores the mouse.
   It's all static (nothing moves, no blur) so scrolling stays smooth.
   The HUD elements are added by assets/backdrop.js. */

:root {
  --visr: 110, 200, 225;       /* VISR cyan, used as rgba(var(--visr), a) */
  --amber: 255, 184, 77;       /* HUD amber */
  --hud-text: rgba(var(--amber), .5);
}

/* Base colour; the glows are on the fixed .hud layer below */
body { background: #070A10 }

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

/* VISR hex overlay around the edges of the screen only; the centre, where the content sits, stays plain */
body::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='52'%3E%3Cpath d='M0 26 15 0h30l15 26-15 26H15ZM60 26h30' fill='none' stroke='rgb(110,200,225)' stroke-width='1'/%3E%3C/svg%3E") center / 90px 52px;
  opacity: .12;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, #000 100%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, #000 100%);
}

/* Unit emblem watermark, tinted like a VISR outline */
body::after {
  background: url(logo-512.png) no-repeat 50% 58% / min(72vh, 720px);
  opacity: .035;
  filter: grayscale(1) sepia(1) hue-rotate(160deg) saturate(2.2);
}

/* ── Glass boxes
   Every box is translucent (tinted, no blur: blurring every box made scrolling laggy). --card / --band are the box colours
   both pages already use, so overriding them here (this file loads last) makes them all glass. */
:root {
  --card: rgba(11, 15, 23);
  --band: rgba(18, 23, 33, .5);
  --glass-panel: rgb(11, 15, 23);       /* big panels behind text sections */
  --glass-edge: rgba(170, 210, 235, .12);
}

/* Boxes on both pages (each selector only matches on the page that has it) */
.btn.ghost, .btn.danger, .notice, .stat, .tablewrap, .filehead, .filebox, .notes, .lore, .camp, .req,
.org-box, .shop, .newop, .grid > div, .sec, .leader, .gitem,
.card, .slot, .tile, .chips li, .plt {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 0 0 1px var(--glass-edge);
}

/* Small, numerous boxes (attendance chips, roll-call buttons) */
.chip, .seg { background: var(--card) }

/* Personnel file info row: glass cells with hairline gaps instead of a gold background showing through */
.grid { background: none; border: 0; gap: 2px }
.grid > div { background: var(--card) }

/* Personnel sections (history, attendance, roll call, lore…) get a glass panel behind their text */
.sec { background: var(--glass-panel); padding: 18px 22px 20px; border-radius: 2px }

/* Homepage: every section (except the hero banner) becomes a glass panel; the full-width strips go clear */
.band { background: none }
.band > .wrap,
main > section.wrap:not(.hero) {
  background: var(--glass-panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 0 0 1px var(--glass-edge);
  width: calc(100% - 48px);
  margin: 28px auto;
  padding: 56px 40px;
}

/* Pop-up forms stay solid so they're easy to read */
dialog, dialog .actions { background: #151A24 }

@media (max-width: 700px) {
  .band > .wrap,
  main > section.wrap:not(.hero) { width: calc(100% - 20px); margin: 14px auto; padding: 36px 20px }
  .sec { padding: 14px 14px 16px }
}

/* ── HUD layer (built by backdrop.js) */
.hud {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  font: 11px/1.5 Consolas, "Lucida Console", "Courier New", monospace;
  letter-spacing: 2px;
  color: var(--hud-text);
  text-transform: uppercase;
  /* Night sky: cyan haze up top, amber streetlight glow rising from below, dark visor edges */
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(var(--visr), .12), transparent 70%),
    radial-gradient(ellipse 70% 45% at 20% 112%, rgba(var(--amber), .10), transparent 70%),
    radial-gradient(ellipse 55% 40% at 88% 110%, rgba(var(--amber), .07), transparent 70%),
    radial-gradient(ellipse 120% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, .7) 100%);
}

/* Visor scanlines and grain: edges only, like the rim of a helmet visor */
.hud::before,
.hud::after {
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, #000 100%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, #000 100%);
}

.hud::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px);
  opacity: .45;
}

/* Grain (static) */
.hud::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .06;
}

/* Visor corner brackets */
.hud-corner {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 0 solid rgba(var(--amber), .38);
}

.hud-corner::after {           /* small inner tick */
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border: inherit;
  border-color: rgba(var(--visr), .5);
  margin: 6px;
}

.hud-corner.tl { top: 14px; left: 14px; border-width: 2px 0 0 2px }
.hud-corner.tr { top: 14px; right: 14px; border-width: 2px 2px 0 0 }
.hud-corner.bl { bottom: 14px; left: 14px; border-width: 0 0 2px 2px }
.hud-corner.br { bottom: 14px; right: 14px; border-width: 0 2px 2px 0 }
.hud-corner.tr::after, .hud-corner.br::after { right: 0 }
.hud-corner.bl::after, .hud-corner.br::after { bottom: 0 }

/* Readouts */
.hud-text { position: absolute; white-space: nowrap }
.hud-text.bl { left: 64px; bottom: 18px }
.hud-text.br { right: 64px; bottom: 18px; text-align: right }
.hud-text b { color: rgba(var(--visr), .75); font-weight: 400 }
.hud-live::before { content: "◆ "; color: rgba(var(--visr), .8) }

/* Phones and small windows: drop the readouts */
@media (max-width: 900px) {
  .hud-text { display: none }
}

@media (prefers-reduced-transparency: reduce) {
  body::before,
  body::after,
  .hud { display: none }
}
