/* Looking Glass — an evidence dossier.
   Art direction: archival document forensics. Warm paper, deep ink,
   one ochre signal accent, monospace for every evidence artifact. */

:root {
  --paper:        #F7F4EF;
  --paper-2:      #F1ECE3;
  --paper-3:      #E7E0D3;
  --rule:         #D8CFBE;
  --rule-soft:    #E5DDCE;
  --ink:          #17130E;
  --ink-2:        #3B342A;
  --ink-3:        #5E5546;
  --accent:       #97671A;
  --accent-2:     #7C540F;
  --accent-wash:  #F3E7CE;
  --t1:           #2F6350;
  --t1-wash:      #E4EEE8;
  --t2:           #8A5D0B;
  --t2-wash:      #F5E9CF;
  --t3:           #9A4429;
  --t3-wash:      #F6E3DA;
  --danger:       #96311C;

  --serif: "Newsreader", "Iowan Old Style", "Source Serif 4", Georgia, "Times New Roman", serif;
  --display: "Fraunces", "Newsreader", Georgia, serif;
  --ui: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Menlo", Consolas, monospace;

  --max: 74rem;
  --measure: 38rem;
  --r: 3px;
  --shadow: 0 1px 0 var(--rule), 0 12px 28px -22px rgba(23,19,14,.5);
}

html[data-theme="dark"] {
  --paper:        #14120F;
  --paper-2:      #1B1814;
  --paper-3:      #24201A;
  --rule:         #3A342B;
  --rule-soft:    #2C2721;
  --ink:          #EFE9DD;
  --ink-2:        #D3CABA;
  --ink-3:        #A79C8A;
  --accent:       #E3B25C;
  --accent-2:     #F0C77E;
  --accent-wash:  #2E2517;
  --t1:           #7CC0A5;
  --t1-wash:      #17251F;
  --t2:           #DCAF5C;
  --t2-wash:      #2A2113;
  --t3:           #E0876A;
  --t3-wash:      #2A1913;
  --danger:       #EE9077;
  --shadow: 0 1px 0 var(--rule), 0 14px 30px -22px rgba(0,0,0,.8);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h, 6rem) + 1rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-synthesis-weight: none;
  overflow-wrap: break-word;
}

/* Faint paper tooth */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: .5;
  background-image: radial-gradient(circle at 1px 1px, rgba(120,100,70,.10) 1px, transparent 0);
  background-size: 4px 4px;
}
html[data-theme="dark"] body::before { opacity: .3; background-image: radial-gradient(circle at 1px 1px, rgba(255,240,210,.05) 1px, transparent 0); }
body > * { position: relative; z-index: 1; }

/* ---------- typography ---------- */
h1, h2, h3, h4, h5, h6 { font-family: var(--display); font-weight: 600; line-height: 1.15; letter-spacing: -.012em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5.2vw, 3.15rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.45rem, 3.2vw, 2rem); margin-top: 2.4em; }
h3 { font-size: clamp(1.14rem, 2.2vw, 1.35rem); margin-top: 2em; }
h4 { font-size: 1.02rem; font-family: var(--ui); font-weight: 650; letter-spacing: .01em; margin-top: 1.8em; }
p { margin: 0 0 1.05em; }
a { color: var(--accent-2); text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
a:hover { text-decoration-color: var(--accent); }
/* No dark-mode override for links: the base rule already uses --accent-2, which is
   itself theme-aware. An extra html[data-theme] rule here would out-specify every
   component class (.btn, .nav a, .toc a) and repaint them gold. */
strong { font-weight: 650; }
small { font-size: .8125rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.6rem 0; }
ul, ol { padding-left: 1.15rem; margin: 0 0 1.05em; }
li { margin-bottom: .45em; }
code, kbd, samp { font-family: var(--mono); font-size: .855em; background: var(--paper-3); padding: .12em .34em; border-radius: 2px; }
pre { font-family: var(--mono); font-size: .82rem; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r); padding: 1rem; overflow-x: auto; }
pre code { background: none; padding: 0; }

.eyebrow, .label {
  font-family: var(--ui); font-size: .6875rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}
