:root,
[data-theme="light"] {
  --bg: #f2f7f6;
  --bg-elev: #ffffff;
  --line: #d8e6e3;
  --line-bright: #b8d0cb;
  --ink: #0c1f1c;
  --ink-dim: #3a524e;
  --ink-mute: #5c726e;
  --brand: #0d5c5c;
  --accent: #147a75;
  --accent-dim: #0d5c5c;
  --warn: #c44e18;
  --signal: #3d5a9e;
  --grid: rgba(13, 92, 92, 0.07);
  --nav-bg: rgba(242, 247, 246, 0.88);
  --glow-a: rgba(20, 122, 117, 0.09);
  --glow-b: rgba(13, 92, 92, 0.06);
  --scope-grid: rgba(0, 0, 0, 0.05);
  --scope-readout-bg: rgba(255, 255, 255, 0.94);
  --scope-shadow: 0 28px 56px rgba(13, 92, 92, 0.1);
  --scope-inset: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  --stage-hover: rgba(20, 122, 117, 0.05);
  --on-accent: #f2f7f6;
}
[data-theme="dark"] {
  --bg: #08100f;
  --bg-elev: #0e1817;
  --line: #18221f;
  --line-bright: #243431;
  --ink: #e8eceb;
  --ink-dim: #8a9794;
  --ink-mute: #4f5d5a;
  --brand: #2a8a8a;
  --accent: #5fe3d8;
  --accent-dim: #2a8a8a;
  --warn: #ff8a4c;
  --signal: #9ab4ff;
  --grid: rgba(120, 200, 195, 0.025);
  --nav-bg: rgba(8, 16, 15, 0.88);
  --glow-a: rgba(95, 227, 216, 0.07);
  --glow-b: rgba(42, 138, 138, 0.05);
  --scope-grid: rgba(255, 255, 255, 0.02);
  --scope-readout-bg: rgba(8, 16, 15, 0.92);
  --scope-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
  --scope-inset: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  --stage-hover: rgba(95, 227, 216, 0.04);
  --on-accent: #08100f;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  color-scheme: light;
}
html[data-theme="dark"] { color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geist', -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse 1200px 600px at 70% -10%, var(--glow-a), transparent 60%),
              radial-gradient(ellipse 800px 500px at 0% 100%, var(--glow-b), transparent 60%);
  pointer-events: none; z-index: 0;
  transition: background 0.35s ease;
}
body,
nav,
.scope,
.metric,
.tech-cell,
.case,
.stage {
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.25s ease, box-shadow 0.35s ease;
}
.mono { font-family: 'JetBrains Mono', monospace; }
.serif { font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; }

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 32px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.theme-toggle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-bright);
  background: var(--bg-elev);
  color: var(--ink-dim);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle:focus-visible,
.nav-links a:focus-visible,
.btn:focus-visible,
.logo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.theme-toggle .theme-icon {
  width: 14px;
  height: 14px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}
