/* The Zodiac - archival/forensic design system.
   Warm neutrals only (R>G>B), one oxidized accent, hairline rules, radius 0.
   The crosshair is treated as evidence, never as identity. */

:root {
  --paper:       #F4F1EA;
  --panel:       #EAE5DA;
  --panel-deep:  #DFD8C9;
  --rule:        #C9C2B4;
  --rule-strong: #B5AC9C;
  --border-ui:   #8E8577;

  --ink:         #1A1714;
  --ink-2:       #3D3833;
  --muted:       #5C5650;

  --oxide:       #8A3324;
  --oxide-deep:  #7A2E1E;
  --survey-blue: #2C4A63;

  --font-serif: "Newsreader", "Iowan Old Style", "Source Serif 4", Charter, Georgia, "Times New Roman", serif;
  --font-sans:  "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono:  "Courier Prime", "Nimbus Mono PS", "Courier New", monospace;

  --measure: 34em;
  --container: 1320px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16150F; --panel: #1F1D17; --panel-deep: #2A2721;
    --rule: #3A372E; --rule-strong: #46423A; --border-ui: #6E675C;
    --ink: #D8D2C6; --ink-2: #C8C2B6; --muted: #9A948A;
    --oxide: #D2745A; --oxide-deep: #DA8467; --survey-blue: #8FB4D0;
  }
}
:root[data-theme="dark"] {
  --paper: #16150F; --panel: #1F1D17; --panel-deep: #2A2721;
  --rule: #3A372E; --rule-strong: #46423A; --border-ui: #6E675C;
  --ink: #D8D2C6; --ink-2: #C8C2B6; --muted: #9A948A;
  --oxide: #D2745A; --oxide-deep: #DA8467; --survey-blue: #8FB4D0;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 32px;
  font-optical-sizing: auto;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: 40px; line-height: 44px; letter-spacing: -0.015em; }
h2 { font-size: 28px; line-height: 36px; letter-spacing: -0.010em; margin: 48px 0 16px; }
h3 { font-size: 21px; line-height: 28px; letter-spacing: -0.005em; margin: 32px 0 12px; }
h2:first-child, h3:first-child { margin-top: 0; }
hr.rule + h2, .hero h1 { margin-top: 0; }

p { margin: 0 0 24px; hyphens: auto; }

a { color: var(--oxide); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--oxide-deep); }
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--oxide); outline-offset: 2px;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px; line-height: 16px; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 12px;
}
.stamp {
  font-family: var(--font-mono);
  font-size: 12px; line-height: 16px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.dek {
  font-size: 22px; line-height: 32px; font-weight: 300; font-style: italic;
  color: var(--ink-2); max-width: min(var(--measure), 100%);
}
.small { font-size: 17px; line-height: 28px; }
.muted { color: var(--muted); }

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 72px; }
@media (max-width: 1200px) { .wrap { padding: 0 40px; } }
@media (max-width: 720px)  { .wrap { padding: 0 24px; } }

.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 6px 0;
  background: var(--paper);
}
/* Sticky only where the header is a single compact row on a tall screen. Below
   that the nav wraps to two or three rows, and pinning it costs 20% of a phone
   in portrait and 45% of one in landscape - measured, not guessed. Everywhere
   else it scrolls away like the rest of the page. */
@media (min-width: 1100px) and (min-height: 640px) {
  .masthead { position: sticky; top: 0; z-index: 40; }
}
.masthead .wrap { display: flex; align-items: center; gap: 0 32px; flex-wrap: wrap; }
.wordmark {
  font-family: var(--font-serif); font-size: 21px; font-weight: 600;
  letter-spacing: -0.01em; color: var(--ink); text-decoration: none;
  white-space: nowrap; display: inline-block; padding: 7px 0;
}
.wordmark span { color: var(--muted); font-weight: 400; }
.nav { display: flex; gap: 0 24px; flex-wrap: wrap; margin-left: auto; align-items: center; }
/* 44px tall, at every width. The previous rule gave the links padding only
   below 760px, which left every tablet and every landscape phone tapping a
   20px sliver - under the 24px WCAG 2.5.8 floor, on the one control that
   appears on all nine pages. */
.nav a {
  font-family: var(--font-sans); font-size: 15px; line-height: 20px;
  font-weight: 500; color: var(--ink-2); text-decoration: none;
  display: inline-block; padding: 12px 0;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--oxide); }
