/* ==========================================================================
   GOD OF ALGOS — BASE + HERO
   1. Base  2. Utilities & primitives  3. Ticker / Nav  4. Hero
   ========================================================================== */

/* 1. BASE ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.5; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; letter-spacing: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.14; margin: 0; letter-spacing: normal; color: var(--text-hi); text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
::selection { background: var(--gold); color: #1b1305; }
:focus-visible { outline: 2px solid var(--blueprint); outline-offset: 3px; border-radius: 6px; }

.progress { position: fixed; top: 0; left: 0; height: 1px; width: 100%; z-index: var(--z-progress); transform-origin: 0 50%; transform: scaleX(0); background: var(--sky); box-shadow: var(--sh-halo); }

/* 2. UTILITIES & PRIMITIVES --------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); position: relative; }
.mono { font-family: var(--font-mono); }
.mono, .label, .badge, .tk, .feed, .tip, .heat, .term__body, .regime__row, .panel__equity, .panel__stats b, .gauge__num b,
.stat__value, .meter__top b, .sim__big, .sim__rows b, .insp__h output, .countdown b, .price__amt b, .bigtime { font-variant-numeric: tabular-nums; }
.dot-font { font-family: var(--font-dot); font-weight: 700; }
.sky { background: var(--sky); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .12em; }
.up { color: var(--up); } .down { color: var(--down); }
.label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-4); }

/* eyebrow: dot-matrix caps flanked by fading hairlines */
.eyebrow {
  display: inline-flex; align-items: center; gap: 16px;
  font-family: var(--font-dot); font-weight: 700; font-size: 15px; line-height: 1.2; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2);
  font-feature-settings: "tnum";
}
.eyebrow::before, .eyebrow::after { content: ""; width: clamp(32px, 6vw, 72px); height: 1px; background: linear-gradient(90deg, transparent, var(--edge-strong)); }
.eyebrow::after { transform: scaleX(-1); }

.section-head { text-align: center; max-width: 780px; margin: 0 auto clamp(48px, 6vw, 72px); }
.section-head h2 { font-size: clamp(36px, 4.8vw, 56px); line-height: 1.12; margin-top: 20px; }
.section-head p { color: var(--text-2); font-size: 18px; line-height: 1.55; max-width: 640px; margin: 18px auto 0; }

/* glass surfaces */
.glass { position: relative; background: var(--glass); border-radius: var(--r-card); box-shadow: var(--sh-card); }
.glass-modal { position: relative; background: var(--deep-glass); border-radius: var(--r-card); box-shadow: var(--sh-modal); }
.spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(186, 214, 247, .07), transparent 65%);
}
.spot:hover::after { opacity: 1; }

/* circular frosted icon tile */
.tile { flex: none; width: 40px; height: 40px; border-radius: 9999px; display: grid; place-items: center; background: var(--glass-2); box-shadow: var(--sh-hair), inset 0 1px 1px rgba(216, 236, 248, .14); color: var(--text); }
.tile svg { width: 18px; height: 18px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--r-badge); background: rgba(199, 211, 234, .12); color: var(--text); font-size: 12px; font-weight: 500; box-shadow: inset 0 1px 1px rgba(216, 236, 248, .12); }
.badge--up { background: var(--up-bg); color: var(--up); }
.badge--down { background: var(--down-bg); color: var(--down); }

/* buttons — every interactive surface is a pill */
.btn {
  --h: 44px; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px; border-radius: var(--r-pill); white-space: nowrap;
  font-size: 15px; font-weight: 500; color: var(--white);
  transition: transform .2s var(--ease-out), background .2s, box-shadow .2s;
}
.btn svg { width: 16px; height: 16px; transition: transform .2s var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }
/* .btn--gold (primary buy action) lives in gold.css */
.btn--ghost { background: var(--glass-2); box-shadow: var(--sh-hair); }
.btn--ghost:hover { background: var(--glass-3); }
.btn--outline { color: var(--text); box-shadow: var(--sh-hair); }
.btn--outline:hover { background: var(--glass-2); }
.btn--sm { --h: 36px; padding: 0 16px; font-size: 14px; }
.btn--lg { --h: 52px; padding: 0 26px; font-size: 16px; }
.btn--block { width: 100%; }

