/* ==========================================================================
   LOCU — machine-vision wordmark
   Tokens mirror DESIGN.md. Two hues only: signal-cyan / signal-magenta.
   ========================================================================== */

:root {
  --void-black: #060608;
  --void-black-deep: #0a0e14;
  --signal-white: #f2fcff;
  --signal-cyan: #00f0ff;
  --signal-magenta: #ff1fe0;
  --hud-steel: #5f8891;
  --hairline: rgba(0, 240, 255, 0.16);

  --font-display: "Chakra Petch", Arial, sans-serif;
  --font-label: "IBM Plex Mono", Consolas, monospace;

  --hud-inset: clamp(16px, 4vw, 40px);
}

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

/* Fixed + inset, not just overflow:hidden — belt and suspenders against
   iOS Safari rubber-band scroll and mobile URL-bar resize jitter. */
html,
body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  color-scheme: dark;
  background-color: var(--void-black);
  background-image:
    radial-gradient(ellipse at 50% 50%, var(--void-black-deep) 0%, var(--void-black) 72%);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  font-family: var(--font-label);
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  -webkit-touch-callout: none;
}

/* Faint CRT scan texture + vignette above the canvas, below the HUD. */
.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.035) 0px,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(0, 0, 0, 0.55) 100%);
}

@media (hover: hover) and (pointer: fine) {
  #scene {
    cursor:
      url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNiIgaGVpZ2h0PSIyNiIgdmlld0JveD0iMCAwIDI2IDI2Ij48ZyBzdHJva2U9IiMwMEYwRkYiIHN0cm9rZS13aWR0aD0iMS40IiBmaWxsPSJub25lIj48Y2lyY2xlIGN4PSIxMyIgY3k9IjEzIiByPSI3Ii8+PHBhdGggZD0iTTEzIDAgVjYgTTEzIDIwIFYyNiBNMCAxMyBINiBNMjAgMTMgSDI2Ii8+PC9nPjwvc3ZnPg==")
        13 13,
      crosshair;
  }
}

/* ---- HUD instrumentation --------------------------------------------- */

.hud {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  pointer-events: none;
  z-index: 2;
}

.hud--tl { top: var(--hud-inset); left: var(--hud-inset); align-items: flex-start; }
.hud--tr { top: var(--hud-inset); right: var(--hud-inset); align-items: flex-end; text-align: right; }
.hud--bl { bottom: var(--hud-inset); left: var(--hud-inset); align-items: flex-start; }
.hud--br { bottom: var(--hud-inset); right: var(--hud-inset); align-items: flex-end; text-align: right; }

.hud__bracket {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid transparent;
}

.hud--tl .hud__bracket { top: -2px; left: -2px; border-top-color: var(--hairline); border-left-color: var(--hairline); }
.hud--tr .hud__bracket { top: -2px; right: -2px; border-top-color: var(--hairline); border-right-color: var(--hairline); }
.hud--bl .hud__bracket { bottom: -2px; left: -2px; border-bottom-color: var(--hairline); border-left-color: var(--hairline); }
.hud--br .hud__bracket { bottom: -2px; right: -2px; border-bottom-color: var(--hairline); border-right-color: var(--hairline); }

.hud__line {
  font-family: var(--font-label);
  font-size: clamp(0.6rem, 1.4vw, 0.72rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hud-steel);
  opacity: 0.55;
  line-height: 1.6;
  white-space: nowrap;
}

.hud__line--status {
  color: var(--signal-cyan);
  opacity: 0.8;
  font-weight: 500;
  transition: color 0.4s ease, opacity 0.4s ease;
}

.hud__line--status.is-active {
  color: var(--signal-magenta);
  opacity: 1;
}

@media (max-width: 640px) {
  .hud--br { display: none; }
}

@media (max-width: 480px) {
  .hud--bl,
  .hud--tr { display: none; }
}

/* ---- Accessibility / fallback ----------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.noscript-fallback {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4rem, 22vw, 16rem);
  color: var(--signal-white);
  letter-spacing: 0.01em;
  z-index: 3;
}

/* Higher specificity than .noscript-fallback so it stays hidden until
   main.js explicitly shows it (inline style) on a WebGL failure. */
#fallback-static {
  display: none;
}
