/* ============================================================================
   History of Medicine — shared design system
   Archival editorial: warm paper, deep ink, hairline rules, catalogue metadata.
   Linked by every page. Replaces the per-page <style> blocks.
   ========================================================================= */

/* ---------------------------------------------------------------- tokens  */
:root {
  /* Surfaces */
  --paper:        #FBF8F2;   /* page background          */
  --paper-raised: #FFFFFF;   /* cards, raised surfaces   */
  --paper-sunk:   #F4EFE5;   /* wells, image backdrops   */
  --ink-deep:     #16120F;   /* hero / footer background */
  --ink:          #1C1917;   /* headings                 */
  --ink-body:     #292524;   /* body text        13.6:1  */
  --ink-muted:    #57534E;   /* secondary text    7.1:1  */
  --ink-faint:    #78716C;   /* tertiary, ≥18px   4.6:1  */

  /* Rules */
  --rule:         #E7E0D4;
  --rule-strong:  #D6CCBA;
  --rule-dark:    rgba(251, 248, 242, 0.14);

  /* Gilt — the helix and medallions on the timelines */
  --gilt:      #A9853F;
  --gilt-hi:   #D9C08A;
  --gilt-lo:   #6E5626;

  /* Accents — both pass 4.5:1 on --paper */
  --accent-med:      #0E7490;  /* medical     5.0:1 */
  --accent-med-dim:  rgba(14, 116, 144, 0.10);
  --accent-tech:     #B45309;  /* technology  4.7:1 */
  --accent-tech-dim: rgba(180, 83, 9, 0.10);

  /* On dark ink, accents lighten for contrast */
  --accent-med-on-dark:  #67E8F9;
  --accent-tech-on-dark: #FBBF24;

  /* Per-page accent. Timelines override it; everything else inherits. */
  --accent:      var(--accent-med);
  --accent-dim:  var(--accent-med-dim);
  --accent-lift: var(--accent-med-on-dark);

  /* Type */
  --font-display: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-ui:      Inter, system-ui, -apple-system, sans-serif;

  --step--1: 0.8125rem;                            /* 13px  fine print   */
  --step-0:  1rem;                                 /* 16px  base         */
  --step-1:  1.125rem;                             /* 18px  lead         */
  --step-2:  1.375rem;                             /* 22px  h4           */
  --step-3:  clamp(1.5rem,  1.3rem + 0.9vw, 1.75rem);   /* h3        */
  --step-4:  clamp(1.875rem, 1.6rem + 1.4vw, 2.25rem);  /* h2        */
  --step-5:  clamp(2.25rem, 1.8rem + 2.2vw, 2.875rem);  /* page h1   */
  --step-6:  clamp(2.75rem, 1.9rem + 4.2vw, 4.5rem);    /* hero      */

  --measure: 68ch;

  /* Elevation — soft and warm, never grey */
  --lift-1: 0 1px 2px rgba(28, 25, 23, 0.04);
  --lift-2: 0 2px 4px rgba(28, 25, 23, 0.05), 0 8px 20px -8px rgba(28, 25, 23, 0.10);
  --lift-3: 0 4px 8px rgba(28, 25, 23, 0.06), 0 20px 40px -16px rgba(28, 25, 23, 0.16);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 160ms;
  --t-base: 220ms;

  --z-nav: 50;
  --z-menu: 40;
}

/* ------------------------------------------------------------ dark theme
   The same archive by lamplight: the paper goes to a warm umber, the ink
   lifts to parchment, and the accents brighten to keep their contrast
   (body 12:1, muted 7.6:1, faint 5.3:1, both accents above 7:1). The hero
   and footer drop a step darker than the page so they still read as ink
   panels. The theme is set on <html> by a small script in each page's head,
   which follows the system setting until the visitor picks one. */
:root { --paper-glass: rgba(251, 248, 242, 0.88); color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper:        #1A1714;
  --paper-raised: #221E1A;
  --paper-sunk:   #13110E;
  --paper-glass:  rgba(26, 23, 20, 0.88);
  --ink-deep:     #0E0C0A;
  --ink:          #F3EEE6;
  --ink-body:     #DCD5CA;
  --ink-muted:    #B0A89C;
  --ink-faint:    #948B7F;

  --rule:         #312C26;
  --rule-strong:  #48413A;

  --accent-med:      #56BDD6;
  --accent-med-dim:  rgba(86, 189, 214, 0.14);
  --accent-tech:     #E59A52;
  --accent-tech-dim: rgba(229, 154, 82, 0.14);

  --lift-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --lift-2: 0 2px 4px rgba(0, 0, 0, 0.3), 0 8px 20px -8px rgba(0, 0, 0, 0.5);
  --lift-3: 0 4px 8px rgba(0, 0, 0, 0.35), 0 20px 40px -16px rgba(0, 0, 0, 0.6);
}
/* The orange button keeps its light-theme fill: the brightened accent is too
   pale to carry white text. */
:root[data-theme="dark"] .btn-primary { background: #B45309; }
:root[data-theme="dark"] .btn-primary:hover { background: #C2610F; }
/* Photographs with white grounds glare on a dark page; take the edge off. */
:root[data-theme="dark"] main img { filter: brightness(0.9); }

/* ------------------------------------------------------------------ base  */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

/* Paper grain — a single tiny tiled SVG, fixed so it never repaints on scroll */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

@media (max-width: 767px) {
  body { -webkit-tap-highlight-color: transparent; }
}

::selection { background: var(--accent-dim); color: var(--ink); }

/* Focus — visible on both paper and ink, never removed */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-ink :focus-visible { outline-color: var(--accent-lift); }

/* ------------------------------------------------------------ typography  */
.font-display { font-family: var(--font-display); }
.font-ui      { font-family: var(--font-ui); }

.display {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.022em;
  line-height: 1.08;
  text-wrap: balance;
}
.display-hero { font-size: var(--step-6); }
.display-page { font-size: var(--step-5); }
.display-sect { font-size: var(--step-4); }
.display-sub  { font-size: var(--step-3); }
.display-card { font-size: var(--step-2); line-height: 1.22; letter-spacing: -0.014em; }

.on-ink .display,
.display.on-ink { color: #FBF8F2; }

/* Lead paragraph under a display heading */
.lead {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: var(--measure);
  text-wrap: pretty;
}
.on-ink .lead { color: rgba(251, 248, 242, 0.72); }

.prose-measure { max-width: var(--measure); }

/* Catalogue metadata: dates, era labels, sequence numbers */
.meta {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.seq {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

/* Eyebrow — tracked label with a hairline lead-in */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
  flex: none;
}
.eyebrow--center::after {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
  flex: none;
}
.eyebrow > span { font: inherit; }

/* Pill badge (hero chips, date badges) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--accent);
}
.on-ink .badge {
  background: rgba(251, 248, 242, 0.07);
  border-color: var(--rule-dark);
  color: rgba(251, 248, 242, 0.82);
}

/* ------------------------------------------------------------------ rules */
.hairline { height: 1px; background: var(--rule); border: 0; }
.hairline-fade {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--rule-strong), transparent);
}

/* Era divider on the timelines — a ruled rule with a lozenge either side of
   the label, echoing the marks on the spine below it. */
.era-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3.5rem;
}
.era-divider::before,
.era-divider::after {
  content: "";
  flex: 1;
  height: 3px;
  /* double rule: a solid hairline over a fainter one */
  background-image:
    linear-gradient(var(--rule-strong), var(--rule-strong)),
    linear-gradient(var(--rule), var(--rule));
  background-size: 100% 1px, 100% 1px;
  background-position: 0 0, 0 3px;
  background-repeat: no-repeat;
}
.era-divider > span {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--ink-muted);
  white-space: nowrap;
}
/* Lozenge marks flanking the era label */
.era-divider > span::before,
.era-divider > span::after {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  transform: rotate(45deg);
  background: var(--accent);
  opacity: .55;
}
@media (max-width: 640px) {
  .era-divider > span { white-space: normal; text-align: center; }
}

