/* ASH News — public site styles. No framework, ~20 KB gzipped budget. */

/* ---------- tokens ---------- */
:root {
  --paper: #faf9f6;
  --surface: #ffffff;
  --ink: #121212;
  --ink-2: #3d3d3d;
  --muted: #6b6b6b;
  --rule: #e4e1da;
  --rule-strong: #121212;
  --brand: #c8102e;
  --band: #121417;
  --band-ink: #f2f1ee;
  --skeleton: #ebe8e1;
  --up: #15803d;
  --down: #b91c1c;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1280px;
  --gutter: clamp(16px, 3vw, 32px);
  --radius: 4px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d0f12; --surface: #15181d; --ink: #eceae6; --ink-2: #c9c7c2; --muted: #8f8d88;
    --rule: #262a31; --rule-strong: #eceae6; --band: #000; --band-ink: #eceae6; --skeleton: #1d2127;
    --up: #4ade80; --down: #f87171; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d0f12; --surface: #15181d; --ink: #eceae6; --ink-2: #c9c7c2; --muted: #8f8d88;
  --rule: #262a31; --rule-strong: #eceae6; --band: #000; --band-ink: #eceae6; --skeleton: #1d2127;
  --up: #4ade80; --down: #f87171; color-scheme: dark;
}

/* Cross-document page transitions (Chrome/Edge/Safari 18+); ignored elsewhere. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .18s var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in .28s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -0.012em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 100; transition: top .2s; }
.skip:focus { top: 8px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .2s var(--ease-out), background-color .2s;
}
.btn:hover { background: var(--brand); color: #fff; }
.btn:active { transform: scale(.97); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; transition: background-color .2s, transform .15s var(--ease-out);
}
.icon-btn:hover { background: var(--rule); }
.icon-btn:active { transform: scale(.92); }

/* ---------- header ---------- */
.progress {
  position: fixed; inset: 0 0 auto; height: 3px; z-index: 60; background: var(--brand);
  transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
}
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.topbar { border-bottom: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); }
.topbar__inner { display: flex; align-items: center; gap: 16px; height: 36px; }
.topbar__date { white-space: nowrap; }
.topbar__tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar .icon-btn { width: 32px; height: 32px; }

.ticker { display: flex; gap: 18px; overflow: hidden; font-variant-numeric: tabular-nums; min-width: 0; }
.ticker__item { display: inline-flex; gap: 6px; white-space: nowrap; animation: fade-in .4s var(--ease-out) both; }
.ticker__item b { color: var(--ink); font-weight: 600; }
.ticker__up { color: var(--up); }
.ticker__down { color: var(--down); }
.ticker__loading { width: 160px; height: 10px; border-radius: 4px; background: var(--skeleton); animation: shimmer 1.4s infinite; }

.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; padding: 6px 8px; border-radius: var(--radius); font-weight: 600; color: var(--ink); }
.lang summary::-webkit-details-marker { display: none; }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 150px; padding: 6px; z-index: 5;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 12px 32px rgb(0 0 0 / .12);
  transform-origin: top right; animation: pop .18s var(--ease-out);
}
.lang a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); font-size: 14px; }
.lang a:hover, .lang a[aria-current] { background: var(--rule); }

.masthead { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; height: 76px; transition: height .3s var(--ease-out); }
.is-compact .masthead { height: 56px; }
.masthead__search { justify-self: end; }
.masthead__menu { visibility: hidden; }
.logo { justify-self: center; display: inline-flex; align-items: center; gap: 10px; }
.logo__mark {
  width: 22px; height: 22px; border-radius: 50%; position: relative;
  background: conic-gradient(from 180deg, var(--brand) 0 50%, var(--ink) 0 100%);
  transition: transform .6s var(--ease-out);
}
.logo:hover .logo__mark { transform: rotate(180deg); }
.logo__word { font: 700 clamp(28px, 4vw, 40px)/1 var(--serif); letter-spacing: -0.03em; transition: font-size .3s var(--ease-out); }
.is-compact .logo__word { font-size: 28px; }

