/* Urban Art Core. Paper and charcoal; the photographs supply the colour.
   Instrument Serif for display, the system sans for reading. */
@layer reset, base, layout, components, utilities, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, h4, p, figure, dl, dd, ol, ul, blockquote { margin: 0; }
  img, picture, video, iframe { display: block; max-width: 100%; height: auto; }
  button, input, select, textarea { font: inherit; color: inherit; }
  [hidden] { display: none !important; }
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-400.5eb09b5ac0e28b67c2f041c8ba6d244604ca0c0980d65912ab2d47fed84ddc31.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-400-italic.5a51946dfffa82972bc98745359c46761515641fda557c25116459a9f83da4a7.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
/* Metric-matched fallback so the swap does not shift the layout. */
@font-face { font-family: "Instrument Serif Fallback"; src: local("Georgia"), local("Times New Roman"); size-adjust: 88%; ascent-override: 98%; descent-override: 26%; }

@layer base {
  :root {
    color-scheme: light;
    --paper: #f4f0e7; --ink: #232521; --muted: #5d6057; --line: #cfcabd; --rule: #232521;
    --accent: #963d25; --wash: #ebe6da; --card: #faf7f0;
    --display: "Instrument Serif", "Instrument Serif Fallback", Georgia, serif;
    --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --step--1: clamp(.8rem, .78rem + .1vw, .875rem);
    --step-0: clamp(1rem, .96rem + .2vw, 1.125rem);
    --step-1: clamp(1.25rem, 1.15rem + .5vw, 1.6rem);
    --step-2: clamp(1.6rem, 1.35rem + 1.2vw, 2.4rem);
    --step-3: clamp(2.1rem, 1.6rem + 2.4vw, 3.6rem);
    --step-4: clamp(2.8rem, 1.9rem + 4.4vw, 6rem);
    --gutter: clamp(1rem, 4vw, 3rem);
    --measure: 68ch;
    --ease: cubic-bezier(.2, .7, .2, 1);
  }
  :root:has(.theme-switch [value=light]:checked), :root[data-theme=light] { color-scheme: light; }
  /* Dark tokens: applied by system preference or by the theme switch (no JavaScript needed). */
  :root[data-theme=dark], :root:has(.theme-switch [value=dark]:checked) {
    color-scheme: dark; --paper: #171a18; --ink: #ece8dd; --muted: #b4b9af; --line: #3d433e; --rule: #ece8dd; --accent: #efa98c; --wash: #222724; --card: #1d211f;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme=light]):not(:has(.theme-switch [value=light]:checked)) {
      color-scheme: dark; --paper: #171a18; --ink: #ece8dd; --muted: #b4b9af; --line: #3d433e; --rule: #ece8dd; --accent: #efa98c; --wash: #222724; --card: #1d211f;
    }
  }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
  body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: var(--step-0); line-height: 1.6; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
  a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
  a:hover { color: var(--accent); text-decoration-color: currentColor; }
  :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
  h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.05; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: break-word; }
  h1 { font-size: var(--step-4); }
  h2 { font-size: var(--step-3); }
  h3 { font-size: var(--step-1); line-height: 1.15; }
  em { font-style: italic; }
  p { text-wrap: pretty; }
  ::selection { color: var(--paper); background: var(--ink); }
  button, select, input, textarea { background: var(--paper); border: 1px solid var(--line); border-radius: 0; }
  button, select { min-height: 44px; padding: .55rem .8rem; cursor: pointer; }
  button:hover { border-color: var(--accent); }
  button:disabled { opacity: .5; cursor: default; }
  textarea { width: 100%; padding: .8rem; }
  dt { color: var(--muted); font-size: var(--step--1); }
  dd { overflow-wrap: anywhere; }
}

