/* ascherl.family — leaded glass & blueprint
   Two poles of this family: Bohemian stained glass in Vienna, reactor drawings at Hanford.
   Both are precise linework read against light. That is the whole design. */

@font-face {
  font-family: "Fraunces";
  src: url("/font/fraunces.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url("/font/plex-sans.woff2") format("woff2-variations");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/font/plex-mono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/font/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --ink: #0f1a20;
  --ink-2: #16242c;
  --paper: #e6e9ea;
  --paper-2: #f2f4f4;
  --amber: #c8873c;
  --cobalt: #2d5f7a;
  --slate: #6c787d;

  --bg: var(--paper);
  --bg-raised: var(--paper-2);
  --fg: var(--ink);
  --fg-muted: #55636a;
  --rule: #c3cbcd;
  --accent: #a96c26;
  --accent-quiet: var(--cobalt);
  --plate-bg: #d8dedf;

  --display: "Fraunces", ui-serif, Georgia, serif;
  --body: "Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --rail: 7.5rem;

  --step-0: 1rem;
  --step-1: 1.15rem;
  --step-2: clamp(1.35rem, 2.2vw, 1.7rem);
  --step-3: clamp(1.8rem, 3.4vw, 2.6rem);
  --step-4: clamp(2.4rem, 6.5vw, 4.6rem);
  --step-5: clamp(3rem, 11vw, 7.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--ink);
    --bg-raised: var(--ink-2);
    --fg: #dfe6e8;
    --fg-muted: #93a2a8;
    --rule: #2a3b44;
    --accent: #d99a4e;
    --accent-quiet: #5f9ec0;
    --plate-bg: #16242c;
  }
}
:root[data-theme="dark"] {
  --bg: var(--ink);
  --bg-raised: var(--ink-2);
  --fg: #dfe6e8;
  --fg-muted: #93a2a8;
  --rule: #2a3b44;
  --accent: #d99a4e;
  --accent-quiet: #5f9ec0;
  --plate-bg: #16242c;
}
:root[data-theme="light"] {
  --bg: var(--paper);
  --bg-raised: var(--paper-2);
  --fg: var(--ink);
  --fg-muted: #55636a;
  --rule: #c3cbcd;
  --accent: #a96c26;
  --accent-quiet: var(--cobalt);
  --plate-bg: #d8dedf;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

:where(a, button, summary, input):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; display: block; }

.shell {
  max-width: 78rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 0.75rem;
  z-index: 20;
  background: var(--bg-raised);
  padding: 0.6rem 1rem;
  border: 1px solid var(--accent);
}

/* ── Masthead ─────────────────────────────────────────── */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-block: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-family: var(--display);
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 1;
  font-weight: 600;
  font-size: var(--step-2);
  letter-spacing: 0.04em;
  text-decoration: none;
  line-height: 1;
}
.wordmark b { font-weight: 600; }
.wordmark span { color: var(--fg-muted); font-weight: 300; }

.masthead nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.masthead nav a { color: var(--fg-muted); text-decoration: none; }
.masthead nav a:hover { color: var(--accent); }

.theme-toggle {
  font: inherit;
  font-family: var(--mono);
  background: none;
  border: 1px solid var(--rule);
  color: var(--fg-muted);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.66rem;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ── Dispatches (the news portal) ─────────────────────── */

.dispatches {
  border-bottom: 1px solid var(--rule);
  padding-block: 1.5rem 1.75rem;
}

.dispatches-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.dispatch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.75rem;
}

.dispatch time {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.45rem;
}

.dispatch h3 {
  font-family: var(--display);
  font-variation-settings: "opsz" 24;
  font-weight: 500;
  font-size: var(--step-1);
  line-height: 1.25;
  margin: 0 0 0.4rem;
  text-wrap: balance;
}

.dispatch p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.55;
}

/* ── Hero: a plate set into ink, not a full-bleed ─────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(3rem, 8vw, 6.5rem);
}

.plate {
  position: relative;
  background: var(--plate-bg);
  padding: 0.75rem;
}
/* the came line — leaded glass, drawn in light */
.plate::after {
  content: "";
  position: absolute;
  inset: 0.75rem;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgb(200 135 60 / 0.35);
}
.plate img {
  width: 100%;
  filter: grayscale(1) contrast(1.06);
}

.plate-caption {
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--fg-muted);
  margin: 0.7rem 0 0;
  padding-left: 0.75rem;
  border-left: 2px solid var(--accent);
}

.hero-body h1 {
  font-family: var(--display);
  font-variation-settings: "opsz" 144, "WONK" 1;
  font-weight: 300;
  font-size: var(--step-4);
  line-height: 1.02;
  letter-spacing: -0.018em;
  margin: 0.6rem 0 1.1rem;
  text-wrap: balance;
}
.hero-body h1 em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "WONK" 1, "SOFT" 40;
  color: var(--accent);
}

.hero-body p {
  max-width: var(--measure);
  font-size: var(--step-1);
  color: var(--fg-muted);
  margin: 0 0 1.6rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2rem;
  margin: 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}
