/* ============================================================
   Northern Edge Software — immersive.css
   Layered on TOP of styles.css + enhance.css.
   Owns: richer accent palette, the scroll-altitude JOURNEY background
   (canvas world + grain + chapter rail + flight HUD), translucent
   panel tuning, and the cinematic cattle-ISR hero scene.
   Self-contained: safe to drop onto every page.
   ============================================================ */

/* ---------- Richer accent palette (extends :root) ---------- */
:root {
  /* keep the deep navy base, push the accents brighter + add new hues */
  --cyan: #6fe0ff;
  --cyan-strong: #3cc6ff;
  --blue: #4b8dff;
  --blue-strong: #2f6fff;
  --amber: #f4b65a;
  --amber-strong: #ffce82;
  --magenta: #b56cff;
  --teal: #34ddcf;

  --glow-cyan: rgba(111, 224, 255, 0.55);
  --glow-amber: rgba(244, 182, 90, 0.5);
  --glow-blue: rgba(75, 141, 255, 0.5);
  --glow-magenta: rgba(181, 108, 255, 0.5);

  /* panels go a touch more translucent so the live background reads through */
  --panel-alpha: 0.6;
}

/* CRITICAL: move the opaque base off <body> so the fixed .nes-bg (negative
   z-index) is actually visible. An opaque body background paints OVER any
   negative-z layer, which is why the original grain/vignette barely showed. */
html {
  background:
    radial-gradient(1150px 560px at 18% -12%, rgba(28, 100, 172, 0.20), transparent 62%),
    radial-gradient(980px 480px at 95% 3%, rgba(58, 128, 188, 0.16), transparent 56%),
    linear-gradient(180deg, #02070f 0%, #020a13 52%, #01060d 100%);
  background-attachment: fixed;
}
body {
  background: transparent !important;
}

/* ============================================================
   1. SITE-WIDE REACTIVE BACKGROUND
   Injected by immersive.js as: .nes-bg > (aurora, grid, canvas, scan)
   ============================================================ */

/* ============================================================
   1. THE JOURNEY — site-wide scroll-altitude background
   Injected by immersive.js as:
   .nes-bg > (canvas.nes-bg__canvas, .nes-bg__grain)
   plus fixed chrome: .nes-rail (chapter rail), .nes-hud (flight HUD)
   The canvas paints a continuous flight: pasture -> survey -> AI
   layer -> cloud platform -> orbit -> dawn return. immersive.js
   drives it from scroll position; this file owns the chrome.
   ============================================================ */
.nes-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  pointer-events: none;
  background: #02070f;
}
.nes-bg__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* photographic film grain over the whole world (generated texture) */
.nes-bg__grain {
  position: absolute;
  inset: -8px;
  background: url("assets/journey/grain.png") repeat;
  background-size: 256px 256px;
  opacity: 0.07;
  mix-blend-mode: overlay;
  animation: nes-grain-shift 0.9s steps(3) infinite;
}
@keyframes nes-grain-shift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-4px, 3px); }
  66%  { transform: translate(3px, -4px); }
  100% { transform: translate(0, 0); }
}
/* click surge: brief exposure lift on the whole world */
.nes-bg.is-surge .nes-bg__canvas { filter: brightness(1.18) saturate(1.12); }
.nes-bg__canvas { transition: filter 0.45s ease; }

/* ---------- Chapter rail (right edge) ---------- */
.nes-rail {
  position: fixed;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-end;
  font-family: "JetBrains Mono", monospace;
}
.nes-rail__stop {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.18rem 0;
  background: none;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
  color: #9fb6c6;
}
.nes-rail__label {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.25s ease;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}
.nes-rail__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(159, 182, 198, 0.7);
  background: transparent;
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  flex: 0 0 auto;
}
.nes-rail__stop:hover .nes-rail__label,
.nes-rail__stop.is-active .nes-rail__label { opacity: 1; transform: translateX(0); }
.nes-rail__stop.is-active .nes-rail__label { color: var(--cyan); }
.nes-rail__stop.is-active .nes-rail__dot {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 12px var(--glow-cyan);
}
.nes-rail__line {
  align-self: flex-end;
  width: 1px;
  height: 1.4rem;
  margin-right: 3px;
  background: linear-gradient(180deg, transparent, rgba(159, 182, 198, 0.4), transparent);
}

