:root {
  --bg: #f6f3ea;
  --paper: #fffdf8;
  --ink: #141a15;
  --muted: #6c7068;
  --line: rgba(20, 26, 21, 0.09);
  --green: #2f6b45;
  --green-soft: #e3eedd;
  --amber: #c8841a;
  --amber-soft: #fbefd6;
  --red: #b5412e;
  --red-soft: #f8e2dc;
  --radius: 28px;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, p { margin: 0; }
code, pre { font-family: var(--mono); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 8px; }

/* ---------------------------------------------------------------- glass */
.glass {
  background: rgba(255, 253, 248, 0.62);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 24px 60px -22px rgba(30, 45, 30, 0.38);
}

/* ------------------------------------------------------------------ nav */
.nav {
  position: sticky; top: 14px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: min(1120px, calc(100% - 32px)); margin: 14px auto 0; padding: 10px 12px 10px 18px;
  border-radius: 999px;
  background: rgba(246, 243, 234, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line);
}
.nav nav { display: flex; gap: 26px; font-size: 0.92rem; color: var(--muted); }
.nav nav a:hover { color: var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -0.02em; font-size: 1.05rem; }
.mark { width: 22px; height: 22px; display: inline-block; }
.mark svg { width: 100%; height: 100%; display: block; }
.mark circle { fill: var(--ink); }
.mark path { fill: none; stroke: var(--bg); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 22px; border-radius: 999px; font-weight: 500; font-size: 0.97rem; letter-spacing: -0.01em;
  transition: transform 120ms ease-out, background 160ms ease, box-shadow 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.dark:hover { background: #26302a; }
.btn.ghost { background: rgba(20, 26, 21, 0.06); }
.btn.ghost:hover { background: rgba(20, 26, 21, 0.1); }
.btn.small { padding: 8px 16px; font-size: 0.88rem; }

/* ----------------------------------------------------------------- hero */
main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; padding: 72px 0 40px; }
.eyebrow { font-size: 0.8rem; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 18px; }
h1 { font-size: clamp(2.5rem, 6.1vw, 5rem); line-height: 0.98; letter-spacing: -0.045em; font-weight: 600; }
.lede { margin-top: 26px; font-size: 1.14rem; color: #454b44; max-width: 34em; }
.cta { display: flex; gap: 10px; margin-top: 32px; flex-wrap: wrap; }

.hero-art { position: relative; aspect-ratio: 5 / 5.4; border-radius: 36px; overflow: hidden; background: #dfe6cf; }
.scene svg { display: block; width: 100%; height: 100%; }
.hero-art .scene { position: absolute; inset: 0; }
.gate-card { position: absolute; left: 8%; right: 8%; top: 30%; padding: 20px 22px 22px; border-radius: 26px; }
.gate-top { display: flex; align-items: center; gap: 9px; font-size: 0.8rem; font-weight: 500; color: #4a4f48; }
.bind { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.amber { background: var(--amber); box-shadow: 0 0 0 4px rgba(200, 132, 26, 0.18); }
.dot.green { background: var(--green); }
.dot.red { background: var(--red); }
.gate-action { margin-top: 14px; font-family: var(--mono); font-size: 1.02rem; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.gate-action b { font-weight: 500; color: var(--green); }
.gate-why { margin-top: 8px; font-size: 0.92rem; color: #4a4f48; }
.gate-buttons { display: flex; gap: 8px; margin-top: 18px; }
.pill-btn {
  flex: 1; text-align: center; padding: 12px 0; border-radius: 999px; font-weight: 500; font-size: 0.95rem;
  transition: transform 120ms ease-out, filter 160ms ease;
}
.pill-btn.yes { background: var(--ink); color: var(--bg); }
.pill-btn.no { background: rgba(20, 26, 21, 0.08); }
button.pill-btn:hover { filter: brightness(1.12); }
button.pill-btn:active { transform: scale(0.97); }
.chip { position: absolute; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; font-family: var(--mono); font-size: 0.74rem; }
.chip-a { left: 8%; top: 11%; }
.chip-b { left: 30%; top: 19.5%; }

/* ---------------------------------------------------------------- strip */
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 28px 0 0; border-radius: var(--radius); overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.strip div { background: var(--paper); padding: 26px 24px; }
.strip b { display: block; font-size: 2.5rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.strip span { display: block; margin-top: 8px; font-size: 0.88rem; color: var(--muted); }

/* ------------------------------------------------------------- sections */
.section { padding: 112px 0 0; }
.section-head { max-width: 720px; margin-bottom: 40px; }
h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 600; }
.sub { margin-top: 18px; font-size: 1.06rem; color: #4d534c; }

/* --------------------------------------------------------------- replay */
.replay { display: grid; grid-template-columns: 232px minmax(0, 1fr) 216px; gap: 14px; align-items: start; }
.picker { display: flex; flex-direction: column; gap: 8px; }
.pick {
  text-align: left; padding: 14px 16px; border-radius: 18px; background: transparent; border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease-out;
}
.pick:hover { background: rgba(20, 26, 21, 0.04); }
.pick:active { transform: scale(0.98); }
.pick[aria-pressed="true"] { background: var(--paper); border-color: var(--line); box-shadow: 0 10px 30px -18px rgba(30, 45, 30, 0.35); }
.pick small { display: block; font-family: var(--mono); font-size: 0.68rem; color: var(--muted); margin-bottom: 4px; }
.pick span { display: block; font-size: 0.9rem; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; }

.console { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 560px; display: flex; flex-direction: column; }
.console-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.alert-id { font-family: var(--mono); font-size: 0.72rem; color: var(--red); }
.alert-title { margin-top: 5px; font-weight: 600; font-size: 1.12rem; letter-spacing: -0.02em; }
.alert-sum { margin-top: 3px; font-size: 0.9rem; color: var(--muted); }
.stream { flex: 1; height: 460px; overflow-y: auto; padding: 18px 24px 120px; scroll-behavior: smooth; }
.row { animation: rise 420ms var(--spring) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.note { margin: 14px 0 6px; font-size: 0.93rem; color: #4d534c; }
.call { margin: 6px 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.call summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; list-style: none; cursor: pointer; font-family: var(--mono); font-size: 0.8rem; }
.call summary::-webkit-details-marker { display: none; }
.call .name { font-weight: 500; }
.call .args { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.call pre { margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 0.72rem; line-height: 1.5; color: #4d534c; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow-y: auto; background: #fbfaf5; }
.tag { flex: none; padding: 3px 9px; border-radius: 999px; font-family: "Inter", sans-serif; font-size: 0.7rem; font-weight: 500; background: var(--green-soft); color: var(--green); }
.tag.write, .tag.wait { background: var(--amber-soft); color: #8a5a0c; }
.tag.bad { background: var(--red-soft); color: var(--red); }
.tag.ok { background: var(--green-soft); color: var(--green); }
.call.write { border-color: rgba(200, 132, 26, 0.4); }
.call.stopped { border-color: rgba(181, 65, 46, 0.4); }
.verdict { padding: 9px 12px; border-top: 1px solid var(--line); font-size: 0.82rem; display: flex; gap: 8px; align-items: baseline; }
.verdict.bad { background: var(--red-soft); color: #7d2a1c; }
.verdict.ok { background: var(--green-soft); color: #1f4a30; }
.report { margin-top: 18px; padding: 18px 20px; border-radius: 18px; background: var(--ink); color: var(--bg); }
.report small { font-family: var(--mono); font-size: 0.7rem; opacity: 0.6; }
.report b { display: block; margin: 6px 0 8px; font-family: var(--mono); font-weight: 500; font-size: 0.95rem; overflow-wrap: anywhere; }
.report p { font-size: 0.9rem; opacity: 0.85; }

.sheet-wrap { position: absolute; inset: auto 0 0 0; padding: 60px 20px 20px; background: linear-gradient(to top, rgba(246, 243, 234, 0.9), rgba(246, 243, 234, 0)); }
.sheet-wrap[hidden] { display: none; }
.sheet { border-radius: 24px; padding: 20px 22px; transform-origin: 50% 100%; animation: materialize 520ms var(--spring) both; }
@keyframes materialize { from { opacity: 0; transform: translateY(24px) scale(0.96); filter: blur(8px); } }
.sheet-note { margin-top: 12px; font-size: 0.76rem; color: var(--muted); text-align: center; }

.ledger { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.ledger h3 { font-size: 0.8rem; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }
.ledger dl { margin: 14px 0 0; display: grid; gap: 14px; }
.ledger dt { font-size: 0.8rem; color: var(--muted); }
.ledger dd { margin: 2px 0 0; font-size: 1.9rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.outcome { margin-top: 18px; display: grid; gap: 6px; }
.outcome:empty { display: none; }
.outcome .tag { justify-self: start; font-size: 0.76rem; padding: 5px 11px; }
.outcome button { justify-self: start; margin-top: 8px; font-size: 0.84rem; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.recorded { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.74rem; color: var(--muted); }

/* ---------------------------------------------------------------- bento */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; }
.card h3 { font-size: 1.28rem; letter-spacing: -0.03em; font-weight: 600; }
.card p { margin-top: 8px; color: #4d534c; font-size: 0.96rem; }
.card p code { font-size: 0.85em; background: rgba(20, 26, 21, 0.06); padding: 2px 6px; border-radius: 6px; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-6 { grid-column: span 6; }
.card.tint { background: #edf2e2; }
.viz { margin-top: auto; padding-top: 26px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills span { font-family: var(--mono); font-size: 0.76rem; padding: 8px 12px; border-radius: 999px; background: var(--green-soft); color: var(--green); }
.flow { display: flex; align-items: center; gap: 0; }
.flow .node { padding: 11px 15px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); font-size: 0.86rem; font-weight: 500; white-space: nowrap; }
.flow .gate { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.flow .you { background: var(--amber-soft); border-color: rgba(200, 132, 26, 0.4); }
.flow i { flex: 1; height: 1px; min-width: 10px; background: repeating-linear-gradient(to right, #9aa392 0 5px, transparent 5px 9px); }
.code { margin: 0; padding: 18px 20px; border-radius: 18px; background: #18201a; color: #e9ecdf; font-size: 0.76rem; line-height: 1.7; overflow-x: auto; }
.card .code { margin-top: auto; }
.card > p + .code { margin-top: 26px; }
.code .c { color: #8fa58c; }
.bindviz, .inject { display: grid; gap: 8px; justify-items: start; }
.bindviz code, .inject code { font-size: 0.74rem; padding: 8px 12px; border-radius: 10px; background: rgba(20, 26, 21, 0.05); overflow-wrap: anywhere; }
.bindviz .arrow { font-size: 0.7rem; color: var(--muted); padding-left: 12px; }
.inject code { background: var(--red-soft); color: #7d2a1c; }
.card.wide { flex-direction: row; gap: 40px; align-items: center; }
.card.wide > div:first-child { flex: 1; }
.card.wide .viz { margin: 0; padding: 0; }
.chain { display: flex; align-items: center; flex: 1.4; }
.chain div { flex: none; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; display: grid; gap: 2px; }
.chain small { font-size: 0.68rem; color: var(--muted); }
.chain b { font-size: 0.86rem; font-weight: 600; }
.chain code { font-size: 0.68rem; color: var(--green); }
.chain i { flex: 1; min-width: 12px; height: 1px; background: #9aa392; }

/* ---------------------------------------------------------------- evals */
.eval-set { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.eval-head { padding: 24px 28px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.eval-head h3 { font-size: 1.2rem; letter-spacing: -0.03em; font-weight: 600; }
.eval-head span { font-size: 0.8rem; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tile { background: var(--paper); padding: 22px 24px; }
.tile b { display: block; font-size: 2.2rem; font-weight: 600; letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.tile b small { font-size: 0.45em; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 2px; }
.tile span { display: block; margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.tile.good b { color: var(--green); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.74rem; padding: 14px 12px; white-space: nowrap; }
td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 28px; }
th:last-child, td:last-child { padding-right: 28px; text-align: right; font-variant-numeric: tabular-nums; }
td.id { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); white-space: nowrap; }
td .tag { display: inline-block; }
.more { display: block; width: 100%; padding: 14px; border-top: 1px solid var(--line); font-size: 0.86rem; color: var(--muted); }
.more:hover { color: var(--ink); background: rgba(20, 26, 21, 0.03); }
.pending { padding: 22px 28px; border-radius: var(--radius); border: 1px dashed rgba(20, 26, 21, 0.2); color: var(--muted); font-size: 0.92rem; margin-bottom: 14px; }
.pending code { font-size: 0.85em; color: var(--ink); }
.metric-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 30px; }
.metric-notes h4 { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; }
.metric-notes p { margin-top: 6px; font-size: 0.9rem; color: var(--muted); }

/* ------------------------------------------------------------------ run */
.run { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 14px; }
.term { font-size: 0.82rem; padding: 28px; border-radius: var(--radius); }
.run-notes ul { list-style: none; padding: 0; margin: 18px 0 26px; display: grid; gap: 10px; font-size: 0.92rem; color: #4d534c; }
.run-notes li b { font-family: var(--mono); font-weight: 500; font-size: 0.82rem; color: var(--ink); margin-right: 6px; }
.run-notes .btn { align-self: flex-start; margin-top: auto; }

/* --------------------------------------------------------------- footer */
.footer { position: relative; margin-top: 128px; color: var(--ink); }
.footer-top { width: min(1120px, calc(100% - 32px)); margin: 0 auto; display: flex; justify-content: space-between; gap: 48px; position: relative; z-index: 2; padding-bottom: 24px; }
.footer-brand p { margin-top: 14px; max-width: 22em; color: #4d534c; font-size: 0.96rem; }
.footer-cols { display: flex; gap: 72px; }
.footer-cols h5 { font-size: 0.86rem; font-weight: 600; margin-bottom: 14px; }
.footer-cols a { display: block; font-size: 0.92rem; color: #4d534c; margin-bottom: 10px; }
.footer-cols a:hover { color: var(--ink); }
.footer-scene { margin-top: -40px; height: clamp(360px, 52vw, 720px); }
.footer-scene { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%); mask-image: linear-gradient(to bottom, transparent, #000 22%); }
.footer-scene svg { width: 100%; height: 100%; }
.footer-base { position: absolute; left: 0; right: 0; bottom: 22px; z-index: 2; width: min(1120px, calc(100% - 32px)); margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.8rem; color: rgba(255, 253, 244, 0.88); text-shadow: 0 1px 8px rgba(10, 25, 12, 0.5); }

/* ----------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; }
  .hero-art { aspect-ratio: 5 / 4.2; }
  .replay { grid-template-columns: 1fr; }
  .picker { flex-direction: row; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .picker::-webkit-scrollbar { display: none; }
  .pick { flex: none; width: 210px; scroll-snap-align: start; }
  .ledger dl { grid-template-columns: repeat(4, 1fr); }
  .span-2, .span-3 { grid-column: span 6; }
  .card.wide { flex-direction: column; align-items: stretch; }
  .chain { overflow-x: auto; padding-bottom: 4px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile:last-child { grid-column: 1 / -1; }
  .run, .metric-notes { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav nav { display: none; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .section { padding-top: 80px; }
  .ledger dl { grid-template-columns: repeat(2, 1fr); }
  .footer-top { flex-direction: column; }
  .footer-cols { gap: 48px; }
  .hero-art { aspect-ratio: 1 / 1.05; }
  .flow .node { padding: 9px 10px; font-size: 0.76rem; }
  .card { padding: 22px; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .row, .sheet { animation: fade 200ms ease both; }
  @keyframes fade { from { opacity: 0; } }
  .stream { scroll-behavior: auto; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .nav { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
