/* ============================================================================
   STEALTH.CSS — shared design system
   Extracted from the stealth.org redesign (single source of truth for a new
   project). Dark, editorial, hairline-driven. Two typefaces only:
     • Inter         — display, headings, body
     • IBM Plex Mono — labels, data, nav, meta ("data voice")

   USAGE
     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link rel="stylesheet" href="stealth.css">
     (the @import below also pulls the fonts if you prefer no <link>)

   JS-DEPENDENT PIECES (CSS here, behaviour is yours to wire):
     • .sb-* custom scrollbar  — ticks/thumb/label positioned by a scroll script
     • .reveal                 — add .in via IntersectionObserver to animate
     • .sect-rail a.is-active   — toggled by a scroll-spy script
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&family=IBM+Plex+Mono:wght@300;400;500;600&display=swap');

/* ----------------------------------------------------------------------------
   1. DESIGN TOKENS
   Single brand red (#e7011f) used on every red surface, decorative or textual.
   Hairlines are the structural language — three weights, never heavier.
   -------------------------------------------------------------------------- */
:root {
  /* surfaces */
  --bg:          #000000;   /* page background */
  --bg-alt:      #0a0a0a;   /* cards / lifted surfaces */
  --bg-raised:   #0e0e0e;   /* deeper hierarchy */
  --bg-hover:    #151515;   /* hover state */

  /* hairlines / borders */
  --border:      #303030;   /* visible hairline */
  --border-ui:   #6a6a6a;   /* interactive UI border — meets WCAG 1.4.11 (≥3:1) */
  --border-soft: #252525;   /* soft hairline */
  --rule:        #404040;   /* structural divider — one step above --border */

  /* text */
  --text-hi:     #ffffff;   /* pure white emphasis */
  --text:        #ededed;   /* primary text */
  --text-sec:    #9a9a9a;   /* secondary / labels */
  --text-mute:   #858585;   /* muted / meta (AA: 5.06:1 on --bg) */
  --text-dim:    #4a4a4a;   /* very dim */

  /* brand */
  --red:         #e7011f;   /* LOCKED. Vivid but editorial; single brand red. */
  --red-soft:    rgba(231,1,31,0.35);

  /* composed */
  --hairline:        1px solid var(--border);
  --hairline-soft:   1px solid var(--border-soft);

  /* type families */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

/* ----------------------------------------------------------------------------
   2. RESET + ROOT
   -------------------------------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-feature-settings: "ss01", "cv11", "tnum";
  color-scheme: dark;
  scrollbar-width: none;          /* Firefox — we paint our own scrollbar */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.wrap { position: relative; z-index: 1; }

/* hide native scrollbar (WebKit/Blink: Safari, Chrome, Edge) */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ----------------------------------------------------------------------------
   3. ACCESSIBILITY
   Brand-red focus ring ties focus into the red-hairline motif.
   -------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 1px;
}
:focus:not(:focus-visible) { outline: none; }

a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* anchor jumps clear the sticky header */
section.sect, .subsect { scroll-margin-top: 164px; }
@media (max-width: 900px) {
  section.sect, .subsect { scroll-margin-top: 48px; }
}

/* skip-to-content (WCAG 2.4.1) */
.skip-link {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden; z-index: 10000;
}
.skip-link:focus {
  position: fixed; left: 16px; top: 16px; width: auto; height: auto;
  padding: 12px 16px;
  background: var(--bg); color: var(--text-hi);
  border: 2px solid var(--red);
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; outline: none;
}

/* ----------------------------------------------------------------------------
   4. TYPOGRAPHY SCALE
   Sans: 16 body · 18 lede · clamp() display.  Mono: 14/13/12 labels.
   -------------------------------------------------------------------------- */
.display {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(72px, 15vw, 220px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--text-hi);
}
.heading {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--text);
}
.lede {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.35;
  color: var(--text-sec);
}
.lede em { font-style: normal; font-weight: 500; color: var(--text); }

