/* /media — black photo wall. Chrome is the live nav's type, nothing else.
   #nav a: 13px / 600 / 0.14em, idle #c8c8d2, active #fff.
   Tokens only: --ink, --ink-body, --ink-dim, #c8c8d2, #fff, #000, #141416,
   hairline rgba(255,255,255,.16) / .55.
   No backdrop-filter on filters or tiles. No glass rim on a still. */

:root {
  color-scheme: dark;
  /* The tile hover/tap strip (.veil) is the SAME frost as the crescent menu: these are
     aliases of the shared tokens in menu.css (the one definition, used by home too), not
     values of their own. */
  --glass-tint: var(--glass-menu);
  --glass-blur: var(--glass-menu-blur);
  --glass-rim: var(--glass-menu-rim);
  --ink: #f3f3f7;
  --ink-body: #d8d8e2;
  --ink-dim: #b4b4c0;
  --btn-bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
  /* House-light's own band under a page: styles.css :root --btn-zone. */
  --btn-zone: calc(max(20px, env(safe-area-inset-bottom)) + 60px);
  /* House-light's first line sits 28px under the clock: .panel-inner
     padding-top is max(64px, safe-area + 44px). The filter labels are 44px
     boxes with centred 13px type (~15px above the glyphs), so the box starts
     at max(48px, safe-area + 28px). Sticky header = that + one filter row. */
  --bar-top: max(48px, calc(env(safe-area-inset-top) + 28px));
  --bar-h: calc(var(--bar-top) + 44px + 8px);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #000;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;            /* as home (styles.css html, body): no bounce, no scroll chaining */
}

body {
  height: 100svh;
  overflow: hidden;
}

:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 2px;
}
/* The crescent menu is the site's menu: its rows get the browser's own focus ring,
   exactly as on home (which has no custom outline for #nav), not Media's white box. */
#nav a:focus-visible,
#nav button:focus-visible {
  outline: revert;
  outline-offset: revert;
}
/* styles.css: kill mobile double-tap zoom on the controls (same selector list, as on home) */
button, a, .glass-btn, #nav {
  touch-action: manipulation;
}

/* The page does not scroll; `main` does, and it is FULL-BLEED like home's film: the
   crescent and speaker float over it with no band behind them. (It used to stop above
   a --btn-zone band, which showed up under the open menu glass as a flat dark bar
   holding the two controls - nothing like home, where they float over the picture.)
   The wall runs edge to edge: no side padding on main. Only the filter bar carries
   margins, so labels clear the notch and the page edge. The last row scrolls clear of
   the controls through the collage's bottom padding. */
main {
  height: 100svh;
  overflow-y: auto;
  overscroll-behavior: none;            /* main IS the scroller here, so it needs it too */
  padding: 0;
  background: #000;
}
.collage { padding-bottom: var(--btn-zone); }

/* Same soft scrim as home (styles.css "FLOATING CONTROLS" main::after): 35% black to
   clear over 120px + the safe area, so the white glyphs read over a bright tile. A
   gradient, never a hard band; it fades out while the menu is open. */
body::after {
  content: "";
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(120px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0));
  z-index: 39;
  pointer-events: none;
  transition: opacity 300ms ease;
}
body.menu-open::after { opacity: 0; }

/* The bottom band under Safari's toolbar (menu.css "THE BOTTOM BAND"). This page carries
   body.panel-open permanently (it opts into the shared menu's page rules), which on home means "a
   pane frosts the band" - but the wall has no #overlay, so here the band keeps menu.css's strip
   whenever the menu is closed; the open menu's own glass takes it over. Higher specificity than
   menu.css's body.panel-open rule, same tokens. */
@supports (height: 100dvh) and ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html body.panel-open:not(.menu-open):not(.viewer-open)::before {
    background: var(--glass-menu);
    backdrop-filter: var(--glass-menu-blur);
    -webkit-backdrop-filter: var(--glass-menu-blur);
  }
}

.bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  margin: 0;
  /* top padding clears the clock (painted by the fixed #nav); 24px sides are
     house-light's .panel-inner measure */
  padding: var(--bar-top) max(24px, env(safe-area-inset-right)) 8px max(24px, env(safe-area-inset-left));
  background: #000;
}

