:root {
  --bg: #0f1311; --bg-2: #131915; --surface: #182019; --surface-2: #1e2820; --line: #2b362f; --line-2: #3a4740;
  --text: #eeede6; --text-2: #bcc5be; --text-3: #95a198;
  --mint: #8fdca6; --mint-deep: #1f4d3a; --amber: #f2cf8a; --red: #ff8f84; --red-deep: #4a1f1c;
  --serif: "Newsreader", Georgia, serif; --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 17px; line-height: 1.62; -webkit-font-smoothing: antialiased; }
::selection { background: var(--mint); color: #0f1311; }
a { color: var(--mint); text-underline-offset: 3px; transition: color .18s ease, background-color .18s ease, border-color .18s ease; }
h1, h2, h3, .q { text-wrap: balance; }
p, li, .res { text-wrap: pretty; }
b, strong { font-weight: 600; color: var(--text); }
code { font-family: var(--mono); font-size: .84em; background: var(--surface-2); color: var(--amber); padding: 1px 6px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(15, 19, 17, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; padding: 10px 0; }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--mint); color: #0f1311; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 12.5px; }
.links { display: flex; align-items: center; gap: 6px; list-style: none; }
.links a { display: block; color: var(--text-2); text-decoration: none; font-size: 15px; padding: 10px 12px; border-radius: 8px; }
.links a:hover { color: var(--text); background: var(--surface); }
.links a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.links .cv { border: 1px solid var(--line-2); color: var(--text); margin-left: 6px; }
.links .cv:hover { border-color: var(--mint); color: var(--mint); background: transparent; }
.menu-btn { display: none; background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; padding: 10px 14px; font: 600 14px var(--sans); cursor: pointer; }

/* buttons */
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 20px; border-radius: 10px; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid var(--line-2); color: var(--text); background: var(--surface); transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; }
.btn:hover { border-color: var(--mint); color: var(--mint); }
.btn.primary { background: var(--mint); color: #0f1311; border-color: var(--mint); }
.btn.primary:hover { background: #a6e8b9; color: #0f1311; transform: translateY(-1px); }

/* hero */
.hero { position: relative; padding: 96px 0 88px; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; opacity: .35; -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 30%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse 70% 80% at 70% 30%, #000 20%, transparent 75%); pointer-events: none; }
.hero::after { content: ""; position: absolute; width: 720px; height: 720px; right: -220px; top: -300px; background: radial-gradient(circle, rgba(143, 220, 166, .16), transparent 62%); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; color: var(--mint); margin-bottom: 22px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(143, 220, 166, .18); }
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(42px, 6vw, 76px); line-height: 1.02; letter-spacing: -0.02em; }
h1 em, h2 em { font-style: normal; color: var(--mint); }
.lede { font-size: 19px; color: var(--text-2); margin-top: 24px; max-width: 56ch; }

/* terminal */
.term { background: #0a0d0b; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); overflow: hidden; min-width: 0; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.term-bar span { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.term-body { padding: 18px 18px 20px; font-family: var(--mono); font-size: 13px; line-height: 1.65; }
.tl { display: block; opacity: 0; transform: translateY(4px); animation: tin .4s ease forwards; }
.tl + .tl { margin-top: 8px; }
.tl .who { color: var(--text-3); }
.tl.user { color: var(--amber); }
.tl.tool { color: var(--mint); }
.tl.bot { color: var(--text); }
.tl.ok { color: var(--mint); font-weight: 600; }
.term-note { padding: 0 18px 16px; font-size: 12.5px; color: var(--text-3); font-family: var(--mono); }
@keyframes tin { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tl { animation: none; opacity: 1; transform: none; } }

/* stats */
.stats { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 30px 24px 30px 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat-n { font-family: var(--serif); font-weight: 600; font-size: 44px; line-height: 1; color: var(--text); }
.stat-n small { font-size: 22px; color: var(--text-3); }
.stat-l { font-size: 14.5px; color: var(--text-2); margin-top: 8px; }

/* sections */
section { padding: 96px 0; border-bottom: 1px solid var(--line); }
section.tight { padding: 72px 0; }
section.band { background: var(--bg-2); }
.kicker { font-family: var(--mono); font-size: 13px; color: var(--mint); margin-bottom: 14px; }
h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 3.8vw, 46px); line-height: 1.08; letter-spacing: -0.01em; }
.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: end; margin-bottom: 44px; }
.sec-head p { color: var(--text-2); }
.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.split > div > p { color: var(--text-2); margin-top: 16px; max-width: 48ch; }

/* diff */
.diff { background: #0a0d0b; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 26px; font-family: var(--mono); }
.diff-row { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.diff-row:last-of-type { border-bottom: 0; }
.diff-label { color: var(--text-3); font-size: 13px; }
.diff-val { font-size: 24px; letter-spacing: .04em; }
.diff-val .x { color: var(--red); background: rgba(255, 143, 132, .12); border-radius: 3px; }
.diff-val.good { color: var(--mint); }
.diff-note { color: var(--text-3); font-size: 12.5px; margin-top: 14px; line-height: 1.55; }

/* project cards */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; text-decoration: none; color: var(--text); transition: border-color .2s ease, transform .2s ease, background-color .2s ease; min-width: 0; }
.pcard:hover { border-color: var(--mint); transform: translateY(-3px); background: var(--surface-2); }
.pcard .num { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); }
.pcard h3 { font-family: var(--serif); font-weight: 600; font-size: 25px; line-height: 1.15; margin: 14px 0 12px; }
.pcard p { color: var(--text-2); font-size: 15.5px; }
.pcard .big { font-family: var(--serif); font-size: 52px; font-weight: 600; line-height: 1; color: var(--amber); margin-top: auto; padding-top: 26px; }
.pcard .big small { font-family: var(--sans); font-size: 14px; color: var(--text-2); font-weight: 400; display: block; margin-top: 8px; }
.pcard .more { font-weight: 600; font-size: 14.5px; color: var(--mint); margin-top: 20px; }

/* cards & lists */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cols.three { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; min-width: 0; }
.card h3 { font-family: var(--mono); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text); margin-bottom: 14px; }
.card p { font-size: 16px; color: var(--text-2); }
.card p + p { margin-top: 10px; }
.card.tool h3 { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--amber); }
.facts { list-style: none; }
.facts li { position: relative; padding: 10px 0 10px 22px; font-size: 16px; color: var(--text-2); border-bottom: 1px solid var(--line); }
.facts li:last-child { border-bottom: 0; }
.facts li::before { content: ""; position: absolute; left: 2px; top: 20px; width: 8px; height: 8px; border-radius: 2px; background: var(--mint); }
.facts li.x::before { background: var(--red); }