.prose { font-size: 16px; line-height: 1.6; color: var(--text-sec); max-width: 68ch; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--red); }

/* mono utilities */
.mono { font-family: var(--font-mono); }
.micro {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 500;
}

/* red accents */
.red { color: var(--red); }
.red-word { color: var(--red); font-weight: 700; }

/* ----------------------------------------------------------------------------
   5. SITE HEADER — sticky status bar + masthead + optional section rail
   -------------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); }
@media (max-width: 900px) { .site-header { position: static; } }

/* status bar (mono data strip) */
.statusbar {
  background: var(--bg);
  color: var(--text-sec);
  border-bottom: var(--hairline);
  padding: 10px 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
}
.statusbar-l, .statusbar-r { display: flex; gap: 20px; align-items: center; }
.statusbar strong { color: var(--text); font-weight: 500; }
.statusbar-hide-mobile { display: flex; gap: 20px; align-items: center; }
@media (max-width: 720px) { .statusbar-hide-mobile { display: none; } }

/* live pulse dot */
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* masthead */
.masthead {
  background: var(--bg);
  padding: 22px 24px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: var(--hairline);
}
.logo { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 11px 0; }
.logo-mark { width: 24px; height: 32px; color: var(--text); display: block; flex-shrink: 0; }
.logo-text {
  font-family: var(--font-sans); font-weight: 700; font-size: 17px;
  letter-spacing: 0.2em; color: var(--text);
}
.logo-version {
  font-family: var(--font-mono); font-size: 16px;
  color: var(--text-mute); letter-spacing: 0.1em; margin-left: 10px;
}

/* primary nav (mono, uppercase, 44px touch target) */
nav ul { list-style: none; display: flex; gap: 30px; align-items: center; }
nav a {
  color: var(--text); text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500;
  transition: color 0.15s; position: relative;
  padding: 12px 0; display: inline-block;
}
nav a:hover { color: var(--red); }
/* page links carry a → cue in the masthead */
.masthead nav a.nav-page::before { content: '→'; margin-right: 6px; color: var(--text-dim); transition: color 0.15s; }
.masthead nav a.nav-page:hover::before { color: var(--red); }
.masthead nav a.nav-page { font-size: 15px; }

/* secondary section rail (scroll-spy anchors for the current page) */
.sect-rail {
  display: flex; justify-content: flex-end;
  padding: 0 24px; border-bottom: var(--hairline); background: var(--bg);
}
.sect-rail ul { gap: 22px; }
.sect-rail a {
  font-size: 14px; letter-spacing: 0.1em; color: var(--text-mute);
  padding: 12px 0; position: relative;
}
.sect-rail a:hover { color: var(--text); }
.sect-rail a.is-active { color: var(--text-hi); }
.sect-rail a.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--red);
}
@media (max-width: 900px) {
  .sect-rail { display: none; }
  nav ul { display: none; }
}

/* ----------------------------------------------------------------------------
   6. SECTION SYSTEM
   Numbered, hairline-ruled sections: [num] [title] [meta] grid head.
   -------------------------------------------------------------------------- */
section.sect {
  background: var(--bg);
  padding: 96px max(24px, env(safe-area-inset-right)) 96px max(24px, env(safe-area-inset-left));
  border-bottom: var(--hairline);
  position: relative;
}
.sect-head {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 40px;
  padding-bottom: 20px;
  border-bottom: var(--hairline);
  margin-bottom: 48px;
  align-items: baseline;
}
.sect-num {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 500; letter-spacing: 0.12em;
  color: var(--text-sec);
}
.sect-title {
  font-family: var(--font-sans); font-weight: 700;
  font-size: clamp(32px, 4.2vw, 52px); line-height: 1;
  letter-spacing: -0.035em; color: var(--text);
}
.sect-meta {
  font-family: var(--font-mono);
  font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-mute); text-align: right;
}
@media (max-width: 720px) {
  .sect-head { grid-template-columns: 1fr; gap: 12px; }
  .sect-meta { text-align: left; }
}