/* The page name is for screen readers only. Home is the clock, top-left. */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* First label sits on the page margin, not 12px in from it. */
.filters li:first-child button { padding-left: 0; }

.filters button {
  appearance: none;
  cursor: pointer;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  min-height: 44px;
  padding: 0 12px;
  color: #c8c8d2;
  /* .6 (was .55): #c8c8d2 at .6 over black is about 4.8:1, past the 4.5:1 AA bar for
     this small text; the look barely moves */
  opacity: 0.6;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  letter-spacing: 0.14em;
}

.filters button[aria-selected="true"] {
  color: #fff;
  opacity: 1;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.filters sup {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-dim);
  margin-left: 4px;
  vertical-align: super;
}

.empty {
  margin: 18vh 0 0;
  padding: 0 max(24px, env(safe-area-inset-left));
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #c8c8d2;
}

/* Masonry wall, X-feed scale. media.js builds N columns (2 under 700px, 3 up to
   1799px, 4 beyond) and drops each tile into the shortest one, so reading order
   stays earliest-first across the top and no column is a football field. Tiles
   keep their photo's own aspect ratio (no crop, no stretch): about 478px wide at
   1440, 194px at 390. Black gutter is 2px. */
.collage {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  background: #000;
}

.col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tile { position: relative; min-width: 0; width: 100%; background: #000; }

/* A source too small for its column (media.js fitTile): the tile is held to 1.1x
   the photo's own pixels and centred on the black, never stretched to fill. */
.col > .tile.capped:not(.slot) {
  align-self: center;
  max-width: var(--cap);
}

.shot {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000;
  cursor: pointer;
  /* the photo's own shape; media.js sets the real ratio once the image loads */
  aspect-ratio: 3 / 4;
}

.shot img,
.shot video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  border-radius: 0;
}

/* Invisible until media.js has passed it through the 1.1x check, so a source that
   is too small for its tile is never painted upscaled (not even for the frames a
   full-photo swap takes to load). */
.shot img { opacity: 0; }
.shot img.ready { opacity: 1; transition: opacity 120ms ease, scale 380ms ease; }

/* ---- REVEAL (motion batch 1) -------------------------------------------------
   The existing "ready" moment (the picture has passed the 1.1x check) is the animation: the
   photo rises ~12px out of a light blur while it fades up. Only opacity, translate and filter -
   the tile's own box, the masonry and the column heights are never touched, so nothing jumps.
   `translate` / `scale` are the individual transform properties, so they compose with the
   .capped slot's centring `transform` instead of replacing it.
   NEVER LEAVES A TILE INVISIBLE: the hidden-until-ready opacity:0 above is the old behaviour,
   and the extra start pose (offset + blur) only exists while the image is neither .ready nor
   already shown once ([data-shown]); the moment media.js adds .ready the pose resolves to
   identity. A swap preview -> full photo (ready removed and re-added) skips the pose and the
   stagger, exactly as before. Reduced motion: no pose, no stagger, the plain 120ms fade. */
.shot { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .shot img:not(.ready):not([data-shown]) {
    translate: 0 12px;
    filter: blur(6px);
  }
  .shot img.ready[data-reveal] {
    transition:
      opacity 560ms ease var(--rv-d, 0ms),
      translate 560ms cubic-bezier(0.2, 0.7, 0.2, 1) var(--rv-d, 0ms),
      filter 560ms ease var(--rv-d, 0ms),
      scale 380ms ease;
  }
}

/* ---- HOVER (motion batch 1): a 2% push-in on the photo, nothing else moves. The frost caption
   (.veil) is the hover design and keeps its own tint/blur untouched; no lift, no shadow, no
   change to the tile's box. Pointer devices only; touch and keyboard get the caption (is-open /
   :focus-visible) without the scale. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .tile:hover .shot img.ready { scale: 1.02; }
}

/* Ratio unknown at placement: the tile keeps its 3:4 slot for the visit and the
   photo sits inside it on black, whole, never cropped or stretched. */
