/* ═══════════════════════════════════════════════════════════════
   Montreal ESK8 — base.css (PR-13 Jarvis HUD)
   Shared: tokens, ambient HUD, nav, footer, buttons, panels.
═══════════════════════════════════════════════════════════════ */

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
ul, ol { list-style: none; }

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  --bg:           #05060c;
  --surface:      #08091a;
  --surface-2:    #0c0e1d;
  --card:         #0d0f1e;
  --card-hover:   #111428;
  --border:       rgba(50, 85, 200, 0.13);
  --border-mid:   rgba(50, 85, 200, 0.22);
  --border-bright:rgba(50, 85, 200, 0.38);
  /* Brand red family (PR-37) — one source of truth; use these, not ad-hoc hex */
  --accent:       #e0202f;                          /* brand red — dominant */
  --accent-hot:   #ff2a3d;                          /* interactive / highlight (same hue family) */
  --accent-deep:  #8a0a14;                          /* gradient ends / pressed depth */
  --accent-dim:   rgba(224, 32, 47, 0.10);
  --accent-glow:  rgba(224, 32, 47, 0.30);
  /* PR-45 / DIP-81 — primary CTA glow ladder (rest → hover expand → active compress) */
  --btn-primary-shadow:        0 0 0 1px var(--accent-glow), 0 4px 24px var(--accent-glow);
  --btn-primary-shadow-hover:  0 0 0 1px var(--accent-glow), 0 8px 36px var(--accent-glow);
  --btn-primary-shadow-active: 0 0 0 1px var(--accent-glow), 0 2px 14px var(--accent-glow);
  /* PR-78 / DIP-114 — primary CTA label scale (shared by .btn-primary + .nav-cta) */
  --btn-primary-font-size:     0.76rem;
  --btn-primary-font-weight:   400;
  --btn-primary-letter-spacing: 0.12em;
  --blue:         #0076bc;
  --blue-dim:     rgba(0, 118, 188, 0.10);
  --blue-glow:    rgba(0, 118, 188, 0.22);
  --cyan:         #00d4ff;
  --cyan-dim:     rgba(0, 212, 255, 0.08);
  --cyan-glow:    rgba(0, 212, 255, 0.35);
  --glass:        rgba(8, 12, 29, 0.72);
  --glass-border: rgba(0, 212, 255, 0.18);
  --grid-line:    rgba(0, 118, 188, 0.06);
  --text:         #b4bad0;
  --muted:        #6b7a99;
  --white:        #eaf0fa;
  --ok:           #0076bc;
  --warn:         #f0a500;
  --danger:       var(--accent);                    /* semantic danger = brand red, not a second red */
  --success:      #00c264;

  /* Status & indicator colors (not brand — keep distinct from --accent) */
  --rec-red:      #ff5555;
  --error-light:  #ff7085;
  --info-light:   #5ab8ff;
  --thermal:      #ff8844;

  --nav-h:        80px;
  --logo-w:       300px;
  --logo-h:       150px;
  --logo-nav-h:   52px;
  --logo-footer-h: 40px;
  --ease:         cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out:     cubic-bezier(0.0, 0.0, 0.2, 1);
}

/* ── BASE BODY ─────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Ambient HUD — vignette + coordinate grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 85% 15%, rgba(0, 212, 255, 0.06), transparent 55%),
    radial-gradient(ellipse 70% 50% at 10% 85%, rgba(224, 32, 47, 0.05), transparent 50%),
    radial-gradient(ellipse 100% 100% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Scanline + grid overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, 0.05) 3px, rgba(0, 0, 0, 0.05) 4px);
  background-size: 48px 48px, 48px 48px, 100% 4px;
  pointer-events: none;
  z-index: 9000;
}

/* ── SKIP LINK ─────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--white);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  z-index: 99999;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ── TYPOGRAPHY HELPERS ────────────────────────────────────── */
.font-mono  { font-family: 'Share Tech Mono', monospace; }
.font-bebas { font-family: 'Bebas Neue', sans-serif; }