[data-theme="light"] .theme-toggle .icon-dark,
:root:not([data-theme]) .theme-toggle .icon-dark { display: inline-flex; }
[data-theme="dark"] .theme-toggle .icon-light { display: inline-flex; }
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border-radius: 6px;
}
.logo img {
  height: 36px;
  width: auto;
  display: block;
  border-radius: 6px;
}
.nav-links { display: flex; gap: 28px; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.nav-links a { color: var(--ink-dim); text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }
.nav-status { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-dim); display: flex; align-items: center; gap: 8px; }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ─── HERO ─── */
.hero {
  position: relative; z-index: 1;
  min-height: 100vh;
  padding: 140px 32px 80px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
  align-items: center; max-width: 1400px; margin: 0 auto;
}
.hero-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-dim);
  letter-spacing: 0.12em; text-transform: uppercase;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 32px;
}
.hero-meta .bar { width: 40px; height: 1px; background: var(--accent); }
h1 {
  font-family: 'Geist', sans-serif;
  font-size: clamp(48px, 6.5vw, 92px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 32px;
}
h1 .em { font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; color: var(--accent); }
.hero-sub {
  font-size: 17px; color: var(--ink-dim); max-width: 480px; margin-bottom: 40px;
  line-height: 1.6;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 14px 22px; border: 1px solid var(--line-bright);
  background: transparent; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
  transition: all 0.2s; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn .arrow { transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ─── HERO VISUAL: Oscilloscope ─── */
.scope {
  position: relative;
  border: 1px solid var(--line-bright);
  background: var(--bg-elev);
  padding: 24px;
  height: 480px;
  box-shadow: var(--scope-shadow), var(--scope-inset);
}
.scope-header {
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--ink-dim); letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.scope-screen {
  position: relative; height: calc(100% - 80px);
  background:
    linear-gradient(var(--scope-grid) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, var(--scope-grid) 1px, transparent 1px) 0 0 / 12.5% 100%;
  border: 1px solid var(--line);
}
.scope svg { width: 100%; height: 100%; }
.trace {
  fill: none; stroke-width: 1.5;
  filter: drop-shadow(0 0 4px currentColor);
}
.trace-gpu { stroke: var(--warn); animation: dash 8s linear infinite; stroke-dasharray: 4 2; opacity: 0.7; }
.trace-fpga { stroke: var(--accent); }
.scope-legend {
  display: flex; gap: 24px; margin-top: 12px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.scope-legend span { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); }
.scope-legend .swatch { width: 12px; height: 2px; }
.swatch-gpu { background: var(--warn); }
.swatch-fpga { background: var(--accent); }
.scope-pulse { fill: var(--accent); }
.stage-icon svg [stroke],
.case-visual svg [stroke] { stroke: var(--accent); }
.stage-icon svg [fill]:not([fill="none"]),
.case-visual svg [fill]:not([fill="none"]) { fill: var(--accent); }
.case-visual svg [fill="none"] { fill: none; }
@keyframes dash { to { stroke-dashoffset: -100; } }

.scope-readout {
  position: absolute; top: 60px; right: 36px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--accent); text-align: right;
  background: var(--scope-readout-bg); padding: 8px 10px;
  border: 1px solid var(--line);
}
.scope-readout .big { font-size: 20px; font-weight: 700; display: block; }

/* ─── SECTION SCAFFOLD ─── */
section { position: relative; z-index: 1; padding: 120px 32px; max-width: 1400px; margin: 0 auto; scroll-margin-top: 88px; }
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-mute);
  letter-spacing: 0.16em; text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
}
.section-label::before { content: ''; width: 6px; height: 6px; background: var(--accent); }
h2 {
  font-size: clamp(36px, 4.5vw, 64px);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.0;
  margin-bottom: 24px;
  max-width: 900px;
}
h2 .em { font-family: 'Instrument Serif', serif; font-style: italic; color: var(--accent); }
.lede { font-size: 18px; color: var(--ink-dim); max-width: 640px; margin-bottom: 64px; line-height: 1.6; }

/* ─── ARCHITECTURE / PIPELINE ─── */
.pipeline {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border: 1px solid var(--line-bright);
  background: var(--bg-elev);
  position: relative;
}
.stage {
  padding: 36px 28px;
  border-right: 1px solid var(--line);
  position: relative;
  transition: background 0.3s;
}
.stage:last-child { border-right: none; }
.stage:hover { background: var(--stage-hover); }
.stage-num { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--accent); letter-spacing: 0.1em; margin-bottom: 24px; }
.stage-icon {
  width: 56px; height: 56px; border: 1px solid var(--line-bright);
  margin-bottom: 24px; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.stage h3 { font-size: 18px; font-weight: 500; margin-bottom: 8px; letter-spacing: -0.01em; }
.stage p { font-size: 13px; color: var(--ink-dim); line-height: 1.5; font-family: 'JetBrains Mono', monospace; }
.stage-latency {
  margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line);
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-mute);
  display: flex; justify-content: space-between;
}
.stage-latency b { color: var(--accent); font-weight: 500; }
.arrow-flow {
  position: absolute; top: 50%; right: -8px;
  width: 16px; height: 16px;
  background: var(--bg);
  border: 1px solid var(--accent);
  transform: translateY(-50%) rotate(45deg);
  z-index: 2;
}
.arrow-flow::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 6px; height: 6px;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  transform: translate(-50%, -50%) rotate(-45deg);
}
.stage:last-child .arrow-flow { display: none; }

/* ─── METRICS ─── */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 64px; }
.metric { background: var(--bg); padding: 40px 28px; }
.metric-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-mute); letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 16px; }
.metric-value { font-size: 48px; font-weight: 300; letter-spacing: -0.03em; line-height: 1; }
.metric-value .unit { font-size: 16px; color: var(--ink-dim); margin-left: 4px; }
.metric-value .accent { color: var(--accent); }
.metric-note { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-dim); margin-top: 12px; }

