/* ============================================================================
 * IGAXMING — HERO 2026 v4 · "The Engine"
 * Software-engine aesthetic. Clean margins, no corner ticks, no overlap.
 * Stack: GSAP + pure CSS + dynamically drawn SVG wires.
 * ========================================================================= */

/* ---------- scoped tokens ---------------------------------------------- */
.hero-engine {
  --e-cyan:   #00C8FF;
  --e-blue:   #2563EB;
  --e-violet: #7C3AED;
  --e-gold:   #F5A623;
  --e-green:  #00E5A8;
  --e-ink:    #020617;
  --e-ink-2:  #060B1A;
  --e-line:   rgba(255,255,255,0.07);
  --e-line-2: rgba(0,200,255,0.22);
  --e-radius: 28px;
  --e-shadow: 0 30px 80px -20px rgba(0,0,0,.65), 0 0 0 1px rgba(0,200,255,.06) inset;
}

/* ---------- STAGE ------------------------------------------------------- */
.hero-3d-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 6;
  min-height: 580px;
  max-height: 760px;
  border-radius: var(--e-radius);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 80% at 50% 40%, rgba(0,200,255,.12) 0%, rgba(2,6,23,0) 55%),
    radial-gradient(80% 60% at 85% 90%, rgba(245,166,35,.08) 0%, rgba(2,6,23,0) 55%),
    radial-gradient(60% 50% at 20% 80%, rgba(124,58,237,.10) 0%, rgba(2,6,23,0) 60%),
    linear-gradient(180deg, #060B1A 0%, #020617 100%);
  border: 1px solid var(--e-line);
  box-shadow: var(--e-shadow);
}

/* ---------- top status bar --------------------------------------------- */
.eng-statusbar {
  position: absolute; top: 18px; left: 18px; right: 18px;
  height: 36px;
  z-index: 22;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(2,6,23,.65);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--e-line-2);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
}
.eng-statusbar .led {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--e-green); box-shadow: 0 0 10px var(--e-green);
  animation: ledBlink 1.6s ease-in-out infinite;
  flex: 0 0 auto;
}
@keyframes ledBlink { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.8)} }
.eng-statusbar .title { color: var(--e-cyan); font-weight: 700; letter-spacing: .2em; }
.eng-statusbar .sep { width: 1px; height: 14px; background: rgba(255,255,255,.1); flex: 0 0 auto; }
.eng-statusbar .stat { display: inline-flex; align-items: center; gap: 5px; color: #94a3b8; flex: 0 0 auto; }
.eng-statusbar .stat b { color: #fff; font-weight: 600; }
.eng-statusbar .pulse { color: var(--e-green); }
.eng-statusbar .ml-auto { margin-left: auto; }

.eng-statusbar .opt-sm, .eng-statusbar .opt-md { display: none; }
@media (min-width: 480px) { .eng-statusbar .opt-sm { display: inline-flex; } }
@media (min-width: 768px) { .eng-statusbar .opt-md { display: inline-flex; } }

/* ---------- SVG network layer (wires built dynamically by JS) ---------- */
.eng-net {
  position: absolute; inset: 0;
  z-index: 4;
  pointer-events: none;
}
.eng-net svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.eng-net .wire {
  fill: none;
  stroke: rgba(0,200,255,.28);
  stroke-width: 1.2;
  stroke-dasharray: 2 4;
}
.eng-net .wire-glow {
  fill: none;
  stroke: var(--e-cyan);
  stroke-width: 1.8;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px var(--e-cyan));
  stroke-dasharray: 8 90;
  stroke-dashoffset: 0;
}
.eng-net .wire-glow.is-gold   { stroke: var(--e-gold);   filter: drop-shadow(0 0 4px var(--e-gold)); }
.eng-net .wire-glow.is-green  { stroke: var(--e-green);  filter: drop-shadow(0 0 4px var(--e-green)); }
.eng-net .wire-glow.is-violet { stroke: var(--e-violet); filter: drop-shadow(0 0 4px var(--e-violet)); }

/* ---------- engine core (centre reactor) ------------------------------- */
.eng-core {
  position: absolute;
  left: 50%; top: 50%;
  width: 132px; height: 132px;
  transform: translate(-50%, -50%);
  z-index: 14;
  display: grid; place-items: center;
}
.eng-core__rings { position: absolute; inset: 0; }
.eng-core__rings svg { width: 100%; height: 100%; overflow: visible; }
.eng-core__rings .ring {
  fill: none; stroke: rgba(0,200,255,.45);
  stroke-width: 1; stroke-dasharray: 3 7;
  transform-origin: 50% 50%;
}
.eng-core__rings .ring.r2 { stroke: rgba(245,166,35,.4); stroke-dasharray: 2 5; }
.eng-core__rings .ring.r3 { stroke: rgba(124,58,237,.4); stroke-dasharray: 1 3; }

.eng-core__halo {
  position: absolute; inset: -36%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,255,.30) 0%, rgba(0,200,255,0) 60%);
  filter: blur(8px);
  animation: coreBreathe 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes coreBreathe { 0%,100%{opacity:.6;transform:scale(1)} 50%{opacity:1;transform:scale(1.08)} }