/* Brand name segments */
.text-accent     { color: var(--accent); }
.text-blue       { color: var(--blue); }
.text-blue-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--blue);
}

/* Section labels & titles */
.section-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  flex-shrink: 0;
}
.section-label.label-red { color: var(--accent); }
.section-label.label-red::before { background: linear-gradient(90deg, var(--accent), transparent); }

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  color: var(--white);
  letter-spacing: 0.05em;
  line-height: 0.95;
  margin-bottom: 20px;
  text-shadow: 0 0 40px rgba(0, 212, 255, 0.08);
}

.section-sub {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.85;
  max-width: 520px;
  margin-bottom: 56px;
}

/* ── TEXT SIZE UTILITIES ───────────────────────────────────── */
.p1 { font-size: 8px; }
.p2 { font-size: 10px; }
.p3 { font-size: 12px; }

/* ── BUTTONS ───────────────────────────────────────────────── */
/* PR-45 / DIP-81: shared rest/hover/active glow for primary CTAs (.btn-primary + .nav-cta) */
/* PR-78 / DIP-114: shared font-size / weight / tracking for primary CTA labels */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: var(--btn-primary-font-size);
  font-weight: var(--btn-primary-font-weight);
  letter-spacing: var(--btn-primary-letter-spacing);
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--white);
  border: none;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  box-shadow: var(--btn-primary-shadow);
  transition: box-shadow 0.25s, filter 0.25s;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.5s;
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:hover {
  box-shadow: var(--btn-primary-shadow-hover);
  filter: brightness(1.08);
}
.btn-primary:active {
  box-shadow: var(--btn-primary-shadow-active);
  filter: brightness(0.92);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 30px;
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid rgba(0, 212, 255, 0.35);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.btn-secondary:hover {
  background: rgba(0, 212, 255, 0.14);
  border-color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow);
}

/* ── NAV ───────────────────────────────────────────────────── */
nav:not(.nav-drawer):not(.footer-links):not(.sfn-right):not(.sidebar-nav) {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: rgba(5, 6, 12, 0.65);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 var(--cyan-glow), 0 8px 32px rgba(0, 0, 0, 0.35);
}

.nav-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.55rem;
  letter-spacing: 0.16em;
  color: var(--white);
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}
.nav-logo img {
  display: block;
  width: auto;
  height: var(--logo-nav-h);
  max-width: min(var(--logo-w), 42vw);
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.2));
  transition: filter 0.3s;
}
.nav-logo:hover img {
  filter: drop-shadow(0 0 14px rgba(0, 212, 255, 0.45));
}
@media (max-width: 900px) {
  .nav-logo img {
    height: 44px;
    max-width: min(220px, 40vw);
  }
}
@media (max-width: 480px) {
  .nav-logo img {
    height: 36px;
    max-width: min(180px, 38vw);
  }
}

.nav-links {
  display: flex;
  gap: 36px;
}
.nav-links a {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--accent));
  box-shadow: 0 0 8px var(--cyan-glow);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover,
.nav-links a.active { color: var(--white); }
.nav-links a.active::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse 2s ease-in-out infinite;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* Language switcher */
.nav-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  flex-shrink: 0;
}
.nav-lang-btn {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  padding: 4px 6px;
  cursor: pointer;
  transition: color 0.2s;
}
.nav-lang-btn:hover,
.nav-lang-btn.active { color: var(--white); }
.nav-lang-btn.active { color: var(--accent); }
.nav-lang-sep {
  color: var(--border-bright);
  font-size: 0.65rem;
  user-select: none;
}

/* Coming-soon links */
.nav-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.nav-disabled::after { display: none !important; }

