/* ============================================================
   The Rising Edition — editorial design system
   Light & dark themes, magazine layout, crafted motion.
   ============================================================ */

:root {
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --paper: #faf7f0;
  --paper-raised: #fffdf8;
  --paper-sunken: #f1ece1;
  --ink: #1c1712;
  --ink-soft: #4c443a;
  --ink-mute: #6e6457;
  --rule: #ddd3c2;
  --rule-strong: #c4b8a3;
  --accent: #a8320a;
  --accent-strong: #8c2908;
  --accent-ink: #fdf3ec;
  --focus-ring: #1d4ed8;
  --skeleton-a: #ece5d7;
  --skeleton-b: #f5efe4;
  --shadow-card: 0 1px 2px rgba(28, 23, 18, .05), 0 8px 28px -12px rgba(28, 23, 18, .18);
  --shadow-pop: 0 2px 6px rgba(28, 23, 18, .08), 0 24px 60px -18px rgba(28, 23, 18, .32);
  --scrim: rgba(24, 18, 12, .45);
  --chip-bg: transparent;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #14110d;
  --paper-raised: #1d1913;
  --paper-sunken: #0e0c09;
  --ink: #f0e9dc;
  --ink-soft: #cdc3b2;
  --ink-mute: #a29785;
  --rule: #36302a;
  --rule-strong: #4c4438;
  --accent: #ff9668;
  --accent-strong: #ffb18e;
  --accent-ink: #241109;
  --focus-ring: #7aa5ff;
  --skeleton-a: #241f18;
  --skeleton-b: #2e2820;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .55);
  --shadow-pop: 0 2px 8px rgba(0, 0, 0, .4), 0 28px 70px -18px rgba(0, 0, 0, .7);
  --scrim: rgba(5, 4, 2, .66);
  color-scheme: dark;
}

/* ---------- foundations ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent-strong); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100px; left: 1rem; z-index: 60;
  padding: .7rem 1.1rem;
  background: var(--ink); color: var(--paper);
  border-radius: 0 0 10px 10px;
  font-weight: 600; text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus-visible { top: 0; color: var(--paper); }

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* ---------- masthead ---------- */

.masthead {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

.utility-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .7rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: .8rem;
  color: var(--ink-mute);
}
.utility-date { margin: 0; letter-spacing: .02em; text-transform: uppercase; font-weight: 600; }
.utility-right { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.freshness {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .8rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-raised);
  font-variant-numeric: tabular-nums;
}
.freshness-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rule-strong);
  flex: none;
}
.freshness[data-state="live"] .freshness-dot { background: #1a7f37; }
.freshness[data-state="loading"] .freshness-dot { background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
.freshness[data-state="stale"] .freshness-dot { background: #b45309; }
@keyframes pulse { 50% { opacity: .25; } }

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .45rem .95rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--ink);
  font: 600 .8rem/1 var(--font-ui);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease, color .2s ease;
}
.btn-icon:hover { background: var(--paper-sunken); transform: translateY(-1px); }
.btn-icon:active { transform: translateY(0); }
.btn-icon[disabled] { opacity: .55; cursor: wait; }
.btn-icon[disabled]:hover { transform: none; background: var(--paper-raised); }

#refresh-btn.refreshing svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#theme-toggle .icon-moon { display: none; }
[data-theme="dark"] #theme-toggle .icon-sun { display: none; }
[data-theme="dark"] #theme-toggle .icon-moon { display: block; }

.masthead-main {
  text-align: center;
  padding: clamp(2.2rem, 6vw, 4.2rem) 0 clamp(1.6rem, 4vw, 2.6rem);
  border-bottom: 3px double var(--rule-strong);
}
.masthead-kicker {
  margin: 0 0 .9rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent);
}
.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 640;
  font-variation-settings: "opsz" 144;
  font-size: clamp(2.9rem, 8.5vw, 6rem);
  line-height: 1.02;
  letter-spacing: -.015em;
}
.wordmark em {
  font-style: italic;
  font-weight: 420;
  color: var(--accent);
}
.masthead-tagline {
  margin: 1.1rem auto 0;
  max-width: 46ch;
  color: var(--ink-mute);
  font-size: .95rem;
}
.endpoint-link { font-family: inherit; word-break: break-all; }