.mono { font-family: var(--mono); font-size: .8125rem; letter-spacing: -.01em; }
.lede { font-size: clamp(1.1rem, 2.1vw, 1.3rem); line-height: 1.5; color: var(--ink-2); }

:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 2px;
}

a.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 200;
  background: var(--ink); color: var(--paper); font-family: var(--ui); font-size: .85rem;
  font-weight: 600; text-decoration: none;
  padding: .6rem 1rem; border-radius: var(--r); transition: top .15s;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
a.skip:focus, a.skip:focus-visible { top: 1rem; color: var(--paper); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2.5rem); }
main { display: block; }
section { scroll-margin-top: calc(var(--head-h, 6rem) + 1rem); }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.head-row { display: flex; align-items: center; gap: 1rem; min-height: 3.6rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); flex: 0 0 auto; }
.brand svg { display: block; color: var(--accent); }
.brand b { font-family: var(--display); font-size: 1.02rem; font-weight: 600; letter-spacing: -.02em; }
.brand span { font-family: var(--ui); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); display: block; margin-top: 1px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; }
.nav a {
  font-family: var(--ui); font-size: .8125rem; color: var(--ink-2); text-decoration: none;
  padding: .4rem .55rem; border-radius: var(--r); white-space: nowrap;
}
.nav a:hover { background: var(--paper-3); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.theme-btn {
  font-family: var(--ui); font-size: .75rem; color: var(--ink-2); background: transparent;
  border: 1px solid var(--rule); border-radius: 99px; padding: .3rem .7rem; cursor: pointer; margin-left: .4rem;
}
.theme-btn:hover { border-color: var(--accent); color: var(--ink); }
.subnav { border-top: 1px solid var(--rule-soft); background: var(--paper-2); }
.subnav .wrap { display: flex; gap: .1rem; align-items: center; overflow-x: auto; scrollbar-width: none; }
.subnav .wrap::-webkit-scrollbar { display: none; }
.subnav strong {
  font-family: var(--ui); font-size: .625rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); padding-right: .7rem; white-space: nowrap; font-weight: 600;
}
.subnav a { font-family: var(--mono); font-size: .72rem; color: var(--ink-2); text-decoration: none; padding: .5rem .6rem; white-space: nowrap; }
.subnav a:hover { color: var(--accent-2); }
.subnav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

@media (max-width: 680px) {
  /* On small screens the header stops being sticky and wraps fully instead of
     hiding links inside a scrollbar-less horizontal scroller: every destination
     stays visible and reachable, and a tall header no longer eats the viewport. */
  .site-head { position: static; }
  .head-row { flex-wrap: wrap; padding-top: .55rem; padding-bottom: .35rem; min-height: 0; }
  .nav { width: 100%; margin-left: 0; flex-wrap: wrap; gap: .1rem .05rem; padding-bottom: .2rem; }
  .nav a { padding: .45rem .5rem; }
  .theme-btn { margin-left: auto; }
  .subnav .wrap { flex-wrap: wrap; overflow-x: visible; padding-bottom: .35rem; }
  .subnav strong { width: 100%; padding: .45rem 0 .1rem; }
}

/* ---------- page head ---------- */
.page-head { padding: clamp(2.6rem, 7vw, 5rem) 0 clamp(1.6rem, 4vw, 2.6rem); border-bottom: 1px solid var(--rule); }
.page-head .eyebrow { margin-bottom: .9rem; display: block; }
.page-head p.lede { max-width: 46rem; margin-bottom: 0; }
.meta-row { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: 1.4rem; }
.chip {
  font-family: var(--mono); font-size: .7rem; color: var(--ink-2);
  border: 1px solid var(--rule); border-radius: 99px; padding: .22rem .6rem; background: var(--paper-2);
}

/* ---------- evidence primitives ---------- */
.evidence {
  background: var(--paper-2); border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  border-radius: var(--r); padding: clamp(1rem, 3vw, 1.6rem); margin: 1.8rem 0;
}
.evidence .label { display: block; margin-bottom: .7rem; }
.quote-block { margin: 0; }
.quote-block p { font-family: var(--mono); font-size: clamp(.8rem, 1.6vw, .9rem); line-height: 1.7; color: var(--ink); }
.quote-block p:last-child { margin-bottom: 0; }
.speaker { color: var(--accent-2); font-weight: 600; }
.tstamp { font-family: var(--mono); font-size: .7rem; color: var(--ink-3); letter-spacing: .02em; }
.src {
  font-family: var(--ui); font-size: .74rem; display: block; margin-top: .9rem;
  padding-top: .7rem; border-top: 1px dashed var(--rule); color: var(--ink-3);
}
.src a { color: var(--accent-2); }

