/* The investigation notebook: ink, paper, highlighter, and quiet graph lines. */
:root {
  color-scheme: light;
  --paper: #f8f8f5;
  --sheet: #fffefa;
  --ink: #202344;
  --muted: #53566c;
  --rule: #7d8093;
  --grid: rgb(37 42 81 / 10%);
  --highlight: #f2e54c;
  --focus: #254fbd;
  --max-width: 1500px;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Intentional: the user-approved investigation-notebook comp makes graph paper the page material. */
body {
  min-width: 320px;
  margin: 0;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  line-height: 1.65;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; color: inherit; }
button, select, input { accent-color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
::selection { color: var(--ink); background: var(--highlight); }

.skip-link { position: absolute; top: -5rem; left: 1rem; z-index: 5; padding: .7rem 1rem; background: var(--sheet); }
.skip-link:focus { top: 1rem; }
.site-header, .page-shell, .policy-section, .site-footer { width: min(calc(100% - 3rem), var(--max-width)); margin-inline: auto; }
.site-header { min-height: 96px; display: flex; justify-content: space-between; align-items: center; gap: 2rem; border-bottom: 1px solid var(--rule); }
.wordmark { display: grid; gap: .1rem; text-decoration: none; }
.wordmark-main { font-size: clamp(1.25rem, 2vw, 1.8rem); font-weight: 800; letter-spacing: -.04em; }
.wordmark-sub { font-size: .69rem; color: var(--muted); font-weight: 650; letter-spacing: .025em; }
.top-nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.3rem); font-size: .89rem; font-weight: 700; }
.top-nav a[aria-current="page"] { text-decoration-thickness: 2px; text-decoration-color: var(--ink); text-underline-offset: .35em; }