/* segmented control */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--glass); box-shadow: var(--sh-hair); }
.seg button { height: 34px; padding: 0 16px; border-radius: var(--r-pill); font-size: 14px; font-weight: 500; color: var(--text-3); transition: color .2s, background .2s, box-shadow .2s; }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"], .seg button[aria-pressed="true"] { color: var(--white); background: var(--glass-3); box-shadow: inset 0 1px 1px rgba(216, 236, 248, .2), var(--sh-hair); }

.dot { position: relative; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--up); }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: ping 1.8s var(--ease-out) infinite; }
.dot--off { background: var(--text-3); } .dot--off::after { animation: none; opacity: 0; }
@keyframes ping { from { opacity: .7; } to { transform: scale(2.8); opacity: 0; } }

/* reveal on scroll (only hides when JS is running) */
.js [data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity .55s var(--ease-out), transform .55s var(--ease-out); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* looping animations pause while off-screen (class set in main.js) */
[data-loop].paused, [data-loop].paused * { animation-play-state: paused !important; }
section[id] { scroll-margin-top: 76px; }

/* 3. TICKER + NAV -------------------------------------------------------- */
.ticker { position: relative; z-index: var(--z-ticker); height: 34px; overflow: hidden; background: rgba(5, 6, 15, .85); box-shadow: inset 0 -1px 0 var(--edge-soft); font-family: var(--font-mono); font-size: 12px; }
.ticker__track { display: flex; width: max-content; height: 100%; align-items: center; animation: marquee 60s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.tk { display: inline-flex; gap: 10px; padding-inline: 22px; color: var(--text-3); box-shadow: inset -1px 0 0 var(--edge-soft); }
.tk b { color: var(--text); font-weight: 500; }
@keyframes marquee { to { transform: translateX(-50%); } }

.nav { position: sticky; top: 0; z-index: var(--z-nav); transition: background .2s, box-shadow .2s; }
.nav.scrolled { background: rgba(5, 6, 15, .72); backdrop-filter: blur(18px) saturate(140%); box-shadow: inset 0 -1px 0 var(--edge-soft); }
/* backdrop-filter would trap the fixed mobile menu inside the bar */
.nav-open .nav.scrolled { backdrop-filter: none; background: transparent; }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 16px; color: var(--text); }
.logo svg { width: 30px; height: 30px; }
.nav__links { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); }
.nav__links a { padding: 7px 14px; border-radius: var(--r-pill); font-size: 14px; color: var(--text-3); transition: color .2s, background .2s; }
.nav__links a:hover { color: var(--text-hi); background: var(--glass-2); }
.nav__right { display: flex; align-items: center; gap: 8px; }
.nav__burger { display: none; width: 40px; height: 40px; border-radius: 50%; box-shadow: var(--sh-hair); position: relative; background: var(--glass); }
.nav__burger span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--text); transition: transform .2s var(--ease-out); }
.nav__burger span:first-child { top: 15px; } .nav__burger span:last-child { top: 23px; }
.nav-open .nav__burger span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-open .nav__burger span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* 4. HERO PRIMITIVES + COCKPIT (the hero itself lives in hero.css) -------- */


