/* Layout: reads left to right, top to bottom. A live timeline band under the hero, then a
   single thread (the weft) steps down and to the right through each section to the download. */
:root {
  --ink: #0b0b0d;
  --crimson: #ba1434;
  --wine: #7b1831;
  --rose: #e5a6b2;
  --lavender: #aaa6b0;
  --white: #faf8fa;
  --cyan: #1fcee7;
  --line: rgba(170, 166, 176, 0.14);
  --claude: #e5732e;
  --codex: #3b8eea;
  --cursor: #9a6fd6;
  --opencode: #d9a520;
  --antigravity: #d05bb4;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --step: clamp(0px, 7vw, 120px);
  /* Left edge of the content column; the nav lines up with it. */
  --inset: calc(var(--gutter) + clamp(0px, 4vw, 64px));
}
* { box-sizing: border-box; }
/* clip, not hidden: mobile Safari still pans sideways under body { overflow-x: hidden }, and the
   hero and section glows reach past the viewport. clip also keeps the sticky bar working. */
html { background: var(--ink); scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; color: var(--white); font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
h1, h2 { margin: 0; font-weight: 600; letter-spacing: -0.04em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.fine { font-family: var(--mono); font-size: 12px; color: var(--lavender); }
.eyebrow { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rose); }
.sub { color: var(--lavender); font-size: 16px; max-width: 34em; margin-top: 14px; }

/* Top bar: transparent at the top so the wine glow bleeds through; blurs once the page scrolls. */
.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--inset); background: transparent; border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
}
.bar.scrolled {
  padding-top: 14px; padding-bottom: 14px; background: rgba(11, 11, 13, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: rgba(170, 166, 176, 0.07);
}
.brand { display: inline-flex; align-items: center; gap: 14px; font-weight: 600; font-size: 24px; text-decoration: none; letter-spacing: -0.025em; }
.brand img { width: 42px; height: 42px; border-radius: 10px; }
.bar nav { display: flex; gap: 36px; font-size: 17px; }
.bar nav a { text-decoration: none; color: var(--lavender); transition: color 0.2s ease; }
.bar nav a:hover { color: var(--white); }
.bar nav .go { color: var(--cyan); }

/* Buttons */
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 18px 0 15px;
  border-radius: 10px; text-decoration: none; font-weight: 500; font-size: 15px; white-space: nowrap;
  color: var(--white); border: 1px solid var(--line); background: transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(170, 166, 176, 0.45); background: rgba(170, 166, 176, 0.06); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--cyan); border-color: var(--cyan); color: var(--ink); font-weight: 600; box-shadow: 0 10px 30px -12px rgba(31, 206, 231, 0.55); }
.btn.primary:hover { background: #4fdaee; box-shadow: 0 16px 36px -12px rgba(31, 206, 231, 0.75); }
.btn svg { width: 16px; height: 16px; flex: none; transition: transform 0.25s ease; }
.btn:hover svg { transform: translateY(2px); }
.btn small { font-weight: 400; opacity: 0.7; font-size: 13px; }

/* Linux: the AppImage button with a small, quiet .deb segment joined on. */
.btn-group { display: inline-flex; transition: transform 0.2s ease; }
.btn-group:hover { transform: translateY(-2px); }
.btn-group > .btn { transform: none; }
.btn-group > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn.seg {
  margin-left: -1px; padding: 0 13px; gap: 0; border-top-left-radius: 0; border-bottom-left-radius: 0;
  font: 500 12.5px var(--mono); color: var(--lavender); background: transparent; box-shadow: none;
}
.btn.seg:hover { color: var(--white); }
.btn.primary + .btn.seg { border-color: rgba(31, 206, 231, 0.55); color: var(--cyan); background: rgba(31, 206, 231, 0.08); }
.btn.primary + .btn.seg:hover { background: rgba(31, 206, 231, 0.16); }

/* Hero: top left */
.hero { position: relative; padding: clamp(50px, 9vh, 110px) var(--gutter) 40px var(--inset); max-width: 1280px; }
.hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 1000px; height: 820px; left: -220px; top: -380px;
  background: radial-gradient(closest-side, rgba(123, 24, 49, 0.55), transparent);
}
.hero h1 { font-size: clamp(40px, 4.6vw, 64px); line-height: 1.02; margin: 20px 0 20px; }
.hero .lede { color: var(--lavender); font-size: 18px; max-width: 32em; }
.hero .fine { margin-top: 22px; }