pre { background: #0a0d0b; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 18px; font-family: var(--mono); font-size: 13px; line-height: 1.6; overflow-x: auto; white-space: pre; }
pre .c { color: var(--text-3); }
pre .k { color: var(--mint); }
pre .s { color: var(--amber); }

.tests { list-style: none; }
.tests li { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: start; }
.tests li:last-child { border-bottom: 0; }
.q { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.5; }
.res { display: block; font-family: var(--sans); font-size: 14.5px; color: var(--text-2); margin-top: 4px; font-weight: 400; }
.pill { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; background: rgba(143, 220, 166, .12); color: var(--mint); border: 1px solid rgba(143, 220, 166, .3); }
.pill.fail { background: rgba(255, 143, 132, .1); color: var(--red); border-color: rgba(255, 143, 132, .3); }

/* bars */
.bars { list-style: none; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 6px 12px; padding: 8px 0; font-size: 15px; }
.bar-label { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; color: var(--text); }
.bar-track { background: var(--surface-2); height: 10px; border-radius: 3px; overflow: hidden; align-self: center; }
.bar-fill { display: block; background: var(--mint); height: 100%; border-radius: 3px; }
.bar-n { font-family: var(--mono); font-size: 13px; text-align: right; color: var(--text-2); }
.trend { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.trend.up { color: var(--red); font-weight: 600; }
.src { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); margin-top: 16px; }

/* funnel */
.funnel { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.fstep { padding: 24px; background: var(--surface); }
.fstep + .fstep { border-left: 1px solid var(--line); background: var(--surface-2); }
.fnum { font-family: var(--serif); font-weight: 600; font-size: 52px; line-height: 1; }
.fstep + .fstep .fnum { color: var(--amber); }
.flab { font-size: 15px; color: var(--text-2); margin-top: 8px; }
.flab a { display: inline-block; padding: 10px 0; }

/* case study */
.case-hero { padding: 72px 0 56px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.case-hero::after { content: ""; position: absolute; width: 600px; height: 600px; right: -200px; top: -320px; background: radial-gradient(circle, rgba(242, 207, 138, .12), transparent 62%); pointer-events: none; }
.crumb { font-family: var(--mono); font-size: 13px; color: var(--text-3); margin-bottom: 22px; }
.crumb a { color: var(--text-2); text-decoration: none; display: inline-block; padding: 8px 0; }
.crumb a:hover { color: var(--mint); }
.case-hero h1 { font-size: clamp(38px, 5vw, 62px); max-width: 20ch; }
.meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--line); }
.meta dt { font-family: var(--mono); font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.meta dd { font-size: 15px; color: var(--text); margin-top: 6px; }
.prose { max-width: 70ch; }
.prose p { color: var(--text-2); font-size: 17.5px; }
.prose p + p { margin-top: 14px; }
.step { display: grid; grid-template-columns: 220px 1fr; gap: 40px; padding: 56px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step-label { font-family: var(--mono); font-size: 13px; color: var(--mint); position: sticky; top: 96px; align-self: start; }
.step h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 18px; }
.next { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.next a { display: block; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; background: var(--surface); transition: border-color .2s ease; }
.next a:hover { border-color: var(--mint); }
.next span { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); display: block; }
.next strong { font-family: var(--serif); font-size: 22px; display: block; margin-top: 8px; color: var(--text); }
.next a:last-child { text-align: right; }

/* footer */
footer { padding: 88px 0 40px; background: var(--bg-2); }
.foot-cta h2 { max-width: 18ch; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-3); }
.foot-bottom nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-bottom a { color: var(--text-2); text-decoration: none; display: inline-block; padding: 8px 0; }
.foot-bottom a:hover { color: var(--mint); }

@media (max-width: 900px) {
  .hero-grid, .split, .sec-head, .cols, .cols.three, .projects, .next { grid-template-columns: 1fr; gap: 28px; }
  .stats .wrap { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .meta { grid-template-columns: 1fr 1fr; }
  .step { grid-template-columns: 1fr; gap: 14px; padding: 44px 0; }
  .step-label { position: static; }
  .hero { padding: 64px 0 56px; }
  section { padding: 64px 0; }
  .menu-btn { display: block; }
  .links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .links.open { display: flex; }
  .links a { padding: 14px 12px; }
  .links .cv { margin: 8px 0 0; text-align: center; }
  .next a:last-child { text-align: left; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .lede { font-size: 17.5px; }
  .card, .pcard { padding: 20px; }
  .stat { padding: 22px 12px 22px 0; }
  .stat + .stat { padding-left: 12px; }
  .stat:nth-child(3) { padding-left: 0; }
  .stat-n { font-size: 34px; }
  .diff { padding: 20px 18px; }
  .diff-row { grid-template-columns: 1fr; gap: 2px; }
  .diff-val { font-size: 21px; }
  .funnel { grid-template-columns: 1fr; }
  .fstep + .fstep { border-left: 0; border-top: 1px solid var(--line); }
  .tests li { grid-template-columns: 1fr; gap: 8px; }
  .tests .pill { justify-self: start; }
  pre { font-size: 11.5px; padding: 14px; }
  .term-body { font-size: 12px; padding: 14px; }
  .meta { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 360px) { pre { font-size: 10px; } }

.step:first-child { padding-top: 0; }
