:root {
  --bg: #07090d;
  --bg-2: #0d1117;
  --card: #111620;
  --line: #1f2733;
  --fg: #eef2f7;
  --muted: #94a3b8;
  --brand: #ff8c42;
  --brand-2: #ffb36b;
  --run: #22c55e;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --r: 14px;
  --pad: clamp(16px, 4vw, 40px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
code { font-family: var(--mono); font-size: .9em; color: var(--brand-2); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #000; padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }

#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .55; }
body::before {
  content: ""; position: fixed; inset: -20% -10% auto; height: 80vh; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 50% at 70% 30%, rgba(255,140,66,.16), transparent 70%),
              radial-gradient(40% 40% at 20% 10%, rgba(34,197,94,.08), transparent 70%);
}

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px;
  padding: 14px var(--pad); backdrop-filter: blur(14px) saturate(140%);
  background: rgba(7,9,13,.6); border-bottom: 1px solid transparent; transition: border-color .3s, background .3s;
}
.nav.scrolled { border-color: var(--line); background: rgba(7,9,13,.85); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 500 15px var(--mono); letter-spacing: .02em; }
.brand b { color: var(--brand); margin-left: 4px; }
.nav nav { display: flex; gap: 22px; margin-left: auto; }
.nav nav a { text-decoration: none; color: var(--muted); font-size: 14px; transition: color .2s; }
.nav nav a:hover { color: var(--fg); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--brand); color: #120800; font-weight: 600; text-decoration: none; border: 0; cursor: pointer;
  font: 600 15px var(--sans); transition: transform .25s var(--spring), box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px var(--brand); }
.btn:active { transform: scale(.97); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--brand); box-shadow: none; }

