/* AtlasLatino — hand-written CSS, no framework.
   Design system "B2": a structured research index. IBM Plex Mono for
   metadata (nav, dates, field labels, link buttons), IBM Plex Sans for
   titles and body prose. A left metadata rail forms a scannable vertical
   spine down the page; hairline rules separate entries. Dark warm-grey
   palette with a terminal-green accent. No gradients, no icon fonts.

   Contrast, measured on each surface text actually renders on
   (--panel #302d29 cards / --paper #1a1917 page background):
     --ink       body text     11.7:1 / 14.9:1
     --ink-soft  prose          8.6:1 / 11.0:1
     --gray-700  muted          6.2:1 /  8.0:1
     --gray-500  muted small    5.3:1 /  6.8:1
     --accent    links         10.1:1 / 13.0:1
   --gray-350 is NON-TEXT only: field-square fallback, separators, borders. */

:root {
  /* Dark warm-grey palette (not blue-black, so it stays in the same
     family as the earlier light theme, just inverted).
     Cards sit on a lighter warm grey than the page, same relative
     logic as before: --panel is always the brighter surface, --ink
     always the text color, so anything relying on that relationship
     (e.g. .entry[open] .chevron using --ink as a fill with --panel as
     the glyph color) still works unchanged.
     Every text color clears 4.5:1 on BOTH surfaces it might render on —
     muted text is brightened further than a literal desaturation would
     give, since small mono metadata needs the margin. */
  --ink: #f0ece7;       /* body text / headings: warm off-white, not pure white */
  --ink-soft: #d2ccc4;  /* prose */
  --gray-700: #b6ada4;
  --gray-500: #a89f96;
  --gray-350: #726b62;  /* non-text only: field-square fallback, separators */
  --gray-300: #4d453e;  /* borders */
  --gray-200: #3a352f;
  --gray-100: #2a2622;

  --paper: #1a1917;   /* page background */
  --panel: #302d29;   /* entry cards / content surface, lighter than paper */
  --rule: #4d453e;

  --accent: #33ff33;          /* classic terminal/phosphor green */
  --accent-soft: rgba(51, 255, 51, 0.32);
  --accent-wash: rgba(51, 255, 51, 0.08);

  --shell-w: 1200px;
  --rail-w: 220px;
  --rail-gap: 56px;
  --measure: 68ch;    /* body paragraph measure inside the wide column */

  --shell-pad: 32px;

  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Field classification colors — kept distinct from --accent so a field
     square is never confused with an interactive link, and distinct from
     each other. Brightened for the dark background; none of these are
     used as text, only as 6px squares, so their own contrast vs. panel
     just needs to be visible (all ≥5:1 here), not text-level. */
  --field-malware-reversing: #e2896b;
  --field-ai-security: #b592c9;
  --field-offensive-security: #caa24a;
  --field-incident-response: #5fb3b3;
  --field-appsec-supply-chain: #7fa0c9;
  --field-other: var(--gray-350);
}

* { box-sizing: border-box; }

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  font-size: 17px;
  line-height: 1.55;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Available to screen readers and heading navigation, not shown visually. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Shell ---------- */

.shell {
  max-width: var(--shell-w);
  margin: 0 auto;
  padding: 0 var(--shell-pad);
}

/* ---------- Header / nav ---------- */

header.site {
  padding: 56px 0 34px;
  border-bottom: 1px solid var(--gray-300);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

/* Uppercase mono at wide tracking — reads as a label on the spine of an
   archive rather than a logo, which matches the index-card language of
   the rest of the site.
   Two things this depends on: the size drops from 22px to 16px, because
   caps have no descenders and far more apparent mass (a 22px caps mark
   would shout next to the same-size lowercase one); and the text-indent
   compensates for the trailing letter-spacing CSS adds after the final
   character, which would otherwise pull the mark left of the grid edge. */
.wordmark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark span { color: var(--accent); }

nav.site-nav {
  display: flex;
  gap: 34px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

nav.site-nav a {
  color: var(--gray-700);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}

nav.site-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

nav.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* The small uppercase mono label that sits in the rail column. */
.rail-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-500);
  padding-top: 5px;
}