.tile.slot .shot img { object-fit: contain; }
.tile.slot.capped .shot img {
  inset: auto;
  top: 50%;
  left: 50%;
  width: var(--cap-w);
  height: auto;
  max-width: 100%;
  max-height: 100%;
  transform: translate(-50%, -50%);
}

/* Play glyph on a video tile: a flat dark disc with a white triangle, the way
   X marks a video. No blur and no rim, so the photo is not framed; it sits
   under the hover veil, which frosts it along with the picture. */
.play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  margin: -9px 0 0 -6px;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
}

/* The frosted glass is a strip along the bottom of the tile (author, label/place,
   link), not a wash over the whole photo: at this scale a full-tile blur would
   crush the picture it is meant to caption. Same material as the menu glass. */
.veil {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: transparent;
  color: #fff;
  /* eases in and out (visibility flips after the fade-out) instead of snapping */
  transition: opacity 180ms ease, visibility 0s linear 180ms;
}
/* When the strip shows:
   - touch: only after the first tap (.is-open); never from the sticky :hover a tap leaves behind
   - mouse: while the pointer is over the tile (and only on hover-capable devices)
   - keyboard: focus-VISIBLE only; plain :focus-within kept the strip pinned open after
     every mouse click, because the clicked button stays focused. */
.tile.is-open .veil,
.tile:has(:focus-visible) .veil {
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease, visibility 0s linear 0s;
  pointer-events: none;
  background: var(--glass-tint);
  box-shadow: var(--glass-rim);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
@media (hover: hover) and (pointer: fine) {
  .tile:hover .veil {
    opacity: 1;
    visibility: visible;
    transition: opacity 180ms ease, visibility 0s linear 0s;
    pointer-events: none;
    background: var(--glass-tint);
    box-shadow: var(--glass-rim);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
  }
}
.veil a { pointer-events: auto; }
.by {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #fff;
}
/* Who posted it, and (stickers) where. Lives only in the hover/focus/first-tap
   glass above; nothing is ever drawn under a tile. */
.who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.at {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  /* a post's text can run long; the strip keeps to three lines */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* Press / X Articles: resting card matches the X Article preview — cover on top,
   solid black band under it with title + the post's own words. Hover frost stays on
   the cover (.shot) only. No numbers, no generated text. */
.tile[data-type="press"] {
  display: flex;
  flex-direction: column;
  background: #000;
}
.tile[data-type="press"] .shot {
  flex: 0 0 auto;
  width: 100%;
}
/* cover button + its frost strip as siblings (a link must never sit inside a button) */
.tile[data-type="press"] .cv {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  overflow: hidden;
}
.tile[data-type="press"] .veil {
  /* frost strip on the cover only (veil is appended inside .shot for press) */
  z-index: 2;
}
.tile[data-type="press"] .at {
  font-size: 15px;
  line-height: 1.4;
  -webkit-line-clamp: 6;
  line-clamp: 6;
}
.tile[data-type="press"] .by { font-size: 14px; }
.pr {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  padding: 10px 12px 12px;
  pointer-events: auto;
  cursor: pointer;
  color: #fff;
  background: #000;
  /* not menu frost — X card text sits on solid black under the cover */
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.pr p { margin: 0; }
.pr-t {
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.pr-at {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 400;
  color: #e7e9ea;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  white-space: pre-line;
}
/* resting text band stays; cover frost does not hide it */
.tile.is-open .pr,
.tile:has(:focus-visible) .pr { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover .pr { opacity: 1; }
}

/* The link that leaves the wall: "POST ↗" opens the creator's status on X (media.js),
   "MAP ↗" opens a sticker's pin. Labelled, so it is never an unexplained arrow. */
.out {
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  white-space: nowrap;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.out::after { content: " \2197"; }

/* Dim the others only while a tile is actually under the pointer. Keyed on the
   tile, not the grid, so crossing a 2px gutter does not flash the whole wall. */
@media (hover: hover) and (pointer: fine) {
  .collage:has(.tile:hover) .tile:not(:hover) { opacity: 0.45; }
  .tile { transition: opacity 300ms ease; }
}

@media (max-width: 559px) {
  .filters sup { display: none; }
}

@media (max-width: 699px) {
  /* ONE row for all five labels, never wrapped, never scrolled (owner: STICKERS
     alone on a second line is the stack he hates). Recalibrated for ARTICLES
     (was PRESS): tighter type/tracking so ALL…STICKERS still fit the 24px-inset
     measure at 390/360/320 without clipping. Counts hide below 560px. */
  .filters {
    flex-wrap: nowrap;
    width: 100%;
    justify-content: space-between;
  }
  .filters button {
    padding: 0 clamp(3px, 1.4vw, 10px);
    font-size: clamp(9.5px, 2.65vw, 12px);
    letter-spacing: 0.04em;
    white-space: nowrap;
  }
  .filters li:last-child button { padding-right: 0; }
}

/* Crescent (bottom centre) and volume (bottom right): the house-light floating
   controls, ported from styles.css "MAIN-SCREEN BUTTONS, MINIMAL" + "SPEAKER
   MATCHES THE CRESCENT". No disc, no fill, no rim: a solid white glyph with a
   hard small shadow, 48px target. With the menu open both glyphs fade to ink
   #141416 together (300ms colour ease). Muted = struck speaker, dimmed to 0.6.
   They float over the wall like home's controls float over the film. */
.glass-btn {
  position: fixed;
  bottom: var(--btn-bottom);
  z-index: 40;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 0;
  border-radius: 50%;
  background: none;
  box-shadow: none;
  color: #fff;
  transition: color 300ms ease;
}
.glass-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
#menu-btn {
  left: 50%;
  transform: translateX(-50%);
  padding: 10px;
}
#menu-btn svg path { fill: currentColor; }
#sound-btn {
  right: max(20px, env(safe-area-inset-right));
  padding: 12px;
}
.glass-btn svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.6));
  transition: transform 140ms cubic-bezier(0.16, 1, 0.3, 1), opacity 300ms ease, filter 300ms ease;
}
.glass-btn:active svg { transform: scale(0.88); }
#sound-btn[aria-pressed="false"] svg { opacity: 0.6; }
/* Menu open = dark grey, both icons, exactly as the site does it (styles.css "Open
   state = dark grey"): the same white -> #6e6e73 fade over 300ms, the drop shadow
   dropped, no extra treatment. Owner rule: main-screen crescent and mute icons fade
   white <-> dark grey the same way on every page. */