/* ----------------------------------------------------------------------------
   7. CUSTOM SCROLLBAR (JS-driven)
   A functional scrollbar with two design signals:
     1. section ticks on the track (click to jump)
     2. red hairline on the LEFT edge of the thumb
     3. mono position label that fades in during scroll ("NN · NN%")
   Wire positions/visibility with a scroll script; styling lives here.
   -------------------------------------------------------------------------- */
.sb-rail {
  position: fixed; top: 0; right: 0;
  width: 100px; height: 100vh; z-index: 9999; pointer-events: none;
}
.sb-track {
  position: absolute; top: 0; right: 2px; width: 8px; height: 100%;
  background: var(--bg-alt); pointer-events: auto; cursor: pointer;
  transition: opacity 0.2s ease;
}
.sb-track.sb-hidden { opacity: 0; pointer-events: none; }
.sb-thumb {
  position: absolute; top: 0; left: 0; width: 8px; min-height: 24px;
  background: var(--text-mute);
  border-left: 1px solid var(--red);     /* signal #2 */
  cursor: grab; transition: background 0.15s ease;
  will-change: transform, height; z-index: 2;
}
.sb-thumb:hover { background: var(--text-sec); }
.sb-thumb:active { background: var(--text-sec); cursor: grabbing; }
.sb-tick {
  position: absolute; right: 2px; width: 8px; height: 1px;
  background: var(--text-dim); pointer-events: auto; cursor: pointer; z-index: 1;
  transition: background 0.15s ease, height 0.15s ease, width 0.15s ease;
}
.sb-tick:hover { background: var(--red); height: 2px; width: 12px; right: 0; }
.sb-label {
  position: absolute; top: 0; right: 16px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-sec); white-space: nowrap; pointer-events: none;
  background: var(--bg); padding: 4px 8px; border: 1px solid var(--border);
  transition: opacity 0.25s ease; opacity: 0; will-change: transform, opacity;
}
.sb-label .sb-label-num { color: var(--red); font-weight: 500; margin-right: 6px; }
.sb-label .sb-label-sep { color: var(--text-dim); margin: 0 6px; }
.sb-label.is-active { opacity: 1; }

/* ----------------------------------------------------------------------------
   8. COMPARISON TABLE
   Mono row labels, large sans values, one highlighted (brand) column.
   -------------------------------------------------------------------------- */
.comp { width: 100%; border-collapse: collapse; }
.comp thead th {
  padding: 22px 16px; text-align: left;
  font-family: var(--font-mono);
  font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500;
  border-bottom: var(--hairline); color: var(--text-sec);
}
.comp thead th.highlight-col { color: var(--red); border-bottom-color: var(--red); }
.comp tbody td {
  padding: 24px 16px; border-bottom: var(--hairline);
  vertical-align: middle; color: var(--text-sec);
}
.comp tbody td:first-child {
  font-family: var(--font-mono);
  font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-mute); width: 28%;
}
.comp tbody td:not(:first-child) {
  font-family: var(--font-sans); font-weight: 500;
  font-size: 20px; letter-spacing: -0.02em; width: 24%; color: var(--text-sec);
}
.comp tbody td.highlight-col { background: var(--bg-alt); color: var(--text); font-weight: 600; }
.comp tbody td .unit {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-mute);
  font-weight: 400; letter-spacing: 0.08em; margin-left: 4px;
}
.comp tbody td.highlight-col .unit { color: var(--text-sec); }
@media (max-width: 720px) {
  .comp thead th, .comp tbody td { padding: 14px 8px; font-size: 14px; }
  .comp tbody td:not(:first-child) { font-size: 16px; }
}

/* ----------------------------------------------------------------------------
   9. FOOTER
   -------------------------------------------------------------------------- */