/* ---------- Entry-point links (home section bar) ---------- */

.intro-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.intro-links a {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 1px;
}

.intro-links a:hover { border-bottom-color: var(--accent); }

/* ---------- Section label / index count ---------- */

/* Single column on purpose. The rail is for per-entry metadata only —
   when the section bar also opened a rail column, "INDEX" sat alone above
   a ~200px void that was the first thing the eye landed on and held
   nothing. The section bar now spans the full width instead. */
.section-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px 32px;
  padding: 30px 0 16px;
}

.section-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title .count {
  color: var(--gray-500);
  font-weight: 400;
}

/* ---------- Feed ---------- */

.feed {
  border-top: 1px solid var(--gray-300);
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry {
  border-bottom: 1px solid var(--gray-300);
  background: var(--panel);
  /* bleed the panel slightly past the shell padding so the surface reads
     as a full-width band, not a boxed card */
  margin: 0 calc(var(--shell-pad) * -1);
  padding: 0 var(--shell-pad);
}

.entry > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  gap: 0 var(--rail-gap);
  padding: 36px 0;
  position: relative;
}

.entry > summary::-webkit-details-marker { display: none; }

.entry > summary:hover .entry-people { color: var(--accent); }
.entry > summary:hover .rail-date { color: var(--ink); }
.entry > summary:hover .chevron {
  border-color: var(--gray-500);
  color: var(--ink);
}

/* rail */

.rail {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--gray-500);
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 4px;
}

.rail-date {
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Groups type and field on one line, both small uppercase mono labels.
   Only .rail-field gets a color square (below) — type stays plain text
   so it reads as a second, distinct classification rather than another
   subject tag. */
.rail-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rail-type {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gray-500);
  padding-right: 10px;
  border-right: 1px solid var(--gray-300);
}

.rail-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gray-700);
}

/* Shows which event an entry was presented at right in the collapsed
   row, so seeing that doesn't require expanding — several talks now
   share a title across different venues and the event is what tells
   them apart at a glance. Deliberately accent-colored to stand out
   from the plain rail text above it, even though it is NOT a real
   link here: this sits inside <summary> (the disclosure toggle
   itself), so it can't safely be a real <a> — nesting one inside
   summary risks double-triggering the expand/collapse on click and
   screen readers handle it inconsistently. It becomes a real,
   clickable link one click away in the expanded body below. */
.rail-event {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.rail-field::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  background: var(--field-color, var(--gray-350));
  display: inline-block;
  border-radius: 1px;
}

/* Field classification squares — one per field slug in src/_data/fields.js. */
.field-malware-reversing    { --field-color: var(--field-malware-reversing); }
.field-ai-security          { --field-color: var(--field-ai-security); }
.field-offensive-security   { --field-color: var(--field-offensive-security); }
.field-incident-response    { --field-color: var(--field-incident-response); }
.field-appsec-supply-chain  { --field-color: var(--field-appsec-supply-chain); }
.field-other                { --field-color: var(--field-other); }

/* main col header */

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
}

.entry-heading {
  flex: 1;
  min-width: 0;
}

/* The people are the headline. This site exists to make individuals
   visible, so the name carries the weight and the research title is the
   supporting line beneath it — not the other way round. The name is also
   always on its own line: when it ran inline after the title it wrapped
   mid-name ("…telemetry Lucía / Fernández"), which read as part of the
   title and broke the name in half. */
