:root {
  --ink: #101113;
  --plate: #17181b;
  --plate-2: #1e2024;
  --line: rgb(255 255 255 / 8%);
  --steel: #8b8f98;
  --silver: #d6d8dd;
  --white: #f6f7f9;
  --add: #3ecf8e;
  --del: #f26d6d;
  --display: 'Funnel Display', system-ui, sans-serif;
  --sans: 'Funnel Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(1200px 700px at 50% -200px, #26282d 0%, transparent 70%), var(--ink);
  color: var(--silver);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; border-radius: 6px; }
h1, h2 { font-family: var(--display); color: var(--white); margin: 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(30px, 4vw, 46px); line-height: 1.08; font-weight: 600; }

.button {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #c9ccd2);
  color: #121316; font-weight: 600; text-decoration: none;
  box-shadow: inset 0 -1px 0 rgb(0 0 0 / 25%), 0 8px 30px rgb(255 255 255 / 8%);
  transition: transform .15s ease, box-shadow .15s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: inset 0 -1px 0 rgb(0 0 0 / 25%), 0 12px 40px rgb(255 255 255 / 14%); }
.button svg { width: 18px; height: 18px; fill: currentColor; }
.button-small { height: 36px; padding: 0 14px; border-radius: 9px; font-size: 15px; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(20px, 4vw, 48px);
  background: rgb(16 17 19 / 72%); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font: 600 18px var(--display); color: var(--white); text-decoration: none; }
.brand img { border-radius: 7px; }
.nav nav { display: flex; align-items: center; gap: 26px; font-size: 15px; }
.nav nav a:not(.button) { color: var(--steel); text-decoration: none; }
.nav nav a:not(.button):hover { color: var(--white); }