blockquote {
  margin: 1.6rem 0; padding: .2rem 0 .2rem 1.2rem; border-left: 3px solid var(--accent);
  color: var(--ink-2); font-style: normal;
}
blockquote p { font-family: var(--mono); font-size: .86rem; line-height: 1.7; }

/* tables */
.table-scroll { overflow-x: auto; margin: 1.6rem 0; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper-2); }
table { border-collapse: collapse; width: 100%; font-family: var(--ui); font-size: .82rem; min-width: 34rem; }
th, td { text-align: left; padding: .62rem .8rem; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
th { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); background: var(--paper-3); font-weight: 600; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--accent-wash) 55%, transparent); }

/* ---------- document pages ---------- */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding: 2.5rem 0 5rem; }
@media (min-width: 62rem) {
  .doc-layout { grid-template-columns: 15.5rem minmax(0, 1fr); gap: 3.5rem; }
}
.toc { font-family: var(--ui); }
@media (min-width: 62rem) {
  .toc { position: sticky; top: calc(var(--head-h, 6rem) + .7rem); align-self: start; max-height: calc(100vh - var(--head-h, 6rem) - 2.5rem); overflow-y: auto; padding-right: .6rem; }
}
.toc > .label { display: block; margin-bottom: .7rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc li { margin: 0; }
.toc a { display: block; font-size: .78rem; line-height: 1.35; color: var(--ink-3); text-decoration: none; padding: .34rem .7rem; border-left: 2px solid transparent; margin-left: -1px; }
.toc a:hover { color: var(--ink); background: var(--paper-2); }
.toc a.is-active { color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
.toc .lvl3 a { padding-left: 1.5rem; font-size: .74rem; }
.toc-mobile { border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper-2); padding: .3rem .9rem; margin-bottom: 0; }
.toc-mobile summary { font-family: var(--ui); font-size: .8rem; font-weight: 600; padding: .6rem 0; cursor: pointer; }
@media (min-width: 62rem) { .toc-mobile { display: none; } }
@media (max-width: 61.99rem) { .toc-desktop { display: none; } }

.prose { max-width: 44rem; }
.prose > h2:first-child, .prose > h1:first-child { margin-top: 0; }
.prose h2 { padding-top: .4rem; border-top: 1px solid var(--rule); }
.prose h2 .anchor, .prose h3 .anchor {
  font-family: var(--mono); font-size: .7em; color: var(--ink-3); text-decoration: none;
  opacity: 0; margin-left: .4rem; transition: opacity .15s;
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.prose img { max-width: 100%; height: auto; }

.doc-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.btn {
  font-family: var(--ui); font-size: .8rem; font-weight: 550; text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1rem; border-radius: var(--r); border: 1px solid var(--rule);
  background: var(--paper-2); color: var(--ink);
}
.btn:hover { border-color: var(--accent); background: var(--accent-wash); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
/* The dark-mode anchor colour rule is more specific than .btn / .btn-primary,
   so buttons rendered as links need their text colour restored explicitly —
   without this the primary button was pale cream on cream in dark mode. */
html[data-theme="dark"] a.btn, html[data-theme="dark"] button.btn { color: var(--ink); }
html[data-theme="dark"] a.btn-primary, html[data-theme="dark"] button.btn-primary { color: var(--paper); }
html[data-theme="dark"] a.btn-primary:hover, html[data-theme="dark"] .btn-primary:hover { color: var(--paper); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- cards / grids ---------- */
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.card {
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r);
  padding: clamp(1rem, 2.4vw, 1.4rem);
}
.card h3 { margin-top: 0; font-size: 1.08rem; }
.card p:last-child { margin-bottom: 0; }
.card-split { display: grid; gap: 0; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
@media (min-width: 48rem) { .card-split { grid-template-columns: 1fr 1fr; } }
.card-split > div { padding: clamp(1rem, 2.4vw, 1.5rem); }
.card-split > div + div { border-top: 1px solid var(--rule); }
@media (min-width: 48rem) { .card-split > div + div { border-top: 0; border-left: 1px solid var(--rule); } }
.authentic { background: var(--t1-wash); }
.synthetic { background: var(--t3-wash); }

.band { padding: clamp(2.8rem, 7vw, 5rem) 0; border-bottom: 1px solid var(--rule); }
.band-alt { background: var(--paper-2); }
.band > .wrap > h2:first-child { margin-top: 0; }

/* timeline */
.tl { list-style: none; padding: 0; margin: 2rem 0 0; border-left: 1px solid var(--rule); }
.tl li { position: relative; padding: 0 0 1.7rem 1.5rem; }
.tl li::before { content: ""; position: absolute; left: -5px; top: .45rem; width: 9px; height: 9px; border-radius: 99px; background: var(--paper); border: 2px solid var(--accent); }
.tl time { display: block; font-family: var(--mono); font-size: .74rem; color: var(--accent-2); margin-bottom: .2rem; }
.tl h3 { margin: 0 0 .35em; font-size: 1.02rem; }
.tl p { margin-bottom: 0; font-size: .96rem; color: var(--ink-2); }

/* ---------- tiers page ---------- */
.tier-controls {
  position: sticky; top: var(--head-h, 6rem); z-index: 30; background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); padding: .85rem 0;
}
.tier-controls .wrap { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter {
  font-family: var(--ui); font-size: .78rem; font-weight: 550; cursor: pointer;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 99px; padding: .38rem .85rem;
  color: var(--ink-2); display: inline-flex; align-items: center; gap: .4rem;
}
.filter:hover { border-color: var(--ink-3); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filter[aria-pressed="true"][data-tier="1"] { background: var(--t1); border-color: var(--t1); color: #fff; }
.filter[aria-pressed="true"][data-tier="2"] { background: var(--t2); border-color: var(--t2); color: #fff; }
.filter[aria-pressed="true"][data-tier="3"] { background: var(--t3); border-color: var(--t3); color: #fff; }
.filter[aria-pressed="true"][data-tier="4"] { background: var(--ink-2); border-color: var(--ink-2); color: var(--paper); }
html[data-theme="dark"] .filter[aria-pressed="true"] { color: #14120F; }
.filter .n { font-family: var(--mono); font-size: .68rem; opacity: .8; }
.search-field { display: flex; align-items: center; gap: .45rem; margin-left: auto; }
.search-field input {
  font-family: var(--ui); font-size: .82rem; padding: .42rem .7rem; min-width: 12rem;
  background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r);
}
.search-field input::placeholder { color: var(--ink-3); }
.count { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); }
@media (max-width: 640px) { .search-field { margin-left: 0; width: 100%; } .search-field input { flex: 1; min-width: 0; } }

.tier-cards { display: grid; gap: 1rem; margin: 2rem 0 0; }
@media (min-width: 60rem) { .tier-cards { grid-template-columns: 1fr 1fr; } }
.tier-card { border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper-2); overflow: hidden; }
.tier-card[hidden] { display: none; }
.tier-card > summary { padding: 1rem 1.2rem; cursor: pointer; list-style: none; display: block; }
.tier-card > summary::-webkit-details-marker { display: none; }
.tier-card > summary::after { content: "＋ detail"; font-family: var(--mono); font-size: .68rem; color: var(--ink-3); display: block; margin-top: .7rem; }
.tier-card[open] > summary::after { content: "－ collapse"; }
.tier-card > summary h3 { font-size: 1.05rem; margin: .3rem 0 .5rem; }
.tier-card .body { padding: 0 1.2rem 1.2rem; border-top: 1px dashed var(--rule); }
.tier-card .body h4 { margin-top: 1.2rem; }
.tier-card .body > *:first-child { margin-top: 1rem; }
.tier-card .body p, .tier-card .body li { font-size: .93rem; }
.tier-badge {
  font-family: var(--ui); font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: .22rem .55rem; border-radius: 99px; display: inline-flex; gap: .4rem; align-items: center;
}
.t-1 { background: var(--t1-wash); color: var(--t1); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t1) 35%, transparent); }
.t-2 { background: var(--t2-wash); color: var(--t2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t2) 35%, transparent); }
.t-3 { background: var(--t3-wash); color: var(--t3); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t3) 35%, transparent); }
.tier-card.tier-1 { border-left: 3px solid var(--t1); }
.tier-card.tier-2 { border-left: 3px solid var(--t2); }
.tier-card.tier-3 { border-left: 3px solid var(--t3); }
.empty-state { border: 1px dashed var(--rule); border-radius: var(--r); padding: 2.5rem 1.5rem; text-align: center; color: var(--ink-3); font-family: var(--ui); font-size: .9rem; }

.tells { display: grid; gap: 1rem; margin-top: 2rem; }
@media (min-width: 52rem) { .tells { grid-template-columns: 1fr 1fr; } }
.tell { border: 1px solid var(--rule); border-radius: var(--r); padding: 1.2rem; background: var(--paper); }
.tell .num { font-family: var(--display); font-size: 2rem; line-height: 1; color: var(--accent); display: block; margin-bottom: .4rem; }
.tell h3 { margin: 0 0 .5em; font-size: 1.02rem; }
.tell p { font-size: .92rem; }
.tell .example { font-family: var(--mono); font-size: .76rem; line-height: 1.6; color: var(--ink-2); background: var(--paper-2); border-radius: var(--r); padding: .8rem; margin-bottom: 0; }

/* ---------- engine ---------- */
.engine-grid { display: grid; gap: 1.6rem; }
@media (min-width: 64rem) { .engine-grid { grid-template-columns: 18rem minmax(0, 1fr); } }
.panel { border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper-2); padding: 1.2rem; }
.panel h3 { margin-top: 0; font-size: .95rem; font-family: var(--ui); letter-spacing: .01em; }
.field { margin-bottom: 1.15rem; }
.field label { font-family: var(--ui); font-size: .78rem; font-weight: 600; display: flex; justify-content: space-between; gap: .6rem; margin-bottom: .35rem; }
.field label .v { font-family: var(--mono); font-weight: 400; color: var(--accent-2); }
.field .hint { font-family: var(--ui); font-size: .72rem; color: var(--ink-3); margin: .3rem 0 0; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
select, input[type="number"], input[type="text"], input[type="url"], input[type="search"], textarea {
  width: 100%; font-family: var(--ui); font-size: .85rem; padding: .5rem .6rem;
  background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r);
}
textarea { font-family: var(--mono); font-size: .8rem; line-height: 1.6; min-height: 9rem; resize: vertical; }
.chart-shell { border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); padding: .8rem; }
canvas { display: block; width: 100%; height: auto; }
.readout { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); margin-top: 1rem; }
.stat { border: 1px solid var(--rule); border-radius: var(--r); padding: .8rem; background: var(--paper-2); }
.stat .k { font-family: var(--ui); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); display: block; }
.stat .val { font-family: var(--mono); font-size: 1.18rem; color: var(--ink); display: block; margin-top: .3rem; }
.stat .val.warn { color: var(--t3); }
.stat .val.ok { color: var(--t1); }

