/* ==========================================================================
   APEX & Omega Terminal — site stylesheet
   Zero dependencies. No build step. No CDN. No inline styles (strict CSP).

   The palette is taken from the terminals themselves: #0B0F16 is the real
   Electron BrowserWindow background, the gold is the app's hexagon icon,
   and the green/red are "Omega's own trading green and red".
   ========================================================================== */

/* ---------- 1. Fonts ---------------------------------------------------- */

@font-face {
  font-family: 'Inter var';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-var.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono var';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-var.woff2') format('woff2');
}

/* ---------- 2. Tokens --------------------------------------------------- */

:root {
  /* surfaces */
  --bg:          #0B0F16;
  --bg-deep:     #070A0F;
  --surface:     #111722;
  --surface-2:   #161D2B;
  --surface-3:   #1C2433;
  --border:      #232B3A;
  --border-soft: #1A212E;

  /* text */
  --text:        #E6EDF3;
  --text-dim:    #AEB9C6;
  --muted:       #97A1AD;
  --muted-deep:  #7C8694;

  /* brand + semantics */
  --gold:        #E3B341;
  --gold-bright: #F5CA5E;
  --gold-deep:   #A87F1E;
  --up:          #3FB950;
  --down:        #F85149;
  --accent:      #58A6FF;
  --warn:        #D29922;

  /* type */
  --sans: 'Inter var', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono var', 'JetBrains Mono', ui-monospace, SFMono-Regular, 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;

  /* spacing scale (8pt) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --s9: 96px; --s10: 128px;

  /* radii */
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-xl: 18px;

  /* layout */
  --maxw: 1200px;
  --nav-h: 60px;

  /* motion */
  --t-fast: 140ms cubic-bezier(.2,.8,.3,1);
  --t-base: 220ms cubic-bezier(.2,.8,.3,1);
  --t-slow: 420ms cubic-bezier(.2,.8,.3,1);

  /* terminal chrome heights — the real CSS tokens from the apps */
  --menubar-h:   25px;
  --indexbar-h:  26px;
  --toolbar-h:   31px;
  --statusbar-h: 20px;

  color-scheme: dark;
}

/* ---------- 3. Reset ---------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

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

img, svg { max-width: 100%; display: block; }
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
dl, dd { margin: 0; }

a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: #79B8FF; }

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: rgba(227,179,65,.28); color: #fff; }

/* ---------- 4. Utilities ------------------------------------------------ */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--s5);
}
@media (max-width: 640px) { .wrap { padding-inline: var(--s4); } }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num  { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.up   { color: var(--up); }
.down { color: var(--down); }
.gold { color: var(--gold); }
.dim  { color: var(--muted); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--s4); top: -100px; z-index: 200;
  background: var(--gold); color: #0B0F16; font-weight: 600;
  padding: var(--s3) var(--s5); border-radius: var(--r-md);
  transition: top var(--t-fast);
}
.skip-link:focus { top: var(--s3); color: #0B0F16; }

/* section rhythm */
.section { padding-block: clamp(56px, 7.5vw, 104px); position: relative; }

.section + .section { border-top: 1px solid var(--border-soft); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--s4);
}
.eyebrow::before { content: ''; width: 18px; height: 1px; background: var(--gold-deep); }

.section-head { max-width: 64ch; margin-bottom: var(--s7); }
.section-head h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: var(--s4); }
.section-head p { color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); }
.section-head p + p { margin-top: var(--s3); }

/* ---------- 5. Background texture -------------------------------------- */

.bg-layer {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 600px at 78% -8%,  rgba(227,179,65,.09), transparent 62%),
    radial-gradient(760px 520px at 8%  12%,  rgba(88,166,255,.07), transparent 60%),
    radial-gradient(600px 600px at 50% 108%, rgba(63,185,80,.05),  transparent 60%);
}
.bg-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .022; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bg-grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(35,43,58,.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35,43,58,.34) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
}