/* Nav CTA button — PR-78: same label scale as .btn-primary */
.nav-cta {
  position: relative;
  font-family: 'Share Tech Mono', monospace;
  font-size: var(--btn-primary-font-size);
  font-weight: var(--btn-primary-font-weight);
  letter-spacing: var(--btn-primary-letter-spacing);
  text-transform: uppercase;
  min-width: 114px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--blue);
  color: var(--blue);
  background: transparent;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  overflow: hidden;
  transition: color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.nav-cta-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  transform: translateX(-105%);
  transition: transform 0.35s var(--ease);
  pointer-events: none;
}
.nav-cta:hover .nav-cta-fill,
.nav-cta:focus .nav-cta-fill { transform: translateX(0); }
.nav-cta:hover,
.nav-cta:focus-visible {
  color: var(--white);
  border-color: var(--accent);
  /* PR-45: same hover glow ladder as .btn-primary */
  box-shadow: var(--btn-primary-shadow-hover);
}
.nav-cta:active {
  box-shadow: var(--btn-primary-shadow-active);
  filter: brightness(0.92);
}
.nav-cta-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 0 20px;
  text-decoration: none;
  color: inherit;
}
.nav-cta-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan-glow);
  transition: transform 0.3s, opacity 0.3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile nav drawer — PR-38: HUD-cinematic open (opacity/transform, not display toggle) */
.nav-drawer {
  display: flex;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: rgba(5, 6, 12, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  border-left: 3px solid var(--cyan);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(0, 212, 255, 0.08);
  padding: 24px 24px 32px;
  flex-direction: column;
  gap: 0;
  z-index: 499;
  /* closed state: stay in layout for transition, block interaction */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transform-origin: top center;
  transition:
    opacity 0.32s var(--ease),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0.4s,
    box-shadow 0.4s var(--ease);
}
.nav-drawer.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity 0.28s var(--ease),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0s,
    box-shadow 0.4s var(--ease);
}
/* cyan edge wash on open (cinematic scan feel) */
.nav-drawer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.nav-drawer.open::before { opacity: 0.85; }

.nav-drawer a {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, opacity 0.3s var(--ease), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translateX(-10px);
}
.nav-drawer.open a {
  opacity: 1;
  transform: translateX(0);
}
.nav-drawer.open a:nth-child(1) { transition-delay: 0.04s; }
.nav-drawer.open a:nth-child(2) { transition-delay: 0.07s; }
.nav-drawer.open a:nth-child(3) { transition-delay: 0.1s; }
.nav-drawer.open a:nth-child(4) { transition-delay: 0.13s; }
.nav-drawer.open a:nth-child(5) { transition-delay: 0.16s; }
.nav-drawer.open a:nth-child(6) { transition-delay: 0.19s; }
.nav-drawer.open a:nth-child(7) { transition-delay: 0.22s; }
.nav-drawer.open a:nth-child(8) { transition-delay: 0.25s; }
.nav-drawer.open a:nth-child(n+9) { transition-delay: 0.28s; }
.nav-drawer:not(.open) a { transition-delay: 0s; }

.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a:hover { color: var(--cyan); }

/* PR-38: dedicated scrim (do not use body::after — that is the grid overlay) */
.nav-scrim {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--nav-h);
  background: rgba(0, 0, 0, 0.35);
  z-index: 498;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.32s var(--ease);
}
.nav-scrim.is-visible {
  display: block;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .nav-drawer,
  .nav-drawer.open,
  .nav-drawer a,
  .nav-drawer.open a {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    transform: none !important;
  }
  .nav-scrim { transition: none; }
}

