:root {
  --bg: #0b0f14;
  --panel: #10161d;
  --panel-2: #141c25;
  --line: #223040;
  --text: #dbe6f2;
  --muted: #8ba0b6;
  --accent: #4fd1a5;
  --accent-dim: #1d6b55;
  --danger: #ef5d6b;
  --warn: #e6b455;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(1100px 500px at 80% -10%, #14222c 0%, var(--bg) 55%) no-repeat, var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(1080px, 92vw); margin: 0 auto; }

header.site {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 20, .85);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 20;
}

header.site .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 62px; flex-wrap: wrap;
}

.brand { font-family: var(--mono); font-weight: 700; letter-spacing: .04em; color: var(--text); }
.brand span { color: var(--accent); }

nav.main { display: flex; gap: 1.15rem; margin-left: auto; flex-wrap: wrap; }
nav.main a { color: var(--muted); font-size: .92rem; }
nav.main a[aria-current="page"], nav.main a:hover { color: var(--text); text-decoration: none; }

main { padding: 3rem 0 4rem; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin: 0 0 .6rem; }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); margin: 2.6rem 0 .8rem; }
h3 { font-size: 1.05rem; margin: 1.6rem 0 .5rem; }

p { margin: .65rem 0; }
.lede { font-size: 1.12rem; color: #c2d2e2; max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .79rem; }

.eyebrow {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .8rem;
}

.hero { padding: 1rem 0 2rem; }
.hero .cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

.btn {
  display: inline-block; padding: .68rem 1.15rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font-size: .94rem; font-weight: 600;
}
.btn:hover { text-decoration: none; border-color: var(--accent-dim); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #06231a; }
.btn.primary:hover { filter: brightness(1.06); }

.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 1.15rem 1.2rem;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stat { background: var(--panel); padding: 1.05rem 1.1rem; }
.stat b { display: block; font-family: var(--mono); font-size: 1.55rem; color: var(--accent); }
.stat span { color: var(--muted); font-size: .84rem; }

pre {
  background: #070b10; border: 1px solid var(--line); border-radius: 7px;
  padding: .95rem 1.05rem; overflow-x: auto;
  font-family: var(--mono); font-size: .82rem; line-height: 1.55; color: #cfe3f5;
}
pre .c { color: #6e859b; }
pre .g { color: var(--accent); }
pre .r { color: var(--danger); }
pre .y { color: var(--warn); }
code { font-family: var(--mono); font-size: .88em; background: var(--panel-2); padding: .1rem .3rem; border-radius: 4px; }
pre code { background: none; padding: 0; }

table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .9rem; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
td.mono, th.mono, .mono { font-family: var(--mono); font-size: .82rem; }

.badge { display: inline-block; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; padding: .12rem .45rem; border-radius: 4px; border: 1px solid var(--line); }
.badge.bad { color: var(--danger); border-color: #5b2530; background: #1d1114; }
.badge.good { color: var(--accent); border-color: var(--accent-dim); background: #0d1a16; }
.badge.warn { color: var(--warn); border-color: #5a4620; background: #1a1510; }

.proof { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 1.2rem; margin: 1.4rem 0; }
.proof header { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; margin-bottom: .6rem; }
.proof h3 { margin: 0; }

.callout { border-left: 3px solid var(--warn); background: #171410; padding: .8rem 1rem; border-radius: 0 6px 6px 0; margin: 1.2rem 0; }

form { display: grid; gap: 1rem; max-width: 640px; }
label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
input, select, textarea {
  width: 100%; padding: .6rem .7rem; border-radius: 6px;
  border: 1px solid var(--line); background: #0a1016; color: var(--text);
  font: inherit; font-size: .93rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-dim); outline-offset: 1px; }
textarea { min-height: 96px; resize: vertical; font-family: var(--mono); font-size: .82rem; }
.field-error { color: var(--danger); font-size: .82rem; margin-top: .3rem; display: none; }
.field-error.show { display: block; }
.form-note { color: var(--muted); font-size: .82rem; }

[hidden] { display: none !important; }
.brief { margin-top: 1.2rem; max-width: 640px; }
.brief textarea { min-height: 240px; margin-top: .6rem; }
.brief-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: .8rem 0 .2rem; }
button.btn { cursor: pointer; font-family: inherit; }

footer.site { border-top: 1px solid var(--line); padding: 1.6rem 0 2.4rem; color: var(--muted); font-size: .84rem; }
footer.site .wrap { display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap; }

ul.tight { margin: .5rem 0; padding-left: 1.2rem; }
ul.tight li { margin: .28rem 0; }

.share { border-top: 1px solid var(--line); margin-top: 2.4rem; padding-top: 1.2rem; color: var(--muted); font-size: .84rem; }

/* Proof comparisons: standalone SVGs, scrollable on narrow screens so the
   monospace text stays at a readable size instead of shrinking with the page. */
.svg-frame { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0 .4rem; }
.svg-frame img { display: block; width: 100%; min-width: 980px; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #0b0f14; }
.figure-note { color: var(--muted); font-size: .8rem; margin: .35rem 0 0; }

details.transcript { border: 1px solid var(--line); border-radius: 8px; background: #0a1016; margin: .9rem 0; }
details.transcript > summary { cursor: pointer; padding: .7rem .9rem; font-size: .9rem; color: var(--text); }
details.transcript > summary:hover { color: var(--accent); }
details.transcript[open] > summary { border-bottom: 1px solid var(--line); }
details.transcript pre { margin: 0; border: 0; border-radius: 0; background: transparent; }

.digest { font-family: var(--mono); font-size: .8rem; word-break: break-all; color: var(--text); }
.scroller { overflow-x: auto; }
