/* Use of Force — a public record.
   Evidentiary-ledger aesthetic: cool archival paper, serif for names and
   narrative, monospace for record metadata. One signature element: the
   five-step accountability trail on every case. */

:root {
  --paper: #f6f5f2;
  --card: #fcfbf9;
  --ink: #1c1d1f;
  --muted: #5d6067;
  --faint: #8a8d93;
  --rule: #d9d6cf;
  --rule-strong: #b9b5ac;
  --fatal: #7f2a24;
  --fatal-bg: #f3e4e2;
  --injury: #7a5200;
  --injury-bg: #f1e8d6;
  --pattern: #3d4650;
  --pattern-bg: #e5e7e9;
  --link: #2f4e78;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16171a;
    --card: #1d1f23;
    --ink: #e7e5e0;
    --muted: #a3a6ad;
    --faint: #7c7f86;
    --rule: #33363c;
    --rule-strong: #4a4e55;
    --fatal: #d4837b;
    --fatal-bg: #3a2422;
    --injury: #d3a558;
    --injury-bg: #362c18;
    --pattern: #aeb6bf;
    --pattern-bg: #2a2e33;
    --link: #92b0d6;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Base type. The whole sheet is rem-based, so scaling the root scales the
   entire layout proportionally — the same effect as browser zoom. Desktop
   reads comfortably at ~19px; phones keep the 16px base (already fine there).
   NB: rem/em in the @media breakpoints below are measured against the browser
   default (16px), not this value, so the 40rem breakpoint stays at 640px. */
html { font-size: 100%; }
@media (min-width: 40rem) { html { font-size: 118.75%; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.55;
  padding: 0 1.25rem 4rem;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.masthead, .hero, .toolbar, .cases, .methodology, .footer {
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
}

/* ---- masthead ---- */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.4rem 0 0.9rem;
  border-bottom: 2px solid var(--ink);
  font-family: var(--mono);
}
.masthead__name {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.masthead__tag {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ---- hero ---- */
.hero { padding: 3rem 0 2.25rem; }
.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 34ch;
}
.hero__lede {
  margin-top: 1.2rem;
  font-size: 1.05rem;
  color: var(--muted);
}
.hero__finding {
  margin-top: 1.6rem;
  padding: 0.75rem 0 0.75rem 1.1rem;
  border-left: 3px solid var(--fatal);
  font-size: 1.15rem;
  font-style: italic;
}

.statstrip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 2rem;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}
.stat {
  flex: 1 1 8rem;
  padding: 0.7rem 1rem 0.8rem 0;
  font-family: var(--mono);
}
.stat + .stat { padding-left: 1rem; border-left: 1px solid var(--rule); }
.stat dt {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.stat dd { font-size: 1.65rem; font-weight: 700; line-height: 1.2; }

/* ---- toolbar ---- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 0 0.9rem;
  font-family: var(--mono);
}
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.filter:hover { color: var(--ink); border-color: var(--ink); }
.filter.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.trail-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  align-items: center;
  font-size: 0.68rem;
  color: var(--muted);
}
.legend__title { letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.legend__item { display: inline-flex; align-items: center; gap: 0.3rem; }

/* trail dots (shared by legend + cases) */
.dot {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  flex: none;
  position: relative;
}
.dot--done { background: var(--ink); }
.dot--delayed { background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); }
.dot--declined { border-color: var(--fatal); }
.dot--declined::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 13px; height: 1.5px;
  background: var(--fatal);
  transform: translate(-50%, -50%) rotate(-45deg);
}
.dot--none { border-color: var(--faint); }

/* ---- case files ---- */
.cases { display: grid; gap: 1.4rem; padding-top: 0.4rem; }

.case {
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--ink);
  border-radius: 0 0 3px 3px;
  padding: 0 1.4rem 1.3rem;
}
.case[hidden] { display: none; }

.case__idrow {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  text-transform: uppercase;
}

.case__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.case__name { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.01em; }

.tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
}
.tag--fatal { color: var(--fatal); background: var(--fatal-bg); }
.tag--injury { color: var(--injury); background: var(--injury-bg); }
.tag--pattern { color: var(--pattern); background: var(--pattern-bg); }

.case__meta {
  margin-top: 0.55rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.7;
}
.case__meta b { color: var(--ink); font-weight: 600; }
.meta-sep { color: var(--rule-strong); padding: 0 0.4rem; }

.case__summary { margin-top: 0.9rem; max-width: 68ch; font-size: 0.98rem; }

/* disputed accounts */
.disputed {
  margin-top: 1rem;
  border-left: 3px solid var(--rule-strong);
  display: grid;
  gap: 0.6rem;
  padding: 0.2rem 0 0.2rem 1rem;
}
.disputed__row { max-width: 64ch; }
.disputed__label {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  display: block;
  margin-bottom: 0.15rem;
}
.disputed__text { font-size: 0.9rem; color: var(--muted); }

/* accountability trail — the signature element */
.trail { margin-top: 1.25rem; }
.trail__title {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.6rem;
}
.trail__steps {
  list-style: none;
  display: flex;
  align-items: flex-start;
}
.trail__step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  min-width: 0;
}
/* connector line */
.trail__step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 5px;
  left: calc(50% + 9px);
  right: calc(-50% + 9px);
  height: 1.5px;
  background: var(--rule-strong);
}
.trail__label {
  margin-top: 0.45rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.35;
}
.trail__status { display: block; color: var(--faint); text-transform: none; letter-spacing: 0; }
.trail__step--declined .trail__label, .trail__step--declined .trail__status { color: var(--fatal); }