/* PR-23: drawer lang + sign-out were inline on dashboard-template (and peers) */
.nav-drawer .nav-lang {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.nav-drawer #signOutMobile {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  padding: 14px 0;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

/* ── FOOTER ────────────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--glass-border);
  padding: 40px 48px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

.footer-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.16em;
}
.footer-logo img {
  display: inline-block;
  width: auto;
  height: var(--logo-footer-h);
  max-width: min(200px, 40vw);
  object-fit: contain;
}

.footer-copy {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.footer-links a {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--cyan); }

/* PR-25 / DIP-59 — site build version under footer */
/* PR-56 / DIP-92 — no overlap with footer-copy at narrow mobile widths */
.site-version {
  display: block;
  position: relative;
  z-index: 1;
  clear: both;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-align: center;
  opacity: 0.65;
  margin: 10px 0 0;
  padding: 10px 16px 20px;
  line-height: 1.45;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  pointer-events: none;
}

/* ── HUD PANELS & UTILITIES (PR-13) ─────────────────────────── */
.hud-panel {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border: 1px solid var(--glass-border);
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.hud-panel::before,
.hud-panel::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 2;
}
.hud-panel::before {
  top: 8px; left: 8px;
  border-top: 2px solid var(--cyan);
  border-left: 2px solid var(--cyan);
  opacity: 0.7;
}
.hud-panel::after {
  bottom: 8px; right: 8px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  opacity: 0.7;
}
.hud-panel:hover {
  border-color: rgba(0, 212, 255, 0.35);
  box-shadow: 0 0 48px rgba(0, 212, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.hud-panel-sweep {
  position: absolute;
  left: 0; right: 0;
  height: 40%;
  top: -40%;
  background: linear-gradient(180deg, transparent, rgba(0, 212, 255, 0.06), transparent);
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}
.hud-panel:hover .hud-panel-sweep { animation: hud-panel-sweep 1.2s var(--ease) forwards; }

.hud-radar-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(0, 212, 255, 0.2);
  animation: spin 30s linear infinite;
  pointer-events: none;
}
.hud-radar-ring::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, var(--cyan-glow) 30deg, transparent 60deg);
  animation: spin 4s linear infinite;
  opacity: 0.5;
}
.hud-radar-ring-outer {
  width: 480px; height: 480px;
  border-color: rgba(224, 32, 47, 0.12);
  animation-duration: 45s;
  animation-direction: reverse;
}
.hud-radar-ring-inner { width: 420px; height: 420px; }

.hud-glitch {
  display: inline-block;
  position: relative;
  text-shadow: 0 0 30px var(--accent-glow);
}
.hud-glitch.is-animating { animation: hud-glitch 4s infinite; }

.hud-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.hud-reveal.is-visible { opacity: 1; transform: translateY(0); }

.hud-cta-radar {
  position: absolute;
  left: 50%; top: 50%;
  width: 360px; height: 360px;
  margin: -180px 0 0 -180px;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.08);
  pointer-events: none;
}
.hud-cta-radar::before {
  content: '';
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  border: 1px dashed rgba(224, 32, 47, 0.1);
  animation: spin 20s linear infinite;
}

.hud-led {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* ── SHARED RING ANIMATION ──────────────────────────────────── */
.recon-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  animation: spin 20s linear infinite;
}
.ring-1 { width: 380px; height: 380px; border-color: rgba(0, 118, 188, 0.16); }
.ring-2 { width: 280px; height: 280px; border-style: dashed; border-color: rgba(224, 32, 47, 0.18); animation-duration: 12s; animation-direction: reverse; }
.ring-3 { width: 180px; height: 180px; border-color: rgba(0, 118, 188, 0.22); animation-duration: 8s; }

.recon-dot {
  position: absolute;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--accent);
  top: calc(50% - 190px);
  left: 50%;
  transform-origin: 0 190px;
  animation: orbit 20s linear infinite;
}

.scan-beam {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.45;
  animation: scan 3s ease-in-out infinite;
  top: 50%;
}

.logo-center {
  width: min(var(--logo-w), 88vw);
  height: min(var(--logo-h), 44vw);
  border-radius: 14px;
  background: var(--card);
  border: 1px solid rgba(0, 118, 188, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  padding: 8px 12px;
  box-shadow: 0 0 40px rgba(0, 118, 188, 0.10), inset 0 0 24px rgba(224, 32, 47, 0.05);
}
.logo-center img {
  width: min(var(--logo-w), 82vw);
  height: min(var(--logo-h), 41vw);
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 0 10px rgba(224, 32, 47, 0.55));
}