/* ------------------------------------------------------------------ cards */
.card {
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--lift-1);
  transition: border-color var(--t-base) var(--ease),
              box-shadow  var(--t-base) var(--ease);
}
.card-interactive:hover {
  border-color: var(--rule-strong);
  box-shadow: var(--lift-2);
}
.card-interactive:hover .card-title { color: var(--accent); }
.card-interactive:hover .card-figure img { filter: saturate(1.06) contrast(1.03); }
.card-interactive:hover .read-on { gap: 0.6rem; }

/* Stretched link: the title anchor covers the whole card, so the card is
   clickable without nesting the Commons credit link inside another anchor. */
.card-link { color: inherit; cursor: pointer; }
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  transition: color var(--t-base) var(--ease);
}
.card-summary {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-muted);
}

/* Rule between title and summary */
.card-rule {
  width: 2rem;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
  margin: 0.85rem 0;
}

/* Figure: warm unifying wash over mixed-provenance archive images.
   4:3 rather than a wide crop — 31 of the 57 archive images are portrait,
   so a letterbox reduced most of the collection to a thin middle slice. */
.card-figure {
  position: relative;
  overflow: hidden;
  background: var(--paper-sunk);
  aspect-ratio: 4 / 3;
}
.card-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter var(--t-base) var(--ease);
}
.card-figure::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
              rgba(120, 82, 40, 0.06) 0%,
              rgba(120, 82, 40, 0.00) 45%,
              rgba(22, 18, 15, 0.16) 100%);
}

/* Museum-label image credit */
.credit-chip {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 2;
  max-width: 88%;
  padding: 0.25rem 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.625rem;
  line-height: 1.35;
  color: #FBF8F2;
  background: rgba(22, 18, 15, 0.74);
  border-top-left-radius: 4px;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease);
}
a.credit-chip { cursor: pointer; }
a.credit-chip:hover { background: rgba(22, 18, 15, 0.9); text-decoration: underline; }

/* "Read entry →" affordance */
.read-on {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  transition: gap var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.read-on svg { width: 0.875rem; height: 0.875rem; flex: none; }

/* Icon tile used by pillar / value cards */
.icon-tile {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--paper);
  color: var(--accent);
  flex: none;
}
.icon-tile svg { width: 1.25rem; height: 1.25rem; }
.icon-tile--tech { color: var(--accent-tech); }
.icon-tile--neutral { color: var(--ink-muted); }

/* --------------------------------------------------------------- buttons  */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--t-base) var(--ease),
              border-color     var(--t-base) var(--ease),
              color            var(--t-base) var(--ease);
}
.btn svg { width: 1rem; height: 1rem; flex: none; }

.btn-primary { background: var(--accent-tech); color: #FFF9F0; }
.btn-primary:hover { background: #92400E; }

.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #3F3A35; }

.btn-outline {
  background: transparent;
  border-color: var(--rule-strong);
  color: var(--ink);
}
.btn-outline:hover { background: var(--paper-sunk); border-color: var(--ink-faint); }

.on-ink .btn-outline {
  border-color: var(--rule-dark);
  color: #FBF8F2;
}
.on-ink .btn-outline:hover { background: rgba(251, 248, 242, 0.1); }

/* Quiet text link with arrow */
.link-quiet {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
  transition: gap var(--t-base) var(--ease);
}
.link-quiet:hover { gap: 0.65rem; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------- nav  */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: var(--paper-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  transition: box-shadow var(--t-base) var(--ease);
}
.site-nav.is-scrolled { box-shadow: var(--lift-1); }

/* Once the visitor is properly under way the bar draws in, giving the record
   back a little of the screen it was borrowing. Desktop only: on phones the
   period heading pins itself at --nav-h, and a bar that changed height under
   it would open a gap the page shows through. */
@media (min-width: 768px) {
  .site-nav > div { transition: padding var(--t-base) var(--ease); }
  .site-nav.is-compact > div { padding-top: 0.4rem; padding-bottom: 0.4rem; }
  .site-nav .nav-wordmark { transition: font-size var(--t-base) var(--ease); }
  .site-nav.is-compact .nav-wordmark { font-size: 1.0625rem; }
}

.nav-wordmark {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color var(--t-fast) var(--ease);
}
.nav-wordmark:hover { color: var(--accent); }

.nav-link {
  position: relative;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-muted);
  padding: 0.5rem 0;
  transition: color var(--t-fast) var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-current { color: var(--accent); }
.nav-link.is-current::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
}

.nav-toggle {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.nav-toggle:hover { background: var(--paper-sunk); }

/* Search button in the bar: an icon in place of the old Explore link, on every
   screen size. On desktop it is the last item, so it takes the toggle's
   negative margin to sit flush with the right edge. */
.nav-search { color: var(--ink-muted); }
.nav-search:hover { color: var(--ink); }
.nav-search.is-current { color: var(--accent); }
@media (min-width: 768px) { .nav-search { margin-right: -.5rem; } }

/* Theme switch. In the bar on desktop; on phones the bar has no room for a
   fourth icon, so it is a row in the drawer instead. Shows the moon in the
   light theme and the sun in the dark one. */
.nav-theme { display: none; color: var(--ink-muted); }
.nav-theme:hover { color: var(--ink); }
@media (min-width: 768px) { .nav-theme { display: inline-flex; } }
.theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }

.mm-theme {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule-dark);
  border-radius: 4px;
  background: rgba(251, 248, 242, 0.04);
  color: #FBF8F2;
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.mm-theme svg { width: 1.125rem; height: 1.125rem; flex: none; color: var(--gilt-hi); }
.mm-theme:hover { background: rgba(251, 248, 242, 0.08); }

/* ---- Mobile index drawer --------------------------------------------------
   Not a shrunken navbar but a catalogue page: ink ground carrying the same
   engraved hatching as the hero, numbered rows ruled off from one another,
   each with the line of description a wall panel would give it, and the
   collection's extent printed at the foot. Only ever shown below 768px, so
   it is styled unconditionally rather than inside a query. */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  background: var(--ink-deep);
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 5.5rem 1.5rem 2.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* The hatching layer is a child, so it sits under the rows without a stacking
   context of its own. */
.mobile-menu > .ink-hatch { z-index: 0; }
.mobile-menu > *:not(.ink-hatch) { position: relative; z-index: 1; }

.mm-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
  color: rgba(251, 248, 242, 0.42);
}
.mm-eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule-dark);
}

.mobile-menu a.mm-item {
  display: grid;
  grid-template-columns: 2.1rem 1fr 1rem;
  align-items: center;
  gap: 0 0.9rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--rule-dark);
  color: #FBF8F2;
}
.mobile-menu a.mm-item:first-child { border-top: 0; }

