/* Wethenorth — stylesheet
   Identity: an independent public dossier. Light paper, ink,
   one stamp red for every accent, monospace metadata.
   No webfonts, no images, no JS required. */

:root {
  --paper: #fdfcf9;
  --paper-2: #f4f1ea;
  --paper-3: #ffffff;
  --ink: #211d17;
  --ink-2: #4a4436;
  --muted: #6d6653;
  --line: #eae6dc;
  --line-2: #d6d0c3;
  --red: #b01a0e;
  --red-deep: #8a1208;
  --red-soft: #f3dfd9;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", "SFMono-Regular", Menlo, monospace;
  --wrap: 76rem;
  --read: 46rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--serif);
}

@media (min-width: 60rem) {
  body { font-size: 1.125rem; }
}

img, svg { max-width: 100%; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.6em; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.8vw, 3.2rem); line-height: 1.06; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.8rem); margin-top: 2.4em; padding-top: 0.9em; border-top: 1px solid var(--line); }
h3 { font-size: 1.17rem; margin-top: 1.8em; }
p { margin: 0 0 1em; text-wrap: pretty; }
code, pre { font-family: var(--mono); }

a { color: var(--red); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--red-deep); text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
::selection { background: var(--red); color: #fff; }
:target { background-color: #f8ece7; }

main ul li::marker, main ol li::marker { color: var(--red); }

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* ---------- section markers ---------- */

main h2::before {
  content: "§";
  margin-right: 0.5em;
  font-family: var(--mono);
  font-size: 0.72em;
  font-weight: 700;
  color: var(--red);
}

.alert h2::before { content: none; }

/* ---------- structure ---------- */

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
main { padding-block: clamp(2rem, 4vw, 3.5rem) clamp(3rem, 6vw, 5rem); }
.measure { max-width: var(--read); }
.measure-wide { max-width: 60rem; }

/* ---------- skip link ---------- */

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; z-index: 10; }
.skip-link:focus { left: 0; }

/* ---------- masthead ---------- */

.site-header { border-bottom: 2px solid var(--ink); background: var(--paper); }

.masthead { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: center; justify-content: space-between; padding-block: 1rem 0.9rem; }

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { flex: none; height: auto; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 1.12rem; letter-spacing: 0.01em; line-height: 1.15; }
.brand-tag { font: 400 0.72rem/1.35 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.site-nav ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; margin: 0; padding: 0; }
.site-nav a { font: 700 0.74rem/1.5 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; padding-bottom: 0.1rem; }
.site-nav a:hover { color: var(--red); border-bottom-color: var(--red); }
.site-nav a[aria-current="page"] { color: var(--red); border-bottom-color: var(--red); }
.site-nav .n { color: var(--muted); margin-right: 0.35em; font-weight: 400; }
.site-nav a[aria-current="page"] .n { color: var(--red); }

.notice-strip { margin: 0; border-top: 1px solid var(--line); background: var(--paper-2); padding-block: 0.5rem; }
.notice-strip .wrap { display: block; font: 400 0.74rem/1.5 var(--mono); letter-spacing: 0.02em; color: var(--ink-2); }
.notice-strip strong { color: var(--red); }

/* ---------- cover (home) ---------- */

.cover {
  border: 2px solid var(--ink);
  outline: 1px solid var(--line-2);
  outline-offset: -9px;
  background: var(--paper-3);
  box-shadow: 10px 10px 0 #ece8df;
  padding: clamp(1.4rem, 4vw, 2.6rem);
  margin-bottom: 2.6rem;
}

.cover-line { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font: 700 0.74rem/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 1.3rem; }
.cover h1 { margin-bottom: 0.6em; }
.cover .lede { margin-bottom: 1.1rem; }
.cover-meta { font: 400 0.8rem/1.7 var(--mono); letter-spacing: 0.02em; color: var(--muted); margin: 0; }
.cover .stamp { margin: 1.3rem 0 0; }

/* ---------- page furniture ---------- */

.kicker { font: 700 0.78rem/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); margin: 0 0 1.1rem; }
.kicker .file-no { color: var(--red); }

.crumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; margin: 0 0 1rem; font: 400 0.74rem/1.5 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--red); text-decoration: underline; }

.lede { font-size: clamp(1.15rem, 1.05rem + 0.55vw, 1.42rem); line-height: 1.5; color: var(--ink-2); max-width: var(--read); }
.lede strong { color: var(--ink); }