/* Timeline band, full bleed, fading into the page on every edge */
.river { position: relative; }
.river-mask {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 86%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 9%, #000 86%, transparent);
}
#river {
  display: block; width: 100%; height: 340px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 82%, transparent);
}
.river-foot {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px;
  padding: 6px var(--gutter) 0 calc(var(--inset) + 28px);
}
.legend { display: inline-flex; flex-wrap: wrap; gap: 4px 16px; }
.legend > span { white-space: nowrap; }
.live { color: var(--rose); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: -0.5px; }
.dot.claude { background: var(--claude); }
.dot.codex { background: var(--codex); }
.dot.cursor { background: var(--cursor); }
.dot.opencode { background: var(--opencode); }
.dot.antigravity { background: var(--antigravity); }
.dia { display: inline-block; width: 8px; height: 8px; transform: rotate(45deg); border: 1.5px solid var(--lavender); margin-right: 7px; }

/* Thread markers */
.node {
  position: absolute; width: 13px; height: 13px; border-radius: 50%;
  background: var(--ink); border: 2px solid rgba(170, 166, 176, 0.5);
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.node.on { border-color: var(--cyan); background: var(--cyan); box-shadow: 0 0 0 6px rgba(31, 206, 231, 0.14); }
.river-foot .node { left: var(--inset); top: 50%; margin-top: -3px; }

/* Flow: each section steps further right */
.flow { position: relative; padding: 40px var(--gutter) 40px var(--inset); }
.thread { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.thread path { fill: none; stroke-linecap: round; }
.thread .base { stroke: rgba(170, 166, 176, 0.22); stroke-width: 1.5; }
.thread .fill { stroke: var(--cyan); stroke-width: 2; }

.step { position: relative; padding: 110px 0 40px 40px; margin-left: calc(var(--i, 0) * var(--step)); max-width: 1120px; }
.step > .node { left: -6px; top: 113px; }
.step h2 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.08; margin-top: 14px; }
.step::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; inset: -80px -120px;
  background: radial-gradient(60% 55% at 30% 40%, rgba(123, 24, 49, 0.32), transparent 70%);
}
#handoff::before { background: radial-gradient(55% 55% at 75% 50%, rgba(123, 24, 49, 0.35), transparent 70%); }
#facts::before { background: radial-gradient(50% 60% at 20% 60%, rgba(186, 20, 52, 0.16), transparent 70%); }

.step-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.tabs button {
  font: 500 14px var(--sans); color: var(--lavender); background: none; border: 0; cursor: pointer;
  padding: 10px 0; margin-bottom: -1px; border-bottom: 2px solid transparent; transition: color 0.2s ease;
}
.tabs button:hover { color: var(--white); }
.tabs button[aria-selected="true"] { color: var(--white); border-bottom-color: var(--cyan); }
.shot { margin: 30px 0 0; }
.shot img {
  display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.4);
  transition: opacity 0.35s ease, transform 0.5s ease, box-shadow 0.5s ease;
}
.shot img.swapping { opacity: 0; }
.shot:hover img { transform: translateY(-4px); box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(31, 206, 231, 0.18); }
/* Tabs advance on their own; the bar under the active tab shows how long until the next. */
.tabs button { position: relative; }
.tabs.auto button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%;
  background: rgba(250, 248, 250, 0.5); transform-origin: left; animation: tab-timer var(--tab-ms, 5000ms) linear;
}
@keyframes tab-timer { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.shot figcaption { margin-top: 14px; }

#handoff { max-width: 1060px; }
.split > * { min-width: 0; }
.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; margin-top: 34px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 26px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; }
.steps li::before {
  content: "0" counter(s); grid-row: span 2; font: 500 13px var(--mono); color: var(--rose); padding-top: 3px;
}
.steps b { font-weight: 600; font-size: 16px; }
.steps span { color: var(--lavender); }
.brief {
  margin: 0; padding: 22px 24px; border-radius: 10px; overflow-x: auto; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(123, 24, 49, 0.16), rgba(11, 11, 13, 0.4));
  font: 400 12.5px/1.7 var(--mono); color: var(--lavender);
}
.brief .h { color: var(--white); font-weight: 500; }
.brief .m { color: rgba(170, 166, 176, 0.7); }
.brief .q { color: var(--rose); }
.note { margin-top: 26px; }