.entry-people {
  display: block;
  margin: 0 0 6px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 23px;
  line-height: 1.28;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.entry-people .sep {
  color: var(--gray-350);
  font-weight: 400;
  margin: 0 8px;
}

/* The ISO country code beside a name. Small and muted so it reads as a
   label on the name, not a competing headline — matches the mono,
   letterspaced, no-icon language already used for field/date. */
.country-tag {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.52em;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  vertical-align: 0.15em;
}

.entry-refs .country-tag {
  font-size: 11px;
  vertical-align: 0.05em;
  margin-left: 1px;
}

.entry-title {
  display: block;
  margin: 0 0 10px;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink-soft);
  letter-spacing: 0;
  max-width: 52ch;
}

/* On a person's own page the name is redundant (it's the page title),
   so the research title steps back up to being the headline there. */
.entry--no-person .entry-title {
  font-weight: 600;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -0.008em;
  color: var(--ink);
  max-width: 46ch;
}

/* The disclosure control lives at the head of the rail, next to the entry
   number, so it reads as belonging to this row. Floated to the far right
   of a wide row it was orphaned — nothing connected it to its own entry. */
.rail-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* A "+" is ambiguous — add, save, and open all use that glyph. This row
   expands in place, so a chevron is the correct affordance for that
   action specifically: pointing down reads as "more below", and
   rotating it to point up on open reads as "collapse" without needing
   a second glyph. */
.chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1px solid var(--gray-300);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chevron::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.entry[open] .chevron {
  transform: rotate(180deg);
  background: var(--ink);
  color: var(--panel);
  border-color: var(--ink);
}

/* expanded content */

.entry-body {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  gap: 0 var(--rail-gap);
  padding: 0 0 40px;
}

.entry-content p {
  margin: 0 0 18px;
  font-size: 16.5px;
  line-height: 1.72;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.entry-content p:last-of-type { margin-bottom: 28px; }

.entry-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
}

.entry-content a:hover { border-bottom-color: var(--accent); }

/* Cross-reference lines inside an expanded entry (people / event links). */
.entry-refs {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--gray-500);
  margin: 0 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}

.entry-refs .ref-kind {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gray-500);
}

.entry-refs a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-300);
}

.entry-refs a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.entry-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: center;
}

.meta-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent-soft);
  padding: 7px 12px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-link:hover {
  background: var(--accent);
  color: var(--panel);
  border-color: var(--accent);
}

.meta-link::after {
  content: "↗";
  font-size: 11px;
}

.coverage-note {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--gray-500);
}

.coverage-note a {
  color: var(--gray-700);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-300);
}

.coverage-note a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Empty states ---------- */

.empty-note {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gray-500);
  padding: 30px 0 34px;
  border-top: 1px solid var(--gray-300);
  margin: 0;
}

.empty-note a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
}

.empty-note a:hover { border-bottom-color: var(--accent); }

/* ---------- Person page ---------- */

.person-head {
  padding: 44px 0 38px;
  border-bottom: 1px solid var(--gray-300);
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  gap: 0 var(--rail-gap);
}

.person-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.person-photo {
  width: 120px;
  height: 120px;
  border-radius: 2px;
  border: 1px solid var(--gray-300);
  background: var(--panel);
}

.person-photo--invader {
  display: block;
  padding: 0;
}

.person-photo--invader .invader {
  display: block;
  width: 100%;
  height: 100%;
}

/* The invader SVG's two layers: a near-black background rect and the
   pixel body in the site's accent green, matching a classic terminal
   sprite (bright figure on dark) regardless of which surface it sits on. */
.invader-bg { fill: var(--paper); }
.invader-fg rect { fill: var(--accent); }

/* Event invaders get a distinct color (pink) from person invaders
   (accent green), so the two are never confused at a glance even
   though they're the same generator (src/_lib/invader.js). */
.event-invader .invader-fg rect,
.event-photo--invader .invader-fg rect {
  fill: #e878b0;
}

.person-head h1 {
  margin: 0 0 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.person-meta {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--gray-700);
  letter-spacing: 0.01em;
}

.person-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: 18px 0 0;
}

.person-links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent-soft);
  padding: 6px 11px;
  border-radius: 2px;
}

