/* ============================================================
   MASTER EAST — dark engineered HUD
   ============================================================ */

:root {
  /* Colors */
  --ink: #0A0C10;
  --carbon: #111620;
  --graphite: #161D29;
  --steel: #232C3A;
  --mist: #8B96A6;
  --chrome: #C3CCD8;
  --bone: #F4F7FA;
  --electric: #2D6DFF;
  --plasma: #3FE0FF;
  --ignition: #FF8A1E;

  /* Fonts */
  --font-display: 'Clash Display', 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-sans: 'Geist', 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-move: cubic-bezier(0.6, 0, 0.4, 1);

  --container: 1440px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, canvas { display: block; max-width: 100%; }
em { font-style: normal; color: var(--electric); }
.mono { font-family: var(--font-mono); }

::selection { background: var(--electric); color: var(--bone); }

/* hide default cursor when custom active */
@media (hover: hover) and (pointer: fine) {
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
}

/* ---------- shared ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 5.5vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  padding: 14px 24px;
  border-radius: 8px;
  border: 1px solid transparent;
  position: relative;
  will-change: transform;
  transition: border-color .35s var(--ease-out), background-color .35s var(--ease-out), color .35s var(--ease-out);
}
.btn span { display: inline-block; will-change: transform; }
.btn--primary { background: var(--electric); color: var(--bone); }
.btn--primary::after {
  content: ""; position: absolute; inset: -2px; border-radius: 10px;
  background: var(--electric); filter: blur(18px); opacity: 0; z-index: -1;
  transition: opacity .4s var(--ease-out);
}
.btn--primary:hover::after { opacity: .55; }
.btn--ghost, .btn--ghost.btn { background: transparent; border-color: var(--steel); color: var(--bone); }
.btn--ghost:hover { border-color: var(--electric); }
.btn--lg { padding: 18px 34px; font-size: 15px; }

/* ============================================================
   GLOBAL OVERLAYS
   ============================================================ */
.grain {
  position: fixed; inset: 0; z-index: 9000; pointer-events: none; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* custom cursor */
.cursor, .cursor-dot { position: fixed; top: 0; left: 0; z-index: 9500; pointer-events: none; mix-blend-mode: difference; }
.cursor {
  width: 32px; height: 32px; margin: -16px 0 0 -16px; border: 1px solid var(--bone);
  border-radius: 50%; transition: width .3s var(--ease-out), height .3s var(--ease-out), margin .3s var(--ease-out), background-color .3s;
  display: flex; align-items: center; justify-content: center;
}
.cursor-dot { width: 4px; height: 4px; margin: -2px 0 0 -2px; background: var(--bone); border-radius: 50%; }
.cursor__label { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; color: var(--bone); opacity: 0; }
body.cursor-active .cursor { width: 72px; height: 72px; margin: -36px 0 0 -36px; }
body.cursor-active .cursor__label { opacity: 1; }
body.cursor-active .cursor-dot { opacity: 0; }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-dot { display: none !important; } }

/* loader */
.loader {
  position: fixed; inset: 0; z-index: 9999; background: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.loader__inner { width: min(320px, 70vw); text-align: center; }
.loader__mark { font-family: var(--font-mono); letter-spacing: .25em; font-size: 13px; color: var(--mist); margin-bottom: 18px; }
.loader__bar { height: 1px; background: var(--steel); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 0%; background: var(--electric); }
.loader__pct { margin-top: 14px; font-size: 11px; color: var(--mist); letter-spacing: .2em; }
.loader.is-done { opacity: 0; visibility: hidden; transition: opacity .6s var(--ease-out), visibility .6s; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; width: 100%; height: 64px; z-index: 8000;
  display: flex; align-items: center; gap: 24px;
  padding: 0 clamp(20px, 4vw, 64px);
  transition: background-color .4s var(--ease-out), backdrop-filter .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(17, 22, 32, .72); backdrop-filter: blur(14px); border-color: var(--steel); }
.nav__brand { font-weight: 600; font-size: 16px; letter-spacing: .04em; }
.nav__brand span { color: var(--electric); }
.nav__links { display: flex; gap: 28px; margin-left: auto; }
.nav__links a { font-size: 12px; letter-spacing: .08em; color: var(--mist); position: relative; padding: 4px 0; transition: color .3s; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0; background: var(--electric); transition: width .35s var(--ease-out); }
.nav__links a:hover { color: var(--bone); }
.nav__links a:hover::after { width: 100%; }
.nav__cta { margin-left: 8px; padding: 10px 18px; }
.nav__burger { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding: 120px clamp(20px, 4vw, 64px) 80px;
  max-width: var(--container); margin: 0 auto;
  overflow: hidden;
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--steel) 1px, transparent 1px),
    linear-gradient(90deg, var(--steel) 1px, transparent 1px);
  background-size: 80px 80px; opacity: .12;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 75%);
}
.hero__glow {
  position: absolute; right: -10%; top: 20%; width: 60vw; height: 60vw; max-width: 760px; max-height: 760px;
  background: radial-gradient(circle, rgba(45,109,255,.32), transparent 62%);
  filter: blur(20px); pointer-events: none;
}
.hero__inner { position: relative; z-index: 2; }
.hero__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(44px, 9.2vw, 132px);
  line-height: 0.96; letter-spacing: -0.025em;
  margin: 26px 0 48px;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: block; will-change: transform; }
