@font-face {
  font-family: "Zilla Slab";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/zilla-slab-500.woff2") format("woff2");
}
@font-face {
  font-family: "Zilla Slab";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/zilla-slab-700.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/atkinson-400.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/atkinson-700.woff2") format("woff2");
}
@font-face {
  font-family: "Sono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/sono-400.woff2") format("woff2");
}
@font-face {
  font-family: "Sono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/sono-600.woff2") format("woff2");
}

:root {
  --ink: #17211b;
  --paper: #e3ecd6;
  --paper-2: #f4f7ef;
  --line: #8ea18a;
  --brass: #e6b325;
  --brass-ink: #3d2c00;
  --stamp: #8f2430;
  --muted: #3e5146;
  --measure: 68ch;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(to right, rgba(23, 33, 27, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(to bottom, rgba(23, 33, 27, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper);
  font-family: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  line-height: 1.5;
}
body.admin {
  --ink: #e7efe4;
  --paper: #141c17;
  --paper-2: #1c2821;
  --line: #3d5246;
  --muted: #c5d4c8;
  --brass-ink: #1a1400;
  color-scheme: dark;
  background:
    linear-gradient(to right, rgba(230, 179, 37, 0.05) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(to bottom, rgba(230, 179, 37, 0.05) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--paper);
}
::selection { background: var(--brass); color: var(--brass-ink); }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }
.skip {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  background: var(--brass);
  color: var(--brass-ink);
  padding: 0.4rem 0.7rem;
}
.skip:focus { top: 0.5rem; z-index: 5; }

.mast, .foot, .record, .denied, .desk { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.mast { display: flex; justify-content: space-between; gap: 1.5rem; align-items: end; padding: 1.25rem 0 0.75rem; }
.word { font-family: "Zilla Slab", Georgia, serif; font-weight: 700; font-size: 1.7rem; color: inherit; text-decoration: none; }
.mast p, .foot p { max-width: var(--measure); color: var(--muted); margin: 0.2rem 0 0; }
.nav { display: flex; gap: 0.8rem; overflow-x: auto; padding-bottom: 0.3rem; }
.nav a { color: var(--ink); text-decoration: none; white-space: nowrap; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: var(--brass); }
main { padding-bottom: 3rem; }
.foot { padding: 1rem 0 2rem; border-top: 1px solid var(--line); }

h1, h2 { font-family: "Zilla Slab", Georgia, serif; font-weight: 500; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0.2rem 0 0.8rem; max-width: 18ch; }
h2 { font-size: 1.5rem; margin: 1.6rem 0 0.5rem; }
.fips, .num, .call-number { font-family: "Sono", ui-monospace, monospace; }
.fips { letter-spacing: 0.04em; margin: 0; color: var(--muted); }
.prose, .source, .empty { max-width: var(--measure); }
.source { color: var(--muted); font-size: 0.95rem; }
a { color: inherit; }
.empty { padding: 0.8rem 0; }

.steps { display: flex; flex-wrap: wrap; gap: 1.2rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.steps li { display: flex; gap: 0.4rem; align-items: baseline; color: var(--muted); white-space: nowrap; }
.steps .current { color: var(--brass-ink); background: var(--brass); padding: 0.15rem 0.45rem; }
.steps span { font-family: "Sono", monospace; }

.call {
  margin: 1rem 0 1.4rem;
  padding: 1rem 1.1rem;
  background: var(--brass);
  color: var(--brass-ink);
  max-width: 36rem;
}
.call a { font-family: "Zilla Slab", Georgia, serif; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; text-decoration: none; }
.call-number { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0.2rem 0; }
.call-placeholder { background: transparent; color: var(--ink); border: 1px dashed var(--stamp); }
.stamp {
  display: inline-block;
  margin: 0;
  color: var(--stamp);
  border: 2px solid var(--stamp);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "Zilla Slab", Georgia, serif;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  transform: rotate(-2deg);
  animation: stamp-in 240ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .stamp { animation: none; }
  html { scroll-behavior: auto; }
}
@keyframes stamp-in { from { transform: rotate(-8deg) scale(1.04); } to { transform: rotate(-2deg) scale(1); } }

.grid { width: 100%; border-collapse: collapse; background: color-mix(in srgb, var(--paper-2) 80%, transparent); }
.grid th, .grid td { text-align: left; padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { font-weight: 700; }
.grid td.num, .grid th:nth-child(n + 2) { font-variant-numeric: tabular-nums; }
.advice { max-width: var(--measure); padding-left: 1.2rem; }
.plain { padding-left: 1.1rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.6rem; font-size: 0.95rem; }
.crumbs .sep { color: var(--line); }
.search { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }
.search input, .filters input, .filters select, form input, form select {
  font: inherit;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 0.45rem 0.55rem;
}
button, .filters button {
  font: inherit;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}
body.admin button { background: var(--brass); color: var(--brass-ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.desk { padding-top: 1rem; }
.desk-body { display: grid; grid-template-columns: 11rem 1fr; gap: 1.2rem; align-items: start; }
.side { display: flex; flex-direction: column; gap: 0.35rem; position: sticky; top: 0.5rem; }
.side a { color: inherit; text-decoration: none; }
.side a[aria-current="page"] { background: var(--brass); color: var(--brass-ink); padding: 0.05rem 0.3rem; }
.banner { background: var(--brass); color: var(--brass-ink); padding: 0.6rem 0.8rem; max-width: 70ch; }
.banner.quiet { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; margin: 0.8rem 0 1rem; }
.filters label, form label { display: grid; gap: 0.2rem; font-size: 0.92rem; }
.short { width: 7rem; }
.ledger { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ledger div { padding: 0.7rem 0.5rem; }
.ledger span, .live-note { color: var(--muted); display: block; }
.ledger strong { font-family: "Sono", monospace; font-size: 1.25rem; font-weight: 600; }
.ledger small { display: block; color: var(--muted); font-size: 0.85rem; }
.chart svg { width: 100%; height: auto; background: var(--paper-2); }
.chart-label { fill: var(--muted); font-size: 11px; font-family: "Sono", monospace; }
.bar-in { fill: var(--brass); }
.bar-out { fill: #d36a62; }
.denied { padding: 4rem 0; }
form { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: end; margin: 1rem 0; }
.opening { padding-top: 1rem; }

@media (max-width: 800px) {
  .mast { flex-direction: column; align-items: start; }
  .desk-body { grid-template-columns: 1fr; }
  .side { position: static; flex-direction: row; overflow-x: auto; }
  .ledger { grid-template-columns: 1fr 1fr; }
  .call a, .call-number { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: no-preference) {
  @media (max-width: 800px) {
    .side { scroll-snap-type: x proximity; }
  }
}
