/* White Rabbit's Hole — v1
   Static, self-contained, no external requests, no web fonts.
   Restrained research/editorial aesthetic. Dark base, single muted accent. */

:root {
  --bg:        #0b0c0e;
  --bg-raised: #121417;
  --bg-sunken: #08090a;
  --line:      #23272e;
  --line-soft: #191c21;
  --text:      #e7e5df;
  --text-dim:  #a7adb6;
  --text-mute: #6d7480;
  --accent:    #c2a565;   /* muted brass — used sparingly */
  --accent-dim:#8f7c48;
  --good:      #79a889;
  --bad:       #c07b74;
  --warn:      #c2a565;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", "Cascadia Code", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --maxw: 68rem;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.5rem; }

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); margin: 0 0 0.6rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 2.5rem 0 1rem; }
h3 { font-size: 1.2rem; margin: 1.6rem 0 0.6rem; }
p  { margin: 0 0 1.05rem; }
a  { color: var(--text); text-decoration-color: var(--accent-dim); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
strong { font-weight: 650; }
.lead { font-size: 1.2rem; color: var(--text-dim); max-width: 44ch; }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.mono { font-family: var(--mono); }
.small { font-size: 0.86rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* ---------- Skip link / focus ---------- */
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: .5rem .8rem; z-index: 100; }
.skip:focus { left: .5rem; top: .5rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* ---------- Header / nav ---------- */
.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); position: sticky; top: 0; backdrop-filter: blur(6px); z-index: 20; }
.nav { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--serif); font-size: 1.05rem; font-weight: 600; letter-spacing: .01em; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand svg { display: block; }
.nav-links { display: flex; gap: 1.35rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a { font-size: .95rem; color: var(--text-dim); text-decoration: none; padding: .2rem 0; border-bottom: 1.5px solid transparent; }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Layout blocks ---------- */
main { display: block; }
.section { padding: 3rem 0; }
.section-sunken { background: var(--bg-sunken); border-block: 1px solid var(--line-soft); }
.hero { padding: 5rem 0 3.5rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.eyebrow { font-family: var(--mono); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin: 0 0 1rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .5rem; font-size: .95rem; padding: .6rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; background: var(--bg-raised); cursor: pointer; }
.btn:hover { border-color: var(--accent-dim); }
.btn-primary { border-color: var(--accent-dim); }
.btn-row { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---------- Cards ---------- */
.card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.card h3 { margin-top: 0; }

/* ---------- Stat blocks ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg-raised); padding: 1.2rem 1.3rem; }
.stat .num { font-family: var(--mono); font-size: 1.9rem; line-height: 1.1; }
.stat .lbl { font-size: .8rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: .08em; margin-top: .35rem; }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; padding: .16rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--text-dim); }
.badge-active   { color: var(--accent); border-color: var(--accent-dim); }
.badge-resolved { color: var(--text-mute); }
.badge-demo     { color: var(--bad); border-color: var(--bad); }
.badge-sealed   { color: var(--accent); border-color: var(--accent-dim); }
.badge-revealed { color: var(--good); border-color: var(--good); }

/* ---------- Forecast cards ---------- */
.forecast { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.3rem; background: var(--bg-raised); margin-bottom: 1rem; }
.forecast-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.forecast-q { font-family: var(--serif); font-size: 1.15rem; margin: 0; }
.forecast-p { font-family: var(--mono); font-size: 1.6rem; color: var(--accent); white-space: nowrap; }
.forecast-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: .7rem; font-size: .85rem; color: var(--text-mute); }
.forecast-meta span { display: inline-flex; gap: .35rem; }
.forecast-meta b { color: var(--text-dim); font-weight: 500; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line-soft); }
th { color: var(--text-mute); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
td.num, th.num { text-align: right; font-family: var(--mono); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Empty state ---------- */
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 2.5rem 1.5rem; text-align: center; color: var(--text-dim); background: var(--bg-sunken); }
.empty .mark { opacity: .5; margin-bottom: 1rem; }

/* ---------- Hash / commitment display ---------- */
.hash { font-family: var(--mono); font-size: .82rem; word-break: break-all; color: var(--text-dim); background: var(--bg-sunken); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: .5rem .65rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.1rem; font-size: .9rem; }
.kv dt { color: var(--text-mute); }
.kv dd { margin: 0; font-family: var(--mono); word-break: break-word; }

/* ---------- Verifier ---------- */
.verifier label { display: block; font-size: .85rem; color: var(--text-dim); margin: 1rem 0 .35rem; }
.verifier textarea, .verifier input {
  width: 100%; font-family: var(--mono); font-size: .9rem; background: var(--bg-sunken);
  color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .7rem;
}
.verifier textarea { min-height: 5rem; resize: vertical; }
.result { margin-top: 1.25rem; padding: 1rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line); font-size: .95rem; }
.result-ok  { border-color: var(--good); color: var(--good); }
.result-bad { border-color: var(--bad); color: var(--bad); }

/* ---------- Notice ---------- */
.notice { border-left: 2px solid var(--accent-dim); background: var(--bg-raised); padding: .9rem 1.1rem; margin: 1.5rem 0; font-size: .92rem; color: var(--text-dim); border-radius: 0 var(--radius) var(--radius) 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; padding: 2.5rem 0; color: var(--text-mute); font-size: .88rem; }
.site-footer .foot-brand { font-family: var(--serif); color: var(--text-dim); }
.footlinks { display: flex; gap: 1.1rem; flex-wrap: wrap; margin: .9rem 0; }
.footlinks a { color: var(--text-mute); text-decoration: none; }
.footlinks a:hover { color: var(--text); }

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }
.tag-list { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Distribution UI (forecast cards) ---------- */
.forecast-dist { margin-top: .9rem; }
.forecast-p-sub { display: block; font-family: var(--mono); font-size: .72rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: .04em; margin-top: .15rem; text-align: right; }
.forecast-pending { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .6rem; white-space: nowrap; }
.badge-class { color: var(--text-dim); border-color: var(--line); }

svg.dist { display: block; width: 100%; height: 30px; }
.dist-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .74rem; color: var(--text-mute); margin-top: .25rem; gap: .5rem; }
.dist-axis .dim { color: var(--text-dim); }