.person-links a:hover {
  background: var(--accent);
  color: var(--panel);
  border-color: var(--accent);
}

/* ---------- People directory ---------- */

/* True discrete cards, unlike .entry's full-bleed band — a grid needs
   visually separate objects, not a stream. */
.person-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--gray-300);
  border: 1px solid var(--gray-300);
}

.person-card {
  background: var(--panel);
}

.person-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px;
  text-decoration: none;
  color: inherit;
}

.person-card-link:hover {
  background: var(--accent-wash);
}

.person-card-link:hover .person-card-name {
  color: var(--accent);
}

.person-card-photo {
  width: 44px;
  height: 44px;
  border-radius: 2px;
  border: 1px solid var(--gray-300);
  margin-bottom: 14px;
}

/* Deterministic pixel-invader avatar (src/_lib/invader.js) — the site
   doesn't support uploaded photos, so this is every person's permanent
   visual identity. The SVG's own <rect> fills are set via currentColor
   + these two classes rather than inline colors, so the invader picks
   up the site's palette automatically. */
.person-card-photo--invader {
  border: 1px solid var(--gray-300);
  padding: 0;
  overflow: hidden;
}

.person-card-photo--invader .invader {
  display: block;
  width: 100%;
  height: 100%;
}

.person-card-name {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 6px;
}

.person-card-affiliation {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--gray-700);
  line-height: 1.4;
  margin-bottom: 14px;
}

.person-card-last {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--gray-200);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.person-card-last .ref-kind {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 4px;
}

/* ---------- Event index ---------- */

.event-list {
  border-top: 1px solid var(--gray-300);
  list-style: none;
  margin: 0;
  padding: 0;
}

.event-list li {
  border-bottom: 1px solid var(--gray-300);
  background: var(--panel);
  margin: 0 calc(var(--shell-pad) * -1);
  padding: 30px var(--shell-pad);
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  gap: 0 var(--rail-gap);
  align-items: baseline;
}

.event-list .rail {
  padding-top: 2px;
}

.event-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.event-invader {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--gray-300);
  border-radius: 2px;
  overflow: hidden;
}

.event-invader .invader {
  display: block;
  width: 100%;
  height: 100%;
}

.event-name {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.008em;
  color: var(--ink);
  text-decoration: none;
}

.event-name:hover { color: var(--accent); }

.event-location {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--gray-500);
}

/* ---------- Event detail header ---------- */

.event-head {
  padding: 44px 0 38px;
  border-bottom: 1px solid var(--gray-300);
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  gap: 0 var(--rail-gap);
}

.event-head h1 {
  margin: 0 0 14px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.event-photo--invader {
  display: block;
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
  border: 1px solid var(--gray-300);
  border-radius: 2px;
  overflow: hidden;
}

.event-photo--invader .invader {
  display: block;
  width: 100%;
  height: 100%;
}

.event-head .rail {
  padding-top: 9px;
}

/* ---------- Long-form prose (about, contribute, person/event bodies) ---------- */

.prose {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  gap: 0 var(--rail-gap);
  padding: 40px 0 8px;
}

.prose-body { min-width: 0; }

.prose-body > :first-child { margin-top: 0; }

.prose-body h2 {
  margin: 44px 0 14px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-300);
}

.prose-body h3 {
  margin: 30px 0 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.35;
  color: var(--ink);
}

.prose-body p {
  margin: 0 0 18px;
  font-size: 16.5px;
  line-height: 1.72;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.prose-body ul,
.prose-body ol {
  margin: 0 0 18px;
  padding-left: 1.3em;
  max-width: var(--measure);
  font-size: 16.5px;
  line-height: 1.72;
  color: var(--ink-soft);
}

.prose-body li { margin-bottom: 8px; }

.prose-body strong { color: var(--ink); font-weight: 600; }

.prose-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
}

.prose-body a:hover { border-bottom-color: var(--accent); }