.mm-num {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  color: rgba(251, 248, 242, 0.38);
  align-self: start;
  padding-top: 0.42rem;
}
.mm-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6875rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.018em;
}
.mm-desc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgba(251, 248, 242, 0.5);
}
.mm-item svg {
  width: 1rem;
  height: 1rem;
  align-self: start;
  margin-top: 0.5rem;
  color: rgba(251, 248, 242, 0.28);
  transition: transform var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.mm-item:hover svg { transform: translateX(3px); color: rgba(251, 248, 242, 0.6); }

/* Current page: a gilt rule struck in the margin, the number gilded, the title
   lifted to the accent. The rule is pulled out into the drawer's own 1.5rem
   padding — the only margin a phone has to spare. */
.mobile-menu a.mm-item.is-current { position: relative; }
.mobile-menu a.mm-item.is-current::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: 0.85rem;
  bottom: 0.85rem;
  width: 2px;
  background: var(--gilt-hi);
}
.mobile-menu a.mm-item.is-current .mm-title { color: var(--accent-med-on-dark); }
.mobile-menu a.mm-item.is-current .mm-num { color: var(--gilt-hi); }

.mm-foot {
  margin-top: auto;
  padding-top: 2rem;
  color: rgba(251, 248, 242, 0.38);
}
.mm-foot::before {
  content: "";
  display: block;
  width: 3rem;
  height: 1px;
  margin-bottom: 0.9rem;
  background: var(--rule-dark);
}

/* Rows deal themselves in when the drawer opens. `.flex` is the class the nav
   script toggles, so the animation restarts on every open. */
@keyframes mm-deal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.mobile-menu.flex .mm-item { animation: mm-deal 400ms var(--ease) both; }
.mobile-menu.flex .mm-item:nth-child(1) { animation-delay: 40ms; }
.mobile-menu.flex .mm-item:nth-child(2) { animation-delay: 85ms; }
.mobile-menu.flex .mm-item:nth-child(3) { animation-delay: 130ms; }
.mobile-menu.flex .mm-item:nth-child(4) { animation-delay: 175ms; }
.mobile-menu.flex .mm-item:nth-child(5) { animation-delay: 220ms; }

/* ---------------------------------------------------------------- footer  */
.site-footer {
  background: var(--ink-deep);
  color: rgba(251, 248, 242, 0.62);
  border-top: 1px solid var(--rule-dark);
}
.site-footer a { color: rgba(251, 248, 242, 0.62); transition: color var(--t-fast) var(--ease); }
.site-footer a:hover { color: #FBF8F2; }
.footer-heading {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(251, 248, 242, 0.85);
}
.footer-wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: #FBF8F2;
}

/* ------------------------------------------------------- dark ink section */
.ink-section {
  background: var(--ink-deep);
  color: rgba(251, 248, 242, 0.72);
  position: relative;
  overflow: hidden;
}
/* Engraved hatching — the burin-ruled shading of a copperplate anatomical
   plate, in place of the mechanical square lattice that used to sit here.
   Ruled strokes laid on densely at the top-left and thinning across the
   section the way an engraver relieves a shadow, over a fine plate grain.
   The gradient stops ramp to transparent instead of
   stepping (no hard 1px edge anywhere), so the lines antialias cleanly and
   cannot shimmer as the section scrolls. */
.ink-hatch {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.ink-hatch::before,
.ink-hatch::after {
  content: "";
  position: absolute;
  inset: 0;
}
/* The burin strokes. All three rulings run at one angle — crossing a second
   angle over them only rebuilds a grid on the diagonal. Their periods
   (9 / 23 / 37px) share no common factor, so the heavier strokes fall
   between the fine ones on a rhythm that restates itself roughly once every
   eight thousand pixels: hand-ruled, never a repeating tile. */
.ink-hatch::before {
  background-image:
    repeating-linear-gradient(
      -18deg,
      rgba(251, 248, 242, 0.072) 0px,
      rgba(251, 248, 242, 0) 1.8px,
      rgba(251, 248, 242, 0) 9px),
    repeating-linear-gradient(
      -18deg,
      rgba(251, 248, 242, 0) 4.6px,
      rgba(251, 248, 242, 0.05) 6.2px,
      rgba(251, 248, 242, 0) 7.8px,
      rgba(251, 248, 242, 0) 23px),
    repeating-linear-gradient(
      -18deg,
      rgba(251, 248, 242, 0) 13.4px,
      rgba(251, 248, 242, 0.038) 15px,
      rgba(251, 248, 242, 0) 16.6px,
      rgba(251, 248, 242, 0) 37px);
  -webkit-mask-image:
    linear-gradient(160deg,
      #000 0%, rgba(0, 0, 0, 0.58) 35%, rgba(0, 0, 0, 0.18) 64%, transparent 88%);
  mask-image:
    linear-gradient(160deg,
      #000 0%, rgba(0, 0, 0, 0.58) 35%, rgba(0, 0, 0, 0.18) 64%, transparent 88%);
}
/* Plate grain. Doubles as dither — it breaks up the banding the large ink
   washes would otherwise show across a wide screen. */
.ink-hatch::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.05;
}
/* Section lighting.
   LINEAR gradients only, anchored to an edge. A radial-gradient — like the
   blurred circle it replaced — paints a soft ellipse, which read as a stray
   blue blob drifting over the page while scrolling. A linear fade from an
   edge cannot form a closed shape, so there is nothing to mistake for one. */
.ink-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ink-wash--med {
  background:
    linear-gradient(180deg, rgba(14, 116, 144, .17) 0%, rgba(14, 116, 144, .05) 45%, rgba(14, 116, 144, 0) 78%);
}
.ink-wash--med-low {
  background:
    linear-gradient(0deg, rgba(14, 116, 144, .18) 0%, rgba(14, 116, 144, .05) 45%, rgba(14, 116, 144, 0) 78%);
}
.ink-wash--tech {
  background:
    linear-gradient(0deg, rgba(180, 83, 9, .17) 0%, rgba(180, 83, 9, .05) 45%, rgba(180, 83, 9, 0) 78%);
}
.ink-wash--corner-med {
  background:
    linear-gradient(215deg, rgba(14, 116, 144, .30) 0%, rgba(14, 116, 144, 0) 58%);
}
.ink-wash--corner-tech {
  background:
    linear-gradient(215deg, rgba(180, 83, 9, .32) 0%, rgba(180, 83, 9, 0) 58%);
}
/* Very faint tint for light-paper sections */
.paper-wash--med {
  background:
    linear-gradient(205deg, rgba(14, 116, 144, .06) 0%, rgba(14, 116, 144, 0) 48%);
}
.paper-wash--top {
  background:
    linear-gradient(180deg, rgba(14, 116, 144, .06) 0%, rgba(14, 116, 144, 0) 48%);
}

/* --------------------------------------------------------------- prose    */
.entry-prose {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  line-height: 1.72;
  color: var(--ink-body);
  max-width: var(--measure);
}
.entry-prose > p { margin-bottom: 1.4em; text-wrap: pretty; }

/* Drop cap on the opening paragraph only.
   line-height:1 with a whole-number font-size keeps the float box an exact
   multiple of the line box, so wrapped lines align instead of stair-stepping. */
.entry-prose > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 3.3em;    /* just under 2 line boxes (2 x 1.72em) so it wraps 2 */
  line-height: 1;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0.09em 0 0;
  padding: 0;
}

.entry-prose h2 {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 2.4rem 0 0.35rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}
/* Direct child only: the opening heading of the prose loses its rule, but a
   heading nested in a trailing section (Sources) still gets one. */
.entry-prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.entry-prose h3 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  color: var(--ink);
  margin: 1.9rem 0 0.4rem;
}

/* ------------------------------------------------------------- citations   */
/* Sources sit inside .entry-prose, so the h2 already picks up the hairline
   rule that separates sections. The list itself steps down to the UI face and
   a smaller size — reference apparatus, not reading matter. */