@layer layout {
  .masthead, main, .site-footer { width: min(1440px, 100% - 2 * var(--gutter)); margin-inline: auto; }
  .masthead { display: flex; align-items: center; gap: 1rem 2.5rem; flex-wrap: wrap; padding-block: 1.5rem 1.25rem; border-bottom: 1px solid var(--rule); }
  .wordmark { font-family: var(--display); font-size: 1.9rem; line-height: .85; text-decoration: none; flex-shrink: 0; }
  .wordmark > span { display: block; font-style: italic; }
  .wordmark-dot { color: var(--accent); font-style: normal; }
  .identity { font-size: .75rem; color: var(--muted); line-height: 1.35; margin-right: auto; }
  .primary-nav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; font-size: .9rem; }
  .primary-nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
  .primary-nav a:hover, .primary-nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
  main { display: block; padding-bottom: 4rem; }
  main:focus { outline: none; }
  .site-footer { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 2rem; border-top: 1px solid var(--rule); padding-block: 3rem 4rem; font-size: .9rem; }
  .site-footer p { color: var(--muted); max-width: 32ch; margin-top: .75rem; }
  .site-footer nav { display: flex; flex-direction: column; align-items: start; }
  .site-footer nav a { display: inline-flex; align-items: center; min-height: 36px; text-decoration: none; }
  .site-footer nav a:hover { text-decoration: underline; }
  .wordmark.footer-brand { font-size: 2.2rem; display: inline-block; }
  .site-footer nav .icon { margin-right: .5rem; color: var(--muted); }
  .nav-search { gap: .4rem; }
}