.nav { border-block: 1px solid var(--rule); }
.nav__list { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; justify-content: center; }
.nav__list::-webkit-scrollbar { display: none; }
.nav__list a {
  position: relative; display: block; padding: 12px 14px; font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--ink-2);
  transition: color .2s;
}
.nav__list a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; background: var(--c, var(--brand));
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out);
}
.nav__list a:hover { color: var(--ink); }
.nav__list a:hover::after, .nav__list a[aria-current]::after { transform: scaleX(1); }
.nav__list a[aria-current] { color: var(--ink); font-weight: 600; }

.breaking { background: var(--brand); color: #fff; font-size: 14px; }
.breaking__inner { display: flex; align-items: center; gap: 16px; height: 40px; }
.breaking__label { display: inline-flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; white-space: nowrap; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
.breaking__track { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.breaking__items { display: flex; gap: 48px; width: max-content; animation: marquee 40s linear infinite; }
.breaking__items a { white-space: nowrap; font-weight: 500; }
.breaking__items a:hover { text-decoration: underline; }
.breaking:hover .breaking__items { animation-play-state: paused; }

.drawer { position: fixed; inset: 0; z-index: 80; background: rgb(0 0 0 / .4); }
.drawer[hidden] { display: none; }
.drawer__panel {
  width: min(84vw, 340px); height: 100%; background: var(--paper); padding: 64px 24px 24px; position: relative;
  animation: slide-in .32s var(--ease-out);
}
.drawer__close { position: absolute; top: 12px; right: 12px; }
.drawer li a { display: block; padding: 14px 0; border-bottom: 1px solid var(--rule); font: 600 22px var(--serif); border-left: 3px solid var(--c, transparent); padding-left: 12px; }

.search-overlay {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: start center; padding: 18vh var(--gutter) 0;
  background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(10px); animation: fade-in .2s;
}
.search-overlay[hidden] { display: none; }
.search-overlay__form { display: flex; width: min(720px, 100%); border-bottom: 2px solid var(--ink); animation: rise .35s var(--ease-out); }
.search-overlay__form input { flex: 1; min-width: 0; border: 0; background: none; font: 500 clamp(24px, 4vw, 40px) var(--serif); padding: 12px 0; color: var(--ink); outline: none; }
.search-overlay__form button { border: 0; background: none; font-weight: 600; padding: 0 8px; }
.search-overlay__close { position: absolute; top: 20px; right: 20px; }

/* ---------- ads ---------- */
.ad { position: relative; margin: 24px 0; display: grid; place-items: center; background: color-mix(in srgb, var(--rule) 35%, transparent); border-radius: var(--radius); overflow: hidden; }
.ad-label { position: absolute; top: 4px; left: 8px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ad ins { width: 100%; }
.ad--placeholder span:last-child { color: var(--muted); font-size: 13px; }
.ad-row .ad { margin: 16px 0 0; }

/* ---------- cards ---------- */
.card { position: relative; }
.card__media { display: block; overflow: hidden; border-radius: var(--radius); background: var(--skeleton); aspect-ratio: 16 / 9; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out), opacity .4s; }
.card:hover .card__media img { transform: scale(1.04); }
.img-fallback { width: 100%; height: 100%; aspect-ratio: 16/9; background: linear-gradient(135deg, color-mix(in srgb, var(--c, var(--brand)) 70%, #000), color-mix(in srgb, var(--c, var(--brand)) 25%, var(--paper))); }
.card__body { padding-top: 12px; }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.kicker { color: var(--c, var(--brand)); font-weight: 700; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.kicker--sponsored { color: #a16207; }
.kicker--breaking { color: #fff; background: var(--brand); padding: 2px 6px; border-radius: 3px; }
.source { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }
.source img { border-radius: 3px; }
.card__title { font-size: 20px; }
.card__title a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .35s var(--ease-out);
}
.card__title a:hover { background-size: 100% 1px; }
.card__title a::before { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.card .kicker, .card .source { position: relative; z-index: 1; }
.card__excerpt { margin-top: 8px; color: var(--ink-2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__byline { margin-top: 10px; font-size: 13px; color: var(--muted); }

.card--lead .card__title { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.04; letter-spacing: -0.02em; }
.card--lead .card__excerpt { font: 400 19px/1.5 var(--serif); -webkit-line-clamp: 4; }
.card--lead .card__body { padding-top: 18px; }

.card--stack, .card--mini { display: grid; grid-template-columns: 1fr 112px; gap: 14px; align-items: start; }
.card--stack .card__media, .card--mini .card__media { order: 2; aspect-ratio: 4 / 3; }
.card--stack .card__body, .card--mini .card__body { padding-top: 0; }
.card--stack .card__title, .card--mini .card__title { font-size: 18px; }

.card--curated { padding: 18px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); transition: border-color .2s, transform .3s var(--ease-out), box-shadow .3s; }
.card--curated:hover { border-color: var(--c); transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgb(0 0 0 / .18); }
.card--curated .card__title { font-size: 18px; }
.card--curated .card__title a::after { content: " ↗"; color: var(--muted); font-family: var(--sans); font-size: .8em; }
.card--opinion .card__title { font-style: italic; font-weight: 500; }

/* ---------- layout blocks ---------- */
.hero { display: grid; gap: 32px; padding-block: 28px 8px; }
.hero__stack { display: grid; gap: 20px; align-content: start; }
.hero__stack .card + .card { padding-top: 20px; border-top: 1px solid var(--rule); }

.with-sidebar { display: grid; gap: 40px; padding-block: 24px; }
.sidebar { display: grid; gap: 28px; align-content: start; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 3px solid var(--c, var(--rule-strong)); padding-top: 10px; margin-bottom: 20px; }
.section-head h2 { font-size: 26px; }
.section-head__more { font-size: 13px; font-weight: 600; color: var(--muted); transition: color .2s; }
.section-head__more:hover { color: var(--c, var(--brand)); }
.section-head__more span { display: inline-block; transition: transform .25s var(--ease-out); }
.section-head__more:hover span { transform: translateX(3px); }

.river { display: grid; gap: 28px; align-content: start; }
.river .card--grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.river > .card + .card { padding-top: 28px; border-top: 1px solid var(--rule); }

.cat-block { padding-block: 24px; }
.cat-block__grid { display: grid; gap: 24px; }

.band { background: var(--band); color: var(--band-ink); padding-block: 48px; margin-block: 32px; }
.section-head--inverse { border-top-color: var(--band-ink); }
.band .card__excerpt, .band .card__meta, .band .card__byline { color: color-mix(in srgb, var(--band-ink) 70%, transparent); }
.band .kicker { color: #fbbf24; }
.band__grid { display: grid; gap: 28px; }

.curated { padding-block: 24px 48px; }
.curated__grid { display: grid; gap: 16px; }

.widget__title { font: 700 12px var(--sans); letter-spacing: .12em; text-transform: uppercase; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--rule-strong); }
.trending__list { counter-reset: t; display: grid; gap: 16px; }
.trending__list li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.trending__num { font: 600 30px/1 var(--serif); color: var(--brand); font-variant-numeric: lining-nums; }
.trending__list a { font: 600 17px/1.25 var(--serif); }
.trending__list a:hover { color: var(--brand); }
.trending__cat { display: block; margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.sponsored li { padding-block: 10px; border-bottom: 1px solid var(--rule); }
.sponsored a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.sponsored p { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.sponsored__by { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- article ---------- */
.story__head { max-width: 900px; padding-top: 28px; text-align: left; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.crumbs a:hover { color: var(--ink); }
.story__kicker { display: flex; gap: 10px; align-items: center; margin: 18px 0 12px; }
.story__title { font-size: clamp(32px, 5vw, 60px); line-height: 1.03; letter-spacing: -0.025em; animation: rise .6s var(--ease-out) both; }
.story__dek { margin-top: 16px; font: 400 clamp(19px, 2vw, 23px)/1.45 var(--serif); color: var(--ink-2); animation: rise .6s .08s var(--ease-out) both; }
.byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-block: 14px; border-block: 1px solid var(--rule); font-size: 14px; }
.byline__who { display: grid; gap: 2px; }
.byline__who a { font-weight: 700; }
.byline__who a:hover { color: var(--brand); }
.byline__who span { color: var(--muted); }
.share { display: flex; gap: 6px; }
.share__btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule); background: none; font-weight: 700; font-size: 13px; transition: background-color .2s, color .2s, transform .15s var(--ease-out); }
.share__btn:hover { background: var(--ink); color: var(--paper); }
.share__btn:active { transform: scale(.92); }

.story__cover { margin-top: 28px; max-width: 1200px; }
.story__cover img { width: 100%; border-radius: var(--radius); aspect-ratio: 16/9; object-fit: cover; background: var(--skeleton); animation: fade-in .7s var(--ease-out) both; }
.story__cover figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.credit { opacity: .8; }

.story__layout { align-items: start; }
.story__main { min-width: 0; max-width: 720px; }
.prose { font: 400 clamp(18px, 1.6vw, 20px)/1.7 var(--serif); color: var(--ink); }
.prose > * + * { margin-top: 1.1em; }
.prose > p:first-of-type::first-letter { float: left; font-size: 4.1em; line-height: .82; font-weight: 600; padding: 6px 10px 0 0; color: var(--c, var(--brand)); }
.prose h2 { font-size: 1.55em; margin-top: 1.8em; }
.prose h3 { font-size: 1.25em; margin-top: 1.6em; }
.prose a { color: var(--c, var(--brand)); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; } .prose ol { list-style: decimal; }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--c, var(--brand)); font-size: 1.15em; font-style: italic; color: var(--ink-2); }
.prose img, .prose iframe { border-radius: var(--radius); max-width: 100%; }
.prose iframe { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; }
.prose figcaption { font: 13px var(--sans); color: var(--muted); margin-top: 6px; }
.prose table { width: 100%; border-collapse: collapse; font: 15px var(--sans); }
.prose th, .prose td { padding: 8px; border-bottom: 1px solid var(--rule); text-align: left; }
.prose .ad { font-family: var(--sans); }

.source-box { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 28px; border: 1px solid var(--rule); border-left: 4px solid var(--c); border-radius: 8px; background: var(--surface); }
.source-box img { border-radius: 6px; }
.source-box div { display: grid; flex: 1; font-size: 13px; color: var(--muted); }
.source-box strong { font-size: 17px; color: var(--ink); }

.inline-sponsored { position: relative; display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 32px; padding: 26px 16px 14px; border: 1px dashed var(--rule); border-radius: 8px; }
.inline-sponsored a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.tags a { display: block; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px; font-size: 13px; font-weight: 500; transition: border-color .2s, background-color .2s; }
.tags a:hover { border-color: var(--ink); background: var(--surface); }
.translations { margin-top: 20px; font-size: 14px; color: var(--muted); }
.translations a { color: var(--ink); font-weight: 600; margin-left: 6px; text-decoration: underline; }
.author-box { margin-top: 32px; padding: 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; }
.author-box p { margin-top: 6px; color: var(--ink-2); font-size: 15px; }

.toc ol { display: grid; gap: 8px; font-size: 14px; }
.toc a { color: var(--ink-2); display: block; padding-left: 10px; border-left: 2px solid var(--rule); transition: border-color .2s, color .2s; }
.toc a:hover, .toc a.is-active { color: var(--ink); border-left-color: var(--c, var(--brand)); }
.toc__l3 { padding-left: 12px; }

.related { padding-block: 24px 56px; }
.related__grid { display: grid; gap: 28px; }

/* ---------- listings & misc ---------- */
.listing-head { padding-top: 36px; position: relative; }
.listing-head h1 { font-size: clamp(36px, 6vw, 72px); letter-spacing: -0.03em; }
.listing-head h1::after { content: ""; display: block; width: 64px; height: 4px; margin-top: 16px; background: var(--c); transform-origin: left; animation: grow .7s .1s var(--ease-out) both; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.listing-head__intro { margin-top: 16px; max-width: 640px; font: 19px/1.5 var(--serif); color: var(--ink-2); }
.listing-head__rss { position: absolute; right: var(--gutter); top: 40px; font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--rule); padding: 4px 10px; border-radius: 999px; }
.listing__grid { display: grid; gap: 32px 24px; }
.listing__ad { grid-column: 1 / -1; }
.empty { color: var(--muted); padding: 40px 0; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.pager a { font-weight: 600; color: var(--ink); padding: 8px 14px; border: 1px solid var(--rule); border-radius: 999px; transition: background-color .2s; }
.pager a:hover { background: var(--surface); }

.search-inline { display: flex; gap: 8px; margin-top: 20px; max-width: 560px; }
.search-inline input { flex: 1; min-width: 0; padding: 12px 16px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; }
.search-inline button { padding: 0 20px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; }

.static-page { max-width: 760px; padding-block: 40px 64px; }
.static-page h1 { font-size: clamp(34px, 5vw, 56px); margin-bottom: 24px; }
.error-page { padding-block: 64px 24px; text-align: center; display: grid; justify-items: center; gap: 12px; }
.error-page__code { font: 700 clamp(80px, 16vw, 180px)/1 var(--serif); color: var(--brand); letter-spacing: -0.05em; }
.error-page h1 { font-size: 36px; }
.error-page p { color: var(--ink-2); max-width: 520px; }

/* ---------- footer ---------- */
.site-footer { margin-top: 48px; border-top: 3px solid var(--rule-strong); padding-top: 40px; font-size: 14px; }
.footer__grid { display: grid; gap: 32px; }
.footer__grid h2 { font: 700 12px var(--sans); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; color: var(--muted); }
.footer__grid li + li { margin-top: 8px; }
.footer__grid a:hover { color: var(--brand); }
.footer__brand p { margin-top: 12px; color: var(--ink-2); }
.footer__desc { font-size: 13px; color: var(--muted) !important; max-width: 340px; }
.logo--footer .logo__word { font-size: 30px; }
.footer__legal { margin-top: 40px; padding-block: 20px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 13px; }

/* ---------- reveal on scroll ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(14px); }
.js [data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

/* ---------- keyframes ---------- */
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes slide-in { from { transform: translateX(-100%); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(255 255 255 / .7); } 70% { box-shadow: 0 0 0 8px rgb(255 255 255 / 0); } 100% { box-shadow: 0 0 0 0 rgb(255 255 255 / 0); } }
@keyframes shimmer { 50% { opacity: .5; } }
@keyframes flash-up { from { color: var(--up); } }
@keyframes flash-down { from { color: var(--down); } }

/* Reading progress driven by scroll position, no JS needed where supported. */
@supports (animation-timeline: scroll()) {
  .is-article .progress { animation: progress linear both; animation-timeline: scroll(root); }
  @keyframes progress { to { transform: scaleX(1); } }
}

/* ---------- responsive ---------- */
@media (min-width: 640px) {
  .listing__grid, .related__grid, .band__grid, .curated__grid { grid-template-columns: repeat(2, 1fr); }
  .cat-block__grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .hero { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 40px; }
  .hero__stack { border-left: 1px solid var(--rule); padding-left: 32px; }
  .with-sidebar { grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; }
  .sidebar { position: sticky; top: 140px; }
  .story__layout .sidebar { top: 120px; }
  .river .card--grid { grid-template-columns: 260px 1fr; gap: 24px; }
  .river .card--grid .card__body { padding-top: 0; }
  .cat-block__grid { grid-template-columns: 2fr 1fr; grid-template-rows: repeat(3, auto); }
  .cat-block__grid > :first-child { grid-row: span 3; }
  .cat-block__grid > :first-child .card__title { font-size: 28px; }
  .cat-block__grid > .card--mini + .card--mini { padding-top: 20px; border-top: 1px solid var(--rule); }
  .band__grid, .curated__grid, .listing__grid { grid-template-columns: repeat(3, 1fr); }
  .listing .listing__grid { grid-template-columns: repeat(2, 1fr); }
  .related__grid { grid-template-columns: repeat(4, 1fr); }
  .footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
@media (max-width: 1023px) {
  .masthead__menu { visibility: visible; }
  .nav__list { justify-content: flex-start; }
  .topbar__date { display: none; }
}
@media (max-width: 639px) {
  .masthead { height: 60px; }
  .logo__word { font-size: 28px; }
  .card--lead .card__excerpt { font-size: 17px; }
  .share { width: 100%; }
  .listing-head__rss { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .breaking__items { animation: none; }
  @view-transition { navigation: none; }
}

@media print {
  .site-header, .site-footer, .sidebar, .ad, .share, .related, .progress, .inline-sponsored { display: none !important; }
  body { background: #fff; color: #000; }
}