.entry-sources { margin-top: 0.5rem; }

/* Scoped to .entry-prose to outweigh the generic `.entry-prose ol` indent. */
.entry-prose .citation-list {
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: citation;
}
.entry-prose .citation {
  position: relative;
  counter-increment: citation;
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-muted);
  padding-left: 2.1rem;
  margin-bottom: 0.9rem;
  /* MLA hanging indent, done with padding so the marker sits in the gutter. */
  text-wrap: pretty;
}
.citation:last-child { margin-bottom: 0; }
.citation::before {
  content: counter(citation) ".";
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  text-align: right;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
/* Long URLs must not push the column wider than the measure. */
.citation a { word-break: break-word; }
.entry-prose strong { font-weight: 700; color: var(--ink); }
.entry-prose em { font-style: italic; }
.entry-prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--rule-strong);
  transition: text-decoration-color var(--t-fast) var(--ease);
}
.entry-prose a:hover { text-decoration-color: currentColor; }
.entry-prose ul, .entry-prose ol { margin: 0 0 1.4em 1.25em; }
.entry-prose li { margin-bottom: 0.45em; }
.entry-prose blockquote {
  margin: 1.8em 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
  color: var(--ink-muted);
}

/* A quoted source paragraph: <p><em>“…”</em><br>— Attribution</p>.
   Matched on the line break after the quote, not :only-child — that selector
   ignores text, so it also caught any paragraph with one italic word in it. */
.entry-prose > p > em:first-child:has(+ br) {
  display: block;
  padding-left: 1.4rem;
  border-left: 2px solid var(--rule-strong);
  color: var(--ink-muted);
}

/* Editorial pull quote (mission page, homepage) */
.pull-quote {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-style: italic;
  font-weight: 500;
  line-height: 1.42;
  color: var(--ink);
  text-wrap: pretty;
}

/* Bio / long-form body copy on about + mission */
.body-prose {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--ink-body);
  max-width: var(--measure);
}
.body-prose p + p { margin-top: 1.1em; }

/* Definition-style fact list (about page sidebar) */
.fact-list { display: flex; flex-direction: column; }
.fact-list > li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
}
.fact-list > li:first-child { border-top: 0; padding-top: 0; }
.fact-label {
  font-family: var(--font-ui);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.15rem;
}
.fact-value { font-size: 0.9375rem; color: var(--ink-body); }

/* ---------------------------------------------------------------- motion  */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.fade-in.visible { opacity: 1; transform: none; }
.delay-1 { transition-delay: 60ms; }
.delay-2 { transition-delay: 120ms; }
.delay-3 { transition-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; transition: none; }
  .tl-entry.fade-in { transform: none; }
  /* The medallions still gild as you pass — that is orientation, not motion —
     but nothing draws, slides, or drifts to say so. */
  .tl-node,
  .tl-node::before,
  .tl-node::after { --draw: 1; }
  .scroll-cue-rule::after { display: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------- lightbox       */
/* Full-screen plate viewer with its citation. Driven by [data-lightbox]. */

.plate-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  text-align: left;
}

/* Framed artwork panel.
   display:block matters — .plate is a <span> inside the trigger <button>,
   and aspect-ratio has no effect on an inline box. */
.plate {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: var(--paper-sunk);
  box-shadow: var(--lift-3);
}
.plate img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease), filter var(--t-base) var(--ease);
}
/* Inner bevel, like a mounted print */
.plate::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(251, 248, 242, .18),
    inset 0 0 90px rgba(22, 18, 15, .35);
}
.plate-trigger:hover .plate img { transform: scale(1.02); filter: saturate(1.05); }
.plate-trigger:focus-visible { outline: 2px solid var(--accent-lift); outline-offset: 6px; border-radius: 6px; }

/* "View" affordance over the plate */
.plate-hint {
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .8rem;
  border-radius: 3px;
  background: rgba(22, 18, 15, .72);
  color: #FBF8F2;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background var(--t-base) var(--ease);
}
.plate-trigger:hover .plate-hint { background: rgba(22, 18, 15, .9); }
.plate-hint svg { width: .9rem; height: .9rem; flex: none; }

/* Caption under the plate */
.plate-caption {
  margin-top: .9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem .75rem;
}

/* ---- the overlay ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  flex-direction: column;
  background: rgba(12, 10, 8, .94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}
.lightbox.is-open { display: flex; }
.lightbox.is-shown { opacity: 1; }

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(251, 248, 242, .22);
  background: rgba(251, 248, 242, .08);
  color: #FBF8F2;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.lightbox-close:hover { background: rgba(251, 248, 242, .18); }
.lightbox-close:focus-visible { outline: 2px solid var(--accent-lift); outline-offset: 3px; }

.lightbox-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.25rem 1rem;
}
.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}

/* Citation panel */
.lightbox-cite {
  flex: none;
  max-height: 40vh;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1.75rem;
  border-top: 1px solid rgba(251, 248, 242, .14);
  background: rgba(12, 10, 8, .6);
  color: rgba(251, 248, 242, .72);
}
.lightbox-cite-inner { max-width: 60rem; margin: 0 auto; }
.lightbox-title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  color: #FBF8F2;
  line-height: 1.25;
  margin-bottom: .2rem;
}
.lightbox-sub { color: rgba(251, 248, 242, .62); margin-bottom: .9rem; }
.lightbox-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  margin-bottom: .9rem;
}
.lightbox-meta div { min-width: 0; }
.lightbox-meta dt {
  font-family: var(--font-ui);
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(251, 248, 242, .47);
  margin-bottom: .1rem;
}
.lightbox-meta dd { font-size: .875rem; color: rgba(251, 248, 242, .82); }
.lightbox-source {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--accent-med-on-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(103, 232, 249, .4);
  transition: text-decoration-color var(--t-fast) var(--ease);
}
.lightbox-source:hover { text-decoration-color: currentColor; }
.lightbox-source:focus-visible { outline: 2px solid var(--accent-lift); outline-offset: 3px; }
.lightbox-source svg { width: .85rem; height: .85rem; flex: none; }

@media (max-width: 640px) {
  .lightbox-stage { padding: 3.25rem .75rem .75rem; }
  .lightbox-cite { padding: 1rem 1rem 1.25rem; max-height: 45vh; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox { transition: none; }
  .plate img { transition: none; }
  .plate-trigger:hover .plate img { transform: none; }
}

/* ---------------------------------------------------------- timeline      */
/* Alternating spine layout. One markup shape drives both breakpoints:
   desktop puts cards either side of a centre rule, mobile stacks them
   against a left rule. No duplicated cards. */

.timeline { position: relative; }

/* ---- Period filter --------------------------------------------------------
   Chips above the record. Real buttons carrying aria-pressed, so state is
   announced rather than signalled by colour alone. */
.era-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .75rem;
}

.era-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 30px;
  padding: .3rem .6rem;
  font-size: .625rem;
  letter-spacing: .1em;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: var(--paper-raised);
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color var(--t-base) var(--ease),
              color       var(--t-base) var(--ease),
              background  var(--t-base) var(--ease);
}
.era-chip:hover { border-color: var(--gilt); color: var(--ink); }

/* A finger needs a 44px target; a cursor does not. The compact chip is the
   pointer case, and touch gets the height back. */
@media (pointer: coarse) {
  .era-chip { min-height: 38px; padding-block: .5rem; }
}