@layer components {
  .skip { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--paper); padding: 1rem; }
  .skip:focus { top: 1rem; }
  .visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .eyebrow { font-family: var(--sans); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--muted); line-height: 1.5; }
  .eyebrow a { text-decoration: none; }
  .eyebrow a:hover { text-decoration: underline; }
  .small { font-size: .8rem; color: var(--muted); }
  .count { font-family: var(--sans); font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0; }
  .dek { font-size: var(--step-1); line-height: 1.4; color: var(--muted); max-width: 46ch; }
  .text-link { display: inline-flex; align-items: center; gap: .35em; min-height: 44px; font-weight: 600; font-size: .95rem; }
  .section-title { font-size: var(--step-2); }
  .section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: .5rem 2rem; align-items: end; border-top: 1px solid var(--rule); padding-top: 1.25rem; margin-bottom: 2rem; }
  .section-head p { color: var(--muted); max-width: 52ch; }

  /* Theme switch: radios and :has(), so it works before and without JavaScript. */
  .theme-switch { display: inline-flex; border: 1px solid var(--line); padding: 0; margin: 0; min-inline-size: 0; }
  .theme-switch legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .theme-switch label { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 40px; padding-inline: .6rem; font-size: .78rem; cursor: pointer; }
  .theme-switch .icon { width: 1.15rem; height: 1.15rem; transition: transform 240ms var(--ease); }
  .theme-switch label:has(:checked) .icon { transform: rotate(-20deg) scale(1.08); }
  .theme-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
  .theme-switch label:has(:checked) { background: var(--ink); color: var(--paper); }
  .theme-switch label:has(:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

  /* Chips: typed tags with counts. */
  .icon { width: 1em; height: 1em; flex: none; vertical-align: -.125em; }
  .chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
  .chips li { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); padding: .3rem .65rem; border-radius: 999px; font-size: .88rem; line-height: 1.3; background: var(--card); }
  .chips a { text-decoration: none; }
  .chips li:hover { border-color: var(--accent); }

  /* Cards. The title link stretches over the card so each card has one link. */
  .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); gap: 2.5rem 1.5rem; padding: 0; list-style: none; container-type: inline-size; }
  .card { position: relative; display: flex; flex-direction: column; gap: .5rem; container-type: inline-size; }
  .card-media { order: -1; aspect-ratio: 4 / 3; overflow: hidden; background: var(--wash); margin-bottom: .35rem; }
  .card-media picture, .card-media img { width: 100%; height: 100%; }
  .card-media img { object-fit: cover; transition: transform 400ms var(--ease), filter 400ms var(--ease); }
  .card:hover .card-media img { transform: scale(1.03); }
  .card-kicker { display: flex; flex-wrap: wrap; gap: 0 .9rem; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
  .card-reason { color: var(--accent); }
  .card-title { font-size: var(--step-1); line-height: 1.12; }
  .card-title a { text-decoration: none; }
  .card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
  .card-title a:focus-visible { outline: none; }
  .card:has(.card-title a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 6px; }
  .card:hover .card-title a { color: var(--accent); }
  .card-dek { color: var(--muted); font-size: .92rem; line-height: 1.5; }
  .card .chips { position: relative; z-index: 2; margin-top: .25rem; }
  /* Cards adapt to their column, not the viewport. */
  @container (max-width: 15rem) { .card-dek { display: none; } .card-title { font-size: 1.15rem; } }
  .collection-card .card-title { font-size: var(--step-2); }
  .entity-card .card-title { font-size: var(--step-1); }
  .entity-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: 2rem 1.25rem; }
  .place-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }

  /* Homepage. */
  .home-intro { padding-block: clamp(2.5rem, 7vw, 6rem) clamp(2rem, 5vw, 4rem); }
  .home-intro h1 { font-size: clamp(3.4rem, 1.5rem + 9vw, 10rem); line-height: .88; letter-spacing: -.025em; margin-block: 1.25rem 2rem; }
  .home-intro h1 em { color: var(--accent); }
  .home-intro-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 2rem; }
  .home-stats { display: flex; gap: clamp(1.25rem, 4vw, 3.5rem); }
  .home-stats div { display: flex; flex-direction: column-reverse; }
  .home-stats dd { font-family: var(--display); font-size: var(--step-3); line-height: 1; font-variant-numeric: lining-nums; }
  .home-stats dt { text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; font-weight: 600; }
  .home-stats a { text-decoration: none; }
  .home-lead { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: end; border-top: 1px solid var(--rule); padding-top: 2rem; }
  .home-lead-media img { width: 100%; }
  .home-lead-media figcaption { margin-top: .6rem; font-size: .8rem; color: var(--muted); }
  .home-lead-copy h2 { font-size: var(--step-3); margin-block: .8rem 1rem; }
  .home-lead-copy h2 a { text-decoration: none; }
  .home-lead-copy > p { color: var(--muted); margin-bottom: 1rem; max-width: 42ch; }
  .home-section { margin-top: clamp(3.5rem, 8vw, 7rem); }
  .explore-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
  .explore-col h3 { font-size: var(--step-2); margin-bottom: 1rem; }
  .explore-col h3 a { text-decoration: none; }
  .year-strip { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 2rem; }
  .year-strip > li { border-top: 2px solid var(--rule); padding-top: .75rem; }
  .year-number { display: block; font-family: var(--display); font-size: var(--step-4); line-height: 1; text-decoration: none; }
  .year-strip ul { list-style: none; padding: 0; margin-top: 1rem; display: grid; gap: .6rem; }
  .year-strip ul a { font-size: .95rem; }

  /* Directories and term pages. */
  .intro, .directory-head, .entity-head, .collection-head, .page-head { padding-block: clamp(2.5rem, 6vw, 5rem) 2.5rem; }
  .intro h1, .directory-head h1, .entity-head h1, .collection-head h1 { margin-block: .75rem 1.25rem; }
  .directory-switch { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-top: 1.75rem; font-size: .9rem; }
  .directory-switch a { min-height: 44px; display: inline-flex; align-items: center; }
  .directory-switch a[aria-current] { color: var(--accent); font-weight: 600; text-decoration-thickness: 2px; }
  .az-nav { display: flex; flex-wrap: wrap; gap: .15rem; margin-bottom: 2rem; position: sticky; top: 0; z-index: 3; background: var(--paper); padding-block: .5rem; border-bottom: 1px solid var(--line); }
  .az-nav a { display: inline-grid; place-items: center; min-width: 2.4rem; min-height: 2.4rem; text-decoration: none; font-weight: 600; font-size: .85rem; }
  .az-nav a:hover { background: var(--ink); color: var(--paper); }
  .az-list { columns: 16rem auto; column-gap: 2.5rem; }
  .az-group { break-inside: avoid; margin-bottom: 2rem; scroll-margin-top: 4rem; }
  .az-group h3 { font-size: var(--step-2); border-bottom: 1px solid var(--line); margin-bottom: .5rem; color: var(--accent); }
  .az-group ul { list-style: none; padding: 0; }
  .az-group li { display: flex; justify-content: space-between; gap: 1rem; padding-block: .2rem; }
  .tag-groups { display: grid; gap: 3rem; }
  .tag-group { scroll-margin-top: 1rem; }
  .tag-group h2 { margin-bottom: 1rem; }
  main > section > .section-title { margin-block: 3rem 1.5rem; }
  .directory-head + section > .section-title { margin-top: 0; }
  .entity-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0 3rem; align-items: start; }
  .entity-head > :not(.entity-facts) { grid-column: 1; }
  .entity-facts { grid-column: 2; grid-row: 1 / span 4; display: grid; gap: 1.5rem; border-top: 2px solid var(--rule); padding-top: 1rem; }
  .entity-facts dl { display: grid; gap: .9rem; }
  .entity-facts dt { text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; font-weight: 600; }
  .entity-facts time { color: var(--muted); font-size: .85rem; white-space: nowrap; }
  .entity-actions { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin-top: 1rem; }
  .year-bars ol { list-style: none; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .5rem; align-items: end; height: 7rem; }
  .year-bars li { display: grid; grid-template-rows: 1fr auto auto; height: 100%; text-align: center; font-size: .72rem; }
  .year-bar { align-self: end; height: var(--n); min-height: 2px; background: var(--accent); }
  .year-label { color: var(--muted); margin-top: .3rem; }
  .year-count { font-weight: 600; font-variant-numeric: tabular-nums; }
  .companions { border-top: 1px solid var(--line); padding-block: 1.5rem 2.5rem; }

  /* Lifelines: one row per tag, one column per month. */
  .lifelines { margin-block: 3rem; container-type: inline-size; }
  .lifelines-dek { color: var(--muted); margin-top: .35rem; }
  .lifelines-rows { list-style: none; padding: 0; margin-top: 1.25rem; border-top: 1px solid var(--line); }
  .lifelines-rows li, .lifelines-axis { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr) 2.5rem; align-items: center; gap: 1rem; min-height: 2.1rem; border-bottom: 1px solid var(--line); }
  .lifeline-name { font-family: var(--display); font-size: 1.15rem; line-height: 1.1; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lifeline { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(var(--months), minmax(0, 1fr)); align-items: center; height: 1.5rem; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 4 - 1px), var(--line) calc(100% / 4 - 1px) calc(100% / 4)); }
  .lifeline-name { grid-column: 1; grid-row: 1; }
  .lifeline-count { grid-column: 3; grid-row: 1; }
  .beat { position: relative; z-index: 1; grid-row: 1; grid-column: var(--m); justify-self: center; width: calc((.3rem + var(--n) * .14rem) * var(--k, 1)); aspect-ratio: 1; border-radius: 50%; background: var(--accent); }
  .lifelines-rows li:hover .beat, .lifelines-rows li:focus-within .beat { background: var(--ink); }
  /* Crossings (tag pages): the tag's own line, then each companion's. */
  .crossings { margin-block: 1rem 3rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
  .crossings .is-focus { border-bottom-color: var(--ink); }
  .crossings .is-focus .lifeline-name { font-size: 1.35rem; }
  .crossings .is-focus .beat { background: var(--ink); }
  .beat.is-other { --k: .75; background: transparent; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--muted) 70%, transparent); }
  .lifelines-rows li:hover .beat.is-other, .lifelines-rows li:focus-within .beat.is-other { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
  .lifelines-key { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .75rem; color: var(--muted); }
  .key-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--accent); }
  .key-dot.is-other { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); margin-left: .75rem; }
  /* Rows draw themselves as they scroll in: each month's dot pops after the
     one before, left to right. Scroll-driven, so no JavaScript and no timers. */
  @media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
      /* Row r of N draws while the list's entry is between r/N and (r+1)/N,
         that is while the row itself scrolls into view; a row already on
         screen is already drawn. */
      .lifelines-rows { view-timeline: --rows block; }
      .beat { animation: beat-in linear both; animation-timeline: --rows; animation-range: entry calc((var(--row) + .75 * var(--m) / var(--months)) / var(--count) * 100%) entry calc((var(--row) + .75 * var(--m) / var(--months) + .25) / var(--count) * 100%); }
      .lifelines-rows li::after { content: ""; grid-column: 2; grid-row: 1; height: 1px; align-self: center; background: color-mix(in srgb, var(--ink) 22%, transparent); transform-origin: 0 50%; animation: line-in linear both; animation-timeline: --rows; animation-range: entry calc(var(--row) / var(--count) * 100%) entry calc((var(--row) + 1) / var(--count) * 100%); pointer-events: none; }
    }
  }
  @keyframes beat-in { from { scale: 0; opacity: 0; } 70% { scale: 1.35; opacity: 1; } to { scale: 1; opacity: 1; } }
  @keyframes line-in { from { scale: 0 1; } to { scale: 1 1; } }
  .lifelines-rows li:hover .lifeline-name { color: var(--accent); }
  .lifeline-count { text-align: right; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
  .lifelines-axis { margin-top: .4rem; font-size: .72rem; letter-spacing: .08em; color: var(--muted); }
  .lifelines-years { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
  @container (max-width: 560px) {
    .lifelines-rows li { grid-template-columns: minmax(0, 1fr) 2rem; gap: 0 .5rem; padding-block: .35rem; }
    .lifeline { grid-column: 1 / -1; grid-row: 2; }
    .lifelines-axis { grid-template-columns: 0 minmax(0, 1fr) 2rem; gap: 0 .5rem; }
    .beat { width: calc((.2rem + var(--n) * .1rem) * var(--k, 1)); }
    .lifeline-count { grid-column: 2; }
    .lifelines-rows li::after { grid-column: 1 / -1; grid-row: 2; }
  }

  /* Bar index: every tag once, A–Z, with a bar for how much was written. */
  .bar-index { list-style: none; padding: 0; margin-top: 1rem; columns: 15rem auto; column-gap: 2rem; }
  .bar-index li { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; padding-block: .3rem .45rem; break-inside: avoid; }
  .bar-index li::after { content: ""; position: absolute; left: 0; bottom: .15rem; height: 2px; width: var(--p); background: color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 2px; }
  .bar-index a { text-decoration: none; }
  .bar-index a:hover { text-decoration: underline; }
  .bar-index .count { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
  .tag-group .section-title { display: flex; align-items: center; gap: .5rem; }
  .tag-group .entity-type-icon .icon { width: 1.4rem; height: 1.4rem; }


  .companions dl, .post-entities dl { display: grid; gap: 1rem; margin-top: 1rem; }
  .companions dl > div, .post-entities dl > div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1rem; align-items: baseline; }
  .companions dt, .post-entities dt { text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; font-weight: 600; }
  .entity-posts h2 { font-size: var(--step-2); border-top: 1px solid var(--rule); padding-top: 1rem; margin-bottom: 2rem; }

  /* Collections. */
  .collection-head { max-width: 60rem; }
  .collection-intro { margin-block: 1.5rem; max-width: var(--measure); }
  .route { list-style: none; padding: 0; counter-reset: stop; }
  .route-stop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.5rem clamp(1.5rem, 4vw, 4rem); padding-block: 2.5rem; border-top: 1px solid var(--line); align-items: center; }
  .route-stop:nth-child(even) .route-media { order: 2; }
  .route-media { background: var(--wash); }
  .route-media img { width: 100%; }
  .route-number { font-family: var(--display); font-size: 3rem; line-height: 1; color: var(--accent); letter-spacing: 0; margin-right: .5rem; vertical-align: middle; text-transform: none; }
  .route-copy h2 { font-size: var(--step-3); margin-block: .75rem 1rem; }
  .route-copy h2 a { text-decoration: none; }
  .route-note { font-size: var(--step-1); line-height: 1.4; color: var(--muted); max-width: 40ch; }
  .more-collections { margin-top: 4rem; }
  .more-collections .section-title { border-top: 1px solid var(--rule); padding-top: 1rem; margin-bottom: 2rem; }

  /* Posts. */
  .post, .page { max-width: 1080px; margin-inline: auto; }
  .post-head, .page-head { max-width: 860px; padding-block: clamp(2.5rem, 6vw, 4.5rem) 2rem; }
  .post-head h1 { font-size: clamp(2.5rem, 1.6rem + 3.8vw, 5rem); line-height: 1; margin-block: 1rem 1.25rem; view-transition-name: post-title; }
  .post-head .dek { margin-bottom: 1.5rem; max-width: 52ch; }
  .post-meta { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .9rem; }
  .post-meta > :first-child { color: var(--ink); font-weight: 600; }
  .post-hero { margin-bottom: 3rem; }
  .post-hero picture { max-width: min(100%, var(--image-width, 100%) * 1.25); }
  .post-hero img { width: auto; max-height: 85svh; margin-inline: auto; }
  .post-hero figcaption, .post-content figcaption { margin-top: .6rem; font-size: .82rem; color: var(--muted); line-height: 1.5; }
  .prose { font-size: clamp(1.06rem, 1rem + .2vw, 1.18rem); line-height: 1.75; }
  .prose > * { max-width: var(--measure); margin-inline: auto; }
  .prose > * + * { margin-top: 1.25em; }
  .prose h2, .prose h3, .prose h4 { margin-top: 2em; }
  .prose h2 { font-size: var(--step-2); }
  .prose h3 { font-size: var(--step-1); }
  .prose blockquote { border-left: 2px solid var(--accent); padding-left: 1.25rem; color: var(--muted); }
  .prose ul, .prose ol { padding-left: 1.3em; }
  .prose li + li { margin-top: .4em; }
  .prose table { display: block; overflow-x: auto; border-collapse: collapse; }
  .prose th, .prose td { border: 1px solid var(--line); padding: .5rem; }
  .prose pre { overflow-x: auto; padding: 1rem; background: var(--wash); }
  .prose, .prose a { overflow-wrap: anywhere; }
  .prose > figure, .prose > .archive-figure, .prose > .report-gallery, .prose > .external-video { max-width: 100%; }
  .post-content { display: flow-root; }
  .post-content figure { margin-block: 2.5rem; }
  .post-content picture { max-width: min(100%, var(--image-width, 100%) * 1.25); margin-inline: auto; }
  /* Definite width and ratio before decode: no layout shift as images load. */
  .post-content figure img { width: var(--image-width, auto); max-width: 100%; max-height: 85svh; aspect-ratio: var(--image-ratio, auto); object-fit: contain; height: auto; margin-inline: auto; }
  .figure-open { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; min-height: 0; cursor: zoom-in; }
  .figure-open:hover { border: 0; }
  .post-content figcaption { max-width: var(--measure); margin-inline: auto; text-align: center; }
  .archive-figure { min-width: 0; }
  .archive-figure figcaption [data-gallery] { display: inline-flex; align-items: center; min-height: 44px; }
  .report-gallery { margin-block: 3rem; }
  .gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 2rem 1.5rem; align-items: start; }
  .gallery-grid figure { margin: 0; }
  .section-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; border-top: 1px solid var(--line); padding-block: 1.25rem; }
  .section-heading h2 { font-size: var(--step-2); }
  .section-heading p { color: var(--muted); font-size: .85rem; }
  .post-foot { max-width: var(--measure); margin: 3rem auto 0; display: grid; gap: 1.5rem; }
  .post-entities { border-top: 1px solid var(--rule); padding-top: 1rem; }
  .post-entities dt, .companions dt { display: inline-flex; align-items: center; gap: .45rem; }
  .post-entities dt .icon, .entity-type-icon { color: var(--accent); }
  .entity-type-icon { display: inline-flex; vertical-align: -.2em; }
  .entity-type-icon .icon, .post-entities dt .icon { width: 1rem; height: 1rem; }
  .share ul { list-style: none; padding: 0; margin-top: .75rem; display: flex; flex-wrap: wrap; gap: .5rem; }
  .share a, .share button { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: .85rem; text-decoration: none; cursor: pointer; transition: border-color 160ms var(--ease), color 160ms var(--ease); }
  .share a:hover, .share button:hover { border-color: var(--accent); color: var(--accent); }
  .share .icon { width: 1.05rem; height: 1.05rem; }
  .post-formats { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
  .post-formats a { min-height: 36px; display: inline-flex; align-items: center; }

  /* Read next: collections, threads, related, same month, adjacent. */
  .read-next { max-width: 1080px; margin: 4rem auto 0; display: grid; gap: 3rem; }
  .read-next > section > h2.eyebrow { margin-bottom: 1.25rem; }
  .in-collection { background: var(--wash); padding: 1.5rem clamp(1.25rem, 3vw, 2rem); border-left: 3px solid var(--accent); }
  .in-collection h3 { font-size: var(--step-2); margin-block: .4rem .6rem; }
  .in-collection h3 a { text-decoration: none; }
  .trails { display: grid; gap: 1rem; }
  .trail { border-top: 1px solid var(--rule); padding-top: 1rem; display: grid; gap: .8rem; }
  .trail-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; }
  .trail-head a { font-family: var(--display); font-size: var(--step-2); text-decoration: none; line-height: 1; }
  .trail-head span { color: var(--muted); font-size: .85rem; }
  .trail-steps { list-style: none; padding: 0; display: flex; gap: 3px; height: 6px; }
  .trail-steps li { flex: 1; background: var(--line); }
  .trail-steps li.here { background: var(--accent); }
  .trail-nav, .adjacent { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2rem; }
  .trail-nav a, .adjacent a { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; padding-block: .4rem; line-height: 1.3; }
  .trail-nav a span, .adjacent a span { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
  .trail-nav a:hover, .adjacent a:hover { color: var(--accent); }
  .trail-nav [href]:only-child:not(:first-child), .adjacent a[rel=next]:only-child { grid-column: 2; text-align: right; }
  .trail-nav a + a, .adjacent a + a { text-align: right; }
  .same-month ul { columns: 18rem auto; column-gap: 2rem; padding-left: 1.1em; }
  .same-month li { break-inside: avoid; padding-block: .2rem; }
  .same-month p { margin-top: .75rem; }
  .adjacent { border-top: 1px solid var(--rule); padding-top: 1rem; }

  /* Lists and pagination. */
  .archive-list { margin-top: 1rem; }
  .browse-line { display: flex; flex-wrap: wrap; gap: .5rem 2rem; border-top: 1px solid var(--line); padding-block: 1.5rem; margin-top: 3rem; align-items: center; }
  .browse-line a { min-height: 44px; display: inline-flex; align-items: center; }
  .topic-directory { padding: 0; }

  /* Media and embeds. */
  .external-video { padding: 1.5rem; margin-block: 2rem; border: 1px solid var(--line); font-size: .95rem; background: var(--card); }
  .video-player iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; margin-top: 1rem; }
  .media-unavailable, .media-animation-notice { display: block; padding: 1rem; border: 1px dashed var(--line); font-size: .9rem; color: var(--muted); }
  .media-animation-notice { border: 0; padding: .5rem 0 0; }

  /* Lightbox. */
  /* Fixed size: a photograph that loads late appears in place and moves nothing. */
  dialog { color: var(--ink); background: var(--paper); border: 0; padding: 1rem; width: min(1200px, 96vw); height: 96dvh; max-height: 96dvh; }
  dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
  dialog figure { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; margin: 0; }
  dialog figure picture { display: contents; }
  #image-error { position: absolute; inset: 0 0 auto; margin: 0; padding-top: 30%; text-align: center; color: var(--muted); pointer-events: none; }
  dialog::backdrop { background: rgb(10 12 11 / .88); backdrop-filter: blur(4px); }
  .dialog-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .75rem; }
  #image-count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; }
  #close-gallery { margin-left: auto; }
  dialog figure img { grid-row: 1; width: 100%; height: 100%; max-height: none; object-fit: contain; aspect-ratio: auto !important; }
  dialog figcaption { grid-row: 2; margin-top: .75rem; font-size: .85rem; text-align: center; }
}