/* ---------- Flight HUD (bottom left) ---------- */
.nes-hud {
  position: fixed;
  left: 1.2rem;
  bottom: 1.1rem;
  z-index: 90;
  pointer-events: none;
  font-family: "JetBrains Mono", monospace;
  color: #cfe0e8;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(111, 224, 255, 0.22);
  border-radius: 8px;
  background: rgba(4, 14, 24, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.nes-hud__alt {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--amber-strong);
  min-width: 5.2ch;
  text-shadow: 0 0 14px rgba(244, 182, 90, 0.4);
}
.nes-hud__chapter {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}
.nes-hud__sub {
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: #93a8b8;
}

@media (max-width: 880px) {
  .nes-rail { display: none; }
  .nes-hud { left: 0.7rem; bottom: 0.7rem; padding: 0.4rem 0.6rem; }
  .nes-hud__alt { font-size: 1.15rem; }
  .nes-hud__sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nes-bg__grain { animation: none; }
}

/* ============================================================
   2. PANEL TUNING — let the live background read through
   ============================================================ */
.frame {
  background: linear-gradient(160deg, rgba(6, 18, 32, 0.66), rgba(4, 12, 22, 0.72));
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}
.glass-card {
  background: linear-gradient(155deg, rgba(7, 20, 35, 0.62), rgba(5, 14, 25, 0.68));
}
.impact-card, .cap-card, .process-step, .testimonial {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.frame-impact {
  background: linear-gradient(135deg, rgba(8, 22, 38, 0.6), rgba(4, 14, 26, 0.5));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.command-shell {
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}

/* ============================================================
   3. VIBRANCY POLISH — brighter, more inviting accents
   ============================================================ */
.btn-primary {
  background: linear-gradient(140deg, #c8882f, #f4b65a 60%, #ffd591 100%);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 206, 130, 0.2),
              0 8px 30px var(--glow-amber);
}
.btn-primary:hover, .btn-primary:focus-visible {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 24px var(--glow-amber);
}
.btn-secondary:hover, .btn-secondary:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 22px var(--glow-cyan);
}
.nes-scroll-progress {
  height: 3px;
  background: linear-gradient(90deg, var(--blue-strong), var(--cyan) 50%, var(--amber));
  box-shadow: 0 0 18px var(--glow-cyan);
}
.marquee-item .dot { box-shadow: 0 0 16px var(--glow-amber); }
.hero-stat strong { text-shadow: 0 0 18px var(--glow-cyan); }
.cap-card:hover { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 24px var(--glow-cyan); }
.cap-card[data-tone="gold"]:hover { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 24px var(--glow-amber); }
.impact-card:hover { box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 22px var(--glow-amber); }
.eyebrow { text-shadow: 0 0 16px rgba(255, 206, 130, 0.35); }

/* click ripple that radiates from buttons/links (drawn by immersive.js) */
.nes-ripple {
  position: fixed;
  z-index: 240;
  pointer-events: none;
  border-radius: 50%;
  border: 1.5px solid var(--cyan);
  box-shadow: 0 0 22px var(--glow-cyan), inset 0 0 18px var(--glow-cyan);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0.9;
  mix-blend-mode: screen;
}
.nes-ripple.is-amber { border-color: var(--amber); box-shadow: 0 0 22px var(--glow-amber), inset 0 0 18px var(--glow-amber); }
@keyframes nes-ripple-go {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ============================================================
   4. HERO MISSION REEL
   Markup (index.html): .mission-scene > canvas#mission-canvas-reel
   + .mission-hud (corners, pill with live mission tag + dots)
   The canvas paints each scene's full sky/world; this container
   just frames it. Driven by mission-reel.js.
   ============================================================ */
.mission-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  background: #060b14;
}
.mission-scene__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.mission-hud {
  position: absolute;
  inset: 0;
  z-index: 4;
  font-family: "JetBrains Mono", monospace;
  color: #eafff6;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}
.mission-hud__corner {
  position: absolute;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  line-height: 1.5;
  padding: 0.5rem 0.66rem;
  border: 1px solid rgba(111, 224, 255, 0.4);
  border-radius: 7px;
  background: rgba(6, 18, 30, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.mission-hud__corner b { color: var(--cyan); font-weight: 700; }
.mission-hud__corner--tl { top: 0.7rem; left: 0.7rem; }
.mission-hud__corner--tr { top: 0.7rem; right: 0.7rem; text-align: right; }

/* mission pill: bottom center — current mission + progress dots */
.mission-pill {
  position: absolute;
  left: 50%; bottom: 1rem;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(244, 182, 90, 0.5);
  background: rgba(6, 18, 30, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 22px rgba(244, 182, 90, 0.25);
  white-space: nowrap;
}
.mission-pill__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 12px var(--teal);
  animation: mission-blink 1.3s ease-in-out infinite;
  flex: 0 0 auto;
}
@keyframes mission-blink { 50% { opacity: 0.3; } }
.mission-pill__tag {
  display: block;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.06em;
  color: var(--amber-strong);
}
.mission-pill__sub {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cfe0e8;
}
.mission-dots {
  display: flex;
  gap: 0.32rem;
  margin-left: 0.2rem;
}
.mission-dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(159, 182, 198, 0.35);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.mission-dots span.is-on {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--glow-cyan);
}

@media (max-width: 720px) {
  .mission-hud__corner { font-size: 0.55rem; }
  .mission-pill { gap: 0.5rem; padding: 0.4rem 0.7rem; }
  .mission-pill__tag { font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .mission-pill__dot { animation: none; }
}
