/* ============================================================
   POSTS — posts.html (js/posts.js)
   ============================================================
   Loaded after galaxy.css, which gives the page its night
   (body.page), the bar and the tokens (--accent*, --j-*). The page
   is the PICTURES: a mosaic of rows whose heights js/posts.js sets
   (--h per row, the widths by flex-grow = each picture's aspect), and
   a full-screen STORY that a picture grows into. The stories' words
   are set in Newsreader (--p-read); titles and controls in Space
   Grotesk, dates in the mono.

     THE MOSAIC  .mosaic > .row.row--feature|bare|brief > a.tile
     THE STORY   dialog.story: .story-bg, .story-scroll > .story-bar,
                 .story-body (data-layout wide | tall | note), .story-nav
                 .story-flyer is the picture in flight (a fixed <img>)
   The phone's own touches are in phone.css (:root.is-phone). */

:root {
  --p-read: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --p-ink: #F2F5FB;
  --p-soft: #B8C0D0;
  --p-mute: #7C869A;
  --p-night: #07090E;
  --gap: 14px;                  /* GAP in js/posts.js — keep in step */
  --tile-r: 16px;
  scrollbar-gutter: stable;     /* the page must not move when the story locks the scroll */
}
.posts [hidden], .story [hidden] { display: none !important; }

.posts {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(110px, 16vh, 150px) clamp(16px, 3.4vw, 44px) 96px;
}

/* ── The header ───────────────────────────────────────────── */
.posts-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title stats" "lead stats" "topics topics";
  column-gap: 48px;
  align-items: end;
  margin-bottom: clamp(30px, 5vh, 52px);
}
.posts-title { grid-area: title; }
.posts-lead { grid-area: lead; }
.topics { grid-area: topics; }

/* The numbers, beside the title: a figure over a hairline per stat. */
.posts-stats {
  grid-area: stats;
  display: flex;
  margin: 0 0 4px;
}
.stat {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  min-width: 104px;
  padding: 0 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}
.stat:last-child { padding-right: 0; }
.stat dd {
  margin: 0;
  font-size: clamp(2.2rem, 3.6vw, 3.1rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.stat dt {
  font-family: var(--j-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--p-mute);
}
.stat:first-child dd { color: var(--accent-pale); }
@media (max-width: 900px) {
  .posts-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "lead" "stats" "topics"; }
  .posts-stats { margin: 26px 0 0; }
  .stat { min-width: 0; flex: 1; padding: 0 16px; }
  .stat:first-child { padding-left: 0; border-left: 0; }
}
.posts-title {
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 6.4rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: #FFFFFF;
}
.posts-lead {
  margin: 1.1rem 0 0;
  max-width: 34em;
  font-size: 1.06rem;
  line-height: 1.7;
  color: #9AA3B8;
}
.topics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.topic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: none;
  font: 500 0.88rem 'Space Grotesk', system-ui, sans-serif;
  color: #9AA3B8;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.topic-n { font-family: var(--j-mono); font-size: 0.66rem; color: #7C869A; transition: color 0.2s ease; }
.topic:hover { color: var(--p-ink); border-color: rgba(255, 255, 255, 0.24); }
.topic[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #0A0D14; }
.topic[aria-pressed="true"] .topic-n { color: #34455F; }   /* 5.4:1 on the accent */
.topic:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 2px; }

/* ============================================================
   THE MOSAIC
   ============================================================ */
.mosaic { display: grid; gap: calc(var(--gap) * 2.6) var(--gap); }
.row { display: flex; gap: var(--gap); align-items: flex-start; }

/* A year: the figure, a rule to the edge, the count. */
.chap {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-top: clamp(28px, 5vh, 56px);
}
.chap:first-child { margin-top: 0; }
.chap-year {
  margin: 0;
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.chap-rule {
  flex: 1;
  height: 1px;
  align-self: center;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.5), rgba(255, 255, 255, 0.07) 30%, rgba(255, 255, 255, 0.04));
}
.chap-n {
  font-family: var(--j-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--p-mute);
}
.mosaic.is-in > * { animation: rowIn 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(18px); } }

