/* crier — the modus-lisp dispatch.
   One stylesheet for the whole site.  Tokens first, then chrome, then prose.

   The site is dark, always.  One palette on :root — no media query, no
   data-theme stamp.  color-scheme tells the browser to match its own chrome
   (scrollbars, form controls, caret) to it. */

:root {
  color-scheme: dark;

  --ground:    #0E1214;   /* fired ash, cooled */
  --surface:   #161B1E;
  --sunken:    #1C2326;
  --ink:       #E6EBE9;
  --ink-soft:  #C0C9C6;
  --muted:     #889693;
  --hair:      #262F32;
  --fire:      #E28B57;   /* kiln */
  --fire-dim:  #A6633F;
  --glass:     #6FBFC9;   /* glass */
  --glass-dim: #4A8891;
  --shadow:    0 1px 0 rgba(0,0,0,.3);

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body:    "Newsreader", Georgia, "Times New Roman", serif;
  --mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 65ch;
  --page:    860px;
}

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

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

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.62;
  margin: 0;
  padding: 0 clamp(18px, 5vw, 56px) 96px;
  -webkit-font-smoothing: antialiased;
}

.page { max-width: var(--page); margin: 0 auto; }

/* ------------------------------------------------------------------ roles */

.mono {
  font-family: var(--mono);
  font-size: .78em;
  letter-spacing: -.01em;
}

a { color: var(--glass); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--fire); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--fire); outline-offset: 3px; }

code {
  font-family: var(--mono);
  font-size: .8em;
  background: var(--sunken);
  padding: 1px 5px;
  border-radius: 2px;
  white-space: nowrap;
}

/* --------------------------------------------------------------- site bar */

.sitebar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  padding: 22px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.sitebar .brand { color: var(--fire); font-weight: 500; text-decoration: none; }
.sitebar .brand:hover { color: var(--ink); }
.sitebar nav { display: flex; gap: 18px; margin-left: auto; }
.sitebar nav a { color: var(--muted); text-decoration: none; }
.sitebar nav a:hover { color: var(--ink); }

/* -------------------------------------------------------------- mastheads */

header.mast { padding: clamp(40px, 8vw, 88px) 0 0; }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 20px;
}
.kicker b { color: var(--fire); font-weight: 500; }

h1 {
  font-family: var(--display);
  font-variation-settings: "wdth" 125, "wght" 700;
  font-size: clamp(38px, 8.6vw, 82px);
  line-height: .92;
  letter-spacing: -.028em;
  text-transform: uppercase;
  text-wrap: balance;
  margin: 0 0 22px;
}
h1 .lo { color: var(--glass); }

.rule-fire { height: 3px; background: var(--fire); border: 0; margin: 0 0 22px; }

.standfirst {
  font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0 0 40px;
  font-weight: 300;
}

/* ---------------------------------------------------------------- tallies */

.tally {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(122px, 1fr));
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
  margin-bottom: 64px;
}
.tally div { background: var(--surface); padding: 16px 18px 18px; }
.tally .n {
  font-family: var(--display);
  font-variation-settings: "wdth" 100, "wght" 700;
  font-size: 34px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  display: block;
  margin-bottom: 7px;
}
.tally .l {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ----------------------------------------------------------------- ledger */

.ledger-wrap { overflow-x: auto; margin-bottom: 22px; }
table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 13px;
  min-width: 560px;
}
table.ledger th {
  text-align: left;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--hair);
}
table.ledger td {
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--hair);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
table.ledger td.repo { color: var(--ink); font-weight: 500; white-space: nowrap; }
table.ledger td.num  { text-align: right; width: 1%; white-space: nowrap; }
table.ledger td.add  { color: var(--glass); text-align: right; width: 1%; }
table.ledger td.del  { color: var(--fire); text-align: right; width: 1%; padding-right: 20px; }
table.ledger td.what { color: var(--muted); font-size: 12px; }
table.ledger td.barcell { width: 34%; padding-right: 0; }
.bar { display: block; height: 8px; background: var(--fire-dim); min-width: 2px; }
.bar.cool { background: var(--glass-dim); }

/* --------------------------------------------------------------- sections */

section { margin-top: 68px; }

.sec-head { border-top: 1px solid var(--ink); padding-top: 14px; margin-bottom: 26px; }
.sec-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}
.sec-eyebrow em { font-style: normal; color: var(--fire); }

h2 {
  font-family: var(--display);
  font-variation-settings: "wdth" 112, "wght" 600;
  font-size: clamp(27px, 4.4vw, 40px);
  line-height: 1.04;
  letter-spacing: -.02em;
  text-wrap: balance;
  margin: 0;
}

