/* Law-Bunker — public site.
   Built to Endr's "Justice Tech Blog" style guide (Design System 2.0, Light):
   Playfair Display headings, Inter body, Clean Paper ground, Deep Charcoal ink,
   Classic Burgundy for authority, Refined Brass as the secondary accent, a subtle
   tech blue for links and hover, and light "bento" cards.
   Contrast was MEASURED, not eyeballed: brass #C5A059 is 2.46:1 on white, so it is
   decoration only; brass-coloured TEXT uses --brass-ink (6.0:1). */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url("/static/fonts/inter.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/playfair.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("/static/fonts/playfair-italic.woff2") format("woff2"); }

:root {
  --paper: #f4f5f7;
  --card: #ffffff;
  --navy-900: #111827;
  --navy-800: #1e293b;
  --muted: #4b5563;          /* 7.56:1 on white */
  --burgundy: #8A1538;
  --burgundy-500: #A11A42;
  --brass: #C5A059;          /* decoration only */
  --brass-600: #A38040;
  --brass-ink: #7A5F28;      /* brass-coloured text, 6.0:1 */
  --blue: #2563eb;           /* links, 5.17:1 */
  --blue-50: #eff6ff;
  --line: rgba(17, 24, 39, 0.08);
  --radius: 1.25rem;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--navy-800);
  background-color: var(--paper);
  background-image: radial-gradient(circle at 50% 0%, #ffffff 0%, #f4f5f7 100%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.has-player { padding-bottom: 5.5rem; }
::selection { background: rgba(197, 160, 89, 0.3); color: var(--navy-900); }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: #1d4ed8; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
img, svg { max-width: 100%; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 46rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--card); padding: .5rem 1rem; z-index: 50; }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--navy-900); font-weight: 400; line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }

/* ---------- header ---------- */
.site-header { padding: 1.5rem 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--navy-900);
  font-family: var(--serif); font-weight: 700; font-size: 1.35rem; letter-spacing: .01em; }