.tag { display: inline-block; font: 700 0.68rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); border: 1px solid var(--red); padding: 0.32em 0.55em; }
.tag-red { color: var(--red); border-color: var(--red); }

.stamp { display: inline-block; border: 3px double var(--red); color: var(--red); font: 700 0.82rem/1.5 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; text-align: center; padding: 0.55em 1em; transform: rotate(-3deg); margin: 0.5rem 0 1.2rem; }
.stamp span { display: block; font-size: 0.62rem; letter-spacing: 0.22em; }

/* ---------- callouts ---------- */

.alert { border: 2px solid var(--ink); border-left: 8px solid var(--red); background: var(--paper-3); padding: 1.2rem 1.3rem; margin: 1.6rem 0; max-width: 58rem; }
.alert h2 { margin: 0 0 0.5em; padding: 0; border: 0; font-size: 1.02rem; font-family: var(--mono); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); }
.alert p:last-child { margin-bottom: 0; }

.note { border-left: 3px solid var(--red-soft); padding: 0.2rem 0 0.2rem 1rem; color: var(--ink-2); max-width: 52rem; font-size: 0.95rem; }
.note p { margin-bottom: 0.6em; }
.note p:last-child { margin-bottom: 0; }
.note .tag { vertical-align: 0.1em; }

/* ---------- plates (page illustrations) ---------- */

.plate { margin: 2.6rem 0; }
.plate img { display: block; width: 100%; height: auto; }
.plate-narrow { max-width: 46rem; }
.plate figcaption { margin-top: 0.85rem; font: 400 0.78rem/1.6 var(--mono); letter-spacing: 0.03em; color: var(--muted); max-width: 60rem; }
.plate figcaption .fig { margin-right: 0.6em; font-weight: 700; color: var(--red); letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- facts ---------- */

.facts { list-style: none; margin: 1.2rem 0 0; padding: 0; max-width: 60rem; }
.facts li { position: relative; padding: 1rem 0 1rem 3rem; border-top: 1px solid var(--line); }
.facts li::before { position: absolute; left: 0; top: 0.95rem; font: 700 1rem/1.6 var(--mono); color: var(--red); }
.facts li:nth-child(1)::before { content: "01"; }
.facts li:nth-child(2)::before { content: "02"; }
.facts li:nth-child(3)::before { content: "03"; }
.facts li:nth-child(4)::before { content: "04"; }
.facts li:nth-child(5)::before { content: "05"; }
.facts li:nth-child(6)::before { content: "06"; }

.ref { font: 700 0.68rem/1 var(--mono); color: var(--red); text-decoration: none; vertical-align: super; }
.ref:hover { color: var(--red-deep); }

/* ---------- file index ---------- */

.file-index { list-style: none; margin: 1.4rem 0; padding: 0; max-width: 60rem; border-top: 2px solid var(--ink); }
.file-index li { border-bottom: 1px solid var(--line); }
.file-index a { display: grid; grid-template-columns: 3.2rem 1fr; gap: 1rem; padding: 0.7rem 0.9rem 0.7rem 0.9rem; margin-left: -0.9rem; border-left: 3px solid transparent; text-decoration: none; color: var(--ink); }
.file-index a:hover { background: var(--paper-3); border-left-color: var(--red); }
.file-index a:hover .t { text-decoration: underline; text-decoration-color: var(--red); }
.file-index .n { font: 700 0.8rem/1.8 var(--mono); color: var(--red); }
.file-index .t { display: block; }
.file-index .d { display: block; font-size: 0.88rem; color: var(--muted); }

/* ---------- timeline ---------- */

.timeline { list-style: none; margin: 1.5rem 0; padding: 0; max-width: 60rem; }
.timeline li { display: grid; grid-template-columns: 9rem 1fr; gap: 0.25rem 1.5rem; padding: 1.1rem 0; border-top: 1px solid var(--line); }
.timeline .t-date { font: 700 0.76rem/1.7 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); }
.timeline h3 { margin: 0 0 0.35em; font-size: 1.05rem; }
.timeline p { margin: 0; }

@media (max-width: 46rem) {
  .timeline li { grid-template-columns: 1fr; }
}

/* ---------- case entries ---------- */