.tile {
  position: relative;
  flex: 1 1 0;                  /* flex-grow = 100 × the picture's aspect, inline */
  min-width: 0;
  display: block;
  color: inherit;
}
.tile-img {
  position: relative;
  display: block;
  height: var(--h, 360px);
  overflow: hidden;
  border-radius: var(--tile-r);
  background: #11141B;
  isolation: isolate;
}
.tile-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tile-img::after {             /* a hairline inside the edge; the accent on hover */
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: inherit;
  pointer-events: none;
  transition: border-color 0.35s ease;
}
.tile-img { transition: box-shadow 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.tile.is-lifted .tile-img > *, .tile-img.is-lifted > * { visibility: hidden; }
.tile-img.is-lifted { background: #0B0D12; }

/* The title on the picture (bare rows): a shade from the bottom. */
.tile-cap {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  display: grid;
  gap: 6px;
  padding: 60px 20px 18px;
  background: linear-gradient(transparent, rgba(4, 6, 10, 0.55) 45%, rgba(4, 6, 10, 0.86));
}
.tile-cap b {
  font-size: clamp(1.02rem, 1.5vw, 1.32rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #fff;
  text-wrap: balance;
}
.tile-meta {
  display: flex;
  gap: 12px;
  font-family: var(--j-mono);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--p-mute);
}
.tile-cap .tile-meta { color: rgba(255, 255, 255, 0.72); }
.tile-meta span { color: var(--accent); }
.tile-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(6, 8, 12, 0.66);
  font-family: var(--j-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
}
.tile-badge--play::before {
  content: '';
  border: solid transparent;
  border-width: 4.5px 0 4.5px 7px;
  border-left-color: #fff;
}

/* Under the picture (brief rows). */
.tile-text { display: grid; gap: 8px; padding: 16px 4px 0; }
.tile-title {
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--p-ink);
  text-wrap: balance;
}
.tile-brief {
  font-family: var(--p-read);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--p-soft);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* A post with no picture: its first words, set large. */
.tile-img--note {
  display: flex;
  align-items: flex-start;
  padding: clamp(22px, 2.6vw, 34px);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(var(--accent-rgb), 0.16), transparent 60%),
    #10131A;
}
.tile-quote {
  font-family: var(--p-read);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-style: italic;
  line-height: 1.38;
  color: #DDE3EE;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
}

/* The FEATURE: one picture, its brief in a panel beside it. */
.tile--feature { flex: 1 1 auto; display: flex; gap: 0; }
.tile--feature .tile-img { flex: 1 1 auto; border-radius: var(--tile-r) 0 0 var(--tile-r); }
.tile-panel {
  transition: border-color 0.35s ease;
  flex: 0 0 clamp(19rem, 31%, 26rem);
  height: var(--h, 460px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 0;
  border-radius: 0 var(--tile-r) var(--tile-r) 0;
  background: #0E1117;
}
.tile-panel > .tile-meta { margin-bottom: auto; }   /* the date at the top, the story at the foot */
.tile-panel .tile-title { font-size: clamp(1.5rem, 2.4vw, 2.2rem); line-height: 1.1; letter-spacing: -0.025em; }
.tile-panel .tile-brief { font-size: 1.08rem; -webkit-line-clamp: 6; }
.tile-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--accent);
}
.tile-go::after { content: '→'; transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1); }