/* ---------- 6. Navigation ----------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(11,15,22,.72);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-base), background var(--t-base);
}
.nav[data-scrolled='true'] { border-bottom-color: var(--border); background: rgba(11,15,22,.92); }
.nav .wrap { display: flex; align-items: center; gap: var(--s5); width: 100%; }

.brand {
  display: flex; align-items: center; gap: var(--s3);
  color: var(--text); font-weight: 600; font-size: 15px;
  letter-spacing: -.01em; flex-shrink: 0;
}
.brand:hover { color: var(--text); }
.brand .hex { width: 20px; height: 22px; flex-shrink: 0; }
.brand-sub {
  font-family: var(--mono); font-size: 11px; color: var(--muted-deep);
  border-left: 1px solid var(--border); padding-left: var(--s3);
}
@media (max-width: 520px) { .brand-sub { display: none; } }

.nav-links { display: flex; align-items: center; gap: var(--s2); margin-left: auto; list-style: none; }
.nav-links a {
  color: var(--muted); font-size: 14px; font-weight: 450;
  padding: var(--s2) var(--s3); border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links .btn { color: #0B0F16; }
.nav-links .btn:hover { color: #0B0F16; background: var(--gold-bright); }

.nav-toggle { display: none; }

@media (max-width: 920px) {
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: var(--s3) var(--s4) var(--s5);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity var(--t-base), transform var(--t-base), visibility var(--t-base);
  }
  .nav[data-open='true'] .nav-links { transform: none; opacity: 1; visibility: visible; }
  .nav-links a { padding: var(--s3) var(--s2); font-size: 16px; }
  .nav-links li:last-child { margin-top: var(--s3); }
  .nav-links .btn { width: 100%; justify-content: center; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: auto; width: 40px; height: 40px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--r-md); color: var(--text);
  }
  .nav-toggle svg { width: 18px; height: 18px; }
  .nav-toggle .ico-close { display: none; }
  .nav[data-open='true'] .nav-toggle .ico-open { display: none; }
  .nav[data-open='true'] .nav-toggle .ico-close { display: block; }
}

/* ---------- 7. Buttons -------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 11px var(--s5); min-height: 44px;
  border-radius: var(--r-md); border: 1px solid var(--border);
  font-size: 14px; font-weight: 550; letter-spacing: -.005em;
  background: var(--surface-2); color: var(--text);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
  white-space: nowrap; text-align: center;
}
.btn:hover { background: var(--surface-3); border-color: #2E3949; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-gold { background: var(--gold); color: #0B0F16; border-color: var(--gold); font-weight: 600; }
.btn-gold:hover { background: var(--gold-bright); border-color: var(--gold-bright); color: #0B0F16; }

.btn-lg { padding: 14px var(--s6); min-height: 52px; font-size: 15px; }
.btn-sm { padding: 7px var(--s4); min-height: 36px; font-size: 13px; }
.btn-block { width: 100%; }

.btn[aria-busy='true'] { pointer-events: none; opacity: .82; }
.btn .spin { display: none; width: 15px; height: 15px; animation: spin .7s linear infinite; }
.btn[aria-busy='true'] .spin { display: block; }
.btn[aria-busy='true'] .btn-ico { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 8. Hero ----------------------------------------------------- */

.hero { position: relative; padding-block: var(--s9) var(--s8); overflow: hidden; }
.hero-inner { display: grid; gap: var(--s8); }

.hero-badge {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 5px var(--s3) 5px var(--s3);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 100px; font-size: 12.5px; color: var(--text-dim);
  margin-bottom: var(--s5);
}
.hero-badge .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--up);
  box-shadow: 0 0 0 3px rgba(63,185,80,.16); flex-shrink: 0;
}
.hero-badge b { color: var(--text); font-weight: 600; }

.hero h1 {
  font-size: clamp(34px, 6.2vw, 64px);
  font-weight: 620;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin-bottom: var(--s5);
  max-width: 18ch;
}
.hero h1 .ln { display: block; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(96deg, var(--gold-bright), var(--gold) 45%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--gold);
}
.hero-lede {
  font-size: clamp(16px, 1.9vw, 19px);
  color: var(--text-dim); max-width: 60ch; margin-bottom: var(--s6);
}
.hero-lede strong { color: var(--text); font-weight: 550; }

.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s4); }
.hero-note {
  font-size: 13px; color: var(--muted-deep);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4);
}
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-note svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ---------- 9. Stat strip ----------------------------------------------- */

.stats { border-block: 1px solid var(--border-soft); background: linear-gradient(180deg, rgba(17,23,34,.55), rgba(17,23,34,0)); }
.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); padding-block: var(--s6); }
.stat { padding-inline: var(--s4); border-left: 1px solid var(--border-soft); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat dt {
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted-deep); font-weight: 500; margin-bottom: 6px;
}
.stat dd {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(17px, 2vw, 23px); font-weight: 600; color: var(--text);
  letter-spacing: -.03em;
}
.stat dd small { font-size: .62em; color: var(--muted); font-weight: 400; letter-spacing: 0; }
@media (max-width: 1000px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s5) 0; }
  .stat:nth-child(3n+1) { border-left: 0; padding-left: 0; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { border-left: 0; padding-left: 0; }
}

