:root {
  --background: #020617;
  --foreground: #f8fafc;
  --muted: #94a3b8;
  --dim: #64748b;
  --border: #1e293b;
  --card: #0f172a;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --ok: #4ade80;
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", monospace;
}

[data-theme="light"] {
  --background: #ffffff;
  --foreground: #0f172a;
  --muted: #475569;
  --dim: #64748b;
  --border: #e2e8f0;
  --card: #f8fafc;
  --accent: #0284c7;
  --accent-soft: rgba(2, 132, 199, 0.08);
  --ok: #16a34a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 20px; }
h1 { font-size: clamp(2.6rem, 6.5vw, 4.6rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 16px; }

a { color: var(--accent); text-decoration: none; }
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.accent { color: var(--accent); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 16px;
}

.lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 32px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(2, 6, 23, 0.82);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--foreground);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand-mark { width: 26px; height: 26px; color: var(--accent); flex-shrink: 0; }

.nav-links {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 180ms ease;
}

.nav-links a:hover { color: var(--foreground); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.btn-primary { background: var(--accent); color: #041525; }
.btn-primary:hover { background: #5cc9fa; transform: translateY(-1px); }

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--foreground);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--accent); }

.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.cta-row.center { justify-content: center; }
.center { text-align: center; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 110px 0 80px;
}

.hero-glow {
  position: absolute;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 520px;
  background: radial-gradient(closest-side, rgba(56, 189, 248, 0.16), transparent);
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 41, 59, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 41, 59, 0.5) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, black 25%, transparent 75%);
  pointer-events: none;
}

.hero .container { position: relative; }

.hero-terminal {
  margin-top: 56px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.6);
  overflow: hidden;
  max-width: 780px;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.terminal-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border);
}

.terminal-bar em {
  margin-left: 10px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--dim);
}

.hero-terminal pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.85;
  color: var(--foreground);
}

.t-dim { color: var(--dim); }
.t-ok { color: var(--ok); }
.t-mono { color: var(--muted); }
.t-accent { color: var(--accent); }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--card); border-block: 1px solid var(--border); }
.section-cta { padding: 120px 0; }
.section-cta .lede { margin-inline: auto; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.split p { color: var(--muted); }

/* ---------- Pillars ---------- */
.pillars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.pillars li { display: flex; gap: 16px; }

.pillars svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 3px;
}

.pillars strong { display: block; margin-bottom: 4px; }
.pillars span { color: var(--muted); font-size: 0.95rem; }

/* ---------- Workflow ---------- */
.workflow {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.workflow li {
  background: var(--background);
  padding: 28px 26px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
}

.workflow strong { display: block; font-size: 1.05rem; margin-bottom: 8px; }
.workflow p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 26px 24px;
  transition: border-color 200ms ease, transform 200ms ease;
}

.card:hover { border-color: rgba(56, 189, 248, 0.5); transform: translateY(-3px); }

.card svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
  margin-bottom: 16px;
}

.card p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---------- Pipeline map ---------- */
.split-reverse { grid-template-columns: 1.1fr 1fr; }

.map-figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--background);
  padding: 20px;
}

.map-figure svg { width: 100%; height: auto; display: block; }

.map-figure figcaption {
  font-size: 0.82rem;
  color: var(--dim);
  padding-top: 12px;
  text-align: center;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
}

.checklist li {
  padding-left: 26px;
  position: relative;
  margin-bottom: 10px;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 14px;
  height: 8px;
  border-left: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg) scale(0.85);
}

/* ---------- Safety ---------- */
.safety-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.safety-item {
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent 60%);
  border-radius: 0 12px 12px 0;
  padding: 22px 24px;
}

.safety-item strong { display: block; margin-bottom: 6px; }
.safety-item p { color: var(--muted); font-size: 0.93rem; margin: 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 32px 0; }

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--dim);
  font-size: 0.88rem;
}

.footer nav { display: flex; gap: 20px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--foreground); }

/* ---------- Light theme component overrides ---------- */
[data-theme="light"] .nav { background: rgba(255, 255, 255, 0.85); }

[data-theme="light"] .hero-glow {
  background: radial-gradient(closest-side, rgba(2, 132, 199, 0.09), transparent);
}

[data-theme="light"] .hero-grid {
  background-image:
    linear-gradient(rgba(226, 232, 240, 0.9) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 232, 240, 0.9) 1px, transparent 1px);
}

/* The terminal and pipeline map stay dark in light mode — they read as
   product screenshots, and their SVG/text colors are tuned for dark. */
[data-theme="light"] .hero-terminal {
  background: #0f172a;
  border-color: #1e293b;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}
[data-theme="light"] .hero-terminal pre { color: #f8fafc; }
[data-theme="light"] .terminal-bar { border-color: #1e293b; }
[data-theme="light"] .terminal-bar span { background: #1e293b; }
[data-theme="light"] .terminal-bar em { color: #64748b; }
[data-theme="light"] .t-ok { color: #4ade80; }
[data-theme="light"] .t-accent { color: #38bdf8; }
[data-theme="light"] .t-mono { color: #94a3b8; }

[data-theme="light"] .map-figure { background: #020617; border-color: #1e293b; }
[data-theme="light"] .map-figure figcaption { color: #94a3b8; }

[data-theme="light"] .workflow li { background: var(--background); }

[data-theme="light"] .card:hover { border-color: rgba(2, 132, 199, 0.45); }

[data-theme="light"] .btn-primary { background: var(--accent); color: #ffffff; }
[data-theme="light"] .btn-primary:hover { background: #0369a1; }

[data-theme="light"] .hero-terminal .t-dim { color: #64748b; }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 380ms ease-out, transform 380ms ease-out;
}

.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .split, .split-reverse { grid-template-columns: 1fr; gap: 40px; }
  .workflow { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .hero { padding: 72px 0 56px; }
  .nav-links { display: none; }
  .workflow, .cards, .safety-grid { grid-template-columns: 1fr; }
}