.laundry { display: grid; gap: 1rem; margin-top: 1.4rem; }
@media (min-width: 56rem) { .laundry { grid-template-columns: 1fr 1fr; } }
.artifact { border: 1px solid var(--rule); border-radius: var(--r); padding: 1.2rem; }
.artifact.honest { background: var(--t1-wash); border-color: color-mix(in srgb, var(--t1) 35%, var(--rule)); }
.artifact.laundered { background: var(--t3-wash); border-color: color-mix(in srgb, var(--t3) 40%, var(--rule)); }
.artifact h4 { margin-top: 0; }
.artifact .headline { font-family: var(--display); font-size: 1.25rem; line-height: 1.2; margin: .4rem 0 .8rem; }
.artifact.laundered .headline { font-weight: 700; text-transform: uppercase; letter-spacing: -.01em; color: var(--danger); }
.artifact ul { font-size: .9rem; }
.artifact .fine { font-family: var(--mono); font-size: .72rem; color: var(--ink-2); }
.diff { list-style: none; padding: 0; margin: 1rem 0 0; font-family: var(--mono); font-size: .78rem; }
.diff li { padding: .45rem .6rem; border-radius: 2px; margin-bottom: .3rem; display: flex; gap: .6rem; }
.diff li.rm { background: var(--t3-wash); color: var(--t3); }
.diff li.add { background: var(--t2-wash); color: var(--t2); }
.diff li b { font-family: var(--mono); }