.hero__bottom { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-end; justify-content: space-between; }
.hero__lead { max-width: 440px; color: var(--chrome); font-size: 17px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__scroll {
  position: absolute; left: clamp(20px, 4vw, 64px); bottom: 30px; z-index: 2;
  display: flex; align-items: center; gap: 14px;
  font-size: 11px; letter-spacing: .15em; color: var(--mist);
}
.hero__scroll-line { width: 60px; height: 1px; background: var(--steel); position: relative; overflow: hidden; }
.hero__scroll-line::after { content: ""; position: absolute; inset: 0; width: 30%; background: var(--electric); animation: scrollline 2.2s var(--ease-move) infinite; }
@keyframes scrollline { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* ============================================================
   THE BUILD
   ============================================================ */
.build { position: relative; height: 500vh; background: var(--carbon); }
.build__sticky {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.build__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.build__fallback { color: var(--mist); font-family: var(--font-mono); }

.hud { position: absolute; inset: 0; pointer-events: none; padding: clamp(20px, 4vw, 56px); z-index: 3; }
.hud__corner { position: absolute; width: 26px; height: 26px; border: 1px solid var(--steel); }
.hud__corner--tl { top: 26px; left: 26px; border-right: 0; border-bottom: 0; }
.hud__corner--tr { top: 26px; right: 26px; border-left: 0; border-bottom: 0; }
.hud__corner--bl { bottom: 26px; left: 26px; border-right: 0; border-top: 0; }
.hud__corner--br { bottom: 26px; right: 26px; border-left: 0; border-top: 0; }

.hud__head { max-width: 420px; }
.hud__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 3.4vw, 44px); line-height: 1.04; letter-spacing: -0.02em; margin-top: 14px; }

.hud__panel {
  position: absolute; left: clamp(20px, 4vw, 56px); bottom: clamp(20px, 4vw, 56px);
  width: min(330px, 80vw);
  background: rgba(17, 22, 32, .55); backdrop-filter: blur(10px);
  border: 1px solid var(--steel); border-radius: 12px; padding: 18px 20px;
}
.hud__row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 12px; border-bottom: 1px solid rgba(35,44,58,.5); }
.hud__row:last-of-type { border-bottom: 0; }
.hud__k { color: var(--mist); letter-spacing: .08em; }
.hud__v { color: var(--bone); text-align: right; }
.hud__v--brand { color: var(--electric); }
.hud__progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.hud__progress-bar { flex: 1; height: 2px; background: var(--steel); overflow: hidden; }
.hud__progress-bar span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--electric), var(--plasma)); }
.hud__progress .mono { font-size: 11px; color: var(--plasma); }