.case { border-top: 2px solid var(--ink); padding: 1.1rem 0 1.4rem; max-width: 60rem; }
.case-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; margin-bottom: 0.4rem; }
.case h3 { margin: 0; font-size: 1.22rem; }
.case .outcome { font: 700 0.72rem/1.6 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); }
.case p { margin: 0 0 0.6em; }
.case p:last-child { margin-bottom: 0; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--paper-3); margin: 1.4rem 0; }
table { border-collapse: collapse; width: 100%; min-width: 44rem; }
caption { caption-side: top; text-align: left; font: 400 0.8rem/1.5 var(--mono); color: var(--muted); padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); }
th, td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 0.95rem; }
th { font: 700 0.72rem/1.5 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); background: var(--paper-2); border-bottom: 2px solid var(--red); }
tbody tr:hover { background: var(--paper-2); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--mono); white-space: nowrap; }

/* ---------- glossary ---------- */

.glossary { margin: 1.4rem 0; max-width: 56rem; }
.glossary dt { font-weight: 700; font-size: 1.05rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.glossary dt:first-of-type { border-top: 0; padding-top: 0; }
.glossary dd { margin: 0.3rem 0 1rem; color: var(--ink-2); }

/* ---------- quote ---------- */

blockquote.cite { font: 400 1.18rem/1.5 var(--serif); border: 0; border-left: 4px solid var(--red); background: transparent; padding: 0.2rem 0 0.2rem 1.4rem; margin: 1.4rem 0; max-width: 52rem; color: var(--ink-2); }

/* ---------- sources ---------- */

.sources { margin-top: 2.6rem; border-top: 2px solid var(--ink); padding-top: 1rem; max-width: 60rem; }
.sources h2 { margin: 0 0 0.6em; padding: 0; border: 0; font-size: 1.05rem; font-family: var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.sources ol { margin: 0; padding-left: 1.4rem; }
.sources li { padding: 0.5rem 0; border-top: 1px solid var(--line); font-size: 0.92rem; color: var(--ink-2); }
.sources li:first-child { border-top: 0; }
.sources .src-link { word-break: break-all; font-family: var(--mono); font-size: 0.82rem; }
.backref { margin-left: 0.4rem; font: 700 0.68rem/1 var(--mono); text-decoration: none; }

/* ---------- citation blocks ---------- */

.cite { background: var(--paper-2); border: 1px solid var(--line-2); padding: 1rem; overflow-x: auto; font: 400 0.82rem/1.6 var(--mono); margin: 0.8rem 0; }
.btn { font: 700 0.74rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; background: transparent; border: 2px solid var(--red); color: var(--red-deep); padding: 0.55em 1em; cursor: pointer; }
.btn:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- pager ---------- */

.pager { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1rem; max-width: 60rem; }
.pager a { font: 700 0.76rem/1.6 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }
.pager a:hover { color: var(--red-deep); text-decoration: underline; }
.pager .dir { display: block; font-weight: 400; color: var(--muted); letter-spacing: 0.14em; }

/* ---------- footer ---------- */

.site-footer { border-top: 3px solid var(--ink); background: var(--paper-2); padding-block: 2rem 1.2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem 3rem; }
.footer-head { font: 700 0.74rem/1.5 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); margin: 0 0 0.7rem; border: 0; padding: 0; }
.footer-block p { font-size: 0.9rem; color: var(--ink-2); max-width: 32rem; }
.footer-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; }
.footer-list li { margin: 0 0 0.3rem; font-size: 0.88rem; }
.footer-meta { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.footer-warning { margin-top: 1.6rem; border-top: 1px solid var(--line); padding-top: 0.9rem; font: 700 0.8rem/1.6 var(--mono); letter-spacing: 0.04em; color: var(--red); }

@media (max-width: 40rem) {
  .footer-list { columns: 1; }
}

/* ---------- print ---------- */

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .skip-link, .site-nav, .notice-strip, .stamp, .pager, .btn { display: none; }
  .site-header, .site-footer { border-color: #000; }
  .site-footer { background: transparent; }
  a { color: #000; }
  .alert { border-color: #000; border-left-color: #000; }
  .wrap { max-width: none; padding: 0; }
  .cover { border-color: #000; outline: 0; box-shadow: none; }
  .case, .sources li, .timeline li, .facts li { break-inside: avoid; }
}