.era-chip-count {
  font-variant-numeric: tabular-nums;
  font-size: .5625rem;
  letter-spacing: .06em;
  padding: .1rem .3rem;
  border-radius: 2px;
  background: var(--paper-sunk);
  /* --ink-muted, not --ink-faint: at this size it needs 4.5:1, and faint on
     paper-sunk only reaches 4.19 */
  color: var(--ink-muted);
  transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease);
}

/* Which period you are currently walking through — a gilt rule struck under
   the chip. Distinct from .is-active, which is the filter the visitor set:
   one is where you are, the other is what you asked to see. Suppressed while
   a filter is on, when there is only one period on the page anyway. */
.era-chip.is-here:not(.is-active) {
  border-color: var(--gilt);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--gilt);
}

.era-chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
}
.era-chip.is-active .era-chip-count {
  /* darkening the accent rather than lightening it — a light veil dropped the
     paper text to 3.27:1, this lifts it back above 6:1 on both accents */
  background: rgba(22, 18, 15, .28);
  color: var(--paper);
}

.era-filter-status {
  margin-bottom: 1.75rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--rule);
}

/* A filtered-out period is removed from the flow entirely */
.tl-era[hidden] { display: none; }

/* ---- The spine ------------------------------------------------------------
   A gilded laurel garland: a braided stem with shaded leaves turning off it,
   in the register of a gilt frame moulding or an illuminated border. Laurel
   is the classical mark of healing and honour, so it ties to the physicians
   the early entries describe.

   Shipped as a pre-rasterised 2x PNG rather than inline SVG. As vector, the
   tile had to be re-rasterised across a 24,000px page and locked up the
   renderer while scrolling; as a bitmap the same artwork paints for free. */
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 11px;
  width: 104px;
  transform: translateX(-50%);
  pointer-events: none;
  background-image: url("garland.png");
  background-repeat: repeat-y;
  background-position: center top;
  background-size: 62px auto;          /* narrower on phones */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 3%, #000 97%, transparent);
}

.tl-entry {
  position: relative;
  padding-left: 4.25rem;
  padding-bottom: 3.5rem;
}

/* ---- Medallions -----------------------------------------------------------
   A struck disc resting on the garland: cream face, double gilt rim, the
   entry's number in the display serif, lifted off the leaves by a soft cast
   shadow. Rings and shadow are all box-shadow, so hover never changes the
   node's box and nothing in the row reflows. */
.tl-node {
  position: absolute;
  left: -12px;                 /* 46px wide, centred on the garland at 11px */
  /* Centred on the card, not pinned to its top. The containing block is the
     entry's padding box, which includes padding-bottom, so half of that is
     subtracted to land on the card's true middle. */
  top: calc(50% - 1.75rem);    /* half of .tl-entry's 3.5rem padding-bottom */
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;

  /* The disc is struck from four tokens rather than four literal shadows, so
     the reached / current / hover states each restate a colour instead of
     restating the whole stack at every breakpoint. box-shadow still animates
     normally — the custom properties resolve before the transition sees it. */
  --ring:       var(--gilt);
  --ring-inner: rgba(189, 154, 85, .5);
  --ring-gap:   3px;
  --ring-edge:  4px;
  --node-fg:    var(--gilt-lo);
  --node-cast:  0 2px 5px rgba(60, 45, 20, .16), 0 8px 20px -6px rgba(60, 45, 20, .26);
  --draw:       1;

  color: var(--node-fg);
  box-shadow:
    var(--node-cast),
    0 0 0 1px var(--ring),
    inset 0 0 0 var(--ring-gap) var(--paper),
    inset 0 0 0 var(--ring-edge) var(--ring-inner);
  transition: box-shadow 420ms var(--ease),
              color      420ms var(--ease);
}

/* ---- Where you are in the record ------------------------------------------
   The spine keeps score as you scroll. An entry you have not reached yet is
   struck but not gilded, and its rules are barely drawn; reaching it strikes
   the gilt and draws them out along the garland; the entry at your reading
   line takes the period's accent. Nothing here changes a box — only colour,
   shadow, and a scaleX — so a 24,000px column never reflows while scrolling. */
.tl-entry:not(.is-lit) .tl-node {
  --ring:       rgba(169, 133, 63, .40);
  --ring-inner: rgba(189, 154, 85, .16);
  --node-fg:    rgba(110, 86, 38, .40);
  --node-cast:  0 1px 3px rgba(60, 45, 20, .07);
  --draw:       0.16;
}
.tl-entry.is-current .tl-node {
  --ring:       var(--accent);
  --ring-inner: var(--accent);
  --node-fg:    var(--accent);
  --node-cast:  0 2px 5px rgba(60, 45, 20, .16), 0 10px 26px -6px rgba(60, 45, 20, .34);
}
/* The plate you are level with lifts off the paper a little */
.tl-entry.is-current .tl-card {
  border-color: var(--rule-strong);
  box-shadow: var(--lift-2);
}

/* Leader line — a gilt rule tying the medallion to the card it marks.
   This carries the connection on its own: a pointer notch on the card was
   tried and dropped, because every card opens with a full-bleed photograph
   and a paper-coloured wedge over the image reads as a rendering fault. */
.tl-node::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  width: 2.4rem;
  height: 2px;
  margin-top: -1px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--gilt) 35%, transparent);
  /* Drawn from the medallion outwards as the entry is reached */
  transform: scaleX(var(--draw));
  transform-origin: 0 50%;
  transition: background var(--t-base) var(--ease),
              transform 520ms var(--ease);
}