.hero-meta div { display: flex; gap: 0.5rem; }
.hero-meta dt { color: var(--fg-muted); }
.hero-meta dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ── Arcs ─────────────────────────────────────────────── */

.arcs {
  border-top: 1px solid var(--rule);
  padding-block: clamp(3rem, 7vw, 5.5rem) 0;
}

.arc {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr) minmax(0, 0.72fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
  position: relative;
}
/* the came line running the length of the rail, joining the two panes */
.arc::before {
  content: "";
  position: absolute;
  left: calc(var(--rail) / 2);
  top: 0.4rem;
  bottom: 0;
  width: 1px;
  background: linear-gradient(var(--accent), transparent 88%);
  opacity: 0.5;
}

.arc-rail {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  text-transform: uppercase;
  position: relative;
  padding-top: 0.35rem;
}
.arc-rail span { display: block; }
.arc-rail .years {
  color: var(--fg);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.arc-body h2 {
  font-family: var(--display);
  font-variation-settings: "opsz" 72, "WONK" 1;
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1.1;
  margin: 0 0 0.9rem;
  text-wrap: balance;
}

.arc-body p {
  max-width: var(--measure);
  margin: 0 0 1rem;
  color: var(--fg-muted);
}
.arc-body p.lead { color: var(--fg); font-size: var(--step-1); }
.arc-body strong { color: var(--fg); font-weight: 600; }

.journey {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}
.journey li { color: var(--fg-muted); }
.journey li::after { content: " →"; color: var(--accent); }
.journey li:last-child::after { content: ""; }

/* ── Plates grid ──────────────────────────────────────── */

.holdings {
  border-top: 1px solid var(--rule);
  padding-block: clamp(3rem, 7vw, 5rem);
}

.holdings-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.holdings-head h2 {
  font-family: var(--display);
  font-variation-settings: "opsz" 72;
  font-weight: 400;
  font-size: var(--step-3);
  margin: 0;
}

.plate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: clamp(1.25rem, 3vw, 2.25rem);
}

.plate-grid figure { margin: 0; }
.plate-grid .plate { padding: 0.5rem; }
.plate-grid .plate::after { inset: 0.5rem; }
/* Uniform plates read as a catalogue. Portraits sit in a 4:5 box; anything markedly
   landscape (headstones, directory pages) takes two columns at 16:9 instead of being
   cropped to nothing. Ratios come from the image manifest at build time. */
.plate-grid .plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
}
.plate-grid .plate picture {
  display: block;
  aspect-ratio: 4 / 5;
}
.plate-grid figure.wide { grid-column: span 2; }
.plate-grid figure.wide .plate picture { aspect-ratio: 16 / 9; }

@media (max-width: 34rem) {
  .plate-grid figure.wide { grid-column: span 1; }
}
.plate-grid figcaption {
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.5;
  color: var(--fg-muted);
  margin-top: 0.6rem;
}
.plate-grid figcaption b {
  display: block;
  color: var(--fg);
  font-weight: 500;
  font-family: var(--body);
  font-size: 0.82rem;
  letter-spacing: 0;
  margin-bottom: 0.15rem;
}

/* ── Archive gate ─────────────────────────────────────── */

.gate {
  border-top: 1px solid var(--rule);
  padding-block: clamp(3rem, 7vw, 5.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.gate h2 {
  font-family: var(--display);
  font-variation-settings: "opsz" 72, "WONK" 1;
  font-weight: 400;
  font-size: var(--step-3);
  margin: 0.5rem 0 0.9rem;
  text-wrap: balance;
}
.gate p { color: var(--fg-muted); max-width: var(--measure); margin: 0 0 1.5rem; }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.btn:hover { background: var(--accent); color: var(--bg); }

.ledger {
  border: 1px solid var(--rule);
  padding: 1.4rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.74rem;
}
.ledger h3 {
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 1rem;
}
.ledger dl { margin: 0; display: grid; gap: 0.55rem; }
.ledger div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px dotted var(--rule);
  padding-bottom: 0.5rem;
}
.ledger div:last-child { border-bottom: 0; padding-bottom: 0; }
.ledger dt { color: var(--fg-muted); }
.ledger dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ── Footer ───────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2rem 3rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--fg-muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  line-height: 1.7;
}
.site-footer a { color: var(--accent); }

/* ── Motion ───────────────────────────────────────────── */

/* Content is visible by default. Only a page that has proved it can run the observer
   is allowed to hide anything — otherwise a JS failure blanks the whole archive. */
:root.js .reveal {
  opacity: 0;
  transform: translateY(0.9rem);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.3, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}
:root.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  :root.js .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Narrow ───────────────────────────────────────────── */

@media (max-width: 60rem) {
  .hero { grid-template-columns: 1fr; }
  .hero .plate { max-width: 24rem; }
  .arc { grid-template-columns: 1fr; }
  .arc::before { display: none; }
  .arc-rail { display: flex; gap: 0.9rem; padding-top: 0; }
  .gate { grid-template-columns: 1fr; }
}