.nav a[aria-current="page"] { border-bottom: 2px solid var(--oxide); }

/* The header stops being one row somewhere under 1100px, and every viewport
   below that - tablets and every phone in landscape - was still getting
   desktop spacing around a nav that had wrapped to three rows. On an 844x390
   landscape phone that made the header 42% of the screen.
   This block must sit AFTER the base .nav rule: media queries add no
   specificity, so source order decides, and declaring it earlier let the base
   gap silently win. */
@media (max-width: 1099px) {
  .masthead .wrap { gap: 8px 20px; }
  .nav { margin-left: 0; width: 100%; gap: 4px 16px; }
}


footer.site {
  border-top: 1px solid var(--rule); margin-top: 96px; padding: 32px 0 64px;
  font-family: var(--font-sans); font-size: 14px; line-height: 20px;
  color: var(--muted);
}
footer.site p { margin: 0 0 8px; max-width: 68ch; }

.doc { display: grid; grid-template-columns: 1fr; gap: 0 48px; padding: 48px 0 0; }
@media (min-width: 1000px) {
  .doc { grid-template-columns: minmax(0, 640px) minmax(240px, 320px); }
}
.doc > * { min-width: 0; }
.col-main { max-width: min(var(--measure), 100%); }
.rail { font-family: var(--font-sans); font-size: 14px; line-height: 20px; color: var(--muted); }
.rail .note { border-left: 1px solid var(--rule); padding: 0 0 0 16px; margin: 0 0 32px; }
.rail .note h4 {
  font-family: var(--font-mono); font-size: 12px; line-height: 16px;
  font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); margin: 0 0 8px;
}
.rail .note p { margin: 0 0 8px; }

.catalogue { width: 100%; border-collapse: collapse; margin: 24px 0 0; }
.catalogue caption {
  text-align: left; caption-side: top;
  border-bottom: 1px solid var(--rule); padding-bottom: 8px; margin-bottom: 8px;
}
.catalogue td:first-child { min-width: 9.5em; }
.catalogue th {
  font-family: var(--font-sans); font-size: 12px; line-height: 16px;
  font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); text-align: left;
  border-bottom: 1px solid var(--rule-strong); padding: 0 16px 8px 0;
}
.catalogue td {
  border-bottom: 1px solid var(--rule); padding: 16px 16px 16px 0;
  vertical-align: baseline;
}
.catalogue tbody tr:hover { background: var(--panel); }
.catalogue .date { font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; color: var(--muted); font-family: var(--font-sans); font-size: 14px; }
.catalogue .desig { font-family: var(--font-mono); font-size: 14px; white-space: nowrap; }
.catalogue .title { font-size: 21px; line-height: 28px; }
.catalogue .title a { text-decoration: none; }
.catalogue .title a:hover { text-decoration: underline; }
.catalogue .status {
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase; white-space: nowrap;
}
.status-open { color: var(--oxide); }
.status-solved { color: var(--muted); }

.evidence {
  background: var(--panel); border: 1px solid var(--rule);
  padding: 24px; margin: 0 0 32px;
}
.evidence .stamp { display: block; margin: 0 0 12px; }
.evidence p:last-child { margin-bottom: 0; }

blockquote.source {
  font-family: var(--font-mono); font-size: 17px; line-height: 28px;
  border-left: 1px solid var(--rule-strong); margin: 0 0 24px;
  padding: 0 0 0 24px; color: var(--ink-2);
}
blockquote.source cite {
  display: block; margin-top: 12px; font-family: var(--font-sans);
  font-size: 13px; font-style: normal; color: var(--muted);
}

figure { margin: 0 0 32px; }
figcaption {
  font-family: var(--font-sans); font-size: 14px; line-height: 20px;
  color: var(--muted); margin-top: 8px;
}
figcaption b { color: var(--ink-2); font-weight: 600; }

.tag {
  font-family: var(--font-sans); font-size: 12px; line-height: 16px;
  font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--rule-strong); padding: 2px 6px; color: var(--muted);
  white-space: nowrap;
}
.tag-disputed { border-color: var(--oxide); color: var(--oxide); }

hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 48px 0; }

table.data { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: 14px; line-height: 20px; }
table.data th { text-align: left; font-weight: 600; border-bottom: 1px solid var(--rule-strong); padding: 8px 12px 8px 0; color: var(--ink-2); }
table.data td { border-bottom: 1px solid var(--rule); padding: 8px 12px 8px 0; font-variant-numeric: lining-nums tabular-nums; }
table.data td.t { font-variant-numeric: normal; }
.scroll-x { overflow-x: auto; margin: 0 0 32px; }

