:root {
  --bg: #0b0f0d;
  --fg: #ecefe9;
  --muted: #9aa59d;
  --accent: #d9f36b;      /* credit: ledger-ink lime */
  --debit: #ff8a5c;       /* debit: warm amber */
  --card: rgba(20, 27, 23, 0.72);
  --line: rgba(236, 239, 233, 0.1);
  --font-display: "Fraunces", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --space-section: clamp(4rem, 3rem + 5vw, 8rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.65 var(--font-mono); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.nav, main, .footer { position: relative; z-index: 1; }

.nav {
  position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center;
  padding: 14px max(16px, 4vw); background: linear-gradient(var(--bg), transparent); backdrop-filter: blur(6px);
}
.nav nav { display: flex; gap: 22px; align-items: center; font-size: .9rem; }
.nav a { color: var(--muted); text-decoration: none; transition: color .2s; }
.nav a:hover { color: var(--fg); }
.brand { color: var(--fg) !important; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: #0b0f0d; font-family: var(--font-display); font-weight: 600; }

main { padding: 0 max(16px, 4vw); max-width: 1180px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; }

.hero { min-height: 90vh; display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center; padding: 40px 0 72px; }
.eyebrow { color: var(--accent); letter-spacing: .14em; text-transform: uppercase; font-size: .75rem; margin: 0 0 16px; }
h1 { font-size: clamp(2.8rem, 8vw, 6rem); line-height: .98; margin: 0 0 24px; }
h1 em { font-style: italic; font-weight: 400; color: var(--accent); }
.lead { max-width: 52ch; color: var(--muted); font-size: 1rem; }

.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 4px; font-weight: 500; text-decoration: none;
  background: var(--accent); color: #0b0f0d; border: 1px solid var(--accent);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px -8px var(--accent); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--fg); box-shadow: none; }
.btn.small { padding: 6px 14px; color: #0b0f0d !important; }
.stack { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 8px 0 0; }
.stack li { border: 1px solid var(--line); border-radius: 3px; padding: 3px 10px; font-size: .75rem; color: var(--muted); }

/* live ledger tape */
.tape { background: var(--card); border: 1px solid var(--line); border-radius: 6px; backdrop-filter: blur(10px); font-size: .8rem; box-shadow: 0 30px 60px -30px #000; }
.tape header, .tape footer { display: flex; justify-content: space-between; padding: 12px 16px; color: var(--muted); }
.tape header { border-bottom: 1px dashed var(--line); text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; }
.tape footer { border-top: 1px dashed var(--line); color: var(--fg); }
.tape output { color: var(--accent); font-variant-numeric: tabular-nums; }
.live { display: flex; align-items: center; gap: 6px; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .25; } }
#tape-rows { list-style: none; margin: 0; padding: 8px 0; min-height: 252px; }
#tape-rows li { display: grid; grid-template-columns: 3.2em 1fr auto; gap: 8px; padding: 4px 16px; animation: slide .5s var(--ease); }
#tape-rows .id { color: var(--muted); }
#tape-rows .dr { color: var(--debit); }
#tape-rows .cr { color: var(--accent); }
@keyframes slide { from { opacity: 0; transform: translateY(10px); } }

.section { padding: var(--space-section) 0 0; }
h2 { font-size: clamp(1.8rem, 4.5vw, 3rem); line-height: 1.05; margin: 0 0 24px; }
h3 { font-size: 1.4rem; margin: 6px 0; }

/* bento: deliberate size contrast */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.card { grid-column: span 2; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 22px; backdrop-filter: blur(8px); transition: border-color .3s, transform .4s var(--ease); }
.card:hover { border-color: var(--accent); transform: translateY(-4px); }
.card.big { grid-column: span 4; grid-row: span 2; display: flex; flex-direction: column; justify-content: flex-end; min-height: 280px; }
.card.big h3 { font-size: clamp(2rem, 4vw, 3.2rem); }
.card.wide { grid-column: span 4; }
.card p { margin: 0; color: var(--muted); font-size: .9rem; }
.num { color: var(--accent); font-size: .75rem; }

.split { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: center; }
.split p { color: var(--muted); }
code { font-family: var(--font-mono); font-size: .88em; }
p code { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 3px; }
.code-wrap { position: relative; }
.code { margin: 0; padding: 22px; overflow-x: auto; background: rgba(5, 8, 6, .88); border: 1px solid var(--line); border-radius: 6px; color: #dfe9c8; font-size: .82rem; }
.copy { position: absolute; top: 10px; right: 10px; z-index: 1; font: inherit; font-size: .72rem; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 3px; padding: 3px 9px; cursor: pointer; }
.copy:hover { color: var(--fg); border-color: var(--fg); }

.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; counter-reset: s; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.flow li { counter-increment: s; padding: 18px; display: flex; flex-direction: column; gap: 2px; border-right: 1px dashed var(--line); }
.flow li:last-child { border-right: 0; }
.flow li::before { content: "0" counter(s); color: var(--accent); font-size: .72rem; }
.flow b { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.flow span { color: var(--muted); font-size: .8rem; }

.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: var(--space-section); padding: 32px max(16px, 4vw); color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); background: rgba(11, 15, 13, .88); }
.footer a { color: var(--accent); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 24px; }
  .split { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .card, .card.big, .card.wide { grid-column: auto; grid-row: auto; min-height: 0; }
  .nav nav a:not(.btn) { display: none; }
  .flow li { border-right: 0; border-bottom: 1px dashed var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  #tape-rows li, .live i { animation: none; }
}

/* ---- complete-page additions ---- */
.muted, .split p, .card p { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(11,15,13,.6); backdrop-filter: blur(6px); }
.stats dl { margin: 0; padding: 22px 18px; border-right: 1px dashed var(--line); }
.stats dl:last-child { border-right: 0; }
.stats dt { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1; color: var(--accent); }
.stats dd { margin: 6px 0 0; font-size: .78rem; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: st; }
.steps li { counter-increment: st; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 22px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.steps li::before { content: counter(st); font-family: var(--font-display); font-size: 2.6rem; line-height: 1; color: var(--accent); opacity: .85; }
.steps b { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.steps span { color: var(--muted); font-size: .85rem; }

.endpoints { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 48px; }
.ep-group { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.ep-group h3 { margin: 0 0 10px; font-size: 1.2rem; }
.ep-group p { margin: 0; padding: 8px 0; border-top: 1px dashed var(--line); display: grid; grid-template-columns: 3.8em 1fr; gap: 2px 10px; font-size: .78rem; }
.ep-group p span { grid-column: 2; color: var(--muted); }
.ep-group code { word-break: break-all; }
.m { font-weight: 500; font-size: .68rem; letter-spacing: .04em; }
.m.get { color: #7cc4ff; } .m.post { color: var(--accent); } .m.patch { color: var(--debit); }

.duo { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; margin-top: 48px; }
.duo h3 { margin: 0 0 4px; }
.codes, .chips, .limits { list-style: none; padding: 0; margin: 12px 0; }
.codes li { display: grid; grid-template-columns: 4.6em 1fr; gap: 10px; padding: 9px 0; border-top: 1px dashed var(--line); font-size: .76rem; }
.codes b { color: var(--debit); font-weight: 500; }
.codes span { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: 1px solid var(--line); border-radius: 3px; padding: 3px 10px; font-size: .75rem; color: var(--accent); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--card); backdrop-filter: blur(8px); }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px dashed var(--line); vertical-align: top; }
th { color: var(--accent); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; }
tbody tr:last-child td { border-bottom: 0; }
td:last-child { color: var(--muted); }

.bench-title { margin: 56px 0 14px; font-size: 1.5rem; }
.bench { display: grid; gap: 12px; }
.bar { display: grid; grid-template-columns: 11em 1fr 4.5em 7em; gap: 14px; align-items: center; font-size: .8rem; }
.bar span { color: var(--muted); }
.bar i { display: block; height: 14px; width: var(--w); background: var(--accent); border-radius: 2px; transform-origin: left; transform: scaleX(0); transition: transform 1.2s var(--ease); }
.bench.in .bar i { transform: scaleX(1); }
.bar.hot i { background: var(--debit); }
.bar b { font-weight: 500; text-align: right; } .bar em { color: var(--muted); font-style: normal; }
.note { font-size: .78rem; max-width: 70ch; }

.limits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 32px; }
.limits li { padding: 14px 0; border-top: 1px dashed var(--line); font-size: .85rem; color: var(--muted); }
.limits b { color: var(--fg); font-weight: 500; }

.ops { margin-top: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.final { text-align: center; padding: var(--space-section) 0 0; }
.final .cta { justify-content: center; }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer nav a { color: var(--muted); }
.footer nav a:hover { color: var(--accent); }

@media (max-width: 860px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats dl:nth-child(2) { border-right: 0; }
  .stats dl:nth-child(-n+2) { border-bottom: 1px dashed var(--line); }
  .steps, .endpoints, .duo, .limits { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 1fr 4em; } .bar span { grid-column: 1 / -1; } .bar em { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bar i { transform: none; transition: none; } }