.brand-mark { width: 2rem; height: 2rem; flex: none; }
.brand:hover { color: var(--navy-900); }
.nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; font-size: .95rem; font-weight: 500; }
.nav > a, .nav summary { color: var(--navy-900); text-decoration: none; padding: .45rem .8rem; border-radius: 999px; cursor: pointer; }
.nav > a:hover, .nav summary:hover { background: rgba(17, 24, 39, .05); }
.nav > a[aria-current="page"] { background: var(--navy-900); color: #fff; }
.horizon { position: relative; }
.horizon summary { list-style: none; display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); }
.horizon summary::-webkit-details-marker { display: none; }
.horizon summary::after { content: ""; width: .45rem; height: .45rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.horizon[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.horizon summary.current { color: var(--navy-900); background: rgba(197,160,89,.15); }
.horizon-menu { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 30; width: min(20rem, 85vw);
  background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: .5rem;
  box-shadow: 0 12px 25px -5px rgba(0,0,0,.08); }
.horizon-menu .kicker { display: block; padding: .5rem .75rem .25rem; }
.horizon-menu a { display: block; padding: .5rem .75rem; border-radius: .6rem; color: var(--navy-800); text-decoration: none; font-weight: 400; }
.horizon-menu a:hover { background: var(--paper); }
.horizon-menu a span { display: block; font-size: .8rem; color: var(--muted); }

/* ---------- shared pieces ---------- */
.kicker { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brass-ink); }
.pill { display: inline-block; padding: .2rem .75rem; border-radius: 999px; font-size: .75rem; font-weight: 500; line-height: 1.6; }
.pill-planned { color: var(--brass-ink); background: rgba(197,160,89,.12); border: 1px solid rgba(197,160,89,.35); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.badge { color: var(--burgundy); background: rgba(138,21,56,.05); border: 1px solid rgba(138,21,56,.2); }
.meta { color: var(--muted); font-size: .9rem; font-weight: 500; }
.lead { font-size: 1.15rem; font-weight: 300; color: var(--navy-800); max-width: 42rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 999px;
  padding: .7rem 1.5rem; font: 500 .95rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: all .3s ease; border: 1px solid var(--navy-900); }
.btn-primary { background: var(--navy-900); color: #fff; }
.btn-primary:hover { background: var(--navy-800); color: #fff; box-shadow: 0 4px 12px rgba(17,24,39,.15); transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--navy-900); border-color: rgba(17,24,39,.2); }
.btn-secondary:hover { border-color: var(--navy-900); background: #f8fafc; color: var(--navy-900); }
.btn[disabled], .btn.is-disabled { background: #e5e7eb; border-color: #e5e7eb; color: var(--muted); cursor: default; transform: none; box-shadow: none; }
.btn svg { width: 1rem; height: 1rem; }

.bento { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); position: relative;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.02), 0 2px 4px -1px rgba(0,0,0,.02); transition: all .3s cubic-bezier(.4,0,.2,1); }
.bento.lift::before { content: ""; position: absolute; inset: 0; border-radius: var(--radius); padding: 2px;
  background: linear-gradient(135deg, rgba(197,160,89,.4), rgba(255,255,255,0) 50%, rgba(59,130,246,.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.bento.lift:hover::before { opacity: 1; }
.bento.lift:hover { transform: translateY(-2px); box-shadow: 0 12px 25px -5px rgba(0,0,0,.05), 0 8px 10px -6px rgba(0,0,0,.01); border-color: transparent; }
.section-title { font-size: 1.5rem; border-bottom: 1px solid rgba(17,24,39,.1); padding-bottom: .5rem; margin: 3.5rem 0 1.5rem; }

/* ---------- home ---------- */
.hero { padding: 3.5rem 0 3rem; }
.hero h1 { max-width: 15ch; margin-bottom: 1.25rem; }
.hero h1 em { color: var(--burgundy); font-style: italic; }
.hero .actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; }

.cards { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); }
.card { padding: 1.75rem; display: flex; flex-direction: column; gap: 1rem; }
.card.featured { grid-column: 1 / -1; }
.card-top { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.card h3 { margin: 0; font-size: 1.6rem; }
.card.featured h3 { font-size: clamp(1.75rem, 3.5vw, 2.4rem); }
.card h3 a { color: var(--navy-900); text-decoration: none; transition: color .3s; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card:hover h3 a { color: var(--blue); }
.card .teaser { margin: 0; font-weight: 300; color: var(--navy-800); }
.card .teaser::before { content: "\201C"; } .card .teaser::after { content: "\201D"; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid #f1f2f4; padding-top: 1rem; margin-top: auto; }
.card-foot .read { color: var(--blue); font-weight: 600; font-size: .9rem; }
.card .play-btn { position: relative; z-index: 2; }
.empty { padding: 2rem; color: var(--muted); }

/* ---------- story ---------- */
.story-head { padding: 2rem 0 1.5rem; }
.story-head h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
.facts { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.byline { color: var(--muted); font-size: .95rem; }
.byline strong { color: var(--navy-900); font-weight: 600; }
.story-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60rem) { .story-grid { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; } .aside { position: sticky; top: 1.5rem; } }
.listen { padding: 1.5rem; }
.transcript { padding: clamp(1.5rem, 4vw, 2.75rem); }
.transcript p { font-size: 1.08rem; line-height: 1.75; font-weight: 400; color: var(--navy-800); }
.transcript h2 { font-size: 1.4rem; }
.aside .bento { padding: 1.5rem; margin-bottom: 1.5rem; }
.aside h2 { font-size: 1.15rem; margin-bottom: .75rem; }
.aside .btn { width: 100%; }
.aside .small { font-size: .85rem; color: var(--muted); margin: .75rem 0 0; }
.coverage { list-style: none; margin: 0; padding: 0; }
.coverage li { padding: .6rem 0; border-top: 1px solid #f1f2f4; }
.coverage li:first-child { border-top: 0; padding-top: 0; }
.coverage .outlet { display: block; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.coverage a { font-weight: 500; text-decoration: none; }
.coverage a:hover { text-decoration: underline; }

/* ---------- inline player (story page) ---------- */
.player { display: flex; align-items: center; gap: 1rem; }
.player .pp { flex: none; width: 3.25rem; height: 3.25rem; border-radius: 50%; border: 0; background: var(--navy-900); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .3s; }
.player .pp:hover { background: var(--burgundy); }
.player .pp svg { width: 1.2rem; height: 1.2rem; }
.player .track { flex: 1; min-width: 0; }
.player .title { font-weight: 500; color: var(--navy-900); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .bar { display: flex; align-items: center; gap: .6rem; font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--muted); }
.player input[type=range] { flex: 1; accent-color: var(--burgundy); min-width: 0; }
.player.coming { color: var(--muted); }
.player.coming .pp { background: #e5e7eb; color: var(--muted); cursor: default; }
.coming-note { font-size: .9rem; color: var(--muted); margin: 0; }

/* ---------- sticky bar ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 20px -10px rgba(0,0,0,.08); }
.dock[hidden] { display: none; }
.dock .wrap { padding-top: .75rem; padding-bottom: .75rem; }
.dock .player .pp { width: 2.75rem; height: 2.75rem; }
.dock .icon-btn { flex: none; background: none; border: 0; cursor: pointer; color: var(--navy-900); padding: .4rem; border-radius: 50%; }
.dock .icon-btn:hover { background: var(--paper); }
.dock .icon-btn svg { width: 1.2rem; height: 1.2rem; display: block; }
.dock .rate { font: 600 .8rem var(--sans); color: var(--navy-900); background: var(--paper); border: 0; border-radius: 999px; padding: .35rem .6rem; cursor: pointer; }

/* ---------- archive ---------- */
.archive { list-style: none; padding: 0; margin: 0; }
.archive li { padding: 1.25rem 1.5rem; display: grid; gap: .25rem; margin-bottom: 1rem; }
.archive a { font-family: var(--serif); font-size: 1.35rem; color: var(--navy-900); text-decoration: none; }
.archive a:hover { color: var(--blue); }
.year { font-family: var(--serif); font-size: 1.25rem; color: var(--muted); margin: 2rem 0 1rem; }

/* ---------- prose pages (Fireworks, horizon) ---------- */
.prose { padding: 2rem 0 1rem; }
.prose p, .prose li { font-size: 1.05rem; line-height: 1.75; }
.prose h2 { margin-top: 3rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.flow { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); counter-reset: box; margin: 1.5rem 0; }
.flow .bento { padding: 1.25rem 1.25rem 1.1rem; }
.flow h3 { font-size: 1.2rem; margin-bottom: .35rem; }
.flow h3 .n { color: var(--brass-ink); font-style: italic; margin-right: .3rem; }
.flow p { font-size: .95rem; margin: 0 0 .6rem; line-height: 1.55; }
.flow .model { font-size: .78rem; color: var(--muted); font-weight: 500; }
.flow .you { border-color: rgba(138,21,56,.35); }
.who { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: .1rem .5rem; border-radius: 999px; margin-left: .25rem; vertical-align: middle; }
.who.machine { color: var(--muted); background: var(--paper); }
.who.me { color: var(--burgundy); background: rgba(138,21,56,.07); }
.steps { counter-reset: s; list-style: none; padding: 0 !important; }
.steps li { counter-increment: s; position: relative; padding: 0 0 1rem 3rem; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: .1rem; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--navy-900); color: #fff; font: 600 .85rem/2rem var(--sans); text-align: center; }
.stat-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); margin: 1.5rem 0; }
.stat { padding: 1.25rem; }
.stat b { display: block; font: 600 1.9rem/1.1 var(--serif); color: var(--navy-900); }
.stat span { font-size: .85rem; color: var(--muted); }
.lessons li { margin-bottom: .75rem; }
.table-wrap { overflow-x: auto; margin: 1.25rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--card); border-radius: 1rem; overflow: hidden; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid #eef0f3; vertical-align: top; }
th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 600; color: var(--navy-900); border-bottom: 0; }
.chart { padding: 1.5rem; margin: 1.25rem 0; }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .85rem; color: var(--navy-800); margin-top: 1rem; }
.legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; }
.note { font-size: .9rem; color: var(--muted); }
.horizon-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); margin: 1.5rem 0; }
.horizon-grid a { padding: 1.25rem; text-decoration: none; color: var(--navy-800); display: block; }
.horizon-grid h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.horizon-grid p { font-size: .9rem; margin: 0; color: var(--muted); }
.planned-hero { padding: 3rem 0 1rem; }
.planned-hero .pill { margin-bottom: 1rem; }
.planned-body { padding: 2rem clamp(1.5rem, 4vw, 2.75rem); margin-bottom: 2rem; }
.planned-body p { font-size: 1.08rem; line-height: 1.75; }

/* ---------- footer ---------- */
.site-footer { margin-top: 5rem; padding: 2.5rem 0 3rem; border-top: 1px solid rgba(17,24,39,.1); font-size: .9rem; color: var(--muted); }
.site-footer .wrap { display: grid; gap: .5rem; }
.site-footer .views { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--navy-900); }
.site-footer a { color: var(--muted); }

@media (max-width: 40rem) {
  .wrap { padding: 0 1rem; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
  .horizon-menu { left: 0; right: auto; }
  .hero { padding: 2rem 0; }
  .card { padding: 1.35rem; }
  .dock .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.gap { margin-top: 1.5rem; }
.gap-sm { margin-top: 1rem; }
.sw-kimi { background: #8A1538; } .sw-deepseek { background: #C5A059; } .sw-whisper { background: #3b82f6; } .sw-none { background: #e5e7eb; }