/* Hover is last, so it reads over whichever state the scroll left behind */
.tl-entry:hover .tl-node {
  --ring:       var(--accent);
  --ring-inner: var(--accent);
  --node-fg:    var(--accent);
  --node-cast:  0 2px 5px rgba(60, 45, 20, .16), 0 10px 26px -6px rgba(60, 45, 20, .34);
  --draw:       1;
}
.tl-entry:hover .tl-node::before {
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* Sequence number + date sit above the card as a catalogue line */
.tl-heading {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.tl-heading .tl-date { color: var(--accent); }
.tl-heading .tl-seq::after {
  content: "";
  display: inline-block;
  width: 1.25rem;
  height: 1px;
  background: var(--rule-strong);
  vertical-align: middle;
  margin-left: 0.75rem;
}

.tl-card { overflow: hidden; }
.tl-body { padding: 1.35rem 1.4rem 1.5rem; }

@media (min-width: 768px) {
  .timeline::before { left: 50%; }

  /* Garland at full size once there is room for it */
  .timeline::before { background-size: 104px auto; }

  .tl-entry {
    display: grid;
    grid-template-columns: 1fr 9.5rem 1fr;
    align-items: start;
    padding-left: 0;
    padding-bottom: 5.5rem;
  }

  .tl-node {
    /* relative, NOT static: .tl-node's pseudo-element is absolutely
       positioned, so the node has to stay its containing block. Made static,
       the ::after resolved against .tl-entry — a full-width, ~600px-tall row
       — and border-radius:50% turned that into a screen-filling ellipse that
       faded in on row hover. */
    position: relative;
    left: auto;
    top: auto;
    transform: none;           /* grid handles the centring here */
    grid-column: 2;
    justify-self: center;
    align-self: center;        /* vertical middle of the card, not its top */
    margin-top: 0;
    width: 62px;
    height: 62px;
    font-size: 1.2rem;
    /* A larger disc carries a wider rim; the colours are the state's business */
    --ring-gap:  4px;
    --ring-edge: 5px;
    --node-cast: 0 2px 5px rgba(60, 45, 20, .16), 0 8px 22px -6px rgba(60, 45, 20, .28);
  }
  .tl-entry.is-current .tl-node,
  .tl-entry:hover .tl-node {
    --node-cast: 0 2px 5px rgba(60, 45, 20, .16), 0 12px 28px -6px rgba(60, 45, 20, .36);
  }

  /* Leader line and card notch both point at whichever side the card is on */
  .tl-entry:not(.tl-entry--right) > .tl-node::before {
    left: auto;
    right: 100%;
    background: linear-gradient(270deg, var(--gilt), transparent);
    transform-origin: 100% 50%;
  }
  .tl-entry:not(.tl-entry--right):hover > .tl-node::before {
    background: linear-gradient(270deg, var(--accent), transparent);
  }


  /* Odd entries left of the spine, even entries right. Only the card's
     position alternates — text stays left-aligned on both sides, because
     ragged-left body copy is materially harder to read. */
  .tl-entry > .tl-content { grid-column: 1; grid-row: 1; }
  .tl-entry--right > .tl-content { grid-column: 3; grid-row: 1; }

  /* Each entry comes in off the side of the spine it belongs to, so the
     alternation is legible while it is still arriving. Slower than the stock
     reveal: these are large plates, and they should settle rather than snap. */
  .tl-entry.fade-in {
    transform: translate3d(-26px, 18px, 0);
    transition-duration: 0.62s;
  }
  .tl-entry--right.fade-in { transform: translate3d(26px, 18px, 0); }
  .tl-entry.fade-in.visible { transform: none; }

  .tl-body { padding: 1.5rem 1.6rem 1.7rem; }
}

/* Back-to-top, timelines are long */
.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 30;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease), visibility var(--t-base) var(--ease);
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { background: #3F3A35; }

/* The disc doubles as the dial: a gilt arc struck round it for how much of
   the record is behind you. --p is set by site.js, and a conic-gradient
   masked to a ring costs one paint of a 52px box. */
.to-top::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(
    var(--gilt-hi) calc(var(--p, 0) * 360deg),
    rgba(169, 133, 63, 0.22) 0);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
          mask: radial-gradient(closest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
}

/* ------------------------------------------------------------------ cursor */
/* The pointer restated in the house register: an ink point for precision with
   a fine gilt reticle riding just behind it, which opens into a medallion's
   ring over anything that can be acted on and takes the page's accent while
   it is there. Over the ink sections both turn to paper and bright gilt — an
   ink point on ink is no point at all.

   Only ever on a fine pointer that hovers. A phone has no cursor to replace
   and would only inherit a mark stranded wherever it was last touched.

   And the native pointer is hidden behind `.has-cursor`, which site.js adds,
   rather than from the stylesheet directly: a page whose script failed to run
   must never leave a visitor with no cursor at all. */
@media (hover: hover) and (pointer: fine) {
  html.has-cursor,
  html.has-cursor *,
  html.has-cursor *::before,
  html.has-cursor *::after { cursor: none !important; }
}

.cursor-ring,
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;              /* over the lightbox at 90 and the skip link at 100 */
  pointer-events: none;
  opacity: 0;
  will-change: transform;
  transition: opacity 200ms var(--ease);
}
.cursor-ring.is-on,
.cursor-dot.is-on { opacity: 1; }

/* The mark hangs off the tracked point in a child, so the script owns the
   outer transform and the stylesheet owns the inner one. A transition on the
   element being written every frame would fight the hand holding it. */
.cursor-ring > span,
.cursor-dot > span {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  border-radius: 50%;
}

.cursor-dot > span {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  background: var(--ink);
  transition: background 200ms var(--ease), transform 220ms var(--ease);
}
.cursor-ring > span {
  width: 27px;
  height: 27px;
  margin: -13.5px 0 0 -13.5px;
  border: 1px solid var(--gilt);
  transition: transform 260ms var(--ease),
              border-color 220ms var(--ease),
              background 220ms var(--ease);
}

/* Over anything that can be acted on the reticle opens to 44px — the size of
   a medallion, and of the smallest thing this site asks anyone to hit. */
.cursor-ring.is-active > span {
  transform: scale(1.65);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.cursor-dot.is-active > span {
  transform: scale(0.55);
  background: var(--accent);
}

/* Pressed: the ring closes on the point */
.cursor-ring.is-down > span { transform: scale(0.78); }
.cursor-ring.is-active.is-down > span { transform: scale(1.32); }

/* On the ink sections, the footer, the drawer and the lightbox */
.cursor-dot.is-ink > span { background: #FBF8F2; }
.cursor-ring.is-ink > span { border-color: var(--gilt-hi); }
.cursor-ring.is-ink.is-active > span {
  border-color: var(--accent-lift);
  background: rgba(251, 248, 242, .08);
}
.cursor-dot.is-ink.is-active > span { background: var(--accent-lift); }

/* Over a field that takes typing, the reticle becomes the caret it replaced.
   Nothing on the site takes typing yet; this is what keeps the override from
   swallowing the affordance the day something does. */
.cursor-ring.is-text > span {
  width: 2px;
  height: 24px;
  margin: -12px 0 0 -1px;
  border: 0;
  border-radius: 1px;
  background: var(--ink);
  transform: none;
}
.cursor-ring.is-text.is-ink > span { background: #FBF8F2; }
.cursor-dot.is-text > span { transform: scale(0); }

/* ------------------------------------------------------------- utilities  */
.tabular { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--ink-muted); }
.text-faint { color: var(--ink-faint); }
.accent { color: var(--accent); }

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 1rem; }

/* Reading progress — a hairline running gilt into the page's accent along the
   bottom edge of the nav, on every page. It is a child of the bar rather than
   a fixed sibling of it, so it stays welded to the bottom edge when the bar
   draws in on scroll instead of leaving a gap the page shows through.
   Injected by site.js wherever the markup does not already carry one. */
.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  transform: scaleX(0);
  /* site.js also scales it to one device pixel; anchor that to the bar's
     bottom edge so it does not drift up off the border. */
  transform-origin: 0 100%;
  opacity: .75;
  background: linear-gradient(90deg, var(--gilt), var(--accent));
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease);
}
/* A page with nothing to scroll has no progress to report */
.read-progress.is-idle { opacity: 0; }

/* ---- The hero's scroll cue ------------------------------------------------
   A gallery tells you where to start. A hairline with a gilt fall running
   down it, which retires the moment the visitor takes the hint. */
.scroll-cue {
  /* Fixed, not pinned to the foot of the hero: the hero is min-height 100vh
     but its content can be taller, and a cue that has to be scrolled to is
     not a cue. It retires at the first touch of the wheel anyway, so it never
     outstays the panel it belongs to. */
  position: fixed;
  left: 50%;
  bottom: 1.75rem;
  z-index: 20;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.75rem;
  color: rgba(251, 248, 242, 0.5);
  transition: opacity var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.scroll-cue:hover { color: rgba(251, 248, 242, 0.88); }
.scroll-cue-rule {
  position: relative;
  width: 1px;
  height: 3.25rem;
  overflow: hidden;
  background: rgba(251, 248, 242, 0.16);
}
.scroll-cue-rule::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 46%;
  background: linear-gradient(180deg, transparent, var(--gilt-hi));
  animation: cue-fall 2.6s var(--ease) infinite;
}
@keyframes cue-fall {
  0%        { transform: translateY(-110%); }
  70%, 100% { transform: translateY(240%); }
}
html.has-scrolled .scroll-cue { opacity: 0; pointer-events: none; }
/* The hero is restructured on phones — the plate leads and there is no
   full-height panel for a cue to sit at the foot of. */
@media (max-width: 767px) { .scroll-cue { display: none; } }