/* hero */
.hero { padding: clamp(64px, 10vw, 120px) 20px 0; text-align: center; }
.headline {
  font-size: clamp(44px, 7.4vw, 92px); line-height: .98; font-weight: 600;
  background: linear-gradient(100deg, #8d9098 0%, #f6f7f9 30%, #b9bcc3 48%, #ffffff 52%, #9a9ea6 75%, #e7e9ec 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 2.4s cubic-bezier(.2, .7, .2, 1) .1s both;
}
@keyframes sheen { from { background-position: 100% 0; opacity: 0; transform: translateY(12px); } 30% { opacity: 1; transform: none; } to { background-position: 0 0; } }
.lede { max-width: 620px; margin: 26px auto 0; font-size: clamp(17px, 1.6vw, 20px); color: var(--steel); animation: rise .8s ease .35s both; }
.cta { margin-top: 34px; animation: rise .8s ease .5s both; }
.fine { margin: 14px 0 0; font-size: 14px; color: var(--steel); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* branch graph: three worktrees merge down into the app window */
.graph { position: relative; max-width: 1200px; margin: 40px auto -2px; }
.graph svg { display: block; width: 100%; height: auto; overflow: visible; }
.lane { fill: none; stroke: #5b5f67; stroke-width: 2; stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 1.6s cubic-bezier(.6, 0, .2, 1) forwards; }
.lane-2 { stroke: #c9ccd2; animation-delay: .7s; }
.lane-1 { animation-delay: .9s; }
.lane-3 { animation-delay: 1.05s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.commit { fill: var(--ink); stroke: var(--white); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.c2 { animation-delay: 1.5s; } .c1 { animation-delay: 1.8s; } .c3 { animation-delay: 1.95s; }
@keyframes pop { from { transform: scale(0); } }
.tag {
  position: absolute; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap;
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--plate);
  font: 13px var(--mono); color: var(--silver); transform: translate(-50%, -50%);
  animation: rise .6s ease both;
}
.tag b { font-weight: 500; }
.tag i { font-style: normal; }
.add { color: var(--add); } .del { color: var(--del); }
.tag-1 { left: 20.8%; top: 6%; animation-delay: 1.9s; }
.tag-2 { left: 50%; top: 18%; animation-delay: 1.65s; }
.tag-3 { left: 79.2%; top: 6%; animation-delay: 2.05s; }

.window {
  max-width: 1200px; margin: 0 auto; padding: 0;
  border-radius: 14px; box-shadow: 0 0 0 1px var(--line), 0 40px 120px rgb(0 0 0 / 70%), 0 -20px 80px rgb(255 255 255 / 4%);
  overflow: hidden; background: var(--plate);
  animation: rise 1s ease 1.2s both;
}
@supports (animation-timeline: view()) {
  .hero .window { transform-origin: 50% 0; animation: rise 1s ease 1.2s both, flatten linear both; animation-timeline: auto, view(); animation-range: normal, entry 0% cover 45%; }
  @keyframes flatten { from { transform: perspective(1600px) rotateX(16deg) scale(.94); } to { transform: none; } }
}

/* works with */
.works-with { padding: 90px 20px 40px; text-align: center; }
.works-with p { margin: 0 0 18px; color: var(--steel); font-size: 15px; }
.works-with ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 34px; margin: 0; padding: 0; list-style: none; font: 500 22px var(--display); color: var(--silver); }

/* loop demo */
.loop {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 80px); align-items: center;
  max-width: 1200px; margin: 0 auto; padding: 110px 20px;
}
.steps { margin: 36px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.steps li { display: grid; gap: 2px; padding: 14px 18px; border-radius: 12px; border: 1px solid transparent; transition: background .4s, border-color .4s; }
.steps strong { color: var(--white); font-weight: 600; }
.steps span { color: var(--steel); font-size: 16px; }
.steps li.active { background: var(--plate); border-color: var(--line); }

.stage { border-radius: 14px; background: var(--plate); box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgb(0 0 0 / 50%); overflow: hidden; font: 13.5px/1.9 var(--mono); }
.stage-bar { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 14px; border-bottom: 1px solid var(--line); font-family: var(--sans); font-size: 14px; }
.stage-bar b { color: var(--white); font-weight: 600; }
.stage-bar em { color: var(--steel); font-style: normal; }
.dots { display: flex; gap: 7px; margin-right: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #3a3c41; }
.code { padding: 14px 0; }
.ln { padding: 0 16px; white-space: pre; overflow: hidden; text-overflow: ellipsis; color: var(--silver); }
.ln u { display: inline-block; width: 34px; color: #5b5f67; text-decoration: none; }
.ln.add { color: var(--silver); background: rgb(62 207 142 / 9%); box-shadow: inset 3px 0 var(--add); }
.note {
  display: grid; gap: 2px; margin: 10px 16px 4px 50px; padding: 10px 14px; border-radius: 10px;
  background: var(--plate-2); border: 1px solid var(--line); font-family: var(--sans); font-size: 15px; line-height: 1.45;
  opacity: 0; transform: translateY(6px);
}
.note-label { color: var(--steel); font-size: 12.5px; }
.typed { color: var(--white); display: inline-block; overflow: hidden; white-space: nowrap; width: 0; max-width: 100%; }
.term { border-top: 1px solid var(--line); background: #0d0e10; padding: 12px 16px 16px; min-height: 124px; }
.send { display: inline-block; margin-bottom: 8px; padding: 2px 12px; border-radius: 999px; background: #3f4bd8; color: #fff; font-family: var(--sans); font-size: 13px; opacity: 0; }
.send b { font-weight: 600; }
.term-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; }
.prompt { color: var(--white); }
.reply { color: var(--steel); }
.spark { color: #e08a6a; }

/* one 9s loop, started when the stage scrolls into view */
.stage.playing .sel { animation: select 9s infinite; }
.stage.playing .note { animation: note 9s infinite; }
.stage.playing .typed { animation: type 9s steps(56) infinite; }
.stage.playing .send { animation: send 9s infinite; }
.stage.playing .prompt { animation: prompt 9s infinite; }
.stage.playing .reply { animation: reply 9s infinite; }
@keyframes select { 0%, 12% { background: rgb(62 207 142 / 9%); } 16%, 88% { background: rgb(120 132 255 / 26%); } 94%, 100% { background: rgb(62 207 142 / 9%); } }
@keyframes note { 0%, 20% { opacity: 0; transform: translateY(6px); } 24%, 88% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; } }
@keyframes type { 0%, 26% { width: 0; } 50%, 100% { width: 100%; } }
@keyframes send { 0%, 54% { opacity: 0; } 58%, 88% { opacity: 1; } 94%, 100% { opacity: 0; } }
@keyframes prompt { 0%, 62% { opacity: 0; transform: translateX(-6px); } 66%, 88% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; } }
@keyframes reply { 0%, 72% { opacity: 0; } 76%, 88% { opacity: 1; } 94%, 100% { opacity: 0; } }

/* before and after */
.compare { max-width: 1200px; margin: 0 auto; padding: 100px 20px 40px; }
.compare table { width: 100%; border-collapse: collapse; margin-top: 40px; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 18px 24px 18px 0; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 400; }
.compare thead th { padding-top: 0; color: var(--steel); font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.compare thead th:last-child { color: var(--white); }
.compare tbody th { width: 200px; color: var(--steel); font: 500 13px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.compare td { color: var(--steel); }
.compare td:last-child { color: var(--white); }

/* more */
.more { max-width: 1200px; margin: 0 auto; padding: 40px 20px 110px; }
.more dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 48px; margin: 44px 0 64px; }
.more dl div { border-top: 1px solid var(--line); padding-top: 18px; }
.more dt { color: var(--white); font: 600 19px var(--display); }
.more dd { margin: 6px 0 0; color: var(--steel); font-size: 16px; }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 0 0 56px; }
.gallery figure { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--plate); }
.gallery img { display: block; width: 100%; }
.gallery figcaption { padding: 14px 18px; color: var(--steel); font-size: 15px; }

/* install */
.install { max-width: 1200px; margin: 0 auto; padding: 90px 20px 130px; border-top: 1px solid var(--line); }
.install ol { counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; margin: 44px 0 48px; padding: 0; list-style: none; }
.install li { counter-increment: step; display: grid; align-content: start; gap: 6px; }
.install li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 8px; border-radius: 50%; border: 1px solid #5b5f67; color: var(--white); font: 500 15px var(--mono); }
.install strong { color: var(--white); font: 600 19px var(--display); }
.install span { color: var(--steel); font-size: 16px; }

.footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px clamp(20px, 4vw, 48px); border-top: 1px solid var(--line); color: var(--steel); font-size: 14px; }
.footer span { display: flex; align-items: center; gap: 8px; }
.footer img { border-radius: 5px; }

@media (max-width: 860px) {
  .nav nav a:not(.button) { display: none; }
  .loop { grid-template-columns: 1fr; padding: 80px 20px; }
  .more dl, .install ol { grid-template-columns: 1fr; gap: 28px; }
  .gallery { grid-template-columns: 1fr; }
  .compare tbody th { width: 120px; }
  .compare th, .compare td { padding-right: 12px; font-size: 14px; }
  .tag { font-size: 10px; padding: 4px 7px; }
  .tag-1, .tag-3 { display: none; }
  .ln { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .lane { stroke-dashoffset: 0; }
  .note, .send, .term-line { opacity: 1; transform: none; }
  .typed { width: auto; white-space: normal; }
  .headline { background-position: 0 0; }
}