/* ---------- 10. Terminal mock ------------------------------------------- */

.term-frame {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-deep);
  box-shadow:
    0 1px 0 rgba(255,255,255,.045) inset,
    0 30px 70px -24px rgba(0,0,0,.85),
    0 0 0 1px rgba(227,179,65,.06);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  --flash-ms: 420ms;
}
.term-frame::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.028), transparent 24%);
}

.term-title {
  display: flex; align-items: center; gap: var(--s2);
  height: 30px; padding-inline: var(--s3);
  background: #0E131C; border-bottom: 1px solid var(--border-soft);
}
.term-title .tdot { width: 9px; height: 9px; border-radius: 50%; background: #2A3341; flex-shrink: 0; }
.term-title .tname { margin-left: var(--s2); font-size: 11px; color: var(--muted-deep); }

.term-menubar {
  display: flex; align-items: center; gap: var(--s3);
  height: var(--menubar-h); padding-inline: var(--s2);
  background: var(--surface); border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.term-brand { display: flex; align-items: center; gap: 5px; font-weight: 700; color: var(--gold); letter-spacing: .04em; }
.term-brand .hex { width: 11px; height: 12px; }
.term-ver { font-size: 9px; color: var(--muted-deep); background: var(--surface-3); padding: 1px 5px; border-radius: 3px; }
.term-menus { display: flex; gap: var(--s3); color: var(--muted); }
.term-chips { display: flex; gap: 5px; margin-left: auto; }
.term-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 1px 7px; border-radius: 3px;
  background: var(--surface-2); border: 1px solid var(--border-soft); font-size: 10px;
}
.term-chip .cdot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.term-chip[data-state='on']   .cdot { background: var(--up); }
.term-chip[data-state='sim']  .cdot { background: var(--accent); }
.term-chip[data-state='hold'] .cdot { background: var(--warn); }
.term-chip .cname { color: var(--text-dim); }

.term-indexbar {
  display: flex; align-items: center; gap: var(--s4);
  height: var(--indexbar-h); padding-inline: var(--s3);
  background: var(--bg-deep); border-bottom: 1px solid var(--border-soft);
  white-space: nowrap; overflow: hidden;
}
.idx { display: flex; align-items: baseline; gap: 6px; }
.idx .iname { color: var(--muted-deep); font-size: 10px; letter-spacing: .05em; }
.idx .ival { color: var(--text); font-weight: 600; }
.idx .ichg { font-size: 10px; }

.term-toolbar {
  display: flex; align-items: center; gap: 5px;
  height: var(--toolbar-h); padding-inline: var(--s2);
  background: var(--surface); border-bottom: 1px solid var(--border-soft);
  white-space: nowrap; overflow: hidden;
}
.tb {
  padding: 3px 8px; border-radius: 3px; font-size: 10px;
  background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text-dim);
}
.tb[data-active='true'] { background: var(--surface-3); color: var(--text); border-color: #2E3949; }
.tb-buy  { color: var(--up);   border-color: rgba(63,185,80,.3); background: rgba(63,185,80,.08); }
.tb-sell { color: var(--down); border-color: rgba(248,81,73,.3); background: rgba(248,81,73,.08); }
.tb-panic { background: var(--down); color: #fff; border-color: var(--down); font-weight: 700; letter-spacing: .06em; }
.tb-hold { color: var(--warn); border-color: rgba(210,153,34,.35); background: rgba(210,153,34,.08); }
.tb-sep { width: 1px; height: 15px; background: var(--border); margin-inline: 3px; flex-shrink: 0; }
.term-funds { margin-left: auto; display: flex; gap: var(--s3); font-size: 10px; }
.term-funds span { color: var(--muted-deep); }
.term-funds b { color: var(--text-dim); font-weight: 600; margin-left: 4px; }

.term-body { background: var(--bg-deep); }
.term-chain { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.term-chain th {
  padding: 5px 7px; text-align: right; font-weight: 500; font-size: 9px;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted-deep);
  background: var(--surface); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.term-chain td {
  padding: 4px 7px; text-align: right; border-bottom: 1px solid rgba(35,43,58,.42);
  white-space: nowrap; color: var(--text-dim);
}
.term-chain .col-strike {
  text-align: center; font-weight: 700; color: var(--text);
  background: var(--surface); border-inline: 1px solid var(--border);
}
.term-chain th.col-strike { color: var(--gold); }
.term-chain tr[data-atm='true'] td { background: rgba(227,179,65,.055); }
.term-chain tr[data-atm='true'] .col-strike { background: rgba(227,179,65,.12); color: var(--gold-bright); }
.term-chain .ltp { color: var(--text); font-weight: 600; }

.flash-up   { animation: flashUp   var(--flash-ms) ease-out; }
.flash-down { animation: flashDown var(--flash-ms) ease-out; }
@keyframes flashUp   { 0% { background-color: rgba(63,185,80,.34); color: #7EE787; } 100% { background-color: transparent; } }
@keyframes flashDown { 0% { background-color: rgba(248,81,73,.34); color: #FF9492; } 100% { background-color: transparent; } }

.term-statusbar {
  display: flex; align-items: center; gap: var(--s4);
  height: var(--statusbar-h); padding-inline: var(--s3);
  background: var(--surface); border-top: 1px solid var(--border-soft);
  font-size: 9.5px; color: var(--muted-deep); white-space: nowrap; overflow: hidden;
}
.feed-dots { display: flex; gap: var(--s3); margin-left: auto; }
.feed { display: flex; align-items: center; gap: 4px; }
.feed .fdot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.feed[data-live='true']  .fdot { background: var(--up); box-shadow: 0 0 5px rgba(63,185,80,.6); }
.feed[data-live='false'] .fdot { background: var(--muted-deep); }

@media (max-width: 760px) {
  .term-frame { font-size: 10px; }
  .term-menus, .term-funds, .hide-sm { display: none; }
  .term-chain .hide-sm-cell { display: none; }
}

/* second mock: deployed strategies */
.term-window .win-title {
  display: flex; align-items: center; gap: var(--s2);
  height: 26px; padding-inline: var(--s3);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 10px; color: var(--text-dim); font-weight: 600; letter-spacing: .03em;
}
.term-window .win-title .spacer { margin-left: auto; display: flex; gap: 7px; color: var(--muted-deep); font-weight: 400; }
.run-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.run-table th {
  padding: 5px 8px; text-align: left; font-size: 9px; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted-deep);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.run-table td { padding: 6px 8px; border-bottom: 1px solid rgba(35,43,58,.4); color: var(--text-dim); }
.run-table td.r { text-align: right; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 100px; font-size: 9px; font-weight: 600; letter-spacing: .05em; }
.pill-run  { background: rgba(63,185,80,.14);   color: var(--up);    border: 1px solid rgba(63,185,80,.3); }
.pill-wait { background: rgba(210,153,34,.14);  color: var(--warn);  border: 1px solid rgba(210,153,34,.3); }
.pill-done { background: rgba(151,161,173,.12); color: var(--muted); border: 1px solid rgba(151,161,173,.25); }

/* ---------- 11. Cards & grids ------------------------------------------- */

.card {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(17,23,34,.4) 100%);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s6);
  transition: border-color var(--t-base), background var(--t-base);
}
.card:hover { border-color: #2C3647; }

.grid { display: grid; gap: var(--s4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- 12. Product cards ------------------------------------------- */

.products { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
@media (max-width: 900px) { .products { grid-template-columns: 1fr; } }

.product {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--r-xl);
  background: linear-gradient(168deg, var(--surface) 0%, rgba(11,15,22,.6) 100%);
  padding: var(--s6); overflow: hidden;
}
.product::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--edge, var(--border)), transparent);
}
.product[data-app='apex']  { --edge: rgba(227,179,65,.55); }
.product[data-app='omega'] { --edge: rgba(88,166,255,.45); }

.product-flag {
  position: absolute; top: var(--s5); right: var(--s5);
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gold);
  background: rgba(227,179,65,.1); border: 1px solid rgba(227,179,65,.3);
  padding: 3px 9px; border-radius: 100px;
}
.product-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s2); }
.product-head .hex { width: 22px; height: 25px; }
.product-head h3 { font-size: 25px; letter-spacing: -.02em; }
.product-role {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted-deep); margin-bottom: var(--s4);
}
.product-desc { color: var(--text-dim); font-size: 15px; margin-bottom: var(--s5); }

.product-list { list-style: none; display: grid; gap: var(--s3); margin-bottom: var(--s5); }
.product-list li { display: flex; gap: var(--s3); font-size: 14px; color: var(--text-dim); line-height: 1.5; }
.product-list svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 4px; color: var(--up); }
.product-list b { color: var(--text); font-weight: 550; }

