*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
  --navy:      #050d1a;
  --deep-blue: #1d519c;
  --mid-blue:  #2475b7;
  --light-blue:#6da8d7;
  --ice:       #D4E2F4;
  --amber:     #E8A830;
  --amber-dim: #8a6118;
  --green:     #2E7D4F;
  --green-lt:  #4CAF72;
  --orange:    #C05818;
  --white:     #F0F4FA;
  --mono: 'Space Mono', monospace;
  --sans: 'Rajdhani', sans-serif;
  --display: 'Orbitron', sans-serif;
}

body {
  background: var(--navy);
  color: var(--white);
  font-family: var(--sans);
  overflow-x: hidden;
}

/* ── PAGE HEADER ── */
.page-header {
  padding: 60px 80px 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid rgba(109,168,215,0.12);
}
.ph-left { max-width: 600px; }
.ph-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--light-blue);
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ph-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--light-blue);
}
.ph-title {
  font-family: var(--display);
  font-size: 42px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.ph-title em {
  font-style: normal;
  color: var(--amber);
}
.ph-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(213,226,244,0.35);
  margin-top: 14px;
  letter-spacing: 0.12em;
  line-height: 1.8;
}
.ph-right {
  text-align: right;
  flex-shrink: 0;
}
.ph-badge {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(213,226,244,0.3);
  text-transform: uppercase;
  line-height: 2;
}

/* ── TAB NAVIGATION ── */
.tab-bar {
  display: flex;
  gap: 0;
  padding: 0 80px;
  border-bottom: 1px solid rgba(109,168,215,0.12);
  margin-top: 0;
}
.tab-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 18px 32px;
  background: transparent;
  border: none;
  color: rgba(213,226,244,0.35);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
  position: relative;
  bottom: -1px;
}
.tab-btn.active {
  color: var(--ice);
  border-bottom-color: var(--amber);
}
.tab-btn:hover:not(.active) {
  color: rgba(213,226,244,0.65);
}

/* ── PANELS ── */
.panel { display: none; }
.panel.active { display: block; }

/* ══════════════════════════════════
   PANEL 1 — TECHNICAL SCHEMATIC
══════════════════════════════════ */
.schematic-wrap {
  padding: 60px 80px 80px;
}

/* Central diagram area */
.diagram-area {
  position: relative;
  width: 100%;
  aspect-ratio: 16/8;
  max-width: 1200px;
  margin: 0 auto;
}

/* Flow SVG sits behind everything */
.flow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Node cards — positioned absolute */
.node-card {
  position: absolute;
  width: 260px;
  background: rgba(5,13,26,0.9);
  border: 1px solid;
  padding: 0;
  transform: translate(-50%, -50%);
  transition: box-shadow 0.3s;
}
.node-card:hover {
  box-shadow: 0 0 40px -10px var(--node-color, rgba(109,168,215,0.3));
}
.node-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* Clip corner */
.node-card { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }

.nc-header {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nc-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.nc-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
}
.nc-node-num {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 8px;
  opacity: 0.25;
  letter-spacing: 0.15em;
}

.nc-body { padding: 16px 18px; }
.nc-name {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}
.nc-location {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  opacity: 0.35;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.nc-rows { border-top: 1px solid rgba(255,255,255,0.05); }
.nc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 8px;
}
.nc-row-key {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: rgba(213,226,244,0.4);
  flex-shrink: 0;
}
.nc-row-val {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-align: right;
  font-weight: 600;
}

/* Position helpers */
.node-ketec    { top: 12%; left: 50%; --node-color: rgba(36,117,183,0.4); border-color: rgba(36,117,183,0.5); }
.node-mining   { top: 65%; left: 82%; --node-color: rgba(232,168,48,0.3); border-color: rgba(232,168,48,0.5); }
.node-gh       { top: 65%; left: 18%; --node-color: rgba(46,125,79,0.3);  border-color: rgba(46,125,79,0.5); }
.node-output   { top: 65%; left: 50%; --node-color: rgba(109,168,215,0.2); border-color: rgba(109,168,215,0.25); }

/* Center circle */
.center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 1px solid rgba(109,168,215,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}
.center-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(109,168,215,0.07);
  animation: ring-pulse 4s ease-in-out infinite;
}
@keyframes ring-pulse {
  0%, 100% { transform: translate(-50%,-50%) scale(1); opacity: 0.5; }
  50%       { transform: translate(-50%,-50%) scale(1.05); opacity: 1; }
}
.cc-label {
  font-family: var(--display);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(213,226,244,0.2);
  line-height: 1.6;
}

/* Metrics strip */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 48px;
  border: 1px solid rgba(109,168,215,0.12);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.ms-cell {
  padding: 28px 32px;
  border-right: 1px solid rgba(109,168,215,0.1);
  position: relative;
  overflow: hidden;
}
.ms-cell:last-child { border-right: none; }
.ms-cell::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
}
.ms-cell:nth-child(1)::after { background: var(--mid-blue); }
.ms-cell:nth-child(2)::after { background: var(--amber); }
.ms-cell:nth-child(3)::after { background: var(--green-lt); }
.ms-cell:nth-child(4)::after { background: var(--ice); opacity: 0.3; }

.ms-val {
  font-family: var(--display);
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}
.ms-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: rgba(213,226,244,0.4);
  text-transform: uppercase;
  line-height: 1.7;
}
.ms-source {
  font-family: var(--mono);
  font-size: 7px;
  color: rgba(213,226,244,0.2);
  margin-top: 10px;
  letter-spacing: 0.08em;
}

/* Legend */
.legend-row {
  display: flex;
  gap: 40px;
  padding: 28px 0 0;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.leg-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(213,226,244,0.45);
  text-transform: uppercase;
}
.leg-line {
  width: 36px;
  height: 1px;
  border-top-width: 1.5px;
  border-top-style: dashed;
}

/* ══════════════════════════════════
   PANEL 2 — VISUAL SCENE
══════════════════════════════════ */
.scene-wrap {
  padding: 0;
  overflow: hidden;
}

/* Main scene SVG container */
.scene-container {
  position: relative;
  width: 100%;
}
.scene-svg-el {
  display: block;
  width: 100%;
}

/* Caption row under scene */
.caption-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid rgba(109,168,215,0.1);
}
.cap-block {
  padding: 40px 48px;
  border-right: 1px solid rgba(109,168,215,0.08);
  position: relative;
}
.cap-block:last-child { border-right: none; }
.cap-num {
  font-family: var(--display);
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.06;
  position: absolute;
  top: 24px;
  right: 28px;
  letter-spacing: -0.05em;
}
.cap-tag {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cap-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cap-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.2;
}
.cap-text {
  font-family: var(--sans);
  font-size: 12px;
  color: rgba(213,226,244,0.5);
  line-height: 1.75;
  font-weight: 300;
}

/* SVG animation styles */
@keyframes flow-dash-anim {
  to { stroke-dashoffset: -30; }
}
@keyframes flow-dash-slow {
  to { stroke-dashoffset: -40; }
}
@keyframes heat-wave {
  0%, 100% { opacity: 0.12; transform: scaleX(1); }
  50%       { opacity: 0.28; transform: scaleX(1.04); }
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.7; }
}
@keyframes float-btc {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}
@keyframes leaf-sway {
  0%, 100% { transform: rotate(-3deg); }
  50%       { transform: rotate(3deg); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50%       { opacity: 0.9; }
}
@keyframes smoke-up {
  0%   { transform: translateY(0) scale(1);    opacity: 0.5; }
  100% { transform: translateY(-50px) scale(2); opacity: 0; }
}