/* stage: giant inscription + fan of glass cards */
.hero__stage { position: relative; margin-top: clamp(56px, 7vw, 88px); }
.hero__word {
  position: absolute; left: 50%; top: -0.32em; transform: translateX(-50%); z-index: var(--z-below); pointer-events: none; user-select: none;
  font-family: var(--font-display); font-weight: 500; font-size: clamp(150px, 30vw, 400px); line-height: 1; letter-spacing: normal;
  background: linear-gradient(180deg, rgba(216, 236, 248, .14) 0%, rgba(152, 192, 239, 0) 70%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fan { display: grid; grid-template-columns: 1fr 1.42fr 1fr; align-items: center; max-width: 1140px; margin: 0 auto; }
.fan__card { text-align: left; padding: 20px; transition: transform .2s var(--ease-out); }
.fan__card--l { transform: translate(22px, 44px) rotate(-5deg) scale(.92); z-index: var(--z-raised); padding-right: 30px; }
.fan__card--r { transform: translate(-22px, 44px) rotate(5deg) scale(.92); z-index: var(--z-raised); padding-left: 30px; }
.fan__card--c { z-index: var(--z-float); padding: 22px; }
.fan:hover .fan__card--l { transform: translate(6px, 30px) rotate(-3deg) scale(.94); }
.fan:hover .fan__card--r { transform: translate(-6px, 30px) rotate(3deg) scale(.94); }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.card-h b { display: block; font-weight: 500; color: var(--text-hi); font-size: 15px; }
.card-h span:not(.tile) { display: block; font-size: 12px; color: var(--text-3); }

/* center: live equity panel */
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; box-shadow: inset 0 -1px 0 var(--edge-soft); font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.panel__dots { display: flex; gap: 6px; } .panel__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--glass-3); }
.panel__status { display: inline-flex; align-items: center; gap: 8px; color: var(--up); transition: color .2s; }
.panel__status.off { color: var(--text-3); }
.panel__balance { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 18px 0 4px; }
.panel__equity { font-family: var(--font-mono); font-size: clamp(28px, 3vw, 38px); font-weight: 500; color: var(--text-hi); }
#heroChart { width: 100%; height: 170px; margin: 8px 0 14px; }
.panel__stats { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 10px; box-shadow: var(--sh-hair); overflow: hidden; }
.panel__stats div { padding: 12px 14px; box-shadow: inset -1px 0 0 var(--edge-soft); }
.panel__stats div:last-child { box-shadow: none; }
.panel__stats b { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 18px; margin-top: 4px; color: var(--text-hi); }
.feed { margin-top: 12px; height: 104px; overflow: hidden; font-family: var(--font-mono); font-size: 12px; mask-image: linear-gradient(#000 50%, transparent); }
.feed__row { display: grid; grid-template-columns: 52px 72px 1fr auto; gap: 10px; padding: 7px 2px; box-shadow: inset 0 -1px 0 var(--edge-soft); color: var(--text-3); animation: feedIn .6s var(--ease-out); }
.feed__row b { color: var(--text); font-weight: 500; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-10px); } }

/* left: shield gauge */
.gauge { position: relative; margin: 6px auto 4px; max-width: 220px; }
.gauge svg { width: 100%; overflow: visible; }
.gauge__track { fill: none; stroke: var(--glass-3); stroke-width: 10; stroke-linecap: round; }
.gauge__val { fill: none; stroke: url(#gSky); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease-out); filter: drop-shadow(0 0 6px rgba(182, 217, 252, .5)); }
.gauge__num { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; }
.gauge__num b { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 26px; color: var(--text-hi); }
.gauge__num span { font-size: 11px; color: var(--text-3); }
.rules { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 1px; border-radius: 10px; overflow: hidden; box-shadow: var(--sh-hair); }
.rules li { display: flex; justify-content: space-between; padding: 10px 12px; font-size: 13px; color: var(--text-3); background: var(--glass); }
.rules b { font-family: var(--font-mono); font-weight: 500; color: var(--text); }

/* right: regime radar */
.regime { display: grid; gap: 12px; }
.regime__row { display: grid; grid-template-columns: 78px 1fr 36px; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); transition: color .2s; }
.regime__bar { height: 6px; border-radius: 6px; background: var(--glass-3); overflow: hidden; }
.regime__bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--text-3); transform-origin: left; transform: scaleX(var(--s, 0)); transition: transform 1s var(--ease-out), background .2s; }
.regime__row.active { color: var(--text-hi); }
.regime__row.active .regime__bar i { background: var(--sky); box-shadow: 0 0 10px rgba(182, 217, 252, .6); }
.decision { margin-top: 18px; padding: 12px; border-radius: 10px; background: var(--glass-2); box-shadow: var(--sh-hair); }
.decision b { display: block; margin-top: 4px; font-weight: 500; color: var(--text-hi); font-size: 14px; transition: opacity .2s; }

.simbar { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: clamp(64px, 7vw, 88px); }
.simbar .label { color: var(--text-3); }
.sample-tag { position: absolute; bottom: 10px; right: 12px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; padding: 3px 7px; border-radius: var(--r-badge); background: var(--glass-3); color: var(--text-2); box-shadow: var(--sh-hair); }
