/* ---------- Design tokens ---------- */
:root {
  --ink: #0b1522;          /* page background */
  --ink-2: #0f1c2e;        /* brand navy, raised surfaces */
  --ink-3: #142438;
  --line: #1f3047;         /* hairlines on dark */
  --line-strong: #2c4260;
  --text: #e8eef5;
  --text-muted: #8a9bb3;
  --text-dim: #5d708a;
  --accent: #0099bb;       /* brand cyan */
  --accent-bright: #22b8d8;
  --warn: #c86a6a;

  --paper: #f3f6f9;        /* light section */
  --paper-line: #d5dee8;
  --paper-text: #0f1c2e;
  --paper-muted: #4a6080;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --max-width: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --header-height: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-height); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5.4vw, 4.5rem); font-weight: 300; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.875rem); font-weight: 300; }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
p { margin: 0; }
::selection { background: var(--accent); color: #fff; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: .5rem 1rem;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }

/* Shared label style: uppercase mono with tracking */
.eyebrow, .index, .cap-num, .step-num, .stat dt, .compare thead th, .console-bar, .site-nav a {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow { color: var(--accent-bright); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 21, 34, .82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-height); }
.brand img { height: 20px; width: auto; }

.site-nav ul { display: flex; gap: 2.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--text-muted); text-decoration: none; transition: color .2s; }
.site-nav a:hover { color: var(--text); }

.nav-toggle { display: none; background: none; border: 0; padding: .75rem .25rem; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--text); transition: transform .25s var(--ease); }
.nav-toggle span + span { margin-top: 6px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: var(--header-height); left: 0; right: 0;
    background: var(--ink); border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: .5rem var(--gutter) 1.25rem; }
  .site-nav li a { display: block; padding: .85rem 0; border-bottom: 1px solid var(--line); }
  .site-nav li:last-child a { border-bottom: 0; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(5rem, 13vw, 10rem) 0 clamp(4rem, 9vw, 7rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}
/* Engineering grid, fading out toward the bottom */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  opacity: .55;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 20%, transparent 75%);
}
.hero-inner { display: grid; gap: clamp(3rem, 6vw, 5rem); }
.hero-copy { max-width: 46rem; }
.hero .eyebrow { margin-bottom: 1.75rem; }
.hero h1 { margin-bottom: 1.75rem; }
.lead { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); color: var(--text-muted); max-width: 40rem; }

@media (min-width: 1040px) {
  .hero-inner { grid-template-columns: minmax(0, 1.5fr) minmax(400px, 1fr); align-items: end; }
}

/* Console illustration */
.console {
  margin: 0;
  background: rgba(15, 28, 46, .85);
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: .8125rem;
  line-height: 1.5;
  box-shadow: 0 30px 80px -40px rgba(0, 153, 187, .35);
}
.console-bar {
  display: flex; align-items: center; gap: .9rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text-dim);
  font-size: .6875rem;
}
.console-dots { display: inline-flex; gap: 5px; }
.console-dots i { width: 7px; height: 7px; border: 1px solid var(--line-strong); }
.console-status { margin-left: auto; color: var(--accent-bright); display: inline-flex; align-items: center; gap: .45rem; }
.console-status::before {
  content: ""; width: 6px; height: 6px; background: var(--accent-bright);
  animation: pulse 2s infinite;
}
.console-log { list-style: none; margin: 0; padding: 1.1rem 1rem 1.25rem; display: grid; gap: .55rem; }
.console-log li { display: grid; grid-template-columns: 5.5rem 1fr; gap: .75rem; color: var(--text-muted); }
.console-log .tag { color: var(--text-dim); }
.console-log .tag::before { content: "▸ "; color: var(--line-strong); }
.console-log .ok { color: var(--text); }
.console-log .ok .tag { color: var(--accent-bright); }
.console-log .ok .tag::before { content: "✓ "; color: var(--accent-bright); }

