/* The Weekly Existential — broadsheet styles */
:root {
  --paper: #fbf9f4;
  --ink: #1a1a1a;
  --ink-2: #3d3d3a;
  --muted: #6b6a64;
  --rule: #d9d5ca;
  --rule-strong: #1a1a1a;
  --accent: #7a1f1f;       /* oxblood: kickers, links on hover */
  --link: #1f3a5f;
  --nuclear: #7a1f1f;
  --climate: #2f5d46;
  --ai: #3d3a73;
  --panel: #f3f0e7;
  --img-bg: #ffffff;
  --serif: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", "Helvetica Neue", Arial, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131416;
    --ink: #ecebe6;
    --ink-2: #cfcdc6;
    --muted: #9c9a92;
    --rule: #33342f;
    --rule-strong: #ecebe6;
    --accent: #e08a7d;
    --link: #9cc0ea;
    --nuclear: #e08a7d;
    --climate: #8fc7a8;
    --ai: #b3adf0;
    --panel: #1c1d20;
    --img-bg: #f4f2ec;
  }
}
:root[data-theme="dark"] {
  --paper: #131416; --ink: #ecebe6; --ink-2: #cfcdc6; --muted: #9c9a92;
  --rule: #33342f; --rule-strong: #ecebe6; --accent: #e08a7d; --link: #9cc0ea;
  --nuclear: #e08a7d; --climate: #8fc7a8; --ai: #b3adf0; --panel: #1c1d20; --img-bg: #f4f2ec;
}

* { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
img { max-width: 100%; }

.container { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.measure { max-width: 42rem; margin: 0 auto; padding: 0 1rem; }

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--rule-strong); }
.topbar {
  display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--sans); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding-top: .6rem; padding-bottom: .6rem; border-bottom: 1px solid var(--rule);
}
.topbar span:nth-child(2) { display: none; }
@media (min-width: 640px) { .topbar span:nth-child(2) { display: inline; } }
.brandline { text-align: center; padding-top: 1.6rem; padding-bottom: 1.1rem; }
.brand {
  font-family: var(--serif); font-weight: 600; color: var(--ink); text-decoration: none;
  font-size: clamp(1.75rem, 7vw, 3.6rem); line-height: 1; letter-spacing: -.01em;
  font-variation-settings: "opsz" 72;
}
.brand:hover { color: var(--ink); }
.motto {
  margin: .55rem 0 0; font-family: var(--serif); font-style: italic;
  color: var(--muted); font-size: .95rem;
}
.sections {
  border-top: 3px double var(--rule-strong);
  display: flex; justify-content: center; flex-wrap: wrap; gap: .2rem 1.6rem;
  padding-top: .65rem; padding-bottom: .65rem;
  font-family: var(--sans); font-size: .72rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
}
.sections a { color: var(--ink); text-decoration: none; padding: .15rem 0; border-bottom: 2px solid transparent; }
.sections a:hover { border-bottom-color: var(--accent); color: var(--ink); }
.sections a[aria-current="page"] { border-bottom-color: var(--ink); }

/* ---------- shared type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); font-variation-settings: "opsz" 48; }
p { margin: 0 0 1.1rem; }
.kicker {
  display: inline-block; font-family: var(--sans); font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: .45rem;
}
.kicker.nuclear { color: var(--nuclear); }
.kicker.climate { color: var(--climate); }
.kicker.ai { color: var(--ai); }
.kicker .horizon { color: var(--muted); font-weight: 600; }
.label {
  display: inline-block; font-family: var(--sans); font-size: .62rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--rule); padding: .1rem .4rem; vertical-align: middle;
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-top: 2px solid var(--rule-strong); padding-top: .5rem; margin: 2.6rem 0 1.2rem;
}
.section-head h2 {
  margin: 0; font-family: var(--sans); font-size: .75rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
}
.section-head a { font-family: var(--sans); font-size: .72rem; text-decoration: none; }

/* ---------- home ---------- */
.lead {
  display: grid; gap: 1.6rem; padding: 2rem 0 2.2rem; border-bottom: 1px solid var(--rule);
}
@media (min-width: 860px) {
  .lead { grid-template-columns: 3fr 2fr; align-items: start; gap: 2.4rem; }
  .lead-second { border-left: 1px solid var(--rule); padding-left: 2.4rem; }
}
.lead-main h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
.lead-main .dek { font-size: 1.18rem; }
.lead-second figure { margin: .2rem 0 .8rem; }
.lead-second h3 { font-size: 1.4rem; line-height: 1.2; margin: 0 0 .5rem; }
.lead-second h3 a { color: var(--ink); text-decoration: none; }
.lead-second h3 a:hover { color: var(--accent); }
.lead-second p { font-size: .95rem; color: var(--ink-2); line-height: 1.5; margin-bottom: .6rem; }
.lead h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.08; margin: 0 0 .9rem; letter-spacing: -.01em; }
.lead h2 a, .story h3 a { color: var(--ink); text-decoration: none; }
.lead h2 a:hover, .story h3 a:hover { color: var(--accent); }
.lead .dek { font-size: 1.12rem; color: var(--ink-2); line-height: 1.5; }
.lead figure { margin: 0; }
.byline-sm, .story .byline-sm, .lead .byline-sm { font-family: var(--sans); font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
.byline-sm strong { color: var(--ink); font-weight: 600; }

.front { display: grid; gap: 0 2.4rem; }
@media (min-width: 960px) { .front { grid-template-columns: 1fr 17rem; } }
.stories { display: grid; gap: 0 2rem; }
@media (min-width: 640px) { .stories { grid-template-columns: 1fr 1fr; } }
.story { padding: 1.3rem 0; border-bottom: 1px solid var(--rule); }
.story h3 { font-size: 1.35rem; line-height: 1.2; margin: 0 0 .5rem; }
.story p { font-size: .95rem; color: var(--ink-2); margin-bottom: .6rem; line-height: 1.5; }

.rail { padding-top: 1.3rem; }
.rail h2 {
  font-family: var(--sans); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  border-top: 2px solid var(--rule-strong); padding-top: .5rem; margin: 0 0 .6rem;
}
.figure-stat { padding: .85rem 0; border-bottom: 1px solid var(--rule); }
.figure-stat .num { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.05; font-variation-settings: "opsz" 72; }
.figure-stat .what { font-size: .9rem; color: var(--ink-2); line-height: 1.4; margin: .25rem 0 .2rem; }
.figure-stat .src { font-family: var(--sans); font-size: .66rem; color: var(--muted); letter-spacing: .02em; }
.rail .about { background: var(--panel); padding: 1rem 1.1rem; margin-top: 1.4rem; font-size: .9rem; line-height: 1.5; }
.rail .about h3 { font-size: 1rem; margin: 0 0 .4rem; }

/* ---------- section pages ---------- */
.section-title { text-align: center; padding: 2.4rem 0 1.4rem; border-bottom: 1px solid var(--rule); }
.section-title h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: .2rem 0 .8rem; letter-spacing: -.01em; }
.section-title .dek { max-width: 40rem; margin: 0 auto; color: var(--ink-2); font-size: 1.08rem; line-height: 1.55; }