.page-shell { display: grid; grid-template-columns: minmax(190px, 240px) minmax(0, 1fr) minmax(205px, 260px); gap: clamp(1.25rem, 3vw, 2.5rem); padding-block: 1.6rem 2.3rem; align-items: start; }
.filters, .evidence { min-width: 0; }
.filters h2, .evidence h2, .archive-heading h2, .section-heading h2 { margin: 0; font-size: 1.35rem; line-height: 1.3; letter-spacing: -.025em; }
.filters h2, .evidence h2 { padding-bottom: .55rem; border-bottom: 2px solid var(--ink); }
.filter-block { display: grid; gap: .45rem; margin-top: 1.2rem; }
.filter-block label { font-size: .9rem; font-weight: 750; }
.date-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .45rem; align-items: center; }
input[type="date"], select { width: 100%; min-height: 42px; padding: .45rem .55rem; border: 1px solid var(--ink); border-radius: 0; background: var(--sheet); }
.text-button { margin-top: 1rem; padding: .35rem 0; border: 0; background: transparent; font-size: .86rem; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.small-note { color: var(--muted); font-size: .82rem; }

.archive { min-width: 0; }
.archive-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.count-line { margin: .15rem 0 0; color: var(--muted); font-size: .85rem; }
.count-line strong { color: var(--ink); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.status-chip, .empty-label { display: inline-flex; align-items: center; gap: .45rem; margin: .1rem 0; padding: .15rem .35rem; background: var(--highlight); font-size: .75rem; font-weight: 750; }
.status-dot { width: .52rem; height: .52rem; flex: 0 0 auto; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--sheet); }
.empty-state { min-height: 390px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: clamp(1.25rem, 4vw, 3.4rem); border: 1px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 6px; background: var(--sheet); }
.empty-copy { max-width: 35rem; }
.empty-copy h3 { max-width: 19ch; margin: .85rem 0 .65rem; font-size: clamp(1.55rem, 2.5vw, 2.35rem); line-height: 1.35; letter-spacing: -.045em; text-wrap: balance; }
.empty-copy > p:not(.empty-label) { max-width: 36ch; margin: 0; color: var(--muted); }
.inline-link { display: inline-block; margin-top: 1.15rem; font-weight: 750; }
.notebook-art { width: clamp(95px, 17vw, 160px); height: auto; flex: 0 0 auto; }
.case-list { border-top: 1px solid var(--ink); }
.case-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem 1rem; padding: 1rem .3rem; border-bottom: 1px solid var(--rule); }
.case-title { grid-column: 1 / -1; font-size: 1.13rem; font-weight: 760; }
.case-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: 0; }
.case-meta div { display: flex; gap: .3rem; font-size: .81rem; }
.case-meta dt { color: var(--muted); }
.case-meta dd { margin: 0; }
.source-count { align-self: end; margin: 0; color: var(--muted); font-size: .77rem; }
.filter-empty { padding: 1rem; border: 1px dashed var(--rule); background: var(--sheet); }
.archive-footnote { display: flex; justify-content: space-between; gap: 1rem; margin-top: .9rem; color: var(--muted); font-size: .78rem; }
.archive-footnote a { color: var(--ink); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
#filter-result { min-height: 1.5em; color: var(--muted); font-size: .8rem; }

.evidence-item { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .5rem; padding-block: .85rem; border-bottom: 1px solid var(--rule); }
.evidence-mark { display: grid; width: 1.7rem; height: 1.7rem; place-items: center; background: var(--highlight); font-size: .7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.evidence-item h3 { margin: 0; font-size: .93rem; }
.evidence-item p, .evidence-note { margin: .2rem 0 0; color: var(--muted); font-size: .82rem; }
.evidence-note { padding-top: .8rem; }

.policy-section { padding-block: 2.2rem 2.7rem; border-top: 1px solid var(--rule); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-heading p { margin: 0; color: var(--muted); }
.policy-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin-top: 1.3rem; }
.policy-columns > div { padding-top: .75rem; border-top: 1px solid var(--ink); }
.policy-columns h3 { margin: 0 0 .3rem; font-size: 1rem; }
.policy-columns p { margin: 0; color: var(--muted); font-size: .91rem; }
.site-footer { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-block: 1.2rem 2rem; border-top: 1px solid var(--rule); font-size: .8rem; }
.footer-brand { font-weight: 800; text-decoration: none; }
.site-footer p { margin: 0; color: var(--muted); }

.case-detail { width: min(calc(100% - 3rem), 900px); margin: 1rem auto 4rem; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .6rem; color: var(--muted); font-size: .85rem; }
.case-header { margin-top: 2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--rule); }
.case-header h1 { margin: .7rem 0 1rem; font-size: clamp(1.8rem, 4vw, 3.3rem); line-height: 1.25; text-wrap: balance; }
.case-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem 1.5rem; margin: 0; }
.case-facts div { display: flex; gap: .6rem; }
.case-facts dt { color: var(--muted); }
.case-facts dd { margin: 0; font-weight: 650; }
.case-body { max-width: 72ch; padding-block: 1.5rem; line-height: 1.9; }
.case-body h2, .case-sources h2, .correction-note h2 { margin-block: 1.8rem .5rem; font-size: 1.3rem; }
.case-sources { padding-top: 1rem; border-top: 1px solid var(--rule); }
.case-sources ol { padding-left: 1.4rem; }
.case-sources li { padding-block: .45rem; }
.source-publisher { display: block; color: var(--muted); font-size: .82rem; }
.external-mark { margin-left: .2rem; font-size: .8em; }
.correction-note { margin-top: 2rem; padding: 1rem; border: 1px solid var(--rule); background: var(--sheet); }
.correction-note h2 { margin-top: 0; }
.correction-note p { margin: 0; }

@media (max-width: 1050px) {
  .page-shell { grid-template-columns: minmax(175px, 220px) minmax(0, 1fr); }
  .evidence { grid-column: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 1rem; }
  .evidence h2, .evidence-note { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .site-header, .page-shell, .policy-section, .site-footer { width: min(calc(100% - 1.5rem), var(--max-width)); }
  .site-header { min-height: auto; align-items: start; flex-direction: column; gap: .8rem; padding-block: 1rem; }
  .top-nav { width: 100%; justify-content: space-between; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; font-size: .79rem; }
  .page-shell { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; padding-top: 1rem; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; }
  .filters h2, .text-button, .filters noscript { grid-column: 1 / -1; }
  .filters h2 { margin-bottom: -.25rem; }
  .filter-block { margin-top: 0; }
  .date-range { grid-template-columns: minmax(0, 1fr); }
  .date-range span { display: none; }
  .archive-heading { flex-direction: column; }
  .empty-state { min-height: 330px; align-items: end; padding: 1.15rem; gap: .4rem; }
  .empty-copy h3 { font-size: 1.5rem; }
  .notebook-art { width: 82px; align-self: center; }
  .evidence { grid-column: auto; grid-template-columns: minmax(0, 1fr); }
  .evidence h2, .evidence-note { grid-column: auto; }
  .section-heading { display: block; }
  .section-heading p { margin-top: .2rem; }
  .policy-columns { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .site-footer { align-items: start; flex-direction: column; gap: .35rem; }
  .case-meta { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-count { grid-column: 1 / -1; }
  .case-facts { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