.product-meta {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5);
  padding-top: var(--s4); margin-top: auto;
  border-top: 1px solid var(--border-soft); font-size: 12px; color: var(--muted-deep);
}
.product-meta b { color: var(--text-dim); font-family: var(--mono); font-weight: 500; }

/* ---------- 13. Comparison table ---------------------------------------- */

.table-scroll {
  overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); -webkit-overflow-scrolling: touch;
}
table.cmp { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
table.cmp caption { text-align: left; padding: var(--s4) var(--s5); color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--border); }
table.cmp th, table.cmp td { padding: var(--s3) var(--s5); text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
table.cmp thead th {
  background: var(--surface-2); font-size: 12px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
table.cmp thead th:nth-child(2) { color: var(--accent); }
table.cmp thead th:nth-child(3) { color: var(--gold); }
table.cmp tbody th { font-weight: 500; color: var(--text-dim); width: 34%; }
table.cmp tbody tr:hover td, table.cmp tbody tr:hover th { background: rgba(255,255,255,.015); }
table.cmp td { color: var(--muted); }
table.cmp td.yes { color: var(--up); }
table.cmp td.no  { color: var(--muted-deep); }
table.cmp .mark { display: inline-flex; align-items: flex-start; gap: 7px; }
table.cmp .mark svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 4px; }
table.cmp tbody tr:last-child th, table.cmp tbody tr:last-child td { border-bottom: 0; }

.table-hint { font-size: 12px; color: var(--muted-deep); margin-top: var(--s3); }
@media (min-width: 761px) { .table-hint { display: none; } }

/* ---------- 14. Feature blocks ------------------------------------------ */

.feature { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s8); align-items: center; padding-block: var(--s7); }
.feature + .feature { border-top: 1px solid var(--border-soft); }
.feature[data-flip='true'] .feature-media { order: -1; }
@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; gap: var(--s6); padding-block: var(--s6); }
  .feature[data-flip='true'] .feature-media { order: 0; }
}