/* ---------- controls ---------- */

.controls {
  padding: 1.1rem 0 .4rem;
  border-bottom: 1px solid var(--rule);
}
.controls-row {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  align-items: stretch;
}
.search-wrap {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 1rem;
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  background: var(--paper-raised);
  color: var(--ink-mute);
  min-height: 48px;
}
.search-wrap:focus-within { border-color: var(--accent); }
.search-wrap svg { flex: none; }
#search {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 400 .95rem var(--font-ui);
  padding: .6rem 0;
  min-width: 0;
}
#search:focus { outline: none; }
#search::placeholder { color: var(--ink-mute); opacity: .85; }

.sort-wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 .4rem 0 1rem;
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  background: var(--paper-raised);
  min-height: 48px;
}
.sort-wrap label {
  font-size: .78rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-mute);
}
#sort {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 600 .9rem var(--font-ui);
  padding: .6rem .4rem;
  min-height: 44px;
  cursor: pointer;
}
#sort:focus { outline: none; }
.sort-wrap:focus-within { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
#sort option { background: var(--paper-raised); color: var(--ink); }

.tag-filter-row { margin-top: .9rem; }
.tag-filter-label {
  margin: 0 0 .45rem;
  font-size: .72rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-mute);
}
.tag-chips {
  list-style: none;
  display: flex;
  gap: .5rem;
  margin: 0;
  padding: .15rem .15rem .5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.tag-chips li { flex: none; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 36px;
  padding: .35rem .8rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--ink-soft);
  font: 600 .8rem/1 var(--font-ui);
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
@media (pointer: coarse) { .tag-chip { min-height: 44px; padding: .5rem 1rem; } }
.tag-chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.tag-chip .chip-count {
  font-size: .68rem;
  font-weight: 700;
  padding: .12rem .42rem;
  border-radius: 999px;
  background: var(--paper-sunken);
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.tag-chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.tag-chip[aria-pressed="true"] .chip-count {
  background: rgba(255, 255, 255, .22);
  color: var(--accent-ink);
}
[data-theme="dark"] .tag-chip[aria-pressed="true"] .chip-count { background: rgba(0, 0, 0, .22); }

.result-count {
  margin: .55rem 0 .3rem;
  font-size: .82rem;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

/* ---------- edition / feed ---------- */

main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
main:focus { outline: none; }

.edition { padding: clamp(1.6rem, 4vw, 3rem) 0 3.5rem; }

.section-title {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: clamp(2.2rem, 5vw, 3.4rem) 0 1.3rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 620;
  letter-spacing: -.01em;
}
.section-title::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule-strong);
  transform: translateY(-.3em);
}

/* hero */
.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.hero-text { min-width: 0; }
.kicker-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.rank-badge svg { flex: none; }
.hero-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 100;
  font-size: clamp(1.9rem, 4.6vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: -.018em;
  overflow-wrap: break-word;
}
.hero-title a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .35s ease, color .25s ease;
}
.hero-title a:hover { color: var(--accent); background-size: 100% 2px; }
.hero-standfirst {
  margin: 0 0 1.4rem;
  font-size: clamp(1rem, 1.6vw, 1.13rem);
  color: var(--ink-soft);
  max-width: 58ch;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.byline {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid var(--rule-strong);
  object-fit: cover;
  flex: none;
  background: var(--paper-sunken);
}
.byline-names { min-width: 0; }
.byline-author {
  font-weight: 700;
  font-size: .95rem;
  display: block;
}
.byline-author a { color: var(--ink); text-decoration: none; }
.byline-author a:hover { color: var(--accent); text-decoration: underline; }
.byline-sub {
  font-size: .8rem;
  color: var(--ink-mute);
}
.byline-org {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: .15rem;
  font-size: .8rem;
  color: var(--ink-mute);
}
.byline-org img {
  width: 20px; height: 20px;
  border-radius: 5px;
  object-fit: cover;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: .85rem;
  color: var(--ink-mute);
  margin-bottom: 1.2rem;
  font-variant-numeric: tabular-nums;
}
.meta-item { display: inline-flex; align-items: center; gap: .38rem; white-space: nowrap; }
.meta-item svg { flex: none; opacity: .8; }

.tag-row {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: .3rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, transform .18s ease;
}
@media (pointer: coarse) { .tag { min-height: 44px; padding: .45rem .9rem; } }
.tag::before { content: "#"; opacity: .55; margin-right: .15em; }
.tag:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.tag[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tag[aria-pressed="true"]::before { opacity: .8; }
.flare-tag {
  border: none;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
}

.hero-figure {
  position: relative;
  margin: 0;
}
.hero-figure .cover-frame { aspect-ratio: 1000 / 420; }
.hero-figure figcaption {
  margin-top: .55rem;
  font-size: .76rem;
  color: var(--ink-mute);
  text-align: right;
}

.cover-frame {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: var(--paper-sunken);
  box-shadow: var(--shadow-card);
}
.cover-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
a > .cover-frame:hover img,
.cover-frame.cover-hover:hover img { transform: scale(1.035); }

/* generated fallback cover */
.cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(.8rem, 2vw, 1.4rem);
  color: #fff;
}
.cover-fallback .cf-glyph {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1;
  opacity: .92;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .3);
}
.cover-fallback .cf-tag {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: .85;
}