.cipher-grid {
  font-family: var(--font-mono); font-size: 17px; line-height: 1;
  display: grid; gap: 2px; margin: 0 0 16px; width: max-content;
  max-width: 100%;
}
.cipher-grid .cell {
  width: 26px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid transparent;
  transition: background 80ms linear, color 80ms linear;
  padding: 0; font: inherit; color: var(--ink); cursor: pointer;
}
.cipher-grid .cell.on { background: var(--oxide); color: var(--paper); }
.cipher-grid .cell.dim { opacity: 0.4; }

.legend { font-family: var(--font-sans); font-size: 14px; line-height: 22px; color: var(--muted); }

.btn {
  font-family: var(--font-sans); font-size: 15px; line-height: 20px; font-weight: 500;
  background: var(--paper); color: var(--ink); border: 1px solid var(--border-ui);
  padding: 11px 16px; border-radius: 0; cursor: pointer;
}
.btn:hover { background: var(--panel); }
.btn[aria-pressed="true"] { background: var(--oxide); color: var(--paper); border-color: var(--oxide); }

.controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 24px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--paper); color: var(--ink); padding: 12px 16px;
  border: 1px solid var(--border-ui); font-family: var(--font-sans); font-size: 15px;
}
.skip:focus { left: 8px; top: 8px; z-index: 100; }

.lede { font-size: 22px; line-height: 34px; }
ul.plain li { margin-bottom: 12px; }

.hero { padding: 64px 0 0; border-bottom: 1px solid var(--rule); }
.hero h1 { font-size: 64px; line-height: 60px; letter-spacing: -0.022em; font-weight: 500; max-width: 16ch; }
@media (max-width: 720px) { .hero h1 { font-size: 40px; line-height: 40px; } }
.hero .dek { margin: 24px 0 48px; }

.section { padding: 64px 0 0; }
.section > .eyebrow { border-bottom: 1px solid var(--rule); padding-bottom: 8px; }


/* ---- mobile ---- */
@media (max-width: 760px) {
  body { font-size: 18px; line-height: 30px; }
  h1 { font-size: 30px; line-height: 34px; letter-spacing: -0.01em; }
  h2 { font-size: 24px; line-height: 30px; letter-spacing: 0; margin: 40px 0 12px; }
  h3 { font-size: 19px; line-height: 26px; letter-spacing: 0; }
  .hero { padding-top: 40px; }
  .hero h1 { font-size: 34px; line-height: 38px; letter-spacing: -0.01em; }
  .dek { font-size: 19px; line-height: 28px; }
  .lede { font-size: 19px; line-height: 30px; }
  .doc { padding-top: 32px; }
  .rail { margin-top: 8px; }
  [style*="font-size:48px"] { font-size: 32px !important; line-height: 36px !important; }
  [style*="font-size:64px"] { font-size: 36px !important; line-height: 40px !important; }
  .catalogue td:first-child { min-width: 0; }
  .catalogue .title { font-size: 19px; line-height: 26px; }
  .catalogue td, .catalogue th { padding-right: 10px; }
  hr.rule { margin: 32px 0; }
}

/* long unbroken strings (cipher text, plaintext samples) must not overflow */
blockquote.source, pre, code { overflow-wrap: anywhere; }


/* full-bleed section inside .wrap, for wide catalogue tables that should not
   be squeezed into the reading measure */
.full { margin: 48px 0 0; }
.full > h2 { margin-top: 0; }
.full .catalogue td:nth-child(3) { min-width: 26em; }
@media (max-width: 760px) {
  .full .catalogue td:nth-child(3) { min-width: 16em; }
}


/* ---- horizontally scrollable regions -------------------------------------
   Wide tables and the 17-column cipher grids cannot shrink to a phone without
   losing their meaning, so they scroll. A right-edge fade tells the reader
   there is more, which a bare overflow container does not. */
.scroll-x, .grid-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.grid-scroll { margin: 0 0 16px; padding-bottom: 4px; }

@media (max-width: 900px) {
  .scroll-x, .grid-scroll {
    background:
      linear-gradient(to right, var(--paper) 30%, transparent),
      linear-gradient(to left,  var(--paper) 30%, transparent) 100% 0,
      radial-gradient(farthest-side at 0 50%, rgba(0,0,0,0.18), transparent),
      radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.18), transparent) 100% 0;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
  }
}