.feature-tag {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px; margin-bottom: var(--s4);
}
.feature-tag[data-scope='both'] { color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.feature-tag[data-scope='apex'] { color: var(--gold);  background: rgba(227,179,65,.1); border: 1px solid rgba(227,179,65,.3); }
.feature h3 { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: var(--s4); }
.feature-copy > p { color: var(--muted); margin-bottom: var(--s4); }
.feature-points { list-style: none; display: grid; gap: var(--s3); }
.feature-points li { display: flex; gap: var(--s3); font-size: 14px; color: var(--text-dim); line-height: 1.55; }
.feature-points li::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold-deep); flex-shrink: 0; margin-top: 9px;
}
.feature-points b { color: var(--text); font-weight: 550; }
code.inline {
  font-family: var(--mono); font-size: .88em; color: var(--gold);
  background: rgba(227,179,65,.08); padding: 1px 5px; border-radius: 3px;
  overflow-wrap: anywhere;
}

.quote {
  border-left: 2px solid var(--gold-deep); padding: var(--s2) 0 var(--s2) var(--s4);
  margin-top: var(--s5); color: var(--text-dim); font-size: 14px; font-style: italic;
}

.panel { background: var(--bg-deep); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); overflow: hidden; }
.panel-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted-deep); margin-bottom: var(--s4);
}