body.menu-open .glass-btn { color: #6e6e73; }
body.menu-open .glass-btn svg { filter: none; }
body.menu-open #menu-btn:active svg { transform: none; }
/* State is the icon: muted when off, waves when on. Never a [hidden] attribute,
   which the page-wide [hidden] rule would force to display:none for good. */
#sound-btn[aria-pressed="true"] #icon-muted { display: none; }
#sound-btn[aria-pressed="false"] #icon-sound { display: none; }
/* SPEAKER GLYPH CROSSFADE (motion batch 1): the two glyphs share one cell and swap by opacity
   over 180ms instead of a hard display flip. Same colours as always (currentColor, the
   white <-> #6e6e73 menu fade, muted at .6); the crescent is not touched. Declared after the
   display rules above, with the same specificity, so these win. */
#sound-btn:not([hidden]) { display: grid; grid-template: 100% / 100%; }
#sound-btn svg { grid-area: 1 / 1; transition: transform 140ms cubic-bezier(0.16, 1, 0.3, 1), opacity 180ms ease, filter 300ms ease; }
#sound-btn[aria-pressed="true"] #icon-muted,
#sound-btn[aria-pressed="false"] #icon-sound { display: block; opacity: 0; }
#sound-btn[aria-pressed="true"] #icon-sound { opacity: 1; }
#sound-btn[aria-pressed="false"] #icon-muted { opacity: 0.6; }

/* THE CRESCENT MENU (glass, nav, clock, links, page-state rules, STICKERS gap) is NOT
   defined here: it is menu.css, the same file the home page loads. This page opts in with
   <body class="panel-open"> and shares the markup contract and menu.js. */

/* Embedded in the home page's MEDIA panel (?embed=1, html.embed from resume-gate.js): the home
   page's crescent, clock, speaker and glass are the ones on screen, so this page's copies are
   removed rather than stacked under them. !important because menu.css states these ids. */
html.embed #menu-btn,
html.embed #sound-btn,
html.embed #nav { display: none !important; }
/* The menu glass is the home page's too - except behind an open item PREVIEW: the viewer sits inside
   this frame, so its frost (menu.css "THE MEDIA PREVIEW'S FROST", body.viewer-open) has to be the
   frame's own pane, over the wall, under the picture. Only then; never for the menu. */
html.embed body:not(.viewer-open) #menu-glass { display: none !important; }

/* LOADING: static near-black placeholder tiles, one set per column, in the wall's own columns so
   nothing shifts when the real tiles replace them. No shimmer, no pulse, no animation of any kind. */
.ph { width: 100%; aspect-ratio: 3 / 4; background: #0b0b0e; }
.col .ph:nth-child(2) { aspect-ratio: 4 / 5; }
.col:nth-child(2) .ph:first-child { aspect-ratio: 1 / 1; }
.col:nth-child(3) .ph:nth-child(2) { aspect-ratio: 3 / 4; }

/* FAILED: the retry sits in the sentence, same type as the message around it */
.empty .retry {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  min-height: 44px;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.empty .retry:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* SKIP LINK: first tab stop, invisible until focused, then a plain black pill. Not shown when
   embedded (the home page has its own). */
.skip:not(:focus) {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 100;
  padding: 12px 16px;
  background: #000;
  color: #fff;
  border: 1px solid #fff;
  font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  letter-spacing: 0.14em;
  text-decoration: none;
}
html.embed .skip { display: none !important; }
#collage:focus { outline: none; }

/* VIEWER FLIGHT (media.js "THE VIEWER MOVES WITH THE POST"): the ghost is a fixed copy of the
   tile's picture whose TRANSFORM alone is animated (never a layout property); it sits above the
   viewer (30) and below the site's buttons (40). While it stands in for the real picture the
   figure is hidden, and the tile's own picture is hidden so the post is never shown twice. */
.fly {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 31;
  margin: 0;
  object-fit: cover;
  background: #000;
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform;
}
#light.flying figure { visibility: hidden; }
.tile.lifted .shot img { visibility: hidden; }

#light {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #000;
  display: flex;
  flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

/* The preview's backdrop is the menu's frost (menu.css "THE MEDIA PREVIEW'S FROST"), not opaque black:
   with body.viewer-open (set by media.js, standalone only) the box itself is clear and #menu-glass
   shows the wall through it. Embedded, the class is never set and the viewer stays black as before. */
body.viewer-open #light { background: transparent; }

#light-x {
  align-self: flex-start;
  appearance: none;
  border: 0;
  background: none;
  color: #c8c8d2;
  min-height: 44px;
  padding: 0;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  letter-spacing: 0.14em;
  cursor: pointer;
}

#light figure {
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

#light img,
#light video {
  display: block;
  max-width: 100%;
  max-height: calc(100svh - 140px);
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  background: #000;
}

#light-cap {
  margin: 12px 0 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

/* On-site reader (Press / X Articles): a modal page of plain black type, scrolling inside
   itself. Same chrome as the viewer (CLOSE top-left). All text is textContent. */
#reader {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #000;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}

/* THE ROOM (v0): the post's cover is fixed full-bleed behind the page; the sheet of text
   scrolls up over it, so the cover holds still while the words slide across (the parallax).
   No JS scroll handler, no layout animation. The cover is decoration (aria-hidden). */
#reader-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
  pointer-events: none;
}
/* FIRST PAINT = ONE FULL-BLEED SCENE. The sheet starts at the top, and its first block
   (.rd-scene) is a whole screen tall with ARTICLE / title / source resting low on the cover.
   The sheet has no edge: its background is a soft scrim that is clear over the artwork, warms
   toward the title for legibility, then settles to black as you scroll into the words. The
   rest of the content follows in normal flow. (CLOSE is 56px of the flow above it, so the
   scene is 100svh minus that.) */
