:root {
  --bg-primary: #0b0f14;
  --bg-secondary: #111820;
  --bg-card: #141d26;
  --bg-terminal: #0a0f14;
  --accent: #10b981;
  --accent-dim: rgba(16, 185, 129, 0.12);
  --text-primary: #e8edf2;
  --text-secondary: #7a8fa6;
  --text-muted: #4a5f73;
  --border: #1e2d3d;
  --red: #f87171;
  --amber: #fbbf24;
  --font-display: 'DM Serif Display', serif;
  --font-mono: 'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── TOPBAR ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 18px; color: var(--accent); }
.brand-name { font-family: var(--font-mono); font-weight: 500; font-size: 14px; letter-spacing: 0.05em; color: var(--text-primary); }
.topbar-meta .mono-text { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.1em; }

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 40px 80px;
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 2; max-width: 900px; }
.hero-bg-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(16,185,129,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,185,129,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
}
.hero-label { margin-bottom: 24px; }
.label-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(16,185,129,0.25);
  padding: 5px 12px;
  border-radius: 2px;
}
.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(56px, 8vw, 96px);
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}
.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 48px;
}

/* ── TERMINAL ── */
.hero-terminal {
  background: var(--bg-terminal);
  border: 1px solid var(--border);
  border-radius: 6px;
  max-width: 640px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.red { background: #f87171; }
.terminal-dot.amber { background: #fbbf24; }
.terminal-dot.green { background: #10b981; }
.terminal-title { font-size: 11px; color: var(--text-muted); margin-left: 8px; letter-spacing: 0.08em; }
.terminal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.terminal-line { display: flex; gap: 12px; color: var(--text-secondary); font-size: 12.5px; line-height: 1.5; }
.ts { color: var(--text-muted); flex-shrink: 0; }
.ok { color: var(--accent); flex-shrink: 0; font-weight: 500; }
.highlight { color: var(--text-primary); }

/* ── SECTIONS ── */
section { padding: 100px 40px; }
.section-header { margin-bottom: 64px; }
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* ── MODULES ── */
.modules { background: var(--bg-secondary); }
.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.module-card {
  background: var(--bg-card);
  padding: 48px 40px;
  position: relative;
}
.module-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}
.module-name {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-primary);
  margin-bottom: 14px;
  line-height: 1.3;
}
.module-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── LOOP ── */
.loop { background: var(--bg-primary); }
.loop-inner { max-width: 960px; }
.loop-header { margin-bottom: 64px; }
.loop-stages { display: flex; align-items: center; gap: 0; }
.stage { flex: 1; position: relative; }
.stage-icon { margin-bottom: 16px; }
.stage-content h3 {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.stage-content p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.stage-connector { width: 40px; flex-shrink: 0; position: relative; }
.stage-connector::after {
  content: '';
  position: absolute;
  top: 20px; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.stage-connector::before {
  content: '→';
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 0 4px;
}

/* ── RISK ── */
.risk { background: var(--bg-secondary); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.risk-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.risk-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.5vw, 48px);
  line-height: 1.2;
  margin-bottom: 20px;
}
.risk-body { color: var(--text-secondary); font-size: 16px; line-height: 1.7; }
.risk-rules { display: flex; flex-direction: column; gap: 16px; }
.rule { display: flex; align-items: flex-start; gap: 16px; }
.rule-indicator {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 9px;
  box-shadow: 0 0 8px var(--accent);
}
.rule p { font-size: 15px; color: var(--text-secondary); line-height: 1.5; }
.rule p strong { color: var(--text-primary); }

/* ── PERFORMANCE ── */
.performance { background: var(--bg-primary); }
.perf-header { margin-bottom: 64px; }
.perf-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.perf-card {
  background: var(--bg-card);
  padding: 36px 32px;
}
.perf-card.wide { grid-column: span 2; }
.perf-value {
  font-family: var(--font-mono);
  font-size: 40px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 10px;
}
.perf-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.perf-note { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ── CLOSING ── */
.closing { background: var(--bg-secondary); border-top: 1px solid var(--border); }
.closing-inner { max-width: 760px; }
.closing-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.2;
  margin-bottom: 32px;
}
.closing-body { font-size: 17px; color: var(--text-secondary); line-height: 1.75; margin-bottom: 20px; }

/* ── FOOTER ── */
.footer { padding: 48px 40px; border-top: 1px solid var(--border); }
.footer-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-tagline { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; }
.footer-legal { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .topbar { padding: 14px 20px; }
  section { padding: 72px 20px; }
  .hero { padding: 100px 20px 60px; }
  .modules-grid { grid-template-columns: 1fr; }
  .risk-inner { grid-template-columns: 1fr; gap: 40px; }
  .loop-stages { flex-direction: column; gap: 24px; }
  .stage-connector { display: none; }
  .perf-grid { grid-template-columns: repeat(2, 1fr); }
  .perf-card.wide { grid-column: span 2; }
  .footer-top { flex-direction: column; gap: 12px; }
}

@media (max-width: 480px) {
  .perf-grid { grid-template-columns: 1fr; }
  .perf-card.wide { grid-column: span 1; }
  .hero-headline { font-size: 48px; }
}