.lanes { display: grid; gap: 7px; font-family: var(--mono); font-size: 11px; }
.lane { display: flex; align-items: center; gap: var(--s3); }
.lane-n {
  width: 20px; height: 20px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 4px; background: var(--surface-2); color: var(--muted-deep); font-size: 10px;
}
.lane-bar {
  height: 20px; border-radius: 4px; display: flex; align-items: center;
  padding-inline: var(--s2); color: #0B0F16; font-weight: 600; font-size: 10px; letter-spacing: .04em;
}
.lane-bar[data-w='1']  { width: 100%; background: var(--down); color: #fff; }
.lane-bar[data-w='2']  { width: 84%;  background: var(--up); }
.lane-bar[data-w='3']  { width: 68%;  background: var(--gold); }
.lane-bar[data-w='4']  { width: 54%;  background: var(--gold-deep); color: #fff; }
.lane-bar[data-w='5']  { width: 38%;  background: #2E3949; color: var(--text-dim); }
.lane-bar[data-w='6']  { width: 24%;  background: var(--surface-3); color: var(--muted); }

.stack { display: grid; gap: 5px; font-family: var(--mono); font-size: 10.5px; }
.stack-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: 8px var(--s3); border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border-soft); color: var(--text-dim);
}
.stack-row[data-hi='true'] { border-color: rgba(227,179,65,.35); background: rgba(227,179,65,.06); color: var(--gold); }
.stack-row .tagr { color: var(--muted-deep); font-size: 9.5px; }
.stack-arrow { text-align: center; color: var(--muted-deep); font-size: 11px; line-height: 1; }

/* ---------- 15. Broker cards -------------------------------------------- */

.broker {
  display: flex; flex-direction: column; gap: var(--s3);
  padding: var(--s5); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); transition: border-color var(--t-base), background var(--t-base);
}
.broker:hover { border-color: #2C3647; background: var(--surface-2); }
.broker-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.broker h3 { font-size: 16px; font-weight: 600; }
.broker .api { font-family: var(--mono); font-size: 10px; color: var(--muted-deep); text-align: right; }
.broker dl { display: grid; grid-template-columns: auto 1fr; gap: 5px var(--s3); font-size: 12px; }
.broker dt { color: var(--muted-deep); }
.broker dd { color: var(--text-dim); font-size: 12px; line-height: 1.45; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: var(--s2); }
.badge {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .05em;
  padding: 2px 7px; border-radius: 3px;
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--border-soft);
}
.badge[data-on='true']   { color: var(--up);   background: rgba(63,185,80,.09);  border-color: rgba(63,185,80,.25); }
.badge[data-warn='true'] { color: var(--warn); background: rgba(210,153,34,.09); border-color: rgba(210,153,34,.25); }

.callout {
  display: flex; gap: var(--s4); align-items: flex-start;
  padding: var(--s5); border-radius: var(--r-md);
  background: rgba(88,166,255,.055); border: 1px solid rgba(88,166,255,.22);
  font-size: 14px; color: var(--text-dim); margin-top: var(--s5); line-height: 1.6;
}
.callout svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); margin-top: 3px; }
.callout b { color: var(--text); font-weight: 600; }
.callout[data-tone='warn'] { background: rgba(210,153,34,.06); border-color: rgba(210,153,34,.26); }
.callout[data-tone='warn'] svg { color: var(--warn); }

/* ---------- 16. Security grid ------------------------------------------- */

.sec {
  padding: var(--s5); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); display: flex; flex-direction: column; gap: var(--s3);
}
.sec-ico {
  width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: rgba(227,179,65,.09); border: 1px solid rgba(227,179,65,.22); color: var(--gold);
}
.sec-ico svg { width: 17px; height: 17px; }
.sec h3 { font-size: 15px; font-weight: 600; }
.sec p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }

/* ---------- 17. Download panel ------------------------------------------ */

.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
@media (max-width: 900px) { .dl-grid { grid-template-columns: 1fr; } }

.dl-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--r-xl);
  background: linear-gradient(168deg, var(--surface) 0%, rgba(11,15,22,.7) 100%);
  padding: var(--s6);
}
.dl-card[data-app='apex'] { border-color: rgba(227,179,65,.3); }
.dl-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.dl-head .hex { width: 20px; height: 23px; }
.dl-head h3 { font-size: 20px; }
.dl-head .role {
  margin-left: auto; font-family: var(--mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted-deep);
}

.dl-facts {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--s4); padding-block: var(--s4); margin-bottom: var(--s5);
  border-block: 1px solid var(--border-soft);
}
.dl-facts dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted-deep); margin-bottom: 3px; }
.dl-facts dd { font-family: var(--mono); font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }

