/* ═══════════════════════════════════════════════════════════════
   ReconAI — base.css
   Shared across all pages: tokens, reset, typography,
   nav, footer, buttons, rings, animations.
═══════════════════════════════════════════════════════════════ */

/* ── 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);
  --accent:       #e0202f;
  --accent-dim:   rgba(224, 32, 47, 0.10);
  --accent-glow:  rgba(224, 32, 47, 0.30);
  --blue:         #0076bc;
  --blue-dim:     rgba(0, 118, 188, 0.10);
  --blue-glow:    rgba(0, 118, 188, 0.22);
  --text:         #b4bad0;
  --muted:        #48526a;
  --white:        #eaf0fa;
  --ok:           #0076bc;
  --warn:         #f0a500;
  --danger:       #e0202f;
  --success:      #00c264;

  /* Status & indicator colors */
  --rec-red:      #ff5555;
  --error-light:  #ff7085;
  --info-light:   #5ab8ff;
  --thermal:      #ff8844;

  --nav-h:        68px;
  --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: 300;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Scanline overlay — subtle CRT effect */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.06) 3px,
    rgba(0, 0, 0, 0.06) 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 */
.logo-rec        { color: var(--accent); }
.logo-onai       { color: var(--blue); }
.logo-onai-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(--accent);
  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: var(--accent);
  flex-shrink: 0;
}

.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;
}

.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 ───────────────────────────────────────────────── */
.btn-primary {
  position: relative;
  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: 14px 32px;
  background: linear-gradient(135deg, var(--accent) 0%, #b81820 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: 0 4px 24px var(--accent-glow);
  transition: box-shadow var(--ease) 0.2s, filter var(--ease) 0.2s;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn-primary:hover::after { opacity: 1; }
.btn-primary:hover { box-shadow: 0 6px 32px var(--accent-glow); filter: brightness(1.08); }
.btn-primary: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: transparent;
  color: var(--text);
  border: 1px solid var(--border-mid);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), background 0.25s;
}
.btn-secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
}

/* ── 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.88);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.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;
  height: 28px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}
@media (max-width: 900px) {
  .nav-logo img {
    height: 24px;
    max-width: 140px;
  }
}
@media (max-width: 480px) {
  .nav-logo img {
    height: 20px;
    max-width: 120px;
  }
}

.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: var(--accent);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover,
.nav-links a.active { color: var(--white); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

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

/* Nav CTA button */
.nav-cta {
  position: relative;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  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%, #b01020 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 {
  color: var(--white);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}
.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(--text);
  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 */
.nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: rgba(5, 6, 12, 0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 24px 24px 32px;
  flex-direction: column;
  gap: 0;
  z-index: 499;
}
.nav-drawer.open { display: flex; }
.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;
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a:hover { color: var(--white); }

/* ── FOOTER ────────────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--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 {
  height: auto;
  max-height: 24px;
  max-width: min(160px, 40vw);
  width: auto;
  display: inline-block;
  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(--blue); }

/* ── 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: 120px; height: 120px;
  border-radius: 50%;
  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;
  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: 76px;
  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; }
}

/* ── FOCUS STYLES ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--blue);
  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; }
  .status-bar   { left: 20px; right: 20px; gap: 14px; }
}

/* ── 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;
  }
}
