:root {
  --bg: #0e1714;
  --bg-2: #15211c;
  --panel: #1b2a24;
  --ink: #e8f0eb;
  --muted: #9bb0a4;
  --line: rgba(232, 240, 235, 0.12);
  --accent: #d4a017;
  --accent-2: #3ecf8e;
  --teal: #1f8a70;
  --danger: #e07a5f;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(31, 138, 112, 0.28), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(212, 160, 23, 0.16), transparent 50%),
    linear-gradient(180deg, #0c1411 0%, var(--bg) 40%, #0b1210 100%);
  min-height: 100vh;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.top, main, footer { position: relative; z-index: 1; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 6vw;
  position: sticky;
  top: 0;
  backdrop-filter: blur(14px);
  background: rgba(14, 23, 20, 0.72);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.1rem;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
nav a:hover { color: var(--ink); }

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
  padding: 4.5rem 6vw 2.5rem;
  min-height: min(88vh, 760px);
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: 0.95;
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.12rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 36rem;
  margin: 0 0 1.6rem;
}
.lede strong { color: var(--ink); font-weight: 600; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: var(--accent-2);
  color: #062016;
}
.btn.ghost {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.hero-viz {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background:
    linear-gradient(160deg, rgba(31, 138, 112, 0.18), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 320px;
}
#spike-canvas {
  width: 100%;
  height: auto;
  display: block;
}
.chip-badge {
  position: absolute;
  left: 1rem;
  bottom: 2.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(8, 16, 13, 0.78);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.viz-caption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.65rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.pulse {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.7);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(62, 207, 142, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); }
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem 6vw 3rem;
}
.metrics article {
  background: rgba(27, 42, 36, 0.85);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.2rem 1.25rem;
  transform: translateY(12px);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.6s ease;
}
.metrics article.in { transform: none; opacity: 1; }
.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.metric-value {
  margin: 0.35rem 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.7rem);
  color: var(--accent);
}
.metric-note { margin: 0; color: var(--muted); font-size: 0.88rem; }

.section-head {
  padding: 0 6vw 1.4rem;
  max-width: 44rem;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  margin: 0 0 0.45rem;
}
.section-head p { margin: 0; color: var(--muted); }

.pipeline { padding: 1.5rem 0 3rem; }
.flow {
  list-style: none;
  margin: 0;
  padding: 0 6vw;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}
.flow-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.15rem;
  position: relative;
  overflow: hidden;
  animation: rise 0.8s ease both;
  animation-delay: calc(var(--i) * 0.12s);
}
.flow-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 207, 142, 0.18), transparent 70%);
}
.step {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-2);
  margin-bottom: 0.55rem;
}
.flow-card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.flow-card p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.45; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.split { padding: 1rem 0 3rem; }
.power-grid {
  padding: 0 6vw;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.4rem;
  align-items: stretch;
}
.power-chart, .callouts {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 1.25rem;
}
.bar-wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: end;
  min-height: 240px;
  padding: 0.5rem 0.25rem 0;
}
.bar {
  position: relative;
  height: calc(var(--h) + 18%);
  border-radius: 0.65rem 0.65rem 0.3rem 0.3rem;
  transform-origin: bottom;
  transform: scaleY(0.05);
  animation: grow 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.bar.ours { background: linear-gradient(180deg, #56e0a5, #1f8a70); animation-delay: 0.1s; }
.bar.base { background: linear-gradient(180deg, #f0c14b, #b07a12); }
.bar.base:last-child { animation-delay: 0.25s; }
.bar::after {
  content: attr(data-val);
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  white-space: nowrap;
}
.bar::before {
  content: attr(data-label);
  position: absolute;
  bottom: -2.1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}
@keyframes grow { to { transform: scaleY(1); } }
.chart-caption {
  margin: 2.6rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.callouts {
  list-style: none;
  margin: 0;
  display: grid;
  gap: 0.85rem;
  align-content: start;
}
.callouts li {
  padding: 0.85rem 0.95rem;
  border-left: 3px solid var(--accent);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 0 0.6rem 0.6rem 0;
  color: var(--muted);
  line-height: 1.45;
}
.callouts strong { color: var(--ink); }

.gallery { padding: 1rem 0 3rem; }
.gallery-grid {
  padding: 0 6vw;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.gallery-grid figure {
  margin: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.gallery-grid figure:hover {
  transform: translateY(-4px);
  border-color: rgba(62, 207, 142, 0.4);
}
.gallery-grid img {
  width: 100%;
  display: block;
  background: #fff;
}
.gallery-grid figcaption {
  padding: 0.75rem 0.9rem 0.95rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.code { padding: 1rem 0 4rem; }
.tree {
  margin: 0 6vw 1.25rem;
  padding: 1.1rem 1.2rem;
  overflow: auto;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: #09110e;
  color: #cfe5d8;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
}
.code .cta-row { padding: 0 6vw; }

footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 6vw 2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 980px) {
  .hero, .power-grid, .flow, .metrics, .gallery-grid {
    grid-template-columns: 1fr;
  }
  .hero { min-height: auto; padding-top: 2.5rem; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .top { padding-inline: 1.2rem; }
  .section-head, .flow, .power-grid, .gallery-grid, .tree, .code .cta-row, .metrics, .hero {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }
}

@media (max-width: 560px) {
  .metrics { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  nav { display: none; }
}