/* HERO */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center;
  max-width: 1240px; margin: 0 auto; padding: clamp(48px, 9vh, 110px) var(--pad) 60px; min-height: 86vh;
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 500 13px var(--mono); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; margin: 0 0 24px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--run); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
h1 { font: 700 clamp(40px, 6vw, 76px)/1.02 var(--sans); letter-spacing: -.035em; margin: 0 0 24px; }
.grad { background: linear-gradient(100deg, var(--brand) 10%, var(--brand-2) 45%, #fff 90%); -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 100%; animation: sheen 8s var(--ease) infinite alternate; }
@keyframes sheen { to { background-position: 100% 0; } }
.lede { color: var(--muted); font-size: clamp(17px, 1.4vw, 19px); max-width: 56ch; margin: 0 0 32px; }
.lede em { color: var(--fg); font-style: normal; border-bottom: 2px solid var(--brand); }
.cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.install {
  position: relative; display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--fg); cursor: pointer;
  font: 500 15px var(--mono); transition: border-color .2s, transform .25s var(--spring);
}
.install:hover { border-color: var(--brand); transform: translateY(-2px); }
.install code { color: var(--fg); }
.prompt { color: var(--run); font-family: var(--mono); }
.ico { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; }
.copied { position: absolute; left: 50%; top: -34px; transform: translate(-50%, 6px); opacity: 0; pointer-events: none;
  background: var(--run); color: #03140a; font: 600 12px var(--sans); padding: 4px 10px; border-radius: 6px; transition: .25s var(--spring); }
.install.done .copied { opacity: 1; transform: translate(-50%, 0); }

/* TERMINAL */
.term { background: rgba(13,17,23,.88); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(255,140,66,.05), 0 0 80px -20px rgba(255,140,66,.25);
  transform: perspective(1400px) rotateY(-6deg) rotateX(2deg); transition: transform .8s var(--ease); }
.term:hover { transform: none; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a313c; }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 10px; font: 12px var(--mono); color: var(--muted); }
.term-body { margin: 0; padding: 18px 20px; height: 380px; overflow: hidden; font: 13px/1.7 var(--mono); color: #c9d4e2; white-space: pre-wrap; }
.term-body .c { color: var(--run); } .term-body .o { color: var(--brand); } .term-body .m { color: #6b7a90; }
.term-body .k { color: #7cc4ff; }
.caret { display: inline-block; width: 8px; height: 1.1em; background: var(--brand); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pbar { display: inline-block; width: 120px; height: 8px; background: #1b222d; border-radius: 4px; overflow: hidden; vertical-align: middle; }
.pbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--run)); transition: width .5s var(--ease); }

/* STATS */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 1240px; margin: 0 auto; padding: 0 var(--pad);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 30px 20px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font: 700 clamp(34px, 4vw, 52px)/1 var(--mono); color: var(--fg); letter-spacing: -.03em; }
.stat b::after { content: attr(data-suffix); }
.stat span { display: block; margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.4; }

/* SECTIONS */
.section { max-width: 1240px; margin: 0 auto; padding: clamp(72px, 12vh, 140px) var(--pad) 0; }
.sec-head { max-width: 760px; margin-bottom: 44px; }
.kicker { font: 500 13px var(--mono); color: var(--brand); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 14px; }
h2 { font: 700 clamp(30px, 4vw, 50px)/1.08 var(--sans); letter-spacing: -.03em; margin: 0 0 18px; }
.sec-head p { color: var(--muted); margin: 0; }

/* PICKER */
.picker { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: clamp(18px, 3vw, 32px); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  font: 500 14px var(--mono); cursor: pointer; transition: all .25s var(--spring); }
.chip:hover { color: var(--fg); border-color: #3a4556; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #120800; transform: translateY(-2px); }
.cmd { margin: 24px 0 18px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font: 14px var(--mono); overflow-x: auto; white-space: nowrap; }
.cmd code { color: var(--fg); }
.files { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.files li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  font: 13px var(--mono); color: var(--muted); transition: opacity .35s var(--ease), transform .35s var(--spring), border-color .35s, color .35s; }
.files li .tag { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #1b222d; }
.files li.keep { color: var(--fg); border-color: rgba(255,140,66,.5); }
.files li.keep .tag { background: var(--brand); color: #120800; }
.files li.drop { opacity: .28; transform: scale(.97); text-decoration: line-through; }

/* RACE */
.race { display: grid; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: clamp(18px, 3vw, 32px); }
.lane { display: grid; grid-template-columns: 170px 1fr 64px 44px; gap: 14px; align-items: center; font: 14px var(--mono); }
.lane .name { color: var(--fg); }
.track { height: 14px; background: #161c26; border-radius: 999px; overflow: hidden; }
.bar { height: 100%; width: 0; border-radius: inherit; background: #475569; }
.bar.win { background: linear-gradient(90deg, var(--brand), var(--run)); box-shadow: 0 0 20px rgba(255,140,66,.5); }
.lane .time, .lane .score { color: var(--muted); text-align: right; opacity: 0; transition: opacity .3s; }
.lane.done .time, .lane.done .score { opacity: 1; }
.lane.done .score { color: var(--fg); font-weight: 700; }
.lane:first-child.done .score { color: var(--run); }
.replay { justify-self: start; margin-top: 6px; }
.score-explain { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.score-explain div { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.score-explain b { display: block; font: 700 22px var(--mono); color: var(--brand); }
.score-explain span { color: var(--muted); font-size: 14px; }

/* PIPELINE */
.pipe { list-style: none; padding: 0; margin: 0 0 40px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: s; position: relative; }
.pipe li { position: relative; padding: 22px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); transition: border-color .3s, transform .4s var(--spring); }
.pipe li:hover { border-color: var(--brand); transform: translateY(-4px); }
.pipe .n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(255,140,66,.12); color: var(--brand); font: 700 14px var(--mono); }
.pipe h3 { margin: 16px 0 8px; font-size: 18px; }
.pipe p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.tree-wrap { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); overflow-x: auto; }
.tree { margin: 0; padding: 24px; font: 13.5px/1.9 var(--mono); color: var(--muted); }
.tree i { font-style: normal; color: var(--brand); }
.tree s { text-decoration: none; color: var(--run); }
.tree .ln { display: block; opacity: 0; transform: translateX(-8px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.tree.in .ln { opacity: 1; transform: none; }

/* BENTO */
.bento { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.4fr; gap: 12px; }
.card { padding: 26px; border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(180deg, var(--card), var(--bg-2));
  position: relative; overflow: hidden; transition: border-color .3s; }
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255,140,66,.14), transparent 70%); }
.card:hover { border-color: #3a4556; } .card:hover::after { opacity: 1; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 860px; }
details { border: 1px solid var(--line); border-radius: 12px; background: var(--card); transition: border-color .25s; }
details[open] { border-color: #3a4556; }
summary { cursor: pointer; list-style: none; padding: 18px 20px; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; min-height: 44px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 400 22px/1 var(--mono); color: var(--brand); transition: transform .3s var(--spring); }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0; padding: 0 20px 18px; color: var(--muted); }

.final { text-align: center; padding: clamp(90px, 14vh, 160px) var(--pad); }
.final h2 { margin-bottom: 30px; }
.install.big { min-height: 60px; font-size: 16px; }
.foot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding: 26px var(--pad); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .term { transform: none; }
  .pipe { grid-template-columns: repeat(2, 1fr); }
  .bento { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .nav nav { display: none; }
  .nav .btn { margin-left: auto; }
  .pipe, .bento, .score-explain { grid-template-columns: 1fr 1fr; }
  .lane { grid-template-columns: 1fr 52px 34px; }
  .lane .track { grid-column: 1 / -1; grid-row: 2; }
  .install { max-width: 100%; } .install code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .term-body { height: 330px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .tree .ln { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