#reader-sheet {
  position: relative;
  z-index: 1;
  min-height: 120vh;
  min-height: 120svh;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 40vh, rgba(0, 0, 0, 0.62) 88vh, #000 125vh);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 40svh, rgba(0, 0, 0, 0.62) 88svh, #000 125svh);
  padding: 0 max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
#reader .rd-scene {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: calc(100vh - 56px);
  min-height: calc(100svh - 56px);
  padding-bottom: 36px;
}

/* TWO STAGES. THRESHOLD (what you arrive at): exactly one screen - the place and its title, a
   quiet ENTER; nothing else is shown and nothing scrolls. ROOM (after ENTER or a tap on the
   picture): the title moves up as the header, the picture is held back and dimmed, and the post's
   own words and the text fill the page beneath. The composition changes; it is not a longer page. */
#reader[data-stage="threshold"] { overflow: hidden; }
#reader[data-stage="threshold"] #reader-sheet { min-height: 0; }
#reader[data-stage="threshold"] #reader-body > :not(.rd-scene) { display: none; }
#reader[data-stage="room"] .rd-enter { display: none; }
#reader[data-stage="room"] .rd-scene {
  min-height: 0;
  justify-content: flex-start;
  padding: 9vh 0 14px;
  padding: 9svh 0 14px;
}
/* in the room the title is only a plaque; the monument below is the giant version of it */
#reader[data-stage="room"] .rd-title {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  text-shadow: none;
}
#reader[data-stage="room"] #reader-body { max-width: none; }
#reader[data-stage="room"] #reader-body > :not(.wa) { max-width: 640px; margin-left: auto; margin-right: auto; }
#reader[data-stage="room"] #reader-sheet {
  min-height: 100vh;
  min-height: 100svh;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.5) 24vh, rgba(0, 0, 0, 0.86) 46vh, #000 70vh);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.5) 24svh, rgba(0, 0, 0, 0.86) 46svh, #000 70svh);
}
#reader[data-stage="room"] #reader-stage { opacity: 0.55; scale: 1.06; }