/* Lines type in one after another once revealed */
.js .console-log li { opacity: 0; transform: translateX(-6px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.js .console.is-visible .console-log li { opacity: 1; transform: none; }
.console-log li:nth-child(2) { transition-delay: .25s; }
.console-log li:nth-child(3) { transition-delay: .5s; }
.console-log li:nth-child(4) { transition-delay: .75s; }
.console-log li:nth-child(5) { transition-delay: 1s; }

@keyframes pulse { 50% { opacity: .25; } }

/* ---------- Sections ---------- */
.section { padding: clamp(5rem, 10vw, 8.5rem) 0; }
.section-rule { border-top: 1px solid var(--line); }

.section-head { max-width: 50rem; margin-bottom: clamp(3rem, 6vw, 4.5rem); }
.index { color: var(--text-dim); margin-bottom: 1.5rem; display: flex; align-items: center; gap: .75rem; }
.index span { color: var(--accent-bright); }
.index::after { content: ""; height: 1px; width: 3rem; background: var(--line-strong); }
.section-lead { margin-top: 1.5rem; color: var(--text-muted); font-size: 1.0625rem; max-width: 42rem; }

/* Stats */
.stats { display: grid; margin: 0; border-top: 1px solid var(--line); }
.stat { padding: 2rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: .75rem; }
.stat dt { color: var(--text-dim); font-size: .6875rem; max-width: 18rem; line-height: 1.6; }
.stat dd {
  margin: 0;
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -0.04em;
}
.stat dd small { font-size: .38em; letter-spacing: 0; color: var(--accent-bright); margin-left: .2em; }

@media (min-width: 760px) {
  .stats { grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
  .stat { padding: 2.5rem 2rem; border-bottom: 0; }
  .stat:first-child { padding-left: 0; }
  .stat + .stat { border-left: 1px solid var(--line); }
}

/* Capabilities */
.capabilities { display: grid; border-top: 1px solid var(--line); }
.capability {
  position: relative;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 1rem;
}
.capability::before {
  content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 0;
  background: var(--accent); transition: width .6s var(--ease);
}
.capability:hover::before { width: 100%; }
.cap-num { color: var(--accent-bright); }
.capability h3 { font-size: clamp(1.375rem, 2.2vw, 1.75rem); font-weight: 400; }
.capability p:not(.cap-num):not(.outcome) { color: var(--text-muted); max-width: 34rem; }
.outcome {
  margin-top: auto; padding-top: 1rem;
  font-size: .9375rem; color: var(--text);
  display: flex; gap: .75rem; align-items: baseline;
}
.outcome::before { content: "→"; color: var(--accent-bright); font-family: var(--font-mono); }

@media (min-width: 860px) {
  .capabilities { grid-template-columns: 1fr 1fr; }
  .capability { padding: 3rem 3rem 3rem 0; }
  .capability:nth-child(even) { padding: 3rem 0 3rem 3rem; border-left: 1px solid var(--line); }
}

/* Comparison (light section) */
.section-light { background: var(--paper); color: var(--paper-text); }
.section-light .index { color: var(--paper-muted); }
.section-light .index span { color: var(--accent); }
.section-light .index::after { background: var(--paper-line); }
.section-light .section-lead { color: var(--paper-muted); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 1rem; }
.compare th, .compare td { text-align: left; padding: 1.35rem 1.5rem 1.35rem 0; border-bottom: 1px solid var(--paper-line); vertical-align: top; }
.compare thead th { font-size: .6875rem; color: var(--paper-muted); border-bottom: 1px solid var(--paper-text); padding-bottom: 1rem; }
.compare thead .col-ext { color: #a44a4a; }
.compare thead .col-nz { color: var(--accent); }
.compare tbody th { font-weight: 500; width: 32%; }
.compare .col-ext { color: var(--paper-muted); width: 34%; }
.compare tbody .col-nz { font-weight: 500; }
.compare tbody .col-nz::before {
  content: ""; display: inline-block; width: 6px; height: 6px; background: var(--accent);
  margin-right: .7rem; vertical-align: middle; transform: translateY(-1px);
}

@media (max-width: 640px) {
  .compare { min-width: 0; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .compare tr { display: block; padding: 1.5rem 0; border-bottom: 1px solid var(--paper-line); }
  .compare tbody tr:first-child { border-top: 1px solid var(--paper-text); }
  .compare th, .compare td { display: block; width: auto !important; padding: 0; border: 0; }
  .compare tbody th { margin-bottom: .9rem; }
  .compare td { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: .3rem 0; }
  .compare td::before {
    content: attr(data-label);
    font-family: var(--font-mono); font-size: .625rem; letter-spacing: .12em; text-transform: uppercase;
    padding-top: .3rem;
  }
  .compare td.col-ext::before { color: #a44a4a; }
  .compare td.col-nz::before { color: var(--accent); }
  .compare tbody .col-nz::before { content: attr(data-label); display: block; width: auto; height: auto; background: none; margin: 0; transform: none; }
}

/* Process */
.steps { list-style: none; margin: 0; padding: 0 0 0 1.375rem; display: grid; gap: 0; }
.step { position: relative; padding: 2rem 0 2rem 3.5rem; border-left: 1px solid var(--line-strong); }
.step:last-child { border-left-color: transparent; }
.step-num {
  position: absolute; left: 0; top: 2rem; transform: translateX(-50%);
  background: var(--ink); color: var(--accent-bright);
  border: 1px solid var(--line-strong);
  width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
  font-size: .6875rem;
}
.step h3 { margin: .55rem 0 .75rem; }
.step p { color: var(--text-muted); font-size: .9375rem; max-width: 22rem; }

@media (min-width: 860px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 2rem; padding-left: 0; }
  .step { padding: 4.25rem 0 0; border-left: 0; }
  .step::before {
    content: ""; position: absolute; top: 1.375rem; left: 2.75rem; right: -2rem;
    height: 1px; background: var(--line-strong);
  }
  .step:last-child::before { display: none; }
  .step-num { top: 0; left: 0; transform: none; }
}

/* Closing */
.closing { padding: clamp(5rem, 11vw, 9rem) 0; }
.closing .eyebrow { margin-bottom: 1.5rem; }
.closing-statement {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(2rem, 4.6vw, 3.75rem); line-height: 1.1; letter-spacing: -0.03em;
  max-width: 58rem; text-wrap: balance;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 2.25rem 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.footer-inner img { height: 16px; width: auto; opacity: .85; }
.site-footer p { color: var(--text-dim); font-family: var(--font-mono); font-size: .75rem; letter-spacing: .04em; }

/* ---------- 404 ---------- */
.not-found { min-height: calc(100vh - var(--header-height) - 100px); display: flex; align-items: center; }
.not-found h1 { margin: 1.5rem 0; }
.not-found a { color: var(--accent-bright); font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; }
.not-found a:hover { text-decoration: underline; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .console-log li { opacity: 1; transform: none; }
}