/* Shown only where the layout swaps to the mobile treatment */
.swipe-hint { display: none; }

/* ============================================================================
   PHONE LAYOUT
   ----------------------------------------------------------------------------
   Below 768px the site is not the desktop page narrowed. It reads as a guide
   carried through the galleries: plates run edge to edge, entries are struck
   off from one another by a ruled band bearing the medallion, the period
   heading rides along under the nav as you pass through it, and card grids
   that have no room to be grids become things you swipe.

   Everything here is additive and query-scoped — the desktop composition is
   untouched. Selectors carry an element name where they override a Tailwind
   utility (`section.py-28` beats `.py-28`), because the Play CDN injects its
   stylesheet after this one and would otherwise win the tie.
   ========================================================================= */
@media (max-width: 767px) {

  :root {
    --nav-h: 69px;              /* measured: 44px toggle + 12px padding + rule */
    --gutter: 1.5rem;           /* matches the px-6 every page section uses */
  }

  /* ---- vertical rhythm ----------------------------------------------------
     Desktop section padding is luxurious at 7rem. On a 390px screen that is a
     third of the viewport spent on nothing, so the whole scale steps down. */
  section.py-28 { padding-top: 4.5rem; padding-bottom: 4.5rem; }
  section.py-24, main.py-24 { padding-top: 4rem; padding-bottom: 4rem; }
  section.py-20 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  header.pt-36, section.pt-36 { padding-top: 7rem; }
  section.pt-40 { padding-top: 6.5rem; }
  header.pb-24, section.pb-24 { padding-bottom: 3.25rem; }
  section.pb-28 { padding-bottom: 4rem; }

  /* Buttons get a thumb-sized target and fill the column they sit in */
  .btn { min-height: 50px; width: 100%; }

  /* ---- swipe affordance --------------------------------------------------- */
  .swipe-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--ink-faint);
  }
  .swipe-hint::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--rule-strong), transparent);
  }

  /* ---- card rails ---------------------------------------------------------
     Three cards stacked is three screens of scrolling for one idea. As a
     snapping rail with the next card peeking in, the set reads as a set. */
  #featured-grid,
  #entry-related {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 78%;
    gap: 0.9rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--gutter);
    margin-inline: calc(var(--gutter) * -1);
    padding: 0.25rem var(--gutter) 1rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  #featured-grid::-webkit-scrollbar,
  #entry-related::-webkit-scrollbar { display: none; }
  #featured-grid > *,
  #entry-related > * { scroll-snap-align: start; }
  /* A rail item must not be squashed by the reveal transform mid-scroll */
  #featured-grid > .fade-in,
  #entry-related > .fade-in { transform: none; }

  /* ---- home: the pillars as a contents page -------------------------------
     The desktop 3-up of iconed cards becomes a numbered ledger — rules, no
     boxes. Cheaper vertically and closer to the printed register the rest of
     the site is quoting. */
  .pillars.grid { display: block; counter-reset: pillar; }
  .pillars > .card {
    counter-increment: pillar;
    background: none;
    border: 0;
    border-top: 1px solid var(--rule);
    border-radius: 0;
    box-shadow: none;
    padding: 1.5rem 0 1.5rem 3rem;
    position: relative;
  }
  .pillars > .card::before {
    content: counter(pillar, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 1.72rem;
    font-family: var(--font-ui);
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.1em;
    color: var(--accent);
  }
  .pillars > .card .icon-tile { display: none; }
  .pillars > .card h3 { margin-bottom: 0.5rem; }

  /* ---- home hero: the plate leads ----------------------------------------
     Object first, wall label under it, then the copy — the order you meet a
     picture in a gallery. The plate bleeds to all three edges and runs up
     behind the frosted nav, and its foot dissolves into the ink the copy sits
     on, so the section reads as one panel rather than a photo above text. */
  section.hero-vh { min-height: 0; padding-left: 0; padding-right: 0; }
  .hero-vh > .relative { padding-top: 0; padding-bottom: 3.5rem; }
  .hero-vh .grid { gap: 0; }

  /* 2.5rem of this is spent pulling the caption back up onto the plate, so the
     clear space under the label is the remainder. */
  /* figure.* so it outranks Tailwind's .m-0 on the figure, which loads later
     and otherwise zeroes this margin, parking the badge on the caption. */
  figure.hero-plate { order: -1; margin: 0 0 4.25rem; }
  .hero-plate .plate {
    aspect-ratio: 1 / 1;
    border-radius: 0;
    box-shadow: none;
    background: var(--ink-deep);
  }
  .hero-plate .plate::after {
    /* replaces the mounted-print bevel: a scrim under the nav at the top, and
       a dissolve into --ink-deep at the foot */
    box-shadow: none;
    background:
      linear-gradient(180deg, rgba(22, 18, 15, 0.5) 0%, rgba(22, 18, 15, 0) 24%),
      linear-gradient(0deg, #16120F 0%, rgba(22, 18, 15, 0.55) 22%, rgba(22, 18, 15, 0) 46%);
  }
  .plate-hint { right: var(--gutter); bottom: 4.25rem; }

  /* Wall label, set on the dissolve at the foot of the plate.
     position/z-index are load-bearing: .plate::after is an absolutely
     positioned box, and positioned boxes paint above in-flow content, so an
     untouched caption is buried under the plate's own gradient. */
  .hero-plate .plate-caption {
    position: relative;
    z-index: 2;
    flex-direction: column;
    gap: 0.3rem;
    margin: -2.5rem var(--gutter) 0;
    padding-left: 0.85rem;
    border-left: 1px solid var(--gilt);
  }

  .hero-copy { padding-inline: var(--gutter); }
  .hero-copy .display-hero { font-size: clamp(2.9rem, 13.5vw, 4rem); }
  .hero-copy .badge { margin-bottom: 1.5rem; }
  .hero-rule { width: 3.25rem; margin: 0.4rem 0; }

  /* ---- home: the two timeline panels ------------------------------------- */
  a.ink-section.group { padding: 2rem 1.5rem; min-height: 0; }

  /* ---- about: the portrait leads -----------------------------------------
     The margin has to clear the outer hairline ring (scale 1.19) and the label
     hung below it, so it is larger than the gap it replaces. */
  section .grid.gap-16 { gap: 0; }
  .about-portrait { order: -1; margin-bottom: 3.5rem; }

  /* ---- timelines ---------------------------------------------------------- */

  /* Period chips become a rail that scrolls under a fade at either end,
     instead of a wrapped block four rows deep. */
  .era-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    margin-inline: calc(var(--gutter) * -1);
    padding: 0.15rem var(--gutter) 0.5rem;
    scrollbar-width: none;
    /* Fades on the trailing edge only. A fade on the leading edge veils the
       chip that is flush with the gutter and reads as a rendering fault. */
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent 100%);
    mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent 100%);
  }
  .era-filter::-webkit-scrollbar { display: none; }
  .era-chip { flex: none; scroll-snap-align: start; white-space: nowrap; }
  /* Snap to the gutter, not the scrollport edge, or the first chip lands flush
     against the side of the screen. */
  .era-filter { scroll-padding-inline: var(--gutter); }
  .era-chip { font-size: .6875rem; }
  .era-chip-count { font-size: .625rem; }

  .era-filter-status { margin-bottom: 1.25rem; padding-bottom: .75rem; }

  /* The period heading rides under the nav for as long as you are inside that
     period — the one piece of orientation a 24,000px column otherwise lacks. */
  .era-divider {
    position: sticky;
    top: calc(var(--nav-h) - 1px);
    z-index: 20;
    margin: 0 calc(var(--gutter) * -1) 2.25rem;
    padding: 0.8rem var(--gutter);
    background: var(--paper-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule);
  }
  .era-divider::before { display: none; }   /* one trailing rule reads cleaner */
  /* The reveal is wrong for a pinned bar twice over: it can pin while still
     transparent, and .fade-in's translateY offsets where a sticky box lands. */
  .era-divider.fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  /* The garland runs down the left edge on desktop. Here there is no margin to
     run it in, so the ornament turns ninety degrees: entries are struck apart
     by a ruled gilt band with the medallion set on it, the way plates are
     divided in a bound folio. */
  .timeline { overflow-x: clip; }
  .timeline::before { display: none; }

  .tl-entry {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    padding-bottom: 3rem;
  }

  .tl-node {
    order: -1;                     /* the band precedes the plate it labels */
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    align-self: center;
    margin-bottom: 1.6rem;
    width: 44px;
    height: 44px;
  }
  /* Double gilt rules running off both shoulders of the medallion, fading out
     well before the screen edge. */
  .tl-node::before,
  .tl-node::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 46vw;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 0;
    background-image:
      linear-gradient(var(--gilt), var(--gilt)),
      linear-gradient(rgba(169, 133, 63, 0.45), rgba(169, 133, 63, 0.45));
    background-size: 100% 1px, 100% 1px;
    background-position: 0 0, 0 3px;
    background-repeat: no-repeat;
  }
  /* Both shoulders draw outwards from the medallion as the entry is reached */
  .tl-node::before,
  .tl-node::after {
    transform: scaleX(var(--draw));
    transition: transform 520ms var(--ease);
  }
  .tl-node::before {
    /* `left: 100%` from the desktop rule still applies and would over-constrain
       the box, pinning both shoulders to the right. */
    left: auto;
    right: calc(100% + 0.85rem);
    transform-origin: 100% 50%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 62%);
    mask-image: linear-gradient(90deg, transparent 0, #000 62%);
  }
  .tl-node::after {
    left: calc(100% + 0.85rem);
    transform-origin: 0 50%;
    -webkit-mask-image: linear-gradient(90deg, #000 38%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 38%, transparent 100%);
  }
  .tl-entry:hover .tl-node::before,
  .tl-entry:hover .tl-node::after {
    background-image:
      linear-gradient(var(--accent), var(--accent)),
      linear-gradient(var(--accent), var(--accent));
  }

  /* Plates run to the screen edge. A card floating in a 24px margin on a phone
     is mostly margin; full bleed gives the photograph the width it needs.
     Scoped to .tl-entry: buildCard() stamps .tl-card on every card it makes,
     including the ones in the swipe rails, and those must keep their edges. */
  .tl-entry .tl-card {
    margin-inline: calc(var(--gutter) * -1);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .tl-entry .card-figure { aspect-ratio: 5 / 4; }
  .tl-entry .tl-body { padding: 1.4rem var(--gutter) 1.6rem; }
  /* The plate now reaches the screen edge, so the credit needs its own inset —
     flush right, the last word of the label sits on the bezel. */
  .tl-entry .credit-chip { padding-right: 1rem; }

  /* ---- entry page: the label sheet ---------------------------------------
     The plate fills the top of the screen and the article slides up over it on
     a paper sheet, the way a guide card is held up against the work. */
  article#entry-main {
    position: relative;
    z-index: 2;
    margin-top: -2.25rem;
    padding-top: 0.75rem;
    background: var(--paper);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 28px rgba(28, 25, 23, 0.13);
  }
  article#entry-main::before {
    content: "";
    display: block;
    width: 2.5rem;
    height: 3px;
    margin: 0 auto;
    border-radius: 2px;
    background: var(--rule-strong);
  }

  /* ---- footer ------------------------------------------------------------- */
  .site-footer .grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.25rem 1rem;
    margin-bottom: 2.5rem;
  }
  .site-footer .grid > div:first-child { grid-column: 1 / -1; }
  .site-footer .grid > div:first-child p { max-width: 30ch; }
  /* Footer links were 28px tall: a thumb needs more to hit them reliably. */
  .site-footer li > a.inline-block { padding-block: .45rem; }
}