/* READ: the room is off. A normal document on solid black - no fixed backdrop, no clear-to-black
   scrim, no parallax. The cover is one in-flow picture (.rd-pic) under the title; words never sit
   on artwork. Generous bottom padding keeps the last lines and READ ON X clear of the crescent and
   mute buttons that overlay the page. */
#reader[data-stage="read"] #reader-stage { display: none; }
#reader[data-stage="read"] #reader-sheet {
  min-height: 0;
  background: #000;
  padding-bottom: calc(max(28px, env(safe-area-inset-bottom)) + 120px);
}
#reader[data-stage="read"] .rd-title { text-shadow: none; }
#reader .rd-pic {
  display: block;
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
  margin: 0 0 24px;
  background: #000;
}

/* ENTER: one quiet word under the title. A plain control (no pulse, no glow). */
/* ENTER and LISTEN sit side by side under the title */
#reader .rd-acts { display: flex; align-items: center; margin: 18px 0 0; }
#reader .rd-enter {
  appearance: none;
  margin: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.86);
  font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  letter-spacing: 0.22em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
  cursor: pointer;
}
#reader .rd-enter::after { content: "  \2193"; }
#reader .rd-enter:hover,
#reader .rd-enter:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 6px; }

/* A wide picture on a tall screen: shown whole over a soft blurred copy of itself */
#reader-stage .rd-cover-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(28px) brightness(0.55);
  scale: 1.2;
}
#reader-stage.wide .rd-cover { position: relative; object-fit: contain; }

/* Depth, transform/opacity only. Enter (~700ms): the place settles from 1.04 while the title
   fades up. Scroll (where the engine supports scroll-driven animation): the held cover drifts
   slower than the text, pushes in and dims toward it. Elsewhere the fixed cover under the
   sliding sheet is the whole effect. Reduced motion: none of it - the final state at once. */