/* ---- touch targets -------------------------------------------------------
   Nav links are 20px tall as inline text, well under a comfortable tap. Give
   them real vertical room on touch widths without changing the desktop rhythm. */
@media (max-width: 760px) {

  /* the cipher select carries a long label and was pushing the page sideways.
     Stack the controls, and reset the flex basis: in a column direction a
     300px basis becomes the element's HEIGHT, not its width. */
  .tool .row { flex-direction: column; align-items: stretch; }
  .tool select, .tool input {
    flex: 0 0 auto;
    width: 100%; max-width: 100%; min-width: 0;
  }
  .cipher-grid .cell { width: 24px; height: 28px; font-size: 15px; }
}

/* never let a control exceed its container, at any width */
select, input, textarea { max-width: 100%; }


/* ---- reduced motion ------------------------------------------------------
   There is very little motion here by design - the only transitions are the
   80ms colour changes on cipher-grid cells and table row hovers. Someone who
   has asked their system for less movement should get none of it. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ---- image plates --------------------------------------------------------
   The cryptograms rendered from the canonical transcriptions. A scan of a
   1969 photocopy is less legible than this and carries a rights question; a
   render from the transcription is exact, sharp at any size, and ours. */
.plate-fig { margin: 40px 0 48px; }
.plate-fig img {
  display: block;
  width: 100%;
  max-width: 614px;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--paper);
}
/* The homepage plate carries the whole of Z13 in thirteen cells. Held to a
   column it reads as a stray thumbnail; given the full measure it reads as
   the object it is. */
.plate-fig--hero { margin: 56px 0 8px; }
.plate-fig--hero img { max-width: none; }
.plate-fig figcaption {
  font-family: var(--font-sans);
  font-size: 14px; line-height: 22px;
  color: var(--muted);
  margin-top: 12px;
  max-width: 60ch;
}
.plate-fig figcaption b { color: var(--ink-2); font-weight: 600; }


/* A real page from the release, cropped to the passage that matters. Kept
   distinct from the rendered plates: this one is a photocopy and should look
   like one. */
.doc-fig { margin: 40px 0 48px; }
.doc-fig img {
  display: block;
  width: 100%; height: auto;
  border: 1px solid var(--rule);
  background: #fff;
}
.doc-fig figcaption {
  font-family: var(--font-sans);
  font-size: 14px; line-height: 22px;
  color: var(--muted);
  margin-top: 12px; max-width: 60ch;
}
.doc-fig figcaption b { color: var(--ink-2); font-weight: 600; }

/* A halftone of a photocopy has no useful shadow detail below mid-gray; giving
   it a white mount rather than bleeding it into the dark page keeps it reading
   as a clipping. */
.doc-fig--facsimile img { max-width: 520px; padding: 10px; }

/* The bulletin is a tall sheet. Left at full column width it swamps the page,
   so it is held to a height that keeps the typed description legible without
   turning the section into a poster. */
.doc-fig--bulletin img { max-width: 560px; }

.credit { font-size: 13px; line-height: 21px; color: var(--muted); }


/* ---- the two wanted bulletins, shown together -------------------------------
   The argument of this figure is the difference between the sheets, so they have
   to be visible at once on a screen wide enough to hold them, and in date order
   when they stack. */
.bulletin-pair { margin: 40px 0 48px; }
/* Side by side these sheets land at ~306px inside the text column, where the
   typed description - the actual evidence - stops being readable. Legibility
   wins over adjacency, and 90-69 already prints both drawings together, so the
   visual comparison survives the stack. */
.bp-grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: start; }
.bp-item img {
  display: block; width: 100%; max-width: 560px; height: auto;
  border: 1px solid var(--rule); background: #fff;
}
.bp-cap {
  font-family: var(--font-sans); font-size: 13px; line-height: 21px;
  color: var(--muted); margin: 10px 0 0;
}
.bp-cap b { color: var(--ink-2); font-weight: 600; }
.bulletin-pair > figcaption {
  font-family: var(--font-sans); font-size: 14px; line-height: 22px;
  color: var(--muted); margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--rule); max-width: 66ch;
}
.bulletin-pair > figcaption b { color: var(--ink-2); font-weight: 600; }

