:root {
  color-scheme: light dark;
  --ink: #17171a;
  --muted: #6a6a72;
  --text-soft: #4c4c55;
  --text-faint: #8a8a92;
  --paper: #f5f4ef;
  --surface: #fffefb;
  --surface-muted: #ecebe4;
  --surface-subtle: #f1f0ea;
  --line: #e0ded5;
  --line-strong: #cfccc0;
  --merged: #1f7a4d;
  --merged-soft: #dcefe3;
  --armed: #8a5a12;
  --armed-soft: #f2e7d2;
  --ink-invert: #ffffff;
  --shadow: 0 24px 70px rgba(20, 20, 22, 0.14);
  --mono: "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ecebe6;
    --muted: #9a9a9f;
    --text-soft: #c4c3bd;
    --text-faint: #7c7c84;
    --paper: #141416;
    --surface: #1c1c1f;
    --surface-muted: #262629;
    --surface-subtle: #212124;
    --line: #303034;
    --line-strong: #3d3d42;
    --merged: #4bbd84;
    --merged-soft: #17352a;
    --armed: #d6a24e;
    --armed-soft: #33290f;
    --ink-invert: #141416;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 140ms ease;
}

code {
  font-family: var(--mono);
}

.page-width {
  margin-inline: auto;
  max-width: 1180px;
  padding-inline: 26px;
}

/* ---- nav ---- */
.nav {
  align-items: center;
  display: flex;
  height: 82px;
  justify-content: space-between;
}

.logo {
  align-items: center;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 780;
  gap: 11px;
  letter-spacing: -0.03em;
}

.logo-mark,
.bot-mark {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  object-fit: cover;
  padding: 2px;
}

.nav nav {
  align-items: center;
  display: flex;
  font-size: 0.9rem;
  gap: 26px;
}

.nav nav a {
  color: var(--muted);
}

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

/* ---- hero ---- */
.hero {
  align-items: center;
  display: grid;
  gap: clamp(36px, 5vw, 68px);
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  min-height: 560px;
  padding-block: 44px 88px;
}

.hero-copy {
  min-width: 0;
}

.hero-copy h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4.6vw, 4.15rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin: 0;
  overflow-wrap: break-word;
}

.hero-sub {
  color: var(--muted);
  display: block;
  font-size: 0.4em;
  font-style: italic;
  letter-spacing: -0.02em;
  margin-top: 0.5em;
}

.hero-description {
  color: var(--text-soft);
  font-size: clamp(1.02rem, 1.4vw, 1.16rem);
  line-height: 1.62;
  margin: 26px 0 0;
  max-width: 560px;
}

.hero-actions {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 30px;
  max-width: 100%;
}

.install {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 11px 14px;
  text-decoration: none;
  white-space: nowrap;
}

.install .v {
  color: var(--merged);
  font-weight: 700;
}

.platform {
  color: var(--text-faint);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

/* ---- stack visualization ---- */
.stack-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
  transform: rotate(1.1deg);
}

.stack-card-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr auto;
  padding: 16px 18px;
}

.stack-card-header div {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.stack-card-header strong {
  font-size: 0.85rem;
}

.stack-card-header div span {
  color: var(--muted);
  font-size: 0.7rem;
}

.status {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 760;
  letter-spacing: 0.02em;
  padding: 5px 10px;
  text-transform: lowercase;
}

.status-armed {
  background: var(--armed-soft);
  color: var(--armed);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 20px 18px 8px;
  position: relative;
}

/* the rail behind the commit dots */
.stack::before {
  background: var(--line-strong);
  bottom: 30px;
  content: "";
  left: 32px;
  position: absolute;
  top: 34px;
  width: 2px;
}

.pr {
  align-items: center;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 11px;
  display: grid;
  gap: 12px;
  grid-template-columns: 18px 1fr;
  padding: 13px 15px;
  position: relative;
  transition:
    background-color 300ms ease,
    border-color 300ms ease;
}

.dot {
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  grid-column: 1;
  grid-row: 1;
  height: 14px;
  justify-self: center;
  transition:
    background-color 300ms ease,
    border-color 300ms ease;
  width: 14px;
  z-index: 1;
}

.check {
  color: var(--ink-invert);
  font-size: 0.7rem;
  font-weight: 800;
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  opacity: 0;
  transition: opacity 300ms ease;
  z-index: 2;
}

.pr-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.pr-branch {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.pr-base {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.stack-foot {
  color: var(--text-faint);
  font-size: 0.72rem;
  padding: 6px 18px 18px;
  text-align: center;
}

/* bottom-up merge cascade: the bottom row lights first, then up the stack */
@keyframes mergePulse {
  0%,
  6% {
    background: var(--surface-subtle);
    border-color: var(--line);
  }
  16%,
  46% {
    background: var(--merged-soft);
    border-color: var(--merged);
  }
  60%,
  100% {
    background: var(--surface-subtle);
    border-color: var(--line);
  }
}

@keyframes dotMerge {
  0%,
  6% {
    background: var(--surface);
    border-color: var(--line-strong);
  }
  16%,
  46% {
    background: var(--merged);
    border-color: var(--merged);
  }
  60%,
  100% {
    background: var(--surface);
    border-color: var(--line-strong);
  }
}

@keyframes checkMerge {
  0%,
  10% {
    opacity: 0;
  }
  18%,
  46% {
    opacity: 1;
  }
  58%,
  100% {
    opacity: 0;
  }
}

.pr {
  animation: mergePulse 5.1s ease-in-out infinite;
}
.pr .dot {
  animation: dotMerge 5.1s ease-in-out infinite;
}
.pr .check {
  animation: checkMerge 5.1s ease-in-out infinite;
}

.pr:nth-child(1),
.pr:nth-child(1) .dot,
.pr:nth-child(1) .check {
  animation-delay: 3.4s;
}
.pr:nth-child(2),
.pr:nth-child(2) .dot,
.pr:nth-child(2) .check {
  animation-delay: 1.7s;
}
.pr:nth-child(3),
.pr:nth-child(3) .dot,
.pr:nth-child(3) .check {
  animation-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  .pr,
  .pr .dot,
  .pr .check {
    animation: none;
  }
  .bottom {
    background: var(--merged-soft);
    border-color: var(--merged);
  }
  .bottom .dot {
    background: var(--merged);
    border-color: var(--merged);
  }
  .bottom .check {
    opacity: 1;
  }
}

/* ---- how it works ---- */
.steps {
  padding-block: 84px 108px;
}

.steps-heading h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0;
}

.step-grid {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 46px;
}

.step-grid article {
  border-right: 1px solid var(--line);
  padding: 30px 32px 8px 0;
}

.step-grid article + article {
  padding-left: 32px;
}

.step-grid article:last-child {
  border-right: 0;
  padding-right: 0;
}

.step-index {
  color: var(--merged);
  font-family: var(--serif);
  font-size: 0.9rem;
}

.step-grid h3 {
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  margin: 26px 0 12px;
}

.step-grid p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.66;
  margin: 0;
}

.step-grid code {
  background: var(--surface-muted);
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.82em;
  padding: 1px 5px;
}

/* ---- footer ---- */
.footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 0.78rem;
  gap: 12px;
  justify-content: space-between;
  min-height: 96px;
}

/* ---- responsive ---- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-bottom: 60px;
  }
  .stack-card {
    transform: none;
  }
  .step-grid {
    grid-template-columns: 1fr;
  }
  .step-grid article,
  .step-grid article + article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 26px 0;
  }
  .step-grid article:last-child {
    border-bottom: 0;
  }
}