/* secondary trio */
.trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.2rem, 3vw, 2rem);
}
.trio-card {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  min-width: 0;
}
.trio-card .cover-frame { aspect-ratio: 16 / 8.5; }
.trio-rank {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--accent);
  font-weight: 560;
}
.trio-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trio-title a { color: var(--ink); text-decoration: none; }
.trio-title a:hover { color: var(--accent); }

/* the wire — numbered ledger */
.wire { display: flex; flex-direction: column; }
.wire-item {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) 9.5rem;
  gap: clamp(1rem, 2.5vw, 1.8rem);
  align-items: center;
  padding: 1.25rem .4rem;
  border-top: 1px solid var(--rule);
  border-radius: 10px;
  transition: background-color .2s ease;
}
.wire-item:hover { background: var(--paper-raised); }
.wire-rank {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 480;
  font-size: 1.9rem;
  color: var(--rule-strong);
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: color .25s ease;
}
.wire-item:hover .wire-rank { color: var(--accent); }
.wire-body { min-width: 0; }
.wire-title {
  margin: 0 0 .35rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.22;
  letter-spacing: -.008em;
  overflow-wrap: break-word;
}
.wire-title a { color: var(--ink); text-decoration: none; }
.wire-title a:hover { color: var(--accent); }
.wire-desc {
  margin: 0 0 .5rem;
  font-size: .88rem;
  color: var(--ink-mute);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
}
.wire-meta {
  display: flex;
  gap: .9rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: .78rem;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.wire-meta .avatar { width: 22px; height: 22px; border-width: 1px; }
.wire-figure { margin: 0; }
.wire-figure .cover-frame { aspect-ratio: 16 / 9; }

/* entrance motion */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.revealed {
  opacity: 1;
  transform: none;
  transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

/* ---------- skeletons ---------- */

.skeleton { pointer-events: none; }
.sk-block {
  border-radius: 8px;
  background: linear-gradient(100deg, var(--skeleton-a) 38%, var(--skeleton-b) 50%, var(--skeleton-a) 62%);
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { to { background-position: -120% 0; } }
.sk-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.sk-hero-text { display: flex; flex-direction: column; gap: 1rem; }
.sk-line { height: 1em; }
.sk-title-xl { height: 2.6em; border-radius: 10px; }
.sk-cover { aspect-ratio: 1000 / 420; border-radius: 14px; }
.sk-wire { display: flex; flex-direction: column; gap: 1rem; margin-top: 2.4rem; }
.sk-row { display: grid; grid-template-columns: 3.4rem 1fr 9.5rem; gap: 1.6rem; align-items: center; }
.sk-thumb { aspect-ratio: 16/9; border-radius: 12px; }
.sk-circle { border-radius: 50%; }
.sr-skeleton-note { margin: 1rem 0 0; color: var(--ink-mute); font-size: .85rem; }

/* ---------- states: error / empty ---------- */

.state-panel {
  text-align: center;
  padding: clamp(3rem, 8vw, 5.5rem) 1.5rem;
  border: 1px dashed var(--rule-strong);
  border-radius: 18px;
  background: var(--paper-raised);
  max-width: 640px;
  margin: 1rem auto;
}
.state-panel .state-glyph {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(3rem, 8vw, 4.5rem);
  color: var(--accent);
  line-height: 1;
  display: block;
  margin-bottom: 1rem;
}
.state-panel h2 {
  margin: 0 0 .7rem;
  font-family: var(--font-display);
  font-weight: 620;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  letter-spacing: -.01em;
}
.state-panel p { margin: 0 auto 1.4rem; max-width: 44ch; color: var(--ink-mute); }
.state-panel .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 48px;
  padding: .7rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 .95rem var(--font-ui);
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.state-panel .btn-primary:hover { background: var(--accent-strong); transform: translateY(-1px); }

/* refresh toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translate(-50%, 140%);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .85rem 1.3rem;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: .88rem;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
  max-width: min(92vw, 480px);
}
.toast.show { transform: translate(-50%, 0); }
.toast .toast-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.toast[data-tone="ok"] .toast-dot { background: #4ade80; }
.toast[data-tone="err"] .toast-dot { background: #f87171; }

/* ---------- reader dialog ---------- */

.reader {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
}
.reader::backdrop {
  background: var(--scrim);
  backdrop-filter: blur(6px);
}
.reader-inner {
  position: relative;
  width: min(760px, calc(100vw - 2rem));
  max-height: calc(100dvh - 3rem);
  margin: 1.5rem auto;
  background: var(--paper-raised);
  color: var(--ink);
  border-radius: 20px;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-pop);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(1.4rem, 4vw, 2.6rem);
}
.reader[open] .reader-inner { animation: reader-in .38s cubic-bezier(.2, .8, .25, 1); }
@keyframes reader-in {
  from { opacity: 0; transform: translateY(26px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.reader-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: var(--paper-raised);
  color: var(--ink);
  cursor: pointer;
  z-index: 5;
  float: right;
  transition: background-color .2s ease, transform .2s ease;
}
.reader-close:hover { background: var(--paper-sunken); transform: rotate(90deg); }

.reader-kicker {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin: .2rem 0 1rem;
}
.reader-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 620;
  font-size: clamp(1.7rem, 4.4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -.015em;
  overflow-wrap: break-word;
}
.reader-standfirst {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
  overflow-wrap: break-word;
}
.reader .cover-frame { aspect-ratio: 1000 / 420; margin-bottom: 1.6rem; }

.reader-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .8rem;
  margin: 0 0 1.6rem;
}
.stat-card {
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: .8rem .95rem;
  background: var(--paper);
}
.stat-card dt {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: .25rem;
}
.stat-card dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat-card dd .stat-note { display: block; font-family: var(--font-ui); font-size: .72rem; color: var(--ink-mute); font-weight: 500; }

.reader-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 2rem;
  border-top: 1px solid var(--rule);
  margin: 0 0 1.6rem;
}
.meta-cell {
  padding: .8rem 0;
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}
.meta-cell dt {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: .2rem;
}
.meta-cell dd {
  margin: 0;
  font-size: .92rem;
  overflow-wrap: anywhere;
}
.meta-cell dd time { font-variant-numeric: tabular-nums; }
.meta-cell dd .abs { color: var(--ink-mute); font-size: .8rem; display: block; }

.reader-people {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-bottom: 1.6rem;
}
.person-card {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1rem;
  background: var(--paper);
}
.person-card .avatar { width: 52px; height: 52px; }
.person-card .p-name { font-weight: 700; }
.person-card .p-sub { font-size: .8rem; color: var(--ink-mute); }
.person-card .p-links { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .35rem; font-size: .8rem; font-weight: 600; }

.reader-actions {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  align-items: center;
  border-top: 3px double var(--rule-strong);
  padding-top: 1.4rem;
}
.btn-read {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 48px;
  padding: .75rem 1.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 .95rem var(--font-ui);
  text-decoration: none;
  transition: background-color .2s ease, transform .2s ease;
}
.btn-read:hover { background: var(--accent-strong); color: var(--accent-ink); transform: translateY(-1px); }
.reader-actions .hint { font-size: .8rem; color: var(--ink-mute); }

/* ---------- colophon ---------- */

.colophon {
  border-top: 3px double var(--rule-strong);
  background: var(--paper-sunken);
  transition: background-color .35s ease;
}
.colophon-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.6rem clamp(1rem, 4vw, 2.5rem) 3rem;
  text-align: center;
  color: var(--ink-mute);
  font-size: .88rem;
}
.colophon-word {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 620;
  color: var(--ink);
  margin: 0 0 .8rem;
}
.colophon-word em { font-style: italic; font-weight: 420; color: var(--accent); }
.colophon-fine { font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; margin-top: 1.2rem; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
  .trio { grid-template-columns: 1fr; }
  .trio-card { display: grid; grid-template-columns: minmax(0, 1fr) 10.5rem; gap: 1rem; align-items: center; }
  .trio-card .trio-text { order: 2; }
  .trio-card .cover-frame { order: 1; aspect-ratio: 16/10; }
}

@media (max-width: 640px) {
  .wire-item { grid-template-columns: 2.2rem minmax(0, 1fr); }
  .wire-figure { display: none; }
  .wire-rank { font-size: 1.4rem; }
  .trio-card { grid-template-columns: 1fr; }
  .trio-card .cover-frame { order: 0; }
  .utility-bar { justify-content: center; }
  .freshness { order: 3; width: 100%; justify-content: center; }
  .sk-hero { grid-template-columns: 1fr; }
  .sk-row { grid-template-columns: 2.2rem 1fr; }
  .sk-thumb { display: none; }
  .reader-inner { width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); margin: .5rem auto; border-radius: 16px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .sk-block { animation: none; background: var(--skeleton-a); }
}

/* ---------- spacing rhythm ----------
   Steering pass: generous, intentional vertical gaps between title,
   standfirst, byline/meta, and tag rows on every surface — masthead
   controls, hero, trio cards, the wire ledger, and the reader dialog.
   Later same-specificity rules override the tighter defaults above. */

.utility-bar { padding: .95rem 0; }
.controls { padding: 1.4rem 0 .8rem; }
.tag-filter-row { margin-top: 1.2rem; }
.tag-chips { padding-bottom: .7rem; }
.result-count { margin: .8rem 0 .5rem; }
.section-title { margin-bottom: 1.7rem; }

.hero { gap: clamp(2rem, 5vw, 3.6rem); }
.kicker-row { margin-bottom: 1.3rem; }
.hero-title { margin-bottom: 1.35rem; }
.hero-standfirst { margin-bottom: 1.9rem; line-height: 1.65; }
.byline { gap: 1rem; margin-bottom: 1.6rem; }
.meta-row { gap: 1.3rem; margin-bottom: 1.6rem; }
.hero .tag-row { margin-bottom: 0; }
.hero-figure figcaption { margin-top: .7rem; }

.trio { gap: clamp(1.6rem, 3.5vw, 2.4rem); }
.trio-card { gap: 1.1rem; }
.trio-rank { display: inline-block; margin-bottom: .45rem; }
.trio-title { margin-bottom: .55rem; }

.wire-item { padding: 2rem .6rem; gap: clamp(1.2rem, 3vw, 2rem); }
.wire-title { margin-bottom: .65rem; }
.wire-desc { margin-bottom: .9rem; line-height: 1.6; }
.wire-meta { gap: 1.15rem; row-gap: .6rem; }
.wire-item .tag-row { margin: .95rem 0 0; gap: .55rem; }

.reader-kicker { gap: .8rem; margin-bottom: 1.3rem; }
.reader-title { margin-bottom: 1.3rem; }
.reader-standfirst { margin-bottom: 1.9rem; line-height: 1.65; }
.reader .cover-frame { margin-bottom: 2rem; }
.reader-stats { gap: 1rem; margin-bottom: 2rem; }
.stat-card { padding: 1rem 1.1rem; }
.reader-people { gap: 1.2rem; margin-bottom: 2rem; }
.person-card { gap: 1rem; padding: 1.2rem; }
.person-card .p-links { gap: 1rem; margin-top: .5rem; }
.reader .tag-row { gap: .55rem; margin-bottom: 2rem; }
.reader-meta-grid { margin-bottom: 2rem; }
.meta-cell { padding: 1rem 0; }
.meta-cell dt { margin-bottom: .35rem; }
.reader-actions { gap: 1rem; padding-top: 1.8rem; }