/* Corner data readout */
.corner-data {
  position: absolute;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.52rem;
  color: rgba(224, 32, 47, 0.4);
  letter-spacing: 0.1em;
  line-height: 1.9;
}
.corner-data.tl { top: 20px; left: 20px; }
.corner-data.br { bottom: 20px; right: 20px; text-align: right; }

/* ── STATUS BAR ────────────────────────────────────────────── */
.status-bar {
  position: absolute;
  bottom: 40px;
  left: 48px;
  right: 48px;
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}
.status-item {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
.status-item:nth-child(even) .status-dot { background: var(--blue); }

/* ── KEYFRAMES ─────────────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes orbit   { to { transform: rotate(360deg); } }
@keyframes pulse   { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes scan    { 0%, 100% { top: 15%; opacity: 0; } 50% { top: 85%; opacity: 0.55; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes hud-panel-sweep {
  0% { top: -40%; opacity: 0; }
  20% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
@keyframes hud-glitch {
  0%, 90%, 100% { transform: translate(0); clip-path: inset(0 0 0 0); }
  91% { transform: translate(-2px, 1px); clip-path: inset(20% 0 60% 0); }
  92% { transform: translate(2px, -1px); clip-path: inset(60% 0 10% 0); }
  93% { transform: translate(-1px, 2px); clip-path: inset(40% 0 30% 0); }
}

/* ── BACK TO TOP (PR-92 / DIP-128) ─────────────────────────── */
.back-to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  z-index: 4800;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--cyan);
  box-shadow:
    0 0 0 1px rgba(0, 212, 255, 0.08),
    0 8px 28px rgba(0, 0, 0, 0.45),
    0 0 20px rgba(0, 212, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.22s var(--ease-out),
    transform 0.22s var(--ease-out),
    visibility 0.22s,
    border-color 0.18s,
    color 0.18s,
    box-shadow 0.18s,
    background 0.18s;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  color: var(--white);
  border-color: rgba(0, 212, 255, 0.42);
  background: rgba(8, 12, 29, 0.88);
  box-shadow:
    0 0 0 1px rgba(0, 212, 255, 0.16),
    0 10px 32px rgba(0, 0, 0, 0.5),
    0 0 28px rgba(0, 212, 255, 0.22);
}
.back-to-top:active {
  transform: translateY(1px) scale(0.97);
}
.back-to-top:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.back-to-top__icon {
  display: block;
  width: 18px;
  height: 18px;
}

/* ── FOCUS STYLES ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible { border-radius: 2px; }

/* ── UTILITY ───────────────────────────────────────────────── */
.mb-0  { margin-bottom: 0 !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── RESPONSIVE NAV ────────────────────────────────────────── */
@media (max-width: 900px) {
  nav:not(.nav-drawer):not(.footer-links):not(.sfn-right):not(.sidebar-nav) {
    padding: 0 20px;
  }
  .nav-links { display: none; }
  .nav-cta   { display: none; }
  .nav-hamburger { display: flex; }
  footer {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 32px 20px;
    gap: 16px;
  }
  .footer-links { justify-content: center; }
  .footer-copy  {
    order: 3;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding-inline: 4px;
  }
  /* PR-56: keep version line clear of stacked footer-copy / links */
  .site-version {
    margin-top: 4px;
    padding: 12px 14px 24px;
    letter-spacing: 0.04em;
    font-size: 0.62rem;
  }
  .status-bar   { left: 20px; right: 20px; gap: 14px; }
}

@media (max-width: 400px) {
  .site-version {
    padding-left: 10px;
    padding-right: 10px;
    letter-spacing: 0.02em;
  }
  .footer-copy {
    letter-spacing: 0.05em;
  }
}

/* ── REDUCED MOTION ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:      0.01ms !important;
    animation-iteration-count: 1   !important;
    transition-duration:     0.01ms !important;
    scroll-behavior:         auto  !important;
  }
  .hud-glitch.is-animating { animation: none; }
}
