/* ================================================================
   RECAI Labs — homepage
   Direction: "precision laboratory" — cool near-white, disciplined
   grid, mono details, one dark band, one blue, one line.
   ================================================================ */

:root {
  --paper: #DADEE3;
  --ink: #0C1220;
  /* Darkened alongside the paper so secondary text keeps 4.5:1. */
  --slate: #4E586B;
  /* Rust is the single accent: buttons, links, pipeline, markers.
     (Slightly darkened from #B7410E to hold 4.5:1 on the grey paper.) */
  --rust: #A93E0F;
  --signal: var(--rust);
  --signal-deep: #8A3009;
  /* Same hue, lightened for legibility on the dark band. */
  --rust-on-dark: #E07B4A;
  --hairline: #C2C8D2;
  --hairline-dark: #232B3D;
  --paper-dim: #C9D0DD;

  --font-display: "Archivo", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --container: 1140px;
  --pad-x: 32px;
  --section-gap: 140px;
}

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

html {
  height: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Base elements ------------------------------------------- */

a {
  color: var(--ink);
  text-decoration: none;
  text-underline-offset: 4px;
  text-decoration-color: var(--signal);
}
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  position: relative;
}

.btn {
  display: inline-block;
  background: var(--signal);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.2;
  padding: 14px 28px;
  border-radius: 2px;
  border: 0;
  transition: background-color 150ms ease;
  min-height: 44px;
}
.btn:hover {
  background: var(--signal-deep);
  text-decoration: none;
}

.text-link {
  color: var(--signal);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 24px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  max-width: 22ch;
}

.section {
  padding-top: calc(var(--section-gap) / 2);
  padding-bottom: calc(var(--section-gap) / 2);
}

/* ---- Navigation ---------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 150ms ease;
}
.site-header.scrolled { border-bottom-color: var(--hairline); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-stretch: 112%;
  font-size: 16px;
  letter-spacing: 0.04em;
}
.wordmark:hover { text-decoration: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a:not(.btn) {
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.nav-links .btn { padding: 10px 22px; }

/* Mobile menu — details/summary so it works without JS */
.nav-menu { display: none; }
.nav-menu summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-menu summary::-webkit-details-marker { display: none; }

.nav-overlay {
  position: fixed;
  inset: 68px 0 0 0;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 40px 20px;
  z-index: 30;
}
.nav-overlay a:not(.btn) {
  font-size: 20px;
  font-weight: 500;
  padding: 10px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-overlay .btn { margin-top: 24px; }

@media (prefers-reduced-motion: no-preference) {
  .nav-menu[open] .nav-overlay { animation: menu-fade 200ms ease; }
}
@keyframes menu-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-menu { display: block; }
}

/* ---- Hero ----------------------------------------------------- */

.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 40px;
}
.hero .container { width: 100%; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  font-size: clamp(40px, 6.5vw, 72px);
  line-height: 1.05;
  max-width: 12ch;
}

.hero-sub {
  margin-top: 28px;
  font-size: 20px;
  color: var(--slate);
  max-width: 52ch;
}

.hero-ctas {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

/* ---- The gap -------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 64px;
}
.stat {
  padding: 8px 40px;
  border-left: 1px solid var(--hairline);
}
.stat:first-child {
  border-left: 0;
  padding-left: 0;
}
.stat-figure {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 500;
  color: var(--rust);
  line-height: 1.2;
}
.stat-caption {
  margin-top: 8px;
  font-size: 15px;
  color: var(--slate);
  max-width: 28ch;
}

.gap-closing {
  margin-top: 64px;
  max-width: 60ch;
}

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; row-gap: 32px; }
  .stat {
    border-left: 0;
    border-top: 1px solid var(--hairline);
    padding: 32px 0 0;
  }
  .stat:first-child { border-top: 0; padding-top: 0; }
  .gap-closing { margin-top: 48px; }
}

/* ---- Workstreams (dark band) ---------------------------------- */

.band {
  background: var(--ink);
  color: #FFFFFF;
  margin-top: calc(var(--section-gap) / 2);
  margin-bottom: calc(var(--section-gap) / 2);
  padding-top: 100px;
  padding-bottom: 100px;
}

.band .eyebrow-signal { color: var(--rust-on-dark); }
.band .section-title { color: #FFFFFF; }

.band-intro {
  margin-top: 20px;
  color: var(--paper-dim);
  max-width: 60ch;
}

.cards {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  border: 1px solid var(--hairline-dark);
  border-radius: 2px;
  padding: 40px 32px;
  background: transparent;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  font-size: 20px;
  color: #FFFFFF;
}
.card-body {
  margin-top: 16px;
  font-size: 15px;
  color: var(--paper-dim);
}

.stages {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline-dark);
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-dim);
}
.stages li {
  display: flex;
  gap: 16px;
  padding: 6px 0;
}
.stage-num { color: var(--rust-on-dark); }

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
  .band { padding-top: 72px; padding-bottom: 72px; }
}

/* ---- Split section -------------------------------------------- */

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.split-col { padding-right: 64px; }
.split-col + .split-col {
  border-left: 1px solid var(--hairline);
  padding-left: 64px;
  padding-right: 0;
}

.split-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  font-size: 28px;
  line-height: 1.2;
}
.split-body {
  margin-top: 20px;
  margin-bottom: 28px;
  color: var(--ink);
  max-width: 46ch;
}

@media (max-width: 640px) {
  .split-grid { grid-template-columns: 1fr; row-gap: 64px; }
  .split-col { padding-right: 0; }
  .split-col + .split-col {
    border-left: 0;
    border-top: 1px solid var(--hairline);
    padding-left: 0;
    padding-top: 64px;
  }
}

/* ---- Positioning line ----------------------------------------- */

.positioning {
  padding-top: calc(var(--section-gap) * 0.75);
  padding-bottom: calc(var(--section-gap) * 0.75);
}
.positioning-line {
  font-family: var(--font-display);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.3;
  max-width: 26ch;
  margin: 0 auto;
  text-align: center;
}

/* ---- CTA ------------------------------------------------------- */

.cta { padding-bottom: var(--section-gap); }
.cta-body {
  margin-top: 24px;
  margin-bottom: 40px;
  color: var(--slate);
  max-width: 55ch;
}

/* ---- Footer ---------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 0;
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.wordmark-small { font-size: 14px; }
.footer-meta {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}
.footer-meta nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-meta a {
  color: var(--slate);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ---- Pipeline line (signature element) ------------------------- */

main { position: relative; }

.pipeline {
  position: absolute;
  /* Drawn stroke sits at x=1 inside this 2px box, so the visible
     line lands at container-left + 10px (clamped to 10px). */
  left: max(9px, calc(50% - 561px));
  width: 2px;
  /* No-JS fallback geometry: approximate, static, fully filled.
     script.js replaces top/height with measured values. */
  top: 45vh;
  bottom: 420px;
  pointer-events: none;
}
.pipeline-svg { display: block; width: 2px; height: 100%; overflow: visible; }
.pipeline-base { stroke: var(--hairline); stroke-width: 1; }
.pipeline-fill {
  stroke: var(--signal);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0; /* filled by default (no-JS / reduced motion) */
}

.p-node {
  position: absolute;
  /* Offsets resolve against the container's border box: line runs at
     container-left + 10px, node is 8px wide -> left = 10 - 4 = 6px. */
  left: 6px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--paper);
  transition: background-color 200ms ease, border-color 200ms ease;
}
.p-node.on-dark { background: var(--ink); }
.p-node.filled {
  background: var(--signal);
  border-color: var(--signal);
}
.hero .p-node { top: 8px; }

@media (max-width: 900px) {
  .pipeline, .p-node { display: none; }
}

/* Without JS the nodes render filled (static instrument at rest). */
html:not(.js) .p-node {
  background: var(--signal);
  border-color: var(--signal);
}

/* ---- Reveal (single subtle fade-up) ---------------------------- */

@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 400ms ease-out, transform 400ms ease-out;
  }
  html.js .reveal.in {
    opacity: 1;
    transform: none;
  }
}

/* ---- Responsive ------------------------------------------------ */

@media (max-width: 640px) {
  :root {
    --pad-x: 20px;
    --section-gap: 80px;
  }
  body { font-size: 16px; }
  .hero-sub { font-size: 18px; }
  .eyebrow { font-size: 12px; }
  .stat-figure { font-size: 32px; }
  .card { padding: 32px 24px; }
  .split-title { font-size: 24px; }
  .footer-meta { gap: 16px; }
}