/* Hover: the picture leans in a little. */
@media (hover: hover) {
  .tile:hover .tile-img img { transform: scale(1.035); }
  .tile:hover .tile-img { box-shadow: 0 22px 50px -24px rgba(0, 0, 0, 0.85), 0 0 40px -12px rgba(var(--accent-rgb), 0.22); }
  .tile:hover .tile-img::after { border-color: rgba(var(--accent-rgb), 0.38); }
  .tile:hover .tile-go::after { transform: translateX(4px); }
  .tile--feature:hover .tile-panel { border-color: rgba(var(--accent-rgb), 0.24); }
  .tile:hover .tile-title, .tile:hover .tile-cap b { color: var(--accent-pale); }
  .tile:hover .tile-go { text-decoration: underline; text-underline-offset: 4px; }
}
.tile:focus-visible { outline: none; }
.tile:focus-visible .tile-img { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Narrow: the panel goes under its picture. */
.mosaic.is-narrow { gap: 26px 10px; }
.mosaic.is-narrow .row { gap: 10px; }
.mosaic.is-narrow .tile--feature { flex-direction: column; }
.mosaic.is-narrow .tile--feature .tile-img { border-radius: var(--tile-r); }
.mosaic.is-narrow .tile-panel { flex: none; height: auto; padding: 16px 4px 0; border: 0; background: none; }
.mosaic.is-narrow .tile-panel .tile-title { font-size: 1.45rem; }
.mosaic.is-narrow .tile-panel .tile-brief { -webkit-line-clamp: 3; }
.mosaic.is-narrow .tile-cap { padding: 44px 12px 12px; }
.mosaic.is-narrow .tile-cap b { font-size: 0.95rem; }
.mosaic.is-narrow .tile-cap .tile-meta span { display: none; }
.mosaic.is-narrow .tile-badge { top: 10px; left: 10px; }
.mosaic.is-narrow .tile-quote { font-size: 1.1rem; -webkit-line-clamp: 5; }
.mosaic.is-narrow .tile--bare .tile-quote { display: none; }      /* a small text tile: its title alone */
/* Two side by side on a phone: under each picture only the date and the title. */
.mosaic.is-narrow .row--brief[data-n="2"] .tile-text { gap: 6px; padding-top: 12px; }
.mosaic.is-narrow .row--brief[data-n="2"] .tile-title { font-size: 1rem; line-height: 1.25; }
.mosaic.is-narrow .row--brief[data-n="2"] .tile-brief,
.mosaic.is-narrow .row--brief[data-n="2"] .tile-meta span { display: none; }

/* ── Empty, and under the list ────────────────────────────── */
.posts-empty { margin: 2rem 0 0; font-size: 1rem; line-height: 1.7; color: #9AA3B8; }
.posts-empty a { color: var(--accent); text-underline-offset: 4px; }
.posts-foot { margin: clamp(56px, 9vh, 88px) 0 0; text-align: center; }
.posts-foot::before {          /* the end of the list: a thread of light down to the link */
  content: '';
  display: block;
  width: 1px;
  height: 64px;
  margin: 0 auto 22px;
  background: linear-gradient(rgba(var(--accent-rgb), 0), rgba(var(--accent-rgb), 0.55));
}
.posts-foot-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.posts-foot-link:hover, .posts-foot-link:focus-visible { background: rgba(var(--accent-rgb), 0.12); border-color: rgba(var(--accent-rgb), 0.6); }
.posts-foot-link:focus-visible, .posts-empty a:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 3px; }

/* ============================================================
   THE STORY
   ============================================================ */
:root.story-open, :root.story-open body { overflow: hidden; }
.story {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #E6E9F2;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  overflow: hidden;
}
.story::backdrop { background: transparent; }
.story:focus, .story:focus-visible, .story-scroll:focus { outline: none; }
.story-bg { position: absolute; inset: 0; overflow: hidden; background: var(--p-night); }
/* The cover's light behind the story: the picture, blurred to colour,
   fading down the screen and away as the words are read (--away). */
.story-glow {
  position: absolute;
  inset: -10% -10% auto;
  width: 120%;
  height: 85vh;
  object-fit: cover;
  filter: blur(70px) saturate(1.5);
  opacity: calc(0.34 * (1 - var(--away, 0) * 0.7));
  -webkit-mask-image: linear-gradient(transparent 4%, #000 26%, #000 42%, transparent 92%);
  mask-image: linear-gradient(transparent 4%, #000 26%, #000 42%, transparent 92%);
  pointer-events: none;
}
.story-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.story-flyer {
  position: fixed;
  z-index: 10;
  display: block;
  object-fit: cover;
  object-position: 50% 30%;
  pointer-events: none;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

/* The motion: the night fills in while the picture grows, then the
   words rise (.s-in, in order); closing takes the words first. */
.story.is-opening .story-bg { animation: sFade 0.46s ease-out both; }
.story.is-opening .story-bar,
.story.is-opening .s-in,
.story.is-opening .story-nav { animation: sRise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.story.is-opening .story-bar { animation-delay: 0.3s; }
.story.is-opening .s-in:nth-child(1) { animation-delay: 0.36s; }
.story.is-opening .s-in:nth-child(2) { animation-delay: 0.44s; }
.story.is-opening .s-in:nth-child(n+3), .story.is-opening .story-nav { animation-delay: 0.52s; }
.story.is-fading .story-bg { animation: sFade 0.3s ease-out both; }
.story.is-fading .story-scroll { animation: sRise 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.story.is-swapping .story-body, .story.is-swapping .story-nav { opacity: 0; transition: opacity 0.16s ease; }
.story.is-closing .story-bar,
.story.is-closing .story-col,
.story.is-closing .story-thumbs,
.story.is-closing .story-nav { opacity: 0; transition: opacity 0.18s ease; }
.story.is-closing .story-bg { animation: sFadeOut 0.46s ease-in 0.06s both; }
.story-cover.is-hidden { background: none; }
.story-cover.is-hidden > * { visibility: hidden; }
.story-cover.is-alt.is-hidden::before { opacity: 0; }   /* its light fades in once the picture has landed */
@keyframes sFade { from { opacity: 0; } }
@keyframes sFadeOut { to { opacity: 0; } }
@keyframes sRise { from { opacity: 0; transform: translateY(22px); } }

/* The bar: where you are, and the way out. */
.story-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 clamp(14px, 3vw, 36px);
  background: linear-gradient(var(--p-night) 40%, rgba(7, 9, 14, 0));
}
.story-bar::after {           /* how far through the story: a line along the top edge */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transform: scaleX(var(--read, 0));
  transform-origin: 0 50%;
  opacity: min(1, calc(var(--read, 0) * 20));
}
.story-count { font-family: var(--j-mono); font-size: 0.72rem; letter-spacing: 0.14em; color: var(--p-mute); }
.story-close {               /* on the left, × and the key that does the same */
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 8px 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(14, 17, 23, 0.8);
  color: #E6E9F2;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.story-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.story-esc {                   /* drawn as a key */
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-width: 2px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--j-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #C3CAD8;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.story-close:hover .story-esc { color: #fff; border-color: rgba(var(--accent-rgb), 0.5); }
.story-close:hover { background: rgba(var(--accent-rgb), 0.18); border-color: rgba(var(--accent-rgb), 0.6); }

.story-body {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 4px clamp(14px, 3vw, 36px) 0;
}

/* The cover. Wide: across the top, in its own shape up to 64 % of the window, so the title shows under it. */
.story-cover {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  background: #0E1117;
}
.story-cover img { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.story-cover::before {         /* behind a picture of another shape: its own light */
  content: '';
  position: absolute;
  inset: -40px;
  background: var(--bg, none) center / cover;
  filter: blur(36px) brightness(0.5) saturate(1.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.story-cover.is-alt::before { opacity: 1; }
.story-cover.is-alt img { object-fit: contain; object-position: 50% 50%; }
.story[data-layout="wide"] .story-cover {     /* always the width of the story: wide, big; the words under it */
  width: 100%;
  aspect-ratio: var(--ar, 1.6);
  max-height: 74vh;
  max-height: 74svh;
}

/* The cover and, on its right, the post's other pictures, small. */
.story-stage.has-thumbs { display: flex; gap: 12px; }
.story[data-layout="wide"] .story-stage.has-thumbs .story-cover { flex: 1 1 0; min-width: 0; width: auto; }
.story-thumbs {                /* as tall as the cover (contain: its own size is not the row's), scrolls if more */
  flex: 0 0 84px;
  width: 84px;
  contain: size;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: none;
}
.story-thumbs::-webkit-scrollbar { display: none; }
.story-thumb {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #0E1117;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.story-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.story-thumb:hover { opacity: 0.85; }
.story-thumb[aria-pressed="true"] { opacity: 1; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.story-watch {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(6, 8, 12, 0.72);
  font-size: 0.98rem;
  font-weight: 500;
  white-space: nowrap;
  color: #fff;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.story-watch::before { content: ''; border: solid transparent; border-width: 7px 0 7px 11px; border-left-color: #fff; }
.story-watch:hover { background: rgba(var(--accent-rgb), 0.26); border-color: var(--accent); }

/* Vertical (a post set so in WMS): the picture stands on the left, as tall as
   the window, filling its frame; the words scroll beside it. Wide screens only. */
.story-split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.story[data-layout="tall"] .story-stage {
  display: flex;
  gap: 12px;
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px - 28px);
  height: calc(100svh - 68px - 28px);
}
.story[data-layout="tall"] .story-cover { flex: 1 1 0; min-width: 0; height: 100%; }
.story[data-layout="tall"] .story-col { margin: 0; padding-top: clamp(8px, 4vh, 40px); }

/* The words. */
.story-col { max-width: 42rem; margin: 0 auto; padding: clamp(30px, 5vh, 52px) 0 0; }
.story[data-layout="note"] .story-col { padding-top: clamp(40px, 10vh, 120px); }
.story-meta {
  display: flex;
  gap: 14px;
  font-family: var(--j-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--p-mute);
}
.story-meta span { color: var(--accent); }
.story-title {
  margin-top: 14px;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: #fff;
  text-wrap: balance;
}
.story-title:focus { outline: none; }   /* where focus lands after a swap (posts.js): a place, not a control */
.story-text {
  margin-top: 28px;
  font-family: var(--p-read);
  font-size: 1.24rem;
  line-height: 1.66;
  color: #C9D0DF;
  overflow-wrap: anywhere;
}
.story-text p + p { margin-top: 1em; }
.story-text .ln { display: block; }
.story-text .ln + .ln { margin-top: 0.3em; }
.story-text .ln--head { font-weight: 500; color: var(--p-ink); }
.story-text .ln + .ln--head { margin-top: 0.9em; }
.story-text p:first-child { font-size: 1.36rem; line-height: 1.55; color: var(--p-ink); }
.story-text a { color: var(--accent-pale); text-decoration: underline; text-decoration-color: rgba(var(--accent-rgb), 0.45); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.story-text a:hover { text-decoration-color: var(--accent); }
.story-text .hash { color: var(--accent-dim); }
.story-essay {
  display: grid;
  gap: 6px;
  margin-top: 30px;
  padding: 18px 22px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.06);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.story-essay span { font-size: 0.86rem; color: var(--accent); }
.story-essay b { font-size: 1.15rem; font-weight: 600; color: var(--p-ink); }
.story-essay:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
.story-tags { margin-top: 26px; font-family: var(--j-mono); font-size: 0.72rem; line-height: 1.9; color: #7C869A; overflow-wrap: anywhere; }
.story-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.story-act {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: none;
  font: 500 0.9rem 'Space Grotesk', system-ui, sans-serif;
  color: #C3CAD8;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.story-act:hover { color: #fff; border-color: rgba(var(--accent-rgb), 0.6); background: rgba(var(--accent-rgb), 0.1); }

/* Older / newer. */
.story-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 1240px;
  margin: clamp(56px, 9vh, 96px) auto 0;
  padding: 0 clamp(14px, 3vw, 36px) clamp(28px, 5vh, 48px);
}
.story-step {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.story-step--older { flex-direction: row-reverse; text-align: right; }
.story-step-img { flex: 0 0 auto; width: 88px; height: 66px; overflow: hidden; border-radius: 10px; background: #11141B; }
.story-step-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.story-step-text { min-width: 0; display: grid; gap: 4px; }
.story-step-text span { font-family: var(--j-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.story-step-text b { font-size: 1rem; font-weight: 500; color: var(--p-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-step:hover { border-color: rgba(var(--accent-rgb), 0.45); background: rgba(255, 255, 255, 0.03); }

.story-close:focus-visible, .story-thumb:focus-visible, .story-watch:focus-visible, .story-essay:focus-visible, .story-act:focus-visible, .story-step:focus-visible, .story-text a:focus-visible {
  outline: 2px solid var(--accent-dim);
  outline-offset: 3px;
}

/* ============================================================
   NARROW
   ============================================================ */
@media (max-width: 819px) {
  .story-bar { height: 60px; }
  .story-body { padding: 0; }
  .story[data-layout="wide"] .story-cover { max-height: 64svh; border-radius: 0; }
  .story-col { padding: 26px 18px 0; }
  .story[data-layout="note"] .story-col { padding-top: 24px; }
  .story-text { font-size: 1.14rem; }
  .story-text p:first-child { font-size: 1.24rem; }
  .story-stage.has-thumbs { flex-direction: column; gap: 10px; }
  .story[data-layout="wide"] .story-stage.has-thumbs .story-cover { flex: none; width: 100%; }
  .story-thumbs {               /* a row under the cover, swiped */
    flex: none;
    width: auto;
    contain: none;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    align-self: stretch;
    padding: 0 18px;
  }
  .story-thumb { width: 62px; border-radius: 10px; }
  .story-nav { grid-template-columns: 1fr; gap: 10px; padding: 0 18px 28px; margin-top: 48px; }
  .story-step--older { flex-direction: row; text-align: left; }
  .story-step-img { width: 72px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .mosaic.is-in > *, .story * { animation: none !important; }
  .tile-img, .tile-img::after, .tile-panel, .tile-go::after, .tile-img img, .topic, .posts-foot-link, .story-close, .story-thumb, .story-cover::before, .story-watch, .story-essay, .story-act, .story-step { transition: none; }
}

/* A touch screen has no Esc key: the × alone. */
@media (hover: none) and (pointer: coarse) {
  .story-close { width: 46px; padding: 0; justify-content: center; }
  .story-esc { display: none; }
}