@media (prefers-reduced-motion: no-preference) {
  #reader:not([hidden]) #reader-stage { animation: rm-enter 700ms cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
  #reader:not([hidden]) .rd-scene { animation: rm-rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) 120ms backwards; }
  /* the picture is held back (not snapped) when you go in; the threshold lifts away first */
  #reader-stage { transition: opacity 600ms ease, scale 600ms ease; }
  #reader.is-entering .rd-scene { opacity: 0; translate: 0 -18px; transition: opacity 240ms ease, translate 240ms ease; }
  #reader[data-stage="room"] .rd-scene { animation: rm-settle 600ms cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
  #reader[data-stage="room"] #reader-body > :not(.rd-scene):not(.wa) { animation: rm-rise 600ms cubic-bezier(0.2, 0.7, 0.2, 1) 120ms backwards; }
  @supports (animation-timeline: scroll()) {
    #reader { scroll-timeline: --room block; }
    #reader .rd-cover {
      animation: rm-drift linear both;
      animation-timeline: --room;
    }
  }
}
@keyframes rm-enter { from { opacity: 0; scale: 1.04; } to { opacity: 1; scale: 1; } }
@keyframes rm-rise { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
@keyframes rm-settle { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes rm-drift { from { scale: 1; translate: 0 0; opacity: 1; } to { scale: 1.16; translate: 0 -6%; opacity: 0.45; } }

/* sticky (not fixed) so the focus trap, which skips offsetParent-less nodes, still sees it */
#reader-x {
  appearance: none;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.78);
  position: sticky;
  top: 0;
  z-index: 3;
  display: block;
  min-height: 44px;
  margin: 0;
  padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-left)) 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
  font: 600 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  letter-spacing: 0.16em;
  cursor: pointer;
}

#reader-body {
  max-width: 640px;
  margin: 0 auto;
  color: var(--ink-body);
  font: 400 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  overflow-wrap: anywhere;
}

#reader .rd-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}

#reader .rd-meta,
#reader .rd-status {
  margin: 0 0 24px;
  color: var(--ink-dim);
  opacity: 0.75;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
}
/* the honest "no text yet" line is a whisper, not a headline */
#reader .rd-status {
  opacity: 0.5;
  font-size: 10.5px;
  letter-spacing: 0.12em;
}

#reader .rd-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
#reader .rd-kicker {
  margin: 0 0 8px;
  color: var(--ink-dim);
  opacity: 0.75;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
}
#reader .rd-cap {
  margin: 0 0 24px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.45;
  white-space: pre-line;
}
#reader .rd-p { margin: 0 0 1.1em; }
/* inline photos of the article and bold / italic inside its text (the reader builds real nodes) */
#reader .rd-fig { margin: 1.6em 0; padding: 0; }
#reader .rd-img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; background: #000; }
#reader-body strong { color: var(--ink); font-weight: 700; }
#reader-body em { font-style: italic; }
#reader .rd-h { margin: 1.6em 0 0.5em; color: var(--ink); font-size: 20px; line-height: 1.3; font-weight: 700; }
#reader .rd-q { margin: 0 0 1.1em; padding-left: 16px; border-left: 2px solid #3a3a44; color: var(--ink-dim); }
#reader .rd-list { margin: 0 0 1.1em; padding-left: 1.3em; }
#reader .rd-list li { margin: 0 0 0.4em; }
#reader .rd-foot { margin: 32px 0 0; }
#reader .out {
  color: #c8c8d2;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-decoration: none;
}
#reader .out:hover,
#reader .out:focus-visible { color: #fff; text-decoration: underline; }

/* Reduced motion: no animation on the WALL (tiles, image fade-in, the hover strip).
   !important because the hover, focus and first-tap rules above are more specific than a
   plain selector and re-declare their own 180ms / 120ms transitions. The MENU is not
   handled here at all: its reduced-motion behaviour is whatever menu.css says, the same
   on home and on this page. */
@media (prefers-reduced-motion: reduce) {
  .tile,
  .shot img,
  .shot img.ready[data-reveal],
  #sound-btn svg,
  .veil,
  .pr,
  .tile:hover .veil,
  .tile.is-open .veil,
  .tile:has(:focus-visible) .veil {
    transition: none !important;
  }
}