/* Touch screens: small inline text links get a taller hit area without
   moving anything (the padding is cancelled by an equal negative margin). */
@media (pointer: coarse) {
  .link-quiet { padding-block: .7rem; margin-block: -.7rem; }
}

/* Very narrow screens: the medallion band needs its rules pulled in further */
@media (max-width: 380px) {
  .tl-node::before,
  .tl-node::after { width: 42vw; }
}

/* ---------------------------------------------------------- entry pager
   Previous / next at the foot of an entry. Two columns on wide screens with
   "next" pinned right even when it is alone; stacked on phones. */
.entry-pager {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}
/* A class display rule would otherwise beat the hidden attribute. */
.entry-pager[hidden] { display: none; }
@media (min-width: 640px) {
  .entry-pager { grid-template-columns: 1fr 1fr; }
  .entry-pager-link--next { grid-column: 2; text-align: right; }
}
.entry-pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper-raised);
  color: var(--ink);
  text-decoration: none;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.entry-pager-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.entry-pager-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.entry-pager-dir { color: var(--accent); }
.entry-pager-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.25;
}
@media (prefers-reduced-motion: reduce) {
  .entry-pager-link { transition: none; }
  .entry-pager-link:hover { transform: none; }
}

/* ------------------------------------------------- explore: both timelines
   The combined chronology tags every card with its timeline, and a search
   box above it narrows the record to matching entries. */
.tl-kind {
  display: inline-block;
  margin-left: .6rem;
  padding: .2rem .4rem;
  border-radius: 2px;
  font-size: .5625rem;
  letter-spacing: .1em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  vertical-align: 1px;
}

.explore-search {
  position: relative;
  max-width: 36rem;
  margin: 0 auto 2.5rem;
}
.explore-search label { display: block; margin-bottom: .6rem; color: var(--ink-muted); }
.explore-search input {
  width: 100%;
  min-height: 48px;
  padding: .75rem 2.75rem .75rem 2.75rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.explore-search input::placeholder { color: var(--ink-faint); }
.explore-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.explore-search input::-webkit-search-cancel-button { display: none; }
.explore-search .search-field { position: relative; }
.explore-search .search-icon {
  position: absolute;
  left: .9rem;
  top: 14px;
  width: 20px;
  height: 20px;
  color: var(--ink-faint);
  pointer-events: none;
}
.explore-search .search-clear {
  position: absolute;
  right: .4rem;
  top: 4px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  border-radius: 4px;
}
.explore-search .search-clear:hover { color: var(--ink); background: var(--paper-sunk); }
.explore-search .search-clear[hidden] { display: none; }
.explore-search-status { margin-top: .75rem; min-height: 1em; color: var(--ink-muted); }

/* Search hides rows and empties eras without touching the period filter,
   which uses the hidden attribute — the two compose. */
.tl-entry.is-search-miss,
.tl-era.is-search-empty { display: none; }

.explore-empty { text-align: center; color: var(--ink-muted); padding: 2rem 0 4rem; }
.explore-empty[hidden] { display: none; }

mark.search-hit {
  background: color-mix(in srgb, var(--gilt-hi) 55%, transparent);
  color: inherit;
  padding: 0 .1em;
  border-radius: 2px;
}

/* "Surprise me": the dice beside the search button opens a random entry */
.nav-random { color: var(--ink-muted); }
.nav-random:hover { color: var(--ink); }