/* ─── TECH STACK / CAPABILITIES ─── */
.tech-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tech-cell {
  background: var(--bg);
  padding: 40px;
  position: relative;
  transition: background 0.3s;
}
.tech-cell:hover { background: var(--bg-elev); }
.tech-cell-num { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-mute); letter-spacing: 0.1em; margin-bottom: 20px; }
.tech-cell h3 { font-size: 22px; font-weight: 400; margin-bottom: 12px; letter-spacing: -0.02em; }
.tech-cell h3 .accent { color: var(--accent); }
.tech-cell p { font-size: 14px; color: var(--ink-dim); line-height: 1.6; max-width: 460px; }
.tech-cell .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; padding: 4px 10px; border: 1px solid var(--line-bright); color: var(--ink-dim); letter-spacing: 0.08em; }

/* ─── USE CASES ─── */
.cases-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.case {
  border: 1px solid var(--line);
  padding: 28px 24px;
  position: relative;
  aspect-ratio: 3/4;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: all 0.3s;
  overflow: hidden;
}
.case:hover { border-color: var(--accent); }
.case::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s;
}
.case:hover::before { transform: scaleX(1); }
.case-id { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-mute); letter-spacing: 0.1em; }
.case-visual { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 0; }
.case h3 { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 4px; }
.case p { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-dim); line-height: 1.5; }

/* ─── HYBRID DIAGRAM ─── */
.hybrid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  border: 1px solid var(--line-bright); background: var(--bg-elev);
  padding: 48px; margin-top: 48px;
}
.hybrid-side { padding: 24px; border: 1px dashed var(--line-bright); }
.hybrid-side h4 {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--accent); letter-spacing: 0.15em; text-transform: uppercase;
  margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.hybrid-side h4::before { content: ''; width: 8px; height: 8px; background: var(--accent); }
.hybrid-side.gpu h4 { color: var(--signal); }
.hybrid-side.gpu h4::before { background: var(--signal); }
.hybrid-side h5 { font-size: 22px; font-weight: 400; margin-bottom: 16px; letter-spacing: -0.02em; }
.hybrid-side ul { list-style: none; }
.hybrid-side li { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-dim); padding: 6px 0; padding-left: 16px; position: relative; }
.hybrid-side li::before { content: '─'; position: absolute; left: 0; color: var(--ink-mute); }

/* ─── TEAM / FOOTER ─── */
.closing {
  border-top: 1px solid var(--line);
  margin-top: 60px;
  padding: 100px 32px 60px;
}
.closing-inner { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: 1.5fr 1fr; gap: 80px; align-items: end; }
.closing h2 { margin-bottom: 32px; }
.contact-grid { display: grid; gap: 24px; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.contact-row { display: grid; grid-template-columns: 120px 1fr; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: center; }
.contact-row .k { color: var(--ink-mute); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.contact-row .v { color: var(--ink); }
.contact-row .v a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.contact-row .v a:hover { border-bottom-color: var(--accent); }
footer {
  padding: 24px 32px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--ink-mute); letter-spacing: 0.1em; text-transform: uppercase;
  max-width: 1400px; margin: 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ─── REVEAL ANIMATIONS ─── */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 0.8s, transform 0.8s; }
[data-reveal].in { opacity: 1; transform: translateY(0); }

/* ─── RESPONSIVE ─── */
@media (max-width: 980px) {
  html { scroll-padding-top: 120px; }
  nav {
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 12px 20px;
  }
  .nav-links {
    order: 3;
    flex: 1 1 100%;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-status span:last-child { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 128px; }
  .pipeline, .metrics, .tech-grid, .cases-grid, .hybrid, .closing-inner { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .cases-grid { grid-template-columns: repeat(2, 1fr); }
  .stage { border-right: none; border-bottom: 1px solid var(--line); }
  .stage:last-child { border-bottom: none; }
  .arrow-flow { display: none; }
  section { padding: 80px 20px; }
  .scope { height: 360px; }
  .contact-row { grid-template-columns: 1fr; gap: 6px; }
  .closing { padding: 80px 20px 48px; }
  footer { padding: 20px; justify-content: center; text-align: center; }
}
@media (max-width: 520px) {
  .metrics, .cases-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { justify-content: center; }
  .hybrid { padding: 28px 20px; }
}
