/* Browsernaut Design Tokens */
:root {
  /* Palette — warm orbital dark */
  --bn-bg: #06070a;
  --bn-bg-elev: #0c0e14;
  --bn-bg-card: #11141c;
  --bn-line: rgba(255, 255, 255, 0.08);
  --bn-line-strong: rgba(255, 255, 255, 0.14);
  --bn-fg: #fafafa;
  --bn-fg-dim: rgba(250, 250, 250, 0.68);
  --bn-fg-muted: rgba(250, 250, 250, 0.42);
  --bn-fg-faint: rgba(250, 250, 250, 0.22);

  /* Accents */
  --bn-orange: #ff6b35;       /* orbital orange — thrust */
  --bn-orange-soft: #ff8a5c;
  --bn-orange-glow: rgba(255, 107, 53, 0.22);
  --bn-amber: #fbbf24;        /* star amber */
  --bn-cyan: #7dd3fc;          /* telemetry cyan — used sparingly */
  --bn-green: #4ade80;         /* ok/200 */
  --bn-red: #f87171;           /* err */

  /* Radii & spacing */
  --bn-r-xs: 4px;
  --bn-r-sm: 6px;
  --bn-r-md: 10px;
  --bn-r-lg: 14px;
  --bn-r-xl: 20px;
  --bn-r-pill: 999px;

  /* Type */
  --bn-font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
  --bn-font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Shadows */
  --bn-shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --bn-shadow-md: 0 8px 24px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.3);
  --bn-shadow-orange: 0 0 40px rgba(255,107,53,.25), 0 0 80px rgba(255,107,53,.08);
}

:root[data-theme="light"] {
  --bn-bg: #fafaf7;
  --bn-bg-elev: #ffffff;
  --bn-bg-card: #ffffff;
  --bn-line: rgba(10, 10, 10, 0.08);
  --bn-line-strong: rgba(10, 10, 10, 0.14);
  --bn-fg: #0a0a0a;
  --bn-fg-dim: rgba(10, 10, 10, 0.68);
  --bn-fg-muted: rgba(10, 10, 10, 0.5);
  --bn-fg-faint: rgba(10, 10, 10, 0.28);
  --bn-orange-glow: rgba(255, 107, 53, 0.18);
  --bn-shadow-md: 0 8px 24px rgba(12,14,24,.08), 0 2px 6px rgba(12,14,24,.04);
  --bn-shadow-orange: 0 0 40px rgba(255,107,53,.18), 0 0 80px rgba(255,107,53,.06);
}

/* Base */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bn-bg); color: var(--bn-fg); font-family: var(--bn-font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--bn-orange); color: #fff; }

/* Anchor scrolling is handled by shared/smooth-scroll.js (easeOutQuart with
   sticky-nav offset). We deliberately do NOT set CSS `scroll-behavior: smooth`
   because the JS animator and the browser's native smooth implementation can
   stack and cause double-stepping / jank when the user clicks rapidly.
   scroll-margin-top still helps — it keeps section tops below the sticky nav
   for direct hash navigation (e.g. when JS isn't loaded yet). */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
section[id] { scroll-margin-top: 88px; }

/* Shared utility */
.bn-mono { font-family: var(--bn-font-mono); font-feature-settings: "ss01", "ss02", "tnum"; }

/* Code highlight classes — used by BNCodeTabs */
.c-mute { color: var(--bn-fg-muted); }
.c-str  { color: #ffb86c; }
.c-kw   { color: var(--bn-orange); font-weight: 500; }
.c-fn   { color: #7dd3fc; }
.c-num  { color: var(--bn-amber); }
.bn-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--bn-font-mono); font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--bn-fg-dim);
  padding: 4px 10px; border: 1px solid var(--bn-line);
  border-radius: var(--bn-r-pill); background: var(--bn-bg-elev);
}
.bn-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bn-orange); box-shadow: 0 0 8px var(--bn-orange); }

.bn-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--bn-r-md);
  font-weight: 500; font-size: 14px; letter-spacing: -0.01em;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .12s ease, background .15s, border-color .15s, box-shadow .2s;
  white-space: nowrap;
}
.bn-btn-primary { background: var(--bn-orange); color: #fff; box-shadow: var(--bn-shadow-orange); }
.bn-btn-primary:hover { background: var(--bn-orange-soft); transform: translateY(-1px); }
.bn-btn-ghost { background: transparent; color: var(--bn-fg); border-color: var(--bn-line-strong); }
.bn-btn-ghost:hover { border-color: var(--bn-fg-dim); background: var(--bn-bg-elev); }

/* Starfield backdrop — subtle */
.bn-starfield {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.4) 0, transparent 2px),
    radial-gradient(1px 1px at 68% 42%, rgba(255,255,255,.3) 0, transparent 2px),
    radial-gradient(1px 1px at 82% 78%, rgba(255,255,255,.35) 0, transparent 2px),
    radial-gradient(1px 1px at 28% 88%, rgba(255,255,255,.28) 0, transparent 2px),
    radial-gradient(2px 2px at 48% 12%, rgba(255,180,120,.45) 0, transparent 3px),
    radial-gradient(1px 1px at 92% 22%, rgba(255,255,255,.35) 0, transparent 2px),
    radial-gradient(1px 1px at 6% 62%, rgba(255,255,255,.25) 0, transparent 2px);
  opacity: .6;
  pointer-events: none;
}
:root[data-theme="light"] .bn-starfield { display: none; }

/* Grid backdrop */
.bn-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--bn-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--bn-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}

/* Scroll reveal */
.bn-reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.bn-reveal.in { opacity: 1; transform: none; }

/* Blinking cursor */
@keyframes bn-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.bn-caret { display: inline-block; width: 8px; height: 1em; background: var(--bn-orange); vertical-align: text-bottom; animation: bn-blink 1s steps(1) infinite; margin-left: 2px; }

/* Common section */
.bn-section { position: relative; padding: 120px 0; }
.bn-container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.bn-eyebrow {
  font-family: var(--bn-font-mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--bn-orange); margin-bottom: 16px;
  display: inline-flex; align-items: center; gap: 10px;
}
.bn-eyebrow::before { content: ""; width: 20px; height: 1px; background: var(--bn-orange); }
.bn-h1 { font-size: clamp(44px, 6vw, 84px); font-weight: 600; letter-spacing: -0.035em; line-height: 0.98; margin: 0; }
.bn-h2 { font-size: clamp(32px, 4vw, 52px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 16px; }
.bn-lead { font-size: clamp(16px, 1.4vw, 19px); color: var(--bn-fg-dim); line-height: 1.55; max-width: 620px; }

/* Ticker line animation */
@keyframes bn-dash { to { stroke-dashoffset: -48; } }
.bn-dash { stroke-dasharray: 6 6; animation: bn-dash 2.4s linear infinite; }

/* Pulse */
@keyframes bn-pulse { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
.bn-pulse { animation: bn-pulse 2.4s ease-in-out infinite; }

/* Orbit sweep */
@keyframes bn-orbit { to { transform: rotate(360deg); } }

/* Noise overlay for cinematic variant */
.bn-noise::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay; opacity: .5;
}