.dl-hash { margin-bottom: var(--s5); }
.dl-hash dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted-deep); margin-bottom: 5px; }
.dl-hash-row { display: flex; align-items: stretch; gap: var(--s2); }
.dl-hash code {
  flex: 1; min-width: 0; font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  background: var(--bg-deep); border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  padding: 7px var(--s3); overflow-wrap: anywhere; line-height: 1.4;
}
.copy-btn {
  flex-shrink: 0; width: 36px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--muted); transition: color var(--t-fast), border-color var(--t-fast);
}
.copy-btn:hover { color: var(--text); border-color: #2E3949; }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn .ok { display: none; color: var(--up); }
.copy-btn[data-copied='true'] .ok { display: block; }
.copy-btn[data-copied='true'] .cp { display: none; }

.dl-card .btn { margin-top: auto; }
.dl-req { font-size: 12.5px; color: var(--muted-deep); margin-top: var(--s3); text-align: center; }
.dl-status { font-size: 12.5px; margin-top: var(--s2); text-align: center; min-height: 1.4em; color: var(--muted-deep); }
.dl-status[data-tone='warn'] { color: var(--warn); }

.notes { display: grid; gap: var(--s4); margin-top: var(--s7); }
.note {
  display: grid; grid-template-columns: 34px 1fr; gap: var(--s4);
  padding: var(--s5); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface);
}
.note-n {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--gold);
}
.note h3 { font-size: 15px; margin-bottom: 6px; }
.note p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.note p + p { margin-top: var(--s3); }
.note pre {
  margin: var(--s3) 0 0; padding: var(--s3) var(--s4);
  background: var(--bg-deep); border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
  overflow-x: auto; line-height: 1.5;
}

/* ---------- 18. FAQ ----------------------------------------------------- */

.faq { display: grid; gap: var(--s2); max-width: 880px; }
.faq details {
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); overflow: hidden; transition: border-color var(--t-base);
}
.faq details[open] { border-color: #2C3647; }
.faq summary {
  display: flex; align-items: center; gap: var(--s4);
  padding: var(--s4) var(--s5); cursor: pointer;
  font-size: 15px; font-weight: 550; color: var(--text);
  list-style: none; min-height: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; margin-left: auto; flex-shrink: 0;
  width: 9px; height: 9px;
  border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg) translate(-2px,-2px); transition: transform var(--t-base);
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-3px,-3px); }
.faq summary:hover { background: var(--surface-2); }
.faq .faq-body { padding: 0 var(--s5) var(--s5); color: var(--muted); font-size: 14px; line-height: 1.65; }
.faq .faq-body p + p { margin-top: var(--s3); }
.faq .faq-body strong { color: var(--text-dim); font-weight: 550; }

/* ---------- 19. Risk band + footer -------------------------------------- */

.risk-band {
  border: 1px solid rgba(227,179,65,.3); border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(227,179,65,.07), rgba(227,179,65,.02));
  padding: var(--s6); display: grid; grid-template-columns: 40px 1fr; gap: var(--s5);
}
@media (max-width: 640px) { .risk-band { grid-template-columns: 1fr; } }
.risk-band .ico { width: 40px; height: 40px; display: grid; place-items: center; color: var(--gold); }
.risk-band .ico svg { width: 28px; height: 28px; }
.risk-band h2 { font-size: 19px; margin-bottom: var(--s3); }
.risk-band p { font-size: 14px; color: var(--text-dim); line-height: 1.65; }
.risk-band p + p { margin-top: var(--s3); }

.footer { border-top: 1px solid var(--border); padding-block: var(--s7) var(--s6); margin-top: var(--s8); }
.footer-top { display: flex; flex-wrap: wrap; gap: var(--s6); justify-content: space-between; margin-bottom: var(--s6); }
.footer-brand { max-width: 340px; }
.footer-brand p { font-size: 13px; color: var(--muted-deep); margin-top: var(--s3); line-height: 1.6; }
.footer-cols { display: flex; flex-wrap: wrap; gap: var(--s8); }
.footer-col h2 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-deep); margin-bottom: var(--s4); font-weight: 600; }
.footer-col ul { list-style: none; display: grid; gap: var(--s3); }
.footer-col a { font-size: 13.5px; color: var(--muted); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); justify-content: space-between;
  padding-top: var(--s5); border-top: 1px solid var(--border-soft);
  font-size: 12px; color: var(--muted-deep);
}

/* ---------- 20. Modal --------------------------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  display: grid; place-items: center; padding: var(--s5);
  background: rgba(3,5,9,.8);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  animation: fadeIn 160ms ease-out;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 470px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s6);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.9);
  animation: modalIn 200ms cubic-bezier(.2,.8,.3,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-ico {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  margin-bottom: var(--s4);
  background: rgba(210,153,34,.12); border: 1px solid rgba(210,153,34,.3); color: var(--warn);
}
.modal-ico svg { width: 21px; height: 21px; }
.modal-ico .ico-offline { display: none; }
.modal[data-tone='offline'] .modal-ico { background: rgba(151,161,173,.12); border-color: rgba(151,161,173,.3); color: var(--muted); }
.modal[data-tone='offline'] .modal-ico .ico-offline { display: block; }
.modal[data-tone='offline'] .modal-ico .ico-maint { display: none; }
.modal h2 { font-size: 19px; margin-bottom: var(--s3); }
.modal p { font-size: 14.5px; color: var(--muted); line-height: 1.6; }
.modal p + p { margin-top: var(--s3); }
.modal-actions { display: flex; gap: var(--s3); margin-top: var(--s6); }
.modal-actions .btn { flex: 1; }

/* ---------- 21. Scroll reveal ------------------------------------------- */

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity var(--t-slow), transform var(--t-slow); }