footer.foot {
  background: var(--bg);
  padding: 80px 0 40px;          /* horizontal padding on children → full-bleed hairlines */
  border-top: var(--hairline);
}
.foot-masthead {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px;
  padding: 0 24px 48px; border-bottom: var(--hairline); margin-bottom: 32px;
}
.foot-masthead h4 {
  font-family: var(--font-mono);
  font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 16px; color: var(--text-mute); font-weight: 500;
}
.foot-masthead ul { list-style: none; }
.foot-masthead li { margin-bottom: 8px; }
.foot-masthead a {
  color: var(--text-sec); text-decoration: none; font-size: 16px;
  transition: color 0.15s; display: inline-block; padding: 6px 0;
}
.foot-masthead a:hover { color: var(--text); }
.foot-statement {
  font-weight: 200; font-size: 26px; line-height: 1.2; letter-spacing: -0.02em;
  max-width: 380px; margin-bottom: 20px; color: var(--text);
}
.foot-statement strong { font-weight: 700; }
.foot-bottom {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-mute); flex-wrap: wrap; gap: 16px; padding: 0 24px;
}
nav[aria-label="Legal"] a { transition: color 0.15s; font-size: 12px; }
nav[aria-label="Legal"] a:hover { color: var(--text-hi) !important; }
@media (max-width: 900px) { .foot-masthead { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .foot-masthead { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------------------
   10. UTILITIES + MOTION
   -------------------------------------------------------------------------- */
/* fade-to-black strip pinned to the viewport bottom (toggle .is-hidden near footer) */
.bottom-shade {
  position: fixed; left: 0; right: 0; bottom: 0; height: 400px;
  z-index: 40; pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0) 0%, rgba(0,0,0,0.35) 35%, rgba(0,0,0,0.75) 65%, rgba(0,0,0,1) 100%);
  opacity: 1; transition: opacity 0.35s ease; will-change: opacity;
}
.bottom-shade.is-hidden { opacity: 0; }
@media (max-width: 720px) { .bottom-shade { height: 260px; } }

/* scroll-in reveal (add .in via IntersectionObserver) */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal { opacity: 0; }
.reveal.in { animation: fadeUp 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .sb-track, .sb-thumb, .sb-tick, .sb-label,
  .bottom-shade, .reveal.in, .dot { transition: none; animation: none; }
  html { scroll-behavior: auto; }
}

/* brand rule: stealthPAY = bold red PAY in prose; NOT in uppercase UI (statusbar/eyebrow/sect-meta/footer), titles, meta, or attributes */
.brand-pay { color: var(--red); font-weight: 700; }
.brand-mark { font-weight: 700; color: var(--text-hi); }

/* ============================================================================
   MOBILE NAV — hamburger + full-screen overlay (rev2, 2026-06-20)
   ========================================================================== */
.nav-burger { display: none; background: none; border: 0; cursor: pointer; padding: 10px 6px; flex-direction: column; gap: 5px; margin-left: 12px; }
.nav-burger span { display: block; width: 24px; height: 2px; background: var(--text); transition: opacity .2s ease; }

.nav-overlay { position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(120% 58% at 50% -10%, rgba(231,1,31,0.14), transparent 55%), rgba(8,8,8,0.985);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  opacity: 0; visibility: hidden; transition: opacity .34s ease, visibility .34s ease; }
.nav-overlay.open { opacity: 1; visibility: visible; }
.nav-overlay::before { content:''; position:absolute; inset:0; pointer-events:none;
  background-image: linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 25% 100%; }

.nav-overlay-top { position: relative; display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.10); }
.nav-overlay-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.nav-overlay-brand .logo-mark { width: 28px; height: 34px; }
.nav-overlay-brand span { font-family: var(--font-sans); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; }
.nav-overlay-brand .logo-pay { color: var(--red); }