.trail__note {
  margin-top: 0.7rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 70ch;
}

/* lead — the person's photo sits beside their story */
.case__lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1.6rem;
  align-items: start;
}
.case__lead-main { min-width: 0; }
.portrait { margin: 0.85rem 0 0; max-width: 26rem; }
.portrait img {
  display: block;
  max-width: 100%;
  max-height: 32rem;
  width: auto;
  height: auto;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: var(--paper);
}
.portrait a:hover img { border-color: var(--ink); }
@media (max-width: 40rem) {
  .case__lead { grid-template-columns: minmax(0, 1fr); }
  .portrait { order: -1; margin: 0.35rem 0 0.6rem; max-width: none; }
  .portrait img { max-height: none; width: 100%; }
}

/* media (case images) */
.media { margin-top: 1.15rem; }
.media__title {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.6rem;
}
/* Images display at their recorded native aspect ratio (width/height attrs
   set from cases.js): a shared row height, so portrait images sit narrow and
   landscape images sit wide, nothing cropped. */
.media__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.1rem;
  align-items: flex-start;
}
.media__item {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.media__item img {
  display: block;
  height: 15rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: var(--paper);
}
.media__item figcaption { max-width: 24rem; }
@media (max-width: 40rem) {
  .media__item img { height: auto; width: 100%; max-height: 20rem; object-fit: cover; }
}
.media__item a:hover img { border-color: var(--ink); }
.media__caption {
  margin-top: 0.4rem;
  font-family: var(--sans);
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
}
.media__credit { color: var(--faint); }
.media__credit a { color: var(--faint); }

/* corrections log */
.corrections { margin-top: 1.1rem; border-top: 1px solid var(--rule); padding-top: 0.75rem; }
.corrections__title {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.corrections ul { list-style: none; margin-top: 0.5rem; display: grid; gap: 0.35rem; }
.corrections li { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); }
.corrections s { color: var(--faint); }
.corrections__date { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); margin-right: 0.45rem; }

/* sources */
.case__sources { margin-top: 1.1rem; border-top: 1px solid var(--rule); padding-top: 0.75rem; }
.case__sources summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  list-style: none;
}
.case__sources summary::before { content: "+ "; color: var(--faint); }
.case__sources[open] summary::before { content: "− "; }
.case__sources summary::-webkit-details-marker { display: none; }
.case__sources ul { list-style: none; margin-top: 0.6rem; display: grid; gap: 0.35rem; }
.case__sources li { font-family: var(--sans); font-size: 0.82rem; }
.source__outlet { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 0.45rem; }

.verify {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.verify--confirmed { color: var(--muted); }
.verify--single-source, .verify--developing { color: var(--injury); }

.source__archive {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
  margin-left: 0.35rem;
  white-space: nowrap;
}

/* ---- know your rights ---- */
.rights {
  max-width: 56rem;
  margin: 3.5rem auto 0;
  border-top: 2px solid var(--ink);
  padding-top: 1.5rem;
}
.rights__eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fatal);
}
.rights__title {
  margin-top: 0.5rem;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  max-width: 40ch;
}
.rights__para { margin-top: 0.9rem; font-size: 0.98rem; }
.rights__para a { color: var(--link); }
.rights__sources { list-style: none; margin-top: 1.1rem; display: grid; gap: 0.35rem; }
.rights__sources li { font-family: var(--sans); font-size: 0.82rem; }

/* ---- methodology & footer ---- */
.methodology { margin-top: 3.5rem; border-top: 2px solid var(--ink); padding-top: 1.5rem; }
.methodology h2 {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.methodology ul { list-style: none; display: grid; gap: 0.6rem; }
.methodology li { font-size: 0.92rem; color: var(--muted); }
.methodology li strong { color: var(--ink); font-weight: 600; }
.methodology code { font-family: var(--mono); font-size: 0.85em; }
.disclaimer {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--faint);
}

.footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.noscript { padding: 2rem 0; color: var(--muted); }

/* sample note — shown when the page displays a sample of a larger record */
.sample-note {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  padding-top: 0.4rem;
}
.sample-note .pager {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.35rem 0.7rem;
  margin: 0.6rem 0.25rem 0;
  cursor: pointer;
}
.sample-note .pager:hover { color: var(--ink); border-color: var(--ink); }

/* ---- motion ---- */
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero__lede, .hero__finding, .statstrip {
    animation: rise 0.55s ease-out both;
  }
  .hero__lede { animation-delay: 0.08s; }
  .hero__finding { animation-delay: 0.16s; }
  .statstrip { animation-delay: 0.24s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---- small screens ---- */
@media (max-width: 40rem) {
  .trail__steps { flex-direction: column; align-items: stretch; gap: 0.55rem; }
  .trail__step { flex-direction: row; text-align: left; align-items: center; gap: 0.6rem; }
  .trail__step:not(:last-child)::before { display: none; }
  .trail__label { margin-top: 0; }
  .case { padding-left: 1rem; padding-right: 1rem; }
}