/* ---------- 22. Legal pages --------------------------------------------- */

.legal { max-width: 760px; margin-inline: auto; padding-block: var(--s8) var(--s9); }
.legal h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: var(--s3); }
.legal .updated { font-family: var(--mono); font-size: 12px; color: var(--muted-deep); margin-bottom: var(--s7); }
.legal h2 { font-size: 20px; margin-top: var(--s7); margin-bottom: var(--s4); }
.legal h3 { font-size: 16px; margin-top: var(--s5); margin-bottom: var(--s3); color: var(--text-dim); }
.legal p, .legal li { color: var(--muted); font-size: 15px; line-height: 1.75; }
.legal p + p { margin-top: var(--s4); }
.legal ul, .legal ol { padding-left: var(--s5); margin-top: var(--s4); display: grid; gap: var(--s3); }
.legal li { padding-left: var(--s2); }
.legal strong { color: var(--text); font-weight: 550; }
.legal .placeholder {
  background: rgba(210,153,34,.12); border-bottom: 1px dashed var(--warn);
  color: var(--warn); padding: 1px 5px; border-radius: 3px;
  font-family: var(--mono); font-size: .9em;
}
.legal-back { display: inline-flex; align-items: center; gap: var(--s2); font-size: 13px; color: var(--muted); margin-bottom: var(--s6); }
.legal-back:hover { color: var(--text); }
.legal-back svg { width: 14px; height: 14px; }

/* ---------- 23. 404 ----------------------------------------------------- */

.err { min-height: 66vh; display: grid; place-items: center; text-align: center; padding-block: var(--s9); }
.err .code {
  font-family: var(--mono); font-size: clamp(70px, 16vw, 150px); font-weight: 700;
  line-height: 1; color: var(--surface-3); letter-spacing: -.04em;
}
.err h1 { font-size: clamp(24px, 4vw, 34px); margin-block: var(--s5) var(--s4); }
.err p { color: var(--muted); max-width: 46ch; margin-inline: auto; margin-bottom: var(--s6); }
.err .btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: center; }

/* ---------- 24. Reduced motion ------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- 25. Print --------------------------------------------------- */

@media print {
  .nav, .bg-layer, .bg-grain, .term-frame, .modal-backdrop { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- 26. Stat cards (engineering section) ------------------------ */

.card .eyebrow { margin-bottom: var(--s3); }
.card .num {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700; letter-spacing: -.035em; line-height: 1.1;
  margin-bottom: var(--s3);
}
.card .num strong { font-weight: 700; }
.card .dim { font-size: 13.5px; line-height: 1.55; }

/* ---------- 27. Overflow containment ------------------------------------
   Grid and flex children default to min-width:auto, so one wide child (the
   nowrap option-chain table) stretches its track and drags the whole page
   past the viewport. Every track that can hold wide content is pinned to 0.
   ------------------------------------------------------------------------ */

.hero-inner > *,
.products > *,
.feature > *,
.grid > *,
.dl-grid > *,
.footer-top > *,
.note > * { min-width: 0; }

.term-frame { min-width: 0; max-width: 100%; }
.term-menubar { overflow: hidden; }
.term-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* the chain keeps all seven remaining columns readable on a phone
   instead of forcing a sideways scroll inside the hero */
@media (max-width: 760px) {
  .term-chain th, .term-chain td { padding: 4px 5px; font-size: 9.5px; }
  .term-indexbar { gap: var(--s3); }
  .term-toolbar  { gap: 4px; }
}
@media (max-width: 420px) {
  .term-chain th, .term-chain td { padding: 4px 3px; font-size: 9px; }
  .term-title .tname { font-size: 10px; }
}

/* full-width CTAs on a phone so the two buttons do not sit ragged */
@media (max-width: 560px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .hero-note { gap: var(--s2) var(--s3); font-size: 12.5px; }
}