.nav-overlay-close { position: relative; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; flex: none;
  opacity: .65; transition: opacity .2s ease, transform .3s cubic-bezier(.16,1,.3,1); }
.nav-overlay-close:hover { opacity: 1; transform: rotate(90deg); }
.nav-overlay-close span { position: absolute; left: 10px; top: 21px; width: 24px; height: 2px; background: var(--text); }
.nav-overlay-close span:nth-child(1) { transform: rotate(45deg); }
.nav-overlay-close span:nth-child(2) { transform: rotate(-45deg); }

.nav-overlay-links { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 24px; gap: 0; }
.nav-overlay-links a { display: flex; align-items: center; gap: 18px; padding: 17px 2px; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.07); opacity: 0; transform: translateY(16px); }
.nav-overlay.open .nav-overlay-links a { animation: navItemIn .5s cubic-bezier(.16,1,.3,1) forwards; }
.nav-overlay.open .nav-overlay-links a:nth-child(1){ animation-delay:.05s; }
.nav-overlay.open .nav-overlay-links a:nth-child(2){ animation-delay:.10s; }
.nav-overlay.open .nav-overlay-links a:nth-child(3){ animation-delay:.15s; }
.nav-overlay.open .nav-overlay-links a:nth-child(4){ animation-delay:.20s; }
.nav-overlay.open .nav-overlay-links a:nth-child(5){ animation-delay:.25s; }
.nav-overlay.open .nav-overlay-links a:nth-child(6){ animation-delay:.30s; }
.nav-overlay.open .nav-overlay-links a:nth-child(7){ animation-delay:.35s; }
@keyframes navItemIn { to { opacity:1; transform:translateY(0); } }
.nav-i  { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; color: var(--red); width: 22px; flex: none; }
.nav-l  { flex: 1; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 19px; color: var(--text); transition: color .18s ease; }
.nav-arr{ font-family: var(--font-mono); font-size: 16px; color: var(--text-dim); transition: transform .2s ease, color .18s ease; }
.nav-overlay-links a:hover .nav-l { color: var(--text-hi); }
.nav-overlay-links a:hover .nav-arr { color: var(--red); transform: translateX(5px); }
.nav-overlay-links a.is-current .nav-l,
.nav-overlay-links a.is-current .nav-i,
.nav-overlay-links a.is-current .nav-arr { color: var(--red); }

.nav-overlay-foot { position: relative; padding: 22px 24px 26px; border-top: 1px solid rgba(255,255,255,0.10); }
.nav-overlay-cta { display: block; text-align: center; background: var(--red); color: #fff; text-decoration: none;
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.16em; font-weight: 600; font-size: 13px;
  padding: 16px; transition: filter .15s ease; }
.nav-overlay-cta:hover { filter: brightness(1.1); }
.nav-overlay-meta { margin-top: 16px; text-align: center; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-mute); }

@media (min-width: 901px) { .nav-overlay { display: none !important; } }
@media (max-width: 900px) {
  .nav-burger { display: inline-flex !important; }
  .masthead .nav-cta { display: none !important; }
  .masthead { justify-content: space-between !important; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-overlay.open .nav-overlay-links a { animation: none; opacity: 1; transform: none; }
  .nav-overlay-close:hover { transform: none; }
}

/* ---- mobile sweep polish (2026-06-20) — !important to beat per-page inline rules ---- */
@media (max-width: 720px) {
  /* dense tables: tighter cells need less horizontal scroll inside .comp-wrap */
  .comp-trilemma th, .comp-trilemma td { padding: 9px 11px !important; font-size: 12.5px !important; }
  .comp-wrap { -webkit-overflow-scrolling: touch; }
  /* code: let the header wrap, shrink the body a touch */
  .code-head { flex-wrap: wrap !important; gap: 8px 12px; }
  .code-tabs { flex-wrap: wrap; }
  .code-body { font-size: 12.5px !important; }
}