.prose-body .lede {
  font-size: 18px;
  line-height: 1.68;
  color: var(--ink-soft);
  margin-bottom: 26px;
}

/* Code */

code, pre {
  font-family: var(--font-mono);
}

code {
  font-size: 0.88em;
  background: var(--gray-100);
  color: var(--ink);
  padding: 0.12em 0.38em;
  border-radius: 2px;
}

pre {
  background: var(--panel);
  border: 1px solid var(--gray-300);
  border-radius: 2px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 24px;
  max-width: var(--measure);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* Small, quiet attribution line at the end of a prose page. */
.prose-credit {
  margin-top: 24px;
  font-family: var(--font-sans);
  font-style: italic;
  font-size: 11px;
  color: var(--gray-500);
}

/* ---------- Footer ---------- */

footer.site {
  margin-top: 0;
  padding: 52px 0 76px;
}

.footer-body {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 32px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--gray-500);
}

.footer-body a {
  color: var(--gray-700);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-300);
}

.footer-body a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Mid widths: keep rail from crowding the content ---------- */

@media (max-width: 1080px) {
  :root { --rail-w: 196px; --rail-gap: 44px; }
}

@media (max-width: 900px) {
  :root { --rail-w: 172px; --rail-gap: 36px; --shell-pad: 26px; }
  .entry-title { max-width: none; }
  .person-photo { width: 100px; height: 100px; }
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  :root { --rail-w: 100%; --rail-gap: 0px; --shell-pad: 18px; }

  body { font-size: 16px; }

  header.site {
    padding: 30px 0 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  nav.site-nav { gap: 20px; font-size: 12.5px; flex-wrap: wrap; }

  .person-head,
  .event-head,
  .prose,
  .entry > summary,
  .entry-body,
  .event-list li {
    grid-template-columns: 1fr;
  }

  .rail-label { margin-bottom: 10px; padding-top: 0; }
  .intro-links { gap: 10px 24px; }

  .section-bar { padding: 22px 0 12px; }

  .entry > summary { padding: 22px 0 18px; }

  .rail {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin-bottom: 12px;
    padding-top: 0;
  }

  .entry-head { gap: 14px; }
  .entry-people { font-size: 19px; }
  .entry-title { font-size: 15.5px; max-width: none; }
  .entry--no-person .entry-title { font-size: 18px; max-width: none; }

  .entry-body { padding: 0 0 26px; }
  .rail-spacer { display: none; }
  .entry-content p { font-size: 15.5px; max-width: none; }

  .person-head,
  .event-head { padding: 26px 0 24px; }
  .person-head h1,
  .event-head h1 { font-size: 25px; }
  .person-rail { flex-direction: row; align-items: center; gap: 16px; margin-bottom: 16px; }
  .person-photo { width: 78px; height: 78px; }

  .event-head .rail { padding-top: 0; }
  .event-photo--invader { width: 56px; height: 56px; }
  .event-list li { padding: 22px var(--shell-pad); }
  .event-list .rail { margin-bottom: 8px; }
  .event-invader { width: 28px; height: 28px; }
  .event-name { font-size: 18px; }

  .prose { padding: 26px 0 4px; }
  .prose-body p,
  .prose-body ul,
  .prose-body ol { font-size: 15.5px; max-width: none; }
  .prose-body .lede { font-size: 16.5px; }
  .prose-body h2 { margin-top: 34px; }
  pre { max-width: none; font-size: 12.5px; padding: 14px 15px; }

  footer.site { padding: 34px 0 48px; }
  .footer-body { flex-direction: column; gap: 8px; }
}

@media (max-width: 400px) {
  :root { --shell-pad: 16px; }
  .entry-people { font-size: 17.5px; }
  .entry-title { font-size: 15px; }
  .entry--no-person .entry-title { font-size: 17px; }
  /* tighten tracking too — 0.3em on a narrow screen would wrap the mark */
  .wordmark { font-size: 14px; letter-spacing: 0.22em; text-indent: 0.22em; }
}