.eng-core__disc {
  position: relative;
  width: 74px; height: 74px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,.95) 0%, rgba(255,255,255,0) 25%),
    radial-gradient(circle at 50% 50%, #18b4ff 0%, #0066ff 45%, #0a1a3a 100%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.2) inset,
    0 0 24px rgba(0,200,255,.7),
    0 0 50px rgba(0,200,255,.32),
    0 0 90px rgba(124,58,237,.20);
  display: grid; place-items: center;
}
.eng-core__disc::before {
  content: '';
  position: absolute; inset: 6%;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
}
.eng-core__disc::after {
  content: '';
  position: absolute; inset: 22%;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.35);
  animation: coreSpin 14s linear infinite;
}
@keyframes coreSpin { to { transform: rotate(360deg); } }

.eng-core__label {
  position: relative;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .22em;
  color: #fff;
  text-shadow: 0 0 8px rgba(0,0,0,.6);
  z-index: 2;
  line-height: 1.15;
}
.eng-core__label .v {
  display: block;
  font-size: 7px;
  letter-spacing: .28em;
  color: #93c5fd;
  margin-top: 2px;
}

.eng-core__badge { display: none; }

/* core orbiting dot */
.eng-core__orbit-dot {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--e-gold);
  box-shadow: 0 0 10px var(--e-gold);
  top: -3.5px; left: 50%; margin-left: -3.5px;
  transform-origin: 3.5px 69px;
  animation: dotOrbit 6s linear infinite;
}
@keyframes dotOrbit { to { transform: rotate(360deg); } }

/* ---------- engine modules (nodes) ------------------------------------- */
.eng-module {
  position: absolute;
  z-index: 12;
  display: flex; align-items: center; gap: 7px;
  padding: 8px 11px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15,23,42,.92), rgba(2,6,23,.94));
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow:
    0 16px 32px -14px rgba(0,0,0,.7),
    0 0 0 1px rgba(0,200,255,.05) inset;

  /* Fixed width + min-height → every module is exactly the same size
     regardless of its name length (Affiliates, Payments, etc.) */
  width: 28%;
  min-height: 46px;
  box-sizing: border-box;
  will-change: transform;
}
.eng-module__icon {
  width: 24px; height: 24px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: rgba(0,200,255,.10);
  border: 1px solid var(--e-line-2);
  color: var(--e-cyan);
  font-size: 10.5px;
  flex: 0 0 auto;
}
.eng-module__txt {
  display: flex; flex-direction: column; gap: 2px; line-height: 1;
  min-width: 0; overflow: hidden;
}
.eng-module__name {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eng-module__meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 7.5px;
  letter-spacing: .12em;
  color: #64748b;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eng-module .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--e-green);
  box-shadow: 0 0 8px var(--e-green);
  animation: ledBlink 1.6s ease-in-out infinite;
  margin-left: auto;
  flex: 0 0 auto;
}