@layer utilities {
  .page-head h1 { font-size: var(--step-4); }
}

@layer responsive {
  @media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
    ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 160ms; }
    a, button { transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease; }
    dialog[open] { animation: fade-in 180ms var(--ease); }
    @keyframes fade-in { from { opacity: 0; transform: scale(.985); } }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
    .card:hover .card-media img { transform: none; }
  }
  @media (max-width: 1100px) {
    .identity { display: none; }
    .explore-grid { grid-template-columns: 1fr 1fr; }
    .site-footer { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 760px) {
    .masthead { gap: .5rem 1rem; padding-block: 1rem .75rem; }
    .wordmark { font-size: 1.6rem; margin-right: auto; }
    .primary-nav { order: 3; width: 100%; justify-content: space-between; gap: 0 .75rem; font-size: .85rem; }
    .theme-switch label { padding-inline: .45rem; min-height: 40px; min-width: 40px; font-size: .72rem; }
    .section-head, .home-lead, .entity-head, .route-stop { grid-template-columns: minmax(0, 1fr); }
    .entity-facts { grid-column: 1; grid-row: auto; margin-top: 1.5rem; }
    .route-stop:nth-child(even) .route-media { order: 0; }
    .explore-grid, .site-footer { grid-template-columns: 1fr; }
    .companions dl > div, .post-entities dl > div { grid-template-columns: 1fr; gap: .4rem; }
    .trail-nav, .adjacent { grid-template-columns: 1fr; }
    .trail-nav a + a, .adjacent a + a, .adjacent a[rel=next]:only-child, .trail-nav [href]:only-child:not(:first-child) { text-align: left; grid-column: auto; }
    .home-stats dd { font-size: var(--step-2); }
    .section-heading { display: block; }
  }
  @media print {
    :root { color-scheme: light; --paper: white; --ink: black; --muted: #333; --line: #888; --accent: black; --wash: white; --card: white; }
    .masthead nav, .theme-switch, .site-footer, dialog, .read-next, .skip, .post-formats { display: none; }
    main { width: 100%; }
    figure { break-inside: avoid; }
    a { color: black; }
  }
}