#facts { max-width: 980px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 24px; font-size: 15px; }
.chip { display: inline-flex; align-items: center; transition: color 0.2s ease; }
.chip:hover { color: var(--white); }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px 44px; margin-top: 34px; }
.facts > div {
  border-top: 1px solid var(--line); padding-top: 16px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.facts > div:hover { border-top-color: var(--cyan); transform: translateY(-3px); }
.facts b { display: block; font-weight: 600; margin-bottom: 6px; transition: color 0.25s ease; }
.facts > div:hover b { color: var(--cyan); }
.facts span { color: var(--lavender); transition: color 0.25s ease; }
.facts > div:hover span { color: var(--white); }

/* Sections rise into place the first time they scroll into view (main.js adds .in). */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Last step: bottom right */
.step.end { margin-left: auto; margin-right: 0; max-width: 640px; padding-bottom: 80px; }
.step.end::before { background: radial-gradient(55% 60% at 60% 55%, rgba(186, 20, 52, 0.28), transparent 70%); }
.links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 26px; }
.links a { text-decoration: none; }
.links a:hover { color: var(--white); }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  padding: 26px var(--inset) 34px; border-top: 1px solid var(--line);
}
.foot span { display: inline-flex; align-items: center; gap: 8px; }
.foot img { width: 16px; height: 16px; border-radius: 4px; }

@media (max-width: 860px) {
  :root { --step: 0px; }
  .bar { padding: 16px var(--gutter); }
  .brand { font-size: 20px; gap: 11px; }
  .brand img { width: 34px; height: 34px; border-radius: 8px; }
  .bar nav { gap: 22px; font-size: 15px; }
  .bar nav a:not(.go) { display: none; }
  .hero { padding: 40px var(--gutter) 24px; }
  #river { height: 260px; }
  .river-foot { padding-left: calc(var(--gutter) + 28px); }
  .river-foot .node { left: calc(var(--gutter) + 2px); }
  .flow { padding: 10px var(--gutter) 20px var(--gutter); }
  .step { padding: 70px 0 20px 30px; max-width: none; }
  .step > .node { top: 73px; left: 2px; }
  .step.end { margin-left: 0; max-width: none; }
  .split, .facts { grid-template-columns: 1fr; }
  .tabs { gap: 16px; overflow-x: auto; max-width: 100%; }
  .cta .btn { width: 100%; justify-content: center; }
  .cta .btn-group { width: 100%; }
  .cta .btn-group > .btn { width: auto; }
  .cta .btn-group > .btn:first-child { flex: 1; min-width: 0; }
  /* No room for the AppImage note beside the .deb segment on a phone. */
  .cta .btn-group small { display: none; }
  .foot { padding-left: var(--gutter); padding-right: var(--gutter); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .btn svg, .node, .tabs button, .shot img, .facts > div, .bar { transition: none; }
  .reveal { opacity: 1; transform: none; }
  .tabs.auto button[aria-selected="true"]::after { animation: none; }
}