/* ---------- article ---------- */
.article-head { padding: 2.6rem 0 0; }
.article-head h1 {
  font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -.015em;
  margin: .1rem 0 1rem; font-variation-settings: "opsz" 72;
}
.standfirst { font-size: 1.22rem; line-height: 1.45; color: var(--ink-2); margin-bottom: 1.4rem; }
.byline {
  font-family: var(--sans); font-size: .74rem; color: var(--muted);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: .6rem 0; margin-bottom: 2rem; display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center;
}
.byline strong { color: var(--ink); font-weight: 600; }
article.body { font-size: 1.06rem; }
article.body h2 { font-size: 1.5rem; line-height: 1.25; margin: 2.6rem 0 .8rem; }
article.body h3 { font-size: 1.15rem; margin: 1.8rem 0 .5rem; }
article.body ul, article.body ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
article.body li { margin-bottom: .45rem; }
article.body p.lede::first-letter {
  float: left; font-size: 3.6em; line-height: .82; font-weight: 600;
  padding: .32rem .45rem 0 0; color: var(--ink); font-variation-settings: "opsz" 72;
}
sup { line-height: 0; }
sup a {
  text-decoration: none; font-family: var(--sans); font-size: .7em; font-weight: 600;
  color: var(--accent); padding: 0 .1em;
}

figure { margin: 2.2rem 0; }
figure img { width: 100%; height: auto; display: block; background: var(--img-bg); border: 1px solid var(--rule); }
figcaption {
  font-family: var(--sans); font-size: .74rem; line-height: 1.5; color: var(--muted);
  margin-top: .55rem; padding-top: .45rem; border-top: 1px solid var(--rule);
}
.figure-wide { margin-left: auto; margin-right: auto; }
@media (min-width: 1000px) { article.body .figure-wide { margin-left: -6rem; margin-right: -6rem; } }

.note {
  background: var(--panel); border-top: 2px solid var(--rule-strong);
  padding: 1rem 1.2rem; margin: 2rem 0; font-family: var(--sans); font-size: .82rem; line-height: 1.55; color: var(--ink-2);
}
.note strong:first-child {
  display: block; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin-bottom: .3rem;
}

table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .8rem; margin: 1.6rem 0; line-height: 1.45; }
th, td { text-align: left; padding: .55rem .6rem .55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--rule-strong); }
.table-scroll { overflow-x: auto; }

.sources { font-family: var(--sans); font-size: .78rem; line-height: 1.55; color: var(--ink-2); margin-top: 3rem; }
.sources h2 {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  border-top: 2px solid var(--rule-strong); padding-top: .5rem; font-family: var(--sans);
}
.sources ol { padding-left: 1.5rem; }
.sources li { margin-bottom: .55rem; }
.sources li:target { background: var(--panel); outline: 4px solid var(--panel); }
.sources .tier { color: var(--muted); }

/* plain lists (section pages) */
.article-list { list-style: none; padding: 0; margin: 0; }
.article-list li { padding: 1.3rem 0; border-bottom: 1px solid var(--rule); }
.article-list a.title { font-size: 1.45rem; font-weight: 600; line-height: 1.2; text-decoration: none; color: var(--ink); }
.article-list a.title:hover { color: var(--accent); }
.article-list p { margin: .45rem 0 .5rem; color: var(--ink-2); font-size: .98rem; line-height: 1.5; }

/* about page */
.prose { font-size: 1.04rem; }
.prose h2 { font-size: 1.4rem; margin: 2.4rem 0 .7rem; }
.prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: .6rem; }

/* ---------- footer ---------- */
.site-footer { margin-top: 4.5rem; border-top: 3px double var(--rule-strong); padding: 2rem 0 3rem; font-family: var(--sans); font-size: .74rem; color: var(--muted); }
.footer-grid { display: grid; gap: 1.4rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; color: var(--ink); margin-bottom: .3rem; }
.site-footer h4 { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin: 0 0 .5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .3rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.footer-base { border-top: 1px solid var(--rule); margin-top: 1.6rem; padding-top: 1rem; }
.meta { font-family: var(--sans); font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