.hud__ledger {
  position: absolute; right: clamp(20px, 4vw, 56px); top: 50%; transform: translateY(-50%);
  list-style: none; display: flex; flex-direction: column; gap: 12px;
}
.hud__ledger li { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--mist); opacity: .4; transition: opacity .4s, color .4s; }
.hud__ledger li .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--steel); transition: background-color .4s, box-shadow .4s; }
.hud__ledger li.on { opacity: 1; color: var(--bone); }
.hud__ledger li.on .dot { background: var(--electric); box-shadow: 0 0 10px var(--electric); }

/* ============================================================
   STATS
   ============================================================ */
.stats { max-width: var(--container); margin: 0 auto; padding: clamp(80px, 12vw, 160px) clamp(20px, 4vw, 64px); }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--steel); margin-top: 40px; border: 1px solid var(--steel); }
.stat { background: var(--ink); padding: 40px 28px; }
.stat__num { font-family: var(--font-mono); font-weight: 500; font-size: clamp(38px, 5vw, 64px); line-height: 1; letter-spacing: -.02em; display: flex; align-items: baseline; gap: 4px; }
.stat__num i { font-style: normal; font-size: .4em; color: var(--electric); }
.stat__cap { margin-top: 14px; font-size: 11px; letter-spacing: .1em; color: var(--mist); }

/* ============================================================
   SUPPLIERS MARQUEE
   ============================================================ */
.suppliers { padding: clamp(40px, 6vw, 80px) 0; border-top: 1px solid var(--steel); border-bottom: 1px solid var(--steel); }
.suppliers .eyebrow { text-align: center; margin-bottom: 40px; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee__track { display: flex; gap: 64px; width: max-content; animation: marquee 38s linear infinite; }
.marquee__track span { font-family: var(--font-display); font-weight: 500; font-size: clamp(28px, 4vw, 52px); color: var(--steel); letter-spacing: -.01em; transition: color .3s; white-space: nowrap; }
.marquee__track span:hover { color: var(--bone); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================================================
   PARTS GRID
   ============================================================ */
.parts { max-width: var(--container); margin: 0 auto; padding: clamp(80px, 12vw, 160px) clamp(20px, 4vw, 64px); }
.parts__head { margin-bottom: 56px; }
.parts__head .eyebrow { margin-bottom: 18px; }
.parts__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--graphite); border: 1px solid var(--steel); border-radius: 16px; padding: 28px;
  display: flex; flex-direction: column; min-height: 240px; position: relative; overflow: hidden;
  transition: border-color .4s var(--ease-out), transform .4s var(--ease-out);
  will-change: transform;
}
.card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 70% 0%, rgba(45,109,255,.16), transparent 60%); opacity: 0; transition: opacity .4s; }
.card:hover { border-color: var(--electric); transform: translateY(-6px); }
.card:hover::before { opacity: 1; }
.card__top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--mist); position: relative; z-index: 1; }
.chip { border: 1px solid var(--steel); border-radius: 4px; padding: 4px 8px; color: var(--bone); letter-spacing: .06em; }
.card__glyph { font-size: 56px; color: var(--electric); margin: auto 0 18px; line-height: 1; position: relative; z-index: 1; }
.card__name { font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: -.01em; position: relative; z-index: 1; }
.card__desc { color: var(--mist); font-size: 13px; margin-top: 8px; position: relative; z-index: 1; }

/* ============================================================
   COVERAGE
   ============================================================ */
.coverage { max-width: var(--container); margin: 0 auto; padding: clamp(40px, 6vw, 80px) clamp(20px, 4vw, 64px) clamp(80px, 12vw, 160px); }
.coverage__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.coverage__text .eyebrow { margin-bottom: 18px; }
.coverage__lead { color: var(--chrome); max-width: 460px; margin: 28px 0; font-size: 17px; }
.coverage__badge { display: inline-block; border: 1px solid var(--steel); border-radius: 999px; padding: 8px 16px; font-size: 11px; letter-spacing: .08em; color: var(--mist); }

