/* ========================================
   SKIP NAV
   ======================================== */
.skip-nav {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-nav:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
  z-index: 9999;
  overflow: visible;
}

/* ========================================
   NAVIGATION
   ======================================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 clamp(24px, 5vw, 48px);
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a[aria-current="page"] { color: var(--text-primary); }

.nav-cta {
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--bg-primary) !important;
  background: var(--accent);
  padding: 10px 20px;
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.2s !important;
}

.nav-cta:hover {
  background: var(--accent-hover) !important;
  transform: translateY(-1px);
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
}

.nav-mobile-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-mobile-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-mobile-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-mobile-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ========================================
   FOOTER
   ======================================== */
footer {
  padding: 40px 0;
  text-align: center;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

footer p {
  font-size: 12px;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
}

footer p:last-child {
  font-size: 12px;
  margin-top: 6px;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 18px;
}
.footer-social a {
  color: var(--text-muted);
  display: inline-flex;
  transition: color 0.2s, transform 0.2s;
}
.footer-social a:hover { color: var(--accent); transform: translateY(-1px); }
.footer-social svg { width: 18px; height: 18px; fill: currentColor; display: block; }

/* ========================================
   MEASUREMENT SURFACE  (shared page background, every page)
   Corner glows (cool top-right, gold top-left) over a faint engineering grid
   that fades downward, masked, behind the content. Replicates the benchmark
   page's top treatment site-wide. `html body` beats each page's flat inline
   `body { background }`; main/footer ride above the fixed grid layer.
   ======================================== */
html body {
  background:
    radial-gradient(120% 60% at 82% -10%, rgba(106,166,234,0.10), transparent 58%),
    radial-gradient(120% 55% at -8% -4%, rgba(220,184,117,0.11), transparent 54%),
    var(--bg-primary);
  background-attachment: fixed;
}
html body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(232,228,222,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,228,222,0.022) 1px, transparent 1px),
    linear-gradient(rgba(232,228,222,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,228,222,0.05) 1px, transparent 1px);
  background-size: 38px 38px, 38px 38px, 190px 190px, 190px 190px;
  -webkit-mask-image: radial-gradient(135% 92% at 50% -8%, #000 28%, rgba(0,0,0,0.32) 60%, transparent 86%);
  mask-image: radial-gradient(135% 92% at 50% -8%, #000 28%, rgba(0,0,0,0.32) 60%, transparent 86%);
}
body > main, body > footer { position: relative; z-index: 1; }
/* Page-level guard: a too-wide element must never widen the page and push the
   fixed nav (hamburger) off-screen on mobile. clip (not hidden) keeps sticky working. */
html { overflow-x: clip; }

/* ========================================
   RESPONSIVE / NAV
   ======================================== */
@media (max-width: 640px) {
  .nav-links { display: none; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    padding: 24px clamp(24px, 5vw, 48px);
    gap: 20px;
    border-bottom: 1px solid var(--border);
  }

  .nav-mobile-toggle { display: block; }
}

/* ========================================
   KEYBOARD FOCUS  (WCAG 2.2 / Focus Visible)
   One gold ring for keyboard users on every interactive element. Shows only
   for keyboard navigation (:focus-visible), never on mouse click. The 2px
   offset keeps the ring on the dark background, so it stays visible even on
   the gold buttons.
   ======================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ========================================
   BUTTON PRESS  (micro-interaction / tactile feedback on click)
   Hover lifts the button; active presses it back down.
   ======================================== */
.btn-primary:active,
.nav-cta:active,
.sticky-cta-btn:active {
  transform: translateY(0) !important;
}

/* ========================================
   REDUCED MOTION / respect the user's system preference.
   Neutralises the decorative animation (radar rings, gold shimmer, CTA glow)
   and the scroll-reveal slide; content simply appears. (index / fit-score /
   pilot / about had no guard; benchmark / methodology already did.)
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-delay-1, .reveal-delay-2, .reveal-delay-3,
  .bench-reveal, .bench-anim, .bench-fade, .meth-anim {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-radar-ring { display: none !important; }
}