h3 {
  font-family: var(--display);
  font-variation-settings: "wdth" 90, "wght" 600;
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 38px 0 10px;
}
h3::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--glass);
  vertical-align: middle;
  margin-right: 10px;
  transform: translateY(-1px);
}

p { max-width: var(--measure); margin: 0 0 16px; }

ul.plain { list-style: none; padding: 0; margin: 0 0 18px; max-width: var(--measure); }
ul.plain li { padding: 9px 0 9px 20px; border-bottom: 1px solid var(--hair); position: relative; }
ul.plain li::before {
  content: "";
  position: absolute;
  left: 0; top: 20px;
  width: 9px; height: 1px;
  background: var(--fire);
}

/* ---------------------------------------------------------------- console */

.console {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--fire);
  padding: 16px 18px;
  margin: 24px 0 26px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.console pre {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.85;
  margin: 0;
  color: var(--ink-soft);
  white-space: pre;
}
.console .ret { color: var(--glass); }
.console .cap {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 12px;
}

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

.callout {
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  padding: 22px 0;
  margin: 30px 0;
}
.callout p { font-size: 20px; line-height: 1.45; color: var(--ink); margin: 0; max-width: 54ch; }
.callout .src {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  display: block;
  margin-top: 12px;
}

/* ------------------------------------------------------------- chip lists */

ul.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; }
ul.chips li {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--hair);
  padding: 3px 8px;
}

/* ------------------------------------------------------------ issue index */

h3.month {
  font-family: var(--mono);
  font-size: 11px;
  font-variation-settings: normal;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 36px 0 8px;
}
h3.month::before { content: none; }
h3.month:first-of-type { margin-top: 20px; }

ol.issues { list-style: none; padding: 0; margin: 0; }
ol.issues li { border-bottom: 1px solid var(--hair); }
ol.issues li:first-child { border-top: 1px solid var(--hair); }
ol.issues a {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 4px 20px;
  align-items: baseline;
  padding: 20px 0;
  text-decoration: none;
  color: inherit;
}
ol.issues a:hover .it { color: var(--fire); }
ol.issues .no {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
ol.issues .it {
  font-family: var(--display);
  font-variation-settings: "wdth" 105, "wght" 600;
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.12;
  letter-spacing: -.015em;
  text-wrap: balance;
}
ol.issues .dek { grid-column: 2; color: var(--ink-soft); font-weight: 300; max-width: 58ch; }
@media (max-width: 560px) {
  ol.issues a { grid-template-columns: 1fr; }
  ol.issues .dek { grid-column: 1; }
}

p.more {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .04em;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
}
p.more a { text-decoration: none; }
p.more a:hover { text-decoration: underline; }

p.backfill {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted);
  margin-top: 20px;
}

/* -------------------------------------------------------------- repo map */

.families { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 34px 40px; }
.family h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fire);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hair);
  font-weight: 500;
}
.family dl { margin: 0; }
.family dt {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
}
.family dt a { text-decoration: none; }
.family dt a:hover { text-decoration: underline; }
.family dd {
  margin: 1px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
}

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

footer {
  margin-top: 76px;
  border-top: 1px solid var(--ink);
  padding-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
footer p { max-width: 72ch; }
footer a { color: var(--muted); }

/* --------------------------------------------------------------- motion */

@media (prefers-reduced-motion: no-preference) {
  .bar { animation: grow .7s cubic-bezier(.2,.7,.3,1) both; transform-origin: left center; }
  @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ---------------------------------------------------------------- plates

   Photographs and screenshots carried in from elsewhere.  Every plate says
   where it came from and when, because a picture taken in July is not
   evidence about March unless it admits to being July. */

figure.plate { margin: 34px 0 30px; }

figure.plate img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--hair);
  background: var(--sunken);
}

figure.plate.inset img { padding: 10px; }

figure.plate figcaption {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  margin-top: 10px;
  max-width: 72ch;
}

figure.plate figcaption b { color: var(--ink-soft); font-weight: 500; }
figure.plate figcaption a { color: var(--muted); }

figure.plate .prov {
  display: block;
  margin-top: 4px;
  color: var(--glass-dim);
}

/* two plates abreast on wide screens, stacked on narrow */
.plates {
  display: grid;
  gap: 26px;
  margin: 34px 0 30px;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .plates.two { grid-template-columns: 1fr 1fr; }
}
.plates figure.plate { margin: 0; }