.bars { display: flex; flex-direction: column; gap: .4rem; }
.bar-row { display: grid; grid-template-columns: 7.5rem 1fr 3.4rem; align-items: center; gap: .6rem; font-size: .88rem; }
.bar-label { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--bg-sunken); border: 1px solid var(--line-soft); border-radius: 3px; height: 12px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); opacity: .55; }
.bar-val { text-align: right; color: var(--text-dim); }
.bar-win .bar-fill { opacity: .9; background: var(--good); }
.bar-win .bar-label { color: var(--good); }

.pmf { display: flex; align-items: flex-end; gap: .35rem; height: 44px; }
.pmf-col { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.pmf-bar { width: 16px; background: var(--accent); opacity: .5; border-radius: 2px 2px 0 0; display: block; }
.pmf-bar.bar-win { opacity: .9; background: var(--good); }
.pmf-x { font-family: var(--mono); font-size: .72rem; color: var(--text-mute); }

.ledger-group { border-bottom: 1px solid var(--line); padding-bottom: .4rem; margin-top: 2.5rem; }
.ledger-group:first-child { margin-top: .5rem; }
.tr-class { margin-top: 2.5rem; }
.tr-class h4 { margin: 1.5rem 0 .6rem; font-family: var(--serif); font-size: 1.05rem; }

@media (max-width: 720px) {
  .bar-row { grid-template-columns: 6rem 1fr 3rem; }
}

/* ---------- Blog ---------- */
.prose { max-width: 44rem; }
.prose h1 { margin-bottom: .3rem; }
.post-meta { font-family: var(--mono); font-size: .8rem; color: var(--text-mute); margin-top: 0; }
.prose h2 { margin-top: 2rem; }
.prose blockquote { border-left: 2px solid var(--accent-dim); margin: 1.4rem 0; padding: .2rem 0 .2rem 1.1rem; color: var(--text-dim); }
.prose pre { background: var(--bg-sunken); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: .9rem 1rem; overflow-x: auto; font-size: .85rem; }
.prose ul { padding-left: 1.2rem; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: .9rem 0; border-bottom: 1px solid var(--line-soft); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