.coverage__viz { display: flex; justify-content: center; }
.radar { position: relative; width: min(420px, 80vw); aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--steel); }
.radar span { position: absolute; inset: 0; margin: auto; border: 1px solid var(--steel); border-radius: 50%; opacity: .6; }
.radar span:nth-child(1) { width: 33%; height: 33%; }
.radar span:nth-child(2) { width: 66%; height: 66%; }
.radar span:nth-child(3) { width: 100%; height: 100%; }
.radar__sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(63,224,255,.22), transparent 35%); animation: spin 5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.radar__dot { position: absolute; left: var(--x, 50%); top: var(--y, 50%); width: 8px; height: 8px; border-radius: 50%; background: var(--electric); transform: translate(-50%, -50%); box-shadow: 0 0 10px var(--electric); }
.radar__dot--hub { left: 50%; top: 50%; width: 12px; height: 12px; background: var(--plasma); box-shadow: 0 0 16px var(--plasma); }

/* ============================================================
   CTA
   ============================================================ */
.cta { position: relative; text-align: center; padding: clamp(100px, 16vw, 200px) clamp(20px, 4vw, 64px); overflow: hidden; }
.cta__glow { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 70vw; height: 70vw; max-width: 800px; max-height: 800px; background: radial-gradient(circle, rgba(45,109,255,.18), transparent 60%); filter: blur(30px); pointer-events: none; }
.cta__title { position: relative; font-family: var(--font-display); font-weight: 600; font-size: clamp(38px, 7vw, 104px); line-height: .98; letter-spacing: -.025em; margin: 24px 0 44px; }
.cta__title .line { display: block; overflow: hidden; }
.cta__title .line > span { display: block; }
.cta__mail { position: relative; margin-top: 26px; color: var(--mist); font-size: 13px; letter-spacing: .1em; }
.cta .eyebrow { position: relative; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { position: relative; background: var(--carbon); border-top: 1px solid var(--steel); padding: clamp(56px, 8vw, 96px) clamp(20px, 4vw, 64px) 40px; overflow: hidden; }
.footer__grid { position: absolute; inset: 0; background-image: linear-gradient(90deg, var(--steel) 1px, transparent 1px); background-size: 80px 100%; opacity: .1; }
.footer__top { position: relative; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid var(--steel); padding-bottom: 40px; }
.footer__mark { font-family: var(--font-display); font-weight: 600; font-size: clamp(40px, 8vw, 104px); letter-spacing: -.02em; line-height: .9; }
.footer__tag { font-size: 11px; letter-spacing: .12em; color: var(--mist); }
.footer__cols { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; padding: 48px 0; }
.footer__k { font-size: 11px; letter-spacing: .1em; color: var(--mist); margin-bottom: 14px; }
.footer__col p { color: var(--chrome); font-size: 14px; }
.footer__col a:hover { color: var(--electric); }
.footer__base { position: relative; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 11px; letter-spacing: .08em; color: var(--mist); border-top: 1px solid var(--steel); padding-top: 24px; }

/* ============================================================
   REVEAL (set via JS / GSAP)
   ============================================================ */
.reveal-fade { opacity: 0; transform: translateY(24px); }
.is-inview .reveal-fade, .reveal-fade.is-inview { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: flex; flex-direction: column; gap: 5px; margin-left: auto; background: none; border: 0; padding: 8px; }
  .nav__burger span { width: 22px; height: 1.5px; background: var(--bone); }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .parts__grid { grid-template-columns: 1fr 1fr; }
  .coverage__inner { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: 1fr 1fr; }
  .hud__ledger { display: none; }
  .hud__head { max-width: 70%; }
}
@media (max-width: 560px) {
  .stats__grid, .parts__grid, .footer__cols { grid-template-columns: 1fr; }
  .hero__bottom { flex-direction: column; align-items: flex-start; }
  .build { height: 420vh; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal-fade { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
  .cursor, .cursor-dot { display: none !important; }
}
