/* ============================= */
/* RESET */
/* ============================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0e0e10;
  --text: #f5f5f5;
  --muted: #9ca3af;
  --accent: #3b82f6;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ============================= */
/* BACKGROUND LAYERS */
/* ============================= */

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -3;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: url("noise.png");
  opacity: 0.04;
  pointer-events: none;
  z-index: -2;
}

/* Disable heavy visuals for low performance */
.low-performance #bg-canvas {
  display: none;
}

/* ============================= */
/* LAYOUT */
/* ============================= */

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* ============================= */
/* NAVIGATION */
/* ============================= */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 0;
  backdrop-filter: blur(10px);
}

.nav a {
  margin-left: 28px;
  text-decoration: none;
  color: var(--muted);
  transition: 0.4s cubic-bezier(.22,1,.36,1);
}

.nav a:hover {
  color: var(--text);
}

.logo {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ============================= */
/* HERO */
/* ============================= */

.hero {
  padding: 180px 0;
  text-align: center;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.gradient {
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================= */
/* SECTIONS */
/* ============================= */

.section {
  padding: 140px 0;
  position: relative;
}

.section h2 {
  font-size: 34px;
  margin-bottom: 40px;
}

/* Alternating sections */
.alt {
  background: rgba(255,255,255,0.02);
  border-radius: 20px;
  padding: 60px;
}

/* ============================= */
/* GRID */
/* ============================= */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
}

/* ============================= */
/* GLASS CARDS */
/* ============================= */

.card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 40px;
  border-radius: 20px;
  transition: 0.6s cubic-bezier(.22,1,.36,1);
  transform-style: preserve-3d;
}

.card:hover {
  transform: translateY(-10px) rotateX(2deg) rotateY(-2deg);
}

/* ============================= */
/* REVEAL ANIMATION */
/* ============================= */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: 1s cubic-bezier(.22,1,.36,1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ============================= */
/* METRICS */
/* ============================= */

.section h3.counter {
  font-size: 60px;
  margin-top: 20px;
}

/* ============================= */
/* PROGRESS BAR */
/* ============================= */

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg,#3b82f6,#8b5cf6);
  width: 0%;
  z-index: 9999;
}

/* ============================= */
/* OVERLAY LABEL */
/* ============================= */

.label-overlay {
  position: fixed;
  top: 20%;
  left: 10%;
  font-size: 120px;
  opacity: 0.03;
  pointer-events: none;
}

/* ============================= */
/* ACCESSIBILITY */
/* ============================= */

a:focus,
button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.flow-wrapper {
  display:flex;
  justify-content:center;
  margin-top:60px;
}

.flow-svg {
  max-width:800px;
}

.node {
  fill:rgba(255,255,255,0.05);
  stroke:#3b82f6;
  stroke-width:2;
  transition:0.6s cubic-bezier(.22,1,.36,1);
}

.node:hover {
  fill:#3b82f6;
}

.node-text {
  fill:#ffffff;
  font-size:14px;
  pointer-events:none;
}

.flow-line {
  stroke:#8b5cf6;
  stroke-width:2;
  stroke-dasharray:6 6;
  opacity:0.5;
}

/* FLOW MAP */

.flow-wrapper {
  display:flex;
  justify-content:center;
  margin-top:60px;
  overflow:hidden;
}

.flow-svg {
  width:100%;
  max-width:800px;
  height:auto;
}

.node {
  fill:rgba(255,255,255,0.05);
  stroke:#3b82f6;
  stroke-width:2;
  cursor:pointer;
  transition:0.5s cubic-bezier(.22,1,.36,1);
}

.node.active-node {
  fill:#3b82f6;
  transform:scale(1.1);
}

.node-text {
  fill:#ffffff;
  font-size:14px;
  pointer-events:none;
}

.flow-line {
  stroke:#8b5cf6;
  stroke-width:2;
  stroke-dasharray:6 6;
  opacity:0.5;
  transition:1s ease;
}

/* MOBILE FLOW STACK */
@media (max-width:768px){
  .flow-svg {
    viewBox:0 0 400 800;
  }
}

.node:hover {
  filter:drop-shadow(0 0 12px rgba(59,130,246,0.6));
}