:root {
  --bg: #070a09;
  --bg-2: #0c110f;
  --surface: #0e1512;
  --line: #1d2a24;
  --text: #e2ebe5;
  --muted: #8fa096;
  --dim: #5f7066;
  --accent: #3dff8a;
  --accent-ink: #03130a;
  --accent-soft: rgba(61, 255, 138, .12);
  --pipe: #111a16;
  --pipe-edge: #26362e;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --node: 56px;
  --gutter: 24px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  position: relative;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
/* faint dot grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(61, 255, 138, .08) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 35%, #000 25%, transparent 75%);
          mask-image: radial-gradient(ellipse at 50% 35%, #000 25%, transparent 75%);
}

.mono { font-family: var(--mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
a { color: var(--accent); }

.skip { position: absolute; left: -9999px; top: 12px; z-index: 20; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; }
.skip:focus { left: 12px; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  background: linear-gradient(var(--bg) 35%, transparent);
}
.mark { color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.mark span, .wordmark span { color: var(--accent); }
.hire {
  color: var(--accent); text-decoration: none; font-size: .85rem;
  padding: 6px 12px; border: 1px solid var(--accent); border-radius: 4px;
  transition: background .2s, color .2s;
}
.hire:hover { background: var(--accent); color: var(--accent-ink); }

/* ---------- pipe ---------- */
main { position: relative; z-index: 2; }
.pipe { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none; }
.pipe path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.p-measure { stroke: none; }
.p-edge { stroke: var(--pipe-edge); stroke-width: 20; }
.p-body { stroke: var(--pipe); stroke-width: 14; }
.p-glow { stroke: var(--accent); stroke-width: 24; opacity: .13; }
.p-fill { stroke: var(--accent); stroke-width: 8; }
.p-mask { stroke: #fff; stroke-width: 10; }
.p-flow {
  stroke: rgba(3, 19, 10, .55); stroke-width: 3;
  stroke-dasharray: 2 16;
  animation: flow .7s linear infinite;
}
@keyframes flow { to { stroke-dashoffset: -18; } }
.p-glow, .p-fill, .p-head, .p-head-glow { visibility: hidden; }
.flowing .p-glow, .flowing .p-fill { visibility: visible; }
.has-head .p-head, .has-head .p-head-glow { visibility: visible; }
.p-head { fill: #d9ffe8; }

.flange {
  width: 36px; height: 16px;
  background: var(--pipe); border: 2px solid var(--pipe-edge); border-radius: 4px;
  transition: border-color .4s, box-shadow .4s;
}
.flowing .inlet, .output.on .sink { border-color: var(--accent); box-shadow: 0 0 24px rgba(61, 255, 138, .45); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; place-content: center; text-align: center;
  padding: 0 var(--gutter);
}
.prompt { color: var(--dim); font-size: .85rem; margin: 0 0 12px; }
.wordmark {
  margin: 0; font-weight: 700; line-height: 1;
  font-size: clamp(3.2rem, 13vw, 8.5rem); letter-spacing: -.05em;
}
.wordmark span { text-shadow: 0 0 48px rgba(61, 255, 138, .35); }
.tagline { color: var(--muted); font-size: clamp(.95rem, 2.2vw, 1.2rem); margin: 22px 0 0; min-height: 1.6em; }
.caret {
  display: inline-block; width: .55em; height: 1.1em; margin-left: 3px;
  background: var(--accent); vertical-align: -.18em;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.cue {
  position: absolute; left: 0; right: 0; bottom: 104px; margin: 0;
  color: var(--dim); font-size: .75rem; letter-spacing: .08em;
  transition: opacity .4s;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(5px); } }
.flowing .cue { opacity: 0; }
.inlet { position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); }

/* ---------- stages ---------- */
.pipeline { max-width: 1040px; margin: 0 auto; padding: 12vh var(--gutter) 0; }
.stage {
  display: flex; align-items: flex-start; gap: 28px;
  margin-bottom: clamp(170px, 30vh, 300px);
}
.stage:nth-child(even) { flex-direction: row-reverse; }
.node {
  flex: none; width: var(--node); height: var(--node); border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-2); border: 2px solid var(--pipe-edge);
  color: var(--dim); font-size: .8rem; font-weight: 500;
  transition: border-color .4s, color .4s, box-shadow .4s;
}
.stage.on .node {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft), 0 0 32px rgba(61, 255, 138, .35);
}
.card { max-width: 460px; padding-top: 6px; }
.js .card { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .stage.seen .card { opacity: 1; transform: none; }
.cmd { color: var(--accent); font-size: .8rem; margin: 0 0 6px; }
.card h2 { font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.15; letter-spacing: -.03em; margin: 0 0 8px; }
.hook { color: var(--muted); font-size: 1.05rem; margin: 0 0 16px; }

summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font: 500 .8rem var(--mono); color: var(--text);
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .2s;
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; color: var(--accent); }
details[open] summary::before { content: "−"; }
summary:hover { border-color: var(--accent); }
.more {
  margin-top: 14px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: 6px;
}
.more ul { margin: 0; padding-left: 1.1em; }
.more li { margin: 4px 0; }
.more li::marker { color: var(--accent); }
.meta { margin: 12px 0 0; font: .72rem var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- output / terminal ---------- */
.output { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter) 6vh; min-height: 85vh; }
.sink { margin: 0 auto; }
.terminal {
  margin-top: -2px;
  background: #040706; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  transition: border-color .3s, box-shadow .4s;
}
.output.on .terminal { box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 60px rgba(61, 255, 138, .08); }
.terminal:focus-within { border-color: var(--accent); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--pipe-edge); }
.term-bar span { margin-left: auto; color: var(--dim); font-size: .72rem; }
.term-body { padding: 18px 20px; font-size: .9rem; line-height: 1.75; min-height: 280px; max-height: 440px; overflow-y: auto; cursor: text; }
.term-out p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.term-out .cmdline { color: var(--text); }
.term-out .cmdline::before { content: "~$ "; color: var(--accent); }
.term-out .ok { color: var(--accent); }
.term-out .dim { color: var(--muted); }
.term-out .err { color: #ff8b80; }
.term-form { display: flex; align-items: center; gap: 10px; }
.term-form label { color: var(--accent); white-space: nowrap; }
.term-form input {
  flex: 1; min-width: 0; padding: 0; border: 0; outline: none; background: transparent;
  color: var(--text); font: inherit; caret-color: var(--accent);
}

.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.btn {
  padding: 13px 20px; border: 1px solid var(--accent); border-radius: 6px;
  color: var(--accent); text-decoration: none; font-size: .9rem; font-weight: 500;
  transition: background .2s, color .2s, box-shadow .2s;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn:hover { box-shadow: 0 0 28px rgba(61, 255, 138, .35); }
.foot { margin-top: 64px; text-align: center; color: var(--dim); font-size: .72rem; }

.gauge {
  position: fixed; right: 18px; bottom: 16px; z-index: 10;
  color: var(--dim); font-size: .7rem; letter-spacing: .06em;
}
.gauge b { color: var(--accent); font-weight: 500; }


/* ---------- whoami tags + shipped grid ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tags li {
  font-size: .72rem; color: var(--muted);
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
}
.stage.wide .card { max-width: 620px; }
.shipped { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.ship {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: .9rem; line-height: 1.45;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.ship b { color: var(--text); font-size: 1.02rem; font-weight: 600; }
.ship-k { color: var(--accent); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; }
.ship:hover { border-color: var(--pipe-edge); transform: translateY(-2px); }
a.ship:hover { border-color: var(--accent); box-shadow: 0 0 28px rgba(61, 255, 138, .12); }
.js .stage.seen .ship { animation: rise .5s ease both; }
.js .stage.seen .ship:nth-child(2) { animation-delay: .08s; }
.js .stage.seen .ship:nth-child(3) { animation-delay: .16s; }
.js .stage.seen .ship:nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ---------- mobile: pipe runs straight down the left ---------- */
@media (max-width: 720px) {
  :root { --node: 40px; --gutter: 16px; }
  .stage, .stage:nth-child(even) { flex-direction: row; gap: 18px; margin-bottom: clamp(120px, 20vh, 200px); }
  .card { padding-top: 2px; }
  .hook { font-size: 1rem; }
  .term-form .long { display: none; }
  .term-body { padding: 16px; font-size: .85rem; }
  .shipped { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