/* colour variants */
.eng-module.is-gold .eng-module__icon   { background: rgba(245,166,35,.12); border-color: rgba(245,166,35,.3); color: var(--e-gold); }
.eng-module.is-green .eng-module__icon  { background: rgba(0,229,168,.12);  border-color: rgba(0,229,168,.3);  color: var(--e-green); }
.eng-module.is-violet .eng-module__icon { background: rgba(124,58,237,.12); border-color: rgba(124,58,237,.3); color: #a78bfa; }
.eng-module.is-blue .eng-module__icon   { background: rgba(37,99,235,.12);  border-color: rgba(37,99,235,.3);  color: #60a5fa; }

/* ---------- module positions (DESKTOP) ---------------------------------
   Two clean columns with 4% margin from stage edges and ~25px gap to the
   central core. All six modules are the exact same width (28% of stage)
   and same minimum height — uniformly sized regardless of label length.
   ------------------------------------------------------------------------ */
.eng-pos-1 { top: 11%;     left:  4%; }   /* RNG */
.eng-pos-2 { top: 11%;     right: 4%; }   /* Provably Fair */
.eng-pos-3 { top: 44%;     left:  4%; }   /* Wallet */
.eng-pos-4 { top: 44%;     right: 4%; }   /* AI Anti-Fraud */
.eng-pos-5 { bottom: 26%;  left:  4%; }   /* Affiliates */
.eng-pos-6 { bottom: 26%;  right: 4%; }   /* Payments */

/* ---------- terminal panel (bottom) ------------------------------------ */
.eng-term {
  position: absolute;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  width: calc(100% - 44px);
  max-width: 480px;
  z-index: 18;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15,23,42,.94), rgba(2,6,23,.96));
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 22px 50px -14px rgba(0,0,0,.75);
  overflow: hidden;
}
.eng-term__head {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.eng-term__head i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.eng-term__head .i1 { background: #ef4444; }
.eng-term__head .i2 { background: #f59e0b; }
.eng-term__head .i3 { background: var(--e-green); }
.eng-term__head .tt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; color: #64748b; letter-spacing: .15em;
  margin-left: 6px; text-transform: uppercase;
}
.eng-term__head .stat {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; color: var(--e-green); letter-spacing: .14em;
  display: inline-flex; align-items: center; gap: 4px;
}
.eng-term__body {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  line-height: 1.6;
  color: #cbd5e1;
  padding: 8px 12px 10px;
  height: 84px;
  overflow: hidden;
  position: relative;
}
.eng-term__body .row { display: block; opacity: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eng-term__body .ts { color: #475569; }
.eng-term__body .tag-ok { color: var(--e-green); }
.eng-term__body .tag-gold { color: var(--e-gold); }
.eng-term__body .tag-cyan { color: var(--e-cyan); }
.eng-term__body .tag-violet { color: #a78bfa; }

.eng-term__body::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0; height: 14px;
  background: linear-gradient(180deg, rgba(15,23,42,1), rgba(15,23,42,0));
  pointer-events: none;
}

/* ---------- particles --------------------------------------------------- */
.eng-particles { position: absolute; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.eng-particles span {
  position: absolute;
  width: 2px; height: 2px; border-radius: 50%;
  background: var(--e-cyan);
  box-shadow: 0 0 8px var(--e-cyan);
  opacity: 0;
}

/* micro grain */
.hero-3d-stage::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: .05;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 30;
}

/* subtle background grid */
.eng-bggrid {
  position: absolute; inset: 0;
  z-index: 2; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 80%);
}

/* ---------- RESPONSIVE: tablet ---------------------------------------- */
@media (max-width: 1023px) {
  .hero-3d-stage {
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    height: clamp(580px, 75vw, 700px);
  }
  .eng-core { width: 160px; height: 160px; }
  .eng-core__disc { width: 86px; height: 86px; }
  .eng-module { max-width: 34%; padding: 8px 11px; }
  .eng-module__icon { width: 28px; height: 28px; font-size: 11.5px; }
  .eng-module__name { font-size: 11px; }
  .eng-module__meta { font-size: 8px; }
}

/* ---------- RESPONSIVE: mobile ---------------------------------------- */
@media (max-width: 640px) {
  .hero-3d-stage {
    border-radius: 22px;
    height: clamp(580px, 145vw, 680px);
  }

  .eng-statusbar {
    height: 30px;
    top: 14px; left: 14px; right: 14px;
    font-size: 9px; padding: 0 11px; gap: 7px;
  }
  .eng-statusbar .opt-md { display: none !important; }
  .eng-statusbar .title { letter-spacing: .15em; }

  .eng-core { width: 110px; height: 110px; }
  .eng-core__disc { width: 64px; height: 64px; }
  .eng-core__label { font-size: 8px; letter-spacing: .2em; }
  .eng-core__label .v { font-size: 6.5px; letter-spacing: .22em; }
  .eng-core__badge { font-size: 7.5px; padding: 2px 8px; bottom: -8px; letter-spacing: .16em; }

  /* Module styling — compact, single line, no meta */
  .eng-module {
    min-width: 0;
    padding: 6px 8px;
    gap: 6px;
    max-width: 38%;
    border-radius: 11px;
  }
  .eng-module__icon { width: 22px; height: 22px; font-size: 10px; border-radius: 7px; }
  .eng-module__name { font-size: 10px; letter-spacing: -.01em; }
  .eng-module__meta { display: none; }
  .eng-module .dot { width: 5px; height: 5px; }

  /* Mobile positions — 3 cleanly separated rows */
  .eng-pos-1 { top: 11%;   left: 3%;  }
  .eng-pos-2 { top: 11%;   right: 3%; }
  .eng-pos-3 { top: 40%;   left: 2%;  }
  .eng-pos-4 { top: 40%;   right: 2%; }
  .eng-pos-5 { top: 60%;   left: 3%;  }
  .eng-pos-6 { top: 60%;   right: 3%; }

  .eng-term {
    width: calc(100% - 28px);
    bottom: 14px;
  }
  .eng-term__body {
    font-size: 9px;
    height: 70px;
    padding: 6px 10px 8px;
    line-height: 1.55;
  }
  .eng-term__head { padding: 6px 10px; }
}

/* Extra-small phones */
@media (max-width: 380px) {
  .eng-module { max-width: 40%; padding: 5px 7px; }
  .eng-module__name { font-size: 9px; }
  .eng-core { width: 96px; height: 96px; }
  .eng-core__disc { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .eng-statusbar .led,
  .eng-module .dot,
  .eng-core__halo,
  .eng-core__disc::after,
  .eng-core__orbit-dot { animation: none !important; }
}