/* ---------- verify tool ---------- */
.tool { border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper-2); padding: clamp(1rem, 3vw, 1.6rem); margin-bottom: 1.6rem; }
.tool > h3 { margin-top: 0; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.tool .proves { display: grid; gap: .8rem; margin: 1rem 0 1.3rem; }
@media (min-width: 48rem) { .tool .proves { grid-template-columns: 1fr 1fr; } }
.proves div { border-left: 2px solid var(--rule); padding-left: .8rem; }
.proves .label { display: block; margin-bottom: .3rem; }
.proves p { font-size: .88rem; margin: 0; color: var(--ink-2); }
.result {
  font-family: var(--mono); font-size: .8rem; line-height: 1.65; margin-top: 1rem;
  border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); padding: 1rem; white-space: pre-wrap; word-break: break-word;
}
.result:empty { display: none; }
.result pre { white-space: pre-wrap; margin: .4rem 0; }
.result .hit { display: block; border-left: 2px solid var(--t3); padding-left: .7rem; margin: .5rem 0; }
.result .good { color: var(--t1); }
.result .bad { color: var(--t3); }
.status-banner {
  display: flex; gap: .8rem; align-items: flex-start; font-family: var(--ui); font-size: .85rem;
  border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: var(--r);
  background: var(--accent-wash); padding: .9rem 1.1rem; margin: 1.4rem 0;
}
.status-banner strong { display: block; margin-bottom: .2rem; }
.status-banner.offline { border-left-color: var(--t3); background: var(--t3-wash); }
.status-banner.online { border-left-color: var(--t1); background: var(--t1-wash); }
.spin { display: inline-block; width: .8em; height: .8em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 99px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- alice ---------- */
.embed { border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.embed-pending {
  border: 2px dashed var(--rule); border-radius: var(--r); aspect-ratio: 16 / 9; display: grid; place-items: center;
  text-align: center; background: var(--paper-2); padding: 1.5rem;
}
.embed-pending .label { display: block; margin-bottom: .5rem; }
.embed-pending p { font-family: var(--ui); font-size: .85rem; color: var(--ink-3); max-width: 26rem; margin: 0 auto; }
.embed-caption { font-family: var(--ui); font-size: .78rem; color: var(--ink-3); margin-top: .7rem; }
.mirror-steps { display: grid; gap: 1rem; margin-top: 2rem; }
@media (min-width: 54rem) { .mirror-steps { grid-template-columns: repeat(3, 1fr); } }
.mirror-step { border: 1px solid var(--rule); border-radius: var(--r); padding: 1.2rem; background: var(--paper-2); }
.mirror-step time { font-family: var(--mono); font-size: .8rem; color: var(--accent-2); display: block; margin-bottom: .5rem; }
.mirror-step h3 { margin-top: 0; font-size: 1rem; }
.mirror-step p { font-size: .92rem; margin-bottom: 0; }
.reversed { font-family: var(--display); font-size: 1.1rem; transform: scaleX(-1); display: inline-block; color: var(--accent-2); }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--rule); background: var(--paper-2); padding: 3rem 0 4rem; font-family: var(--ui); font-size: .82rem; color: var(--ink-3); }
.foot-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.site-foot h2 { font-family: var(--ui); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 .8rem; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin-bottom: .4rem; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--accent-2); text-decoration: underline; }
.foot-note { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); max-width: 44rem; line-height: 1.6; }

/* ---------- reveal ---------- */
/* The hidden state is gated on html.js so that content is never trapped
   invisible if scripting is unavailable or app.js fails to load. */
.reveal { opacity: 1; transform: none; }
html.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}
