/* ==========================================================================
   The Demandverse — editorial system
   White reading surface, black type, a black masthead carrying the gold
   wordmark. Gold is the single brand accent. Depth (the spatial layer) is
   reserved for the lead-story stack, floating tools and the search panel.
   ========================================================================== */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk.woff2") format("woff2-variations"), url("/assets/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader.woff2") format("woff2-variations"), url("/assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-italic.woff2") format("woff2-variations"), url("/assets/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800; font-style: italic; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --font-ui: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-read: "Newsreader", "Iowan Old Style", Georgia, serif;

  /* Brand gold, sampled from the logo */
  --gold-1: #F5E876;
  --gold-2: #D9A548;
  --gold-3: #C27C2E;
  --gold-grad: linear-gradient(180deg, #F5E876 0%, #F5E876 45%, #D9A548 78%, #C27C2E 100%);
  --logo-1: #F5E876; --logo-2: #D9A548; --logo-3: #C27C2E;

  /* Reading surface */
  --bg: #FFFFFF;
  --bg-soft: #F5F5F4;
  --surface: #FFFFFF;
  --ink: #0A0A0A;
  --ink-2: #3F3F46;
  --ink-3: #71717A;
  --line: #E7E7E7;
  --line-strong: #0A0A0A;
  --hover: #F4F4F5;
  --gold-text: #8A5A0B;      /* gold that passes contrast on white */
  --gold-tint: #FBF5DF;

  /* Masthead & footer stay black in both themes */
  --mast: #0A0A0A;
  --mast-ink: #FFFFFF;
  --mast-ink-2: #A1A1AA;
  --mast-line: #262626;

  --shadow-pop: 0 40px 80px -30px rgba(0, 0, 0, .35), 0 12px 24px -12px rgba(0, 0, 0, .18);
  --shadow-card: 0 24px 48px -28px rgba(0, 0, 0, .35);
  --backdrop: rgba(10, 10, 10, .42);

  --r-l: 18px;
  --r-m: 12px;
  --r-s: 8px;

  --gutter: clamp(16px, 3.2vw, 40px);
  --maxw: 1240px;
  --read: 700px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A0A0A;
  --bg-soft: #151515;
  --surface: #141414;
  --ink: #F5F5F5;
  --ink-2: #C9C9CF;
  --ink-3: #8E8E96;
  --line: #262626;
  --line-strong: #F5F5F5;
  --hover: #171717;
  --gold-text: #E6C35C;
  --gold-tint: #1B1708;
  --mast: #000000;
  --mast-line: #1F1F1F;
  --shadow-pop: 0 40px 80px -30px rgba(0, 0, 0, .9);
  --shadow-card: 0 24px 48px -28px rgba(0, 0, 0, .9);
  --backdrop: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.12; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; border-radius: 4px; }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--gold-1); color: #0A0A0A; border-radius: 999px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 16px; }
main { outline: none; }
.i { flex: none; }
.env { display: none; }

/* ---------- Masthead ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: #0A0A0A;
  border-bottom: 1px solid var(--mast-line);
  color: var(--mast-ink);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; height: 68px;
  padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.brand { display: block; flex: none; }
.logo { width: 196px; height: auto; }
.tabs { display: flex; align-items: center; gap: 4px; margin: 0 auto; height: 100%; }
.tab {
  position: relative; display: flex; align-items: center; height: 100%; padding: 0 12px;
  color: var(--mast-ink-2); text-decoration: none; font-weight: 500; font-size: 15px; white-space: nowrap;
  transition: color .2s;
}
.tab:hover { color: var(--mast-ink); }
.tab.is-on { color: var(--mast-ink); }
.tab.is-on::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--gold-grad); border-radius: 2px;
}
.tools { display: flex; gap: 8px; }
.tool {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; min-width: 40px; padding: 0 12px;
  border: 1px solid #2E2E2E; border-radius: 999px; background: #161616; color: var(--mast-ink);
  transition: border-color .2s, background .2s;
}
.tool:hover { border-color: #4A4A4A; background: #1E1E1E; }
.tool kbd { font: 500 12px/1 var(--font-ui); padding: 3px 6px; border-radius: 5px; border: 1px solid #3A3A3A; color: var(--mast-ink-2); }
.tool-label { font-size: 14.5px; color: #D4D4D8; }
.theme-toggle { padding: 0; justify-content: center; }
.when-dark { display: none; }
[data-theme="dark"] .when-dark { display: block; }
[data-theme="dark"] .when-light { display: none; }

/* ---------- Page frame ---------- */
.scene {
  max-width: var(--maxw); margin: 0 auto; padding: 36px var(--gutter) 0;
  transform-origin: 50% 0;
  transition: transform .45s var(--ease), opacity .45s var(--ease);
}
body.layer-open .scene { transform: scale(.98) translateY(8px); opacity: .35; }
main > * + * { margin-top: 56px; }

/* Section heading pattern: name on a strong top rule, link at the right */
.rail-head, .room-head, .today-head, .after > h2 { border-top: 2px solid var(--line-strong); padding-top: 14px; }

/* ---------- Small parts ---------- */
.dot { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gold-text); font-size: 13px; font-weight: 650; letter-spacing: .01em; text-decoration: none; white-space: nowrap;
}
a.chip:hover { text-decoration: underline; }
.chip-lg, .topic-strip .chip {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); font-size: 14px; font-weight: 550; background: var(--bg);
}
.topic-strip .chip:hover { border-color: var(--ink); text-decoration: none; }
.chip .count { color: var(--ink-3); font-weight: 500; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px;
  transition: border-color .2s, background .2s;
}
.pill:hover { border-color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 700; font-size: 15px; text-decoration: none;
  transition: transform .2s var(--ease), opacity .2s;
}
.btn:hover { transform: translateY(-1px); opacity: .9; }
.round {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  transition: border-color .2s, transform .2s var(--ease);
}
.round:hover { border-color: var(--ink); }
.text-link { color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: underline; text-decoration-color: var(--gold-2); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--ink-3); font-size: 13.5px; }
.sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }

/* ---------- Covers ---------- */
.cover { width: 100%; height: 100%; object-fit: cover; background: #1A1A1A; }

/* ---------- Home: lead stack (the spatial moment) ---------- */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.stack { position: relative; display: flex; flex-direction: column; min-width: 0; }
.stack-space {
  position: relative; min-height: clamp(440px, 58vh, 600px);
  perspective: 1900px; perspective-origin: 70% 0%;
  transform-style: preserve-3d; margin-top: 34px;
}
.lead {
  position: absolute; inset: 0; border-radius: var(--r-l); overflow: hidden;
  background: #111; box-shadow: var(--shadow-card);
  transform-style: preserve-3d;
  transition: transform .75s var(--ease), opacity .6s var(--ease);
}
.lead[data-pos="0"] { z-index: 5; transform: translate3d(0, 0, 0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.lead[data-pos="1"] { z-index: 4; transform: translate3d(3%, -20px, -130px); opacity: .55; }
.lead[data-pos="2"] { z-index: 3; transform: translate3d(6%, -38px, -260px); opacity: .25; }
.lead[data-pos="3"], .lead[data-pos="4"] { z-index: 2; transform: translate3d(9%, -54px, -390px); opacity: 0; }
.lead[data-pos="-1"] { z-index: 6; transform: translate3d(-4%, 26px, 150px); opacity: 0; pointer-events: none; }
.lead:not([data-pos="0"]) { pointer-events: none; }
.lead-link { display: block; position: absolute; inset: 0; color: #fff; text-decoration: none; transform-style: preserve-3d; }
.lead-art { position: absolute; inset: 0; }
.lead-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.55) 65%, rgba(0,0,0,.9) 100%); }
.lead-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; gap: 12px; justify-items: start; padding: 32px 36px 32px;
  transform: translateZ(50px); color: #fff;
}
.lead-panel .chip { color: var(--gold-1); }
.lead-panel .meta { color: #C4C4C8; }
.lead-title { font-size: clamp(1.75rem, 3.2vw, 2.9rem); font-weight: 760; letter-spacing: -.028em; line-height: 1.04; max-width: 22ch; }
.lead-dek { font-family: var(--font-read); font-size: clamp(1.02rem, 1.3vw, 1.16rem); line-height: 1.5; color: #E4E4E7; max-width: 60ch; }
.lead-link:hover .lead-title { text-decoration: underline; text-decoration-color: var(--gold-1); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.stack-controls { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.stack-count { color: var(--ink-3); font-size: 14px; font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; }

/* Latest rail */
.rail { min-width: 0; }
.rail-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.rail-head h2 { font-size: 1.25rem; }
.rail-list { list-style: none; }
.rail-list li { border-bottom: 1px solid var(--line); }
.rail-list a { display: grid; gap: 5px; padding: 14px 0; text-decoration: none; }
.rail-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; color: var(--gold-text); }
.rail-meta time { color: var(--ink-3); font-weight: 500; margin-left: auto; }
.rail-title { font-weight: 620; font-size: 15.5px; line-height: 1.32; }
.rail-list a:hover .rail-title { text-decoration: underline; }

.topic-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin-inline: -2px; }
.topic-strip::-webkit-scrollbar { display: none; }
.topic-strip.in-head { margin-top: 24px; flex-wrap: wrap; }

/* New today */
.today-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 22px; }
.today-head h2 { font-size: 1.6rem; }
.today-head p { color: var(--ink-3); }
.today-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 26px; }

/* ---------- Topic sections ---------- */
.room-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; margin-bottom: 26px; }
.room-head h2 { font-size: clamp(1.5rem, 2.2vw, 1.9rem); }
.room-head h2 a { text-decoration: none; }
.room-head h2 a:hover { text-decoration: underline; text-decoration-color: var(--gold-2); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.room-head p { color: var(--ink-3); font-size: 14.5px; max-width: 62ch; flex: 1; }
.room-head .pill { margin-left: auto; }
.room-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; }
.room-list { display: grid; align-content: start; }
.room-list .card + .card { border-top: 1px solid var(--line); }
.room-list .card:first-child .card-link { padding-top: 0; }

/* ---------- Cards ---------- */
.card { position: relative; min-width: 0; }
.card-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.frame { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-m); background: #111; }
.frame .cover { transition: transform .6s var(--ease); }
.card-link:hover .frame .cover { transform: scale(1.03); }
.card-text { display: grid; gap: 8px; justify-items: start; padding-top: 14px; }
.card-title { font-size: 1.1rem; font-weight: 650; line-height: 1.28; letter-spacing: -.012em; }
.card-link:hover .card-title { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.card-dek { font-family: var(--font-read); color: var(--ink-2); font-size: 1.05rem; line-height: 1.5; }
.card-feature .card-title { font-size: clamp(1.4rem, 2.1vw, 1.85rem); font-weight: 720; letter-spacing: -.022em; line-height: 1.12; }
.card-feature .card-text { padding-top: 18px; gap: 10px; }
.card-row .card-link { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 18px; align-items: start; padding: 16px 0; }
.card-row .thumb { order: 2; display: block; aspect-ratio: 4 / 3; border-radius: var(--r-s); overflow: hidden; background: #111; }
.card-row .card-text { padding: 0; gap: 6px; }
.card-row .card-title { font-size: 1.02rem; line-height: 1.32; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 40px 28px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-feature { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 36px; align-items: start; padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.feature-side { display: grid; }
.feature-side .card + .card { border-top: 1px solid var(--line); }
.feature-side .card:first-child .card-link { padding-top: 0; }
.grid-topics { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }

/* ---------- Listing heads ---------- */
.list-head { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.list-head-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px 30px; }
.list-title { font-size: clamp(2.3rem, 5vw, 4rem); font-weight: 780; letter-spacing: -.035em; line-height: 1; }
.list-intro { margin-top: 14px; max-width: 60ch; color: var(--ink-2); font-family: var(--font-read); font-size: 1.18rem; line-height: 1.5; }
.list-stats { display: flex; align-items: center; gap: 14px; }
.stat { color: var(--ink-3); }
.stat strong { color: var(--ink); font-size: 1.35rem; margin-right: 4px; font-variant-numeric: tabular-nums; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13.5px; margin-bottom: 18px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
main > * + .grid { margin-top: 40px; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager > :last-child { justify-self: end; }
.pager-count { color: var(--ink-3); font-size: 14px; }
.empty { color: var(--ink-2); padding: 24px 0; }
.empty a, .empty-note a { color: var(--ink); text-decoration-color: var(--gold-2); }

/* Topics */
.topic-tile { display: grid; overflow: hidden; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: var(--r-l); transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.topic-tile:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); }
.topic-art { aspect-ratio: 16 / 7; width: 100%; height: auto; object-fit: cover; }
.topic-body { display: grid; gap: 8px; padding: 18px 20px 20px; }
.topic-name { font-weight: 720; font-size: 1.3rem; letter-spacing: -.015em; }
.topic-desc { color: var(--ink-2); font-size: 15px; }

/* Archive */
.archive-month h2 { font-size: 1.35rem; padding-top: 14px; border-top: 2px solid var(--line-strong); margin-bottom: 6px; }
.archive-list { list-style: none; columns: 2 420px; column-gap: 48px; }
.archive-list li { break-inside: avoid; display: grid; grid-template-columns: 54px 1fr; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.archive-list time { color: var(--ink-3); font-size: 13.5px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.archive-list a { text-decoration: none; font-weight: 560; line-height: 1.35; }
.archive-list a:hover { text-decoration: underline; }
.archive-cat { grid-column: 2; color: var(--gold-text); font-size: 12.5px; font-weight: 600; }

/* Saved */
.saved-list { list-style: none; }
.saved-list li { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.saved-list a { flex: 1; padding: 14px 0; font-weight: 600; text-decoration: none; }
.saved-list a:hover { text-decoration: underline; }
.empty-note { padding: 18px 0; color: var(--ink-2); }

/* Newsletter block: a black panel with the gold action */
.signup {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center;
  padding: 44px; border-radius: var(--r-l); background: #0A0A0A; color: #fff;
  position: relative; overflow: hidden;
}
.signup::before {
  content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 232, 118, .22), rgba(194, 124, 46, 0) 70%); pointer-events: none;
}
.signup > * { position: relative; }
.signup h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: 10px; }
.signup p { color: #BDBDC4; max-width: 52ch; }
.subscribe label { display: block; font-weight: 650; margin-bottom: 10px; }
.subscribe-row { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: #fff; border: 1px solid #E7E7E7; }
.subscribe-row input[type="email"] { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border: 0; background: transparent; color: #0A0A0A; font: inherit; font-size: 16px; outline: none; }
.subscribe-row input::placeholder { color: #8E8E96; }
.subscribe-row .btn { background: var(--gold-grad); color: #0A0A0A; height: 44px; }
.subscribe-msg { min-height: 1.4em; margin-top: 8px; font-size: 14px; color: inherit; opacity: .8; }

/* ---------- Article ---------- */
.story-head { padding-bottom: 8px; }
.story-head-grid { display: grid; gap: 30px; }
.story-head-text { display: grid; gap: 16px; justify-items: start; max-width: 880px; }
.story-title { font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 780; letter-spacing: -.032em; line-height: 1.04; }
.story-dek { font-family: var(--font-read); font-size: clamp(1.15rem, 1.6vw, 1.38rem); line-height: 1.5; color: var(--ink-2); max-width: 62ch; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; color: var(--ink-3); padding-top: 14px; border-top: 1px solid var(--line); width: 100%; }
.byline a { color: var(--ink); font-weight: 650; text-decoration: none; }
.byline a:hover { text-decoration: underline; }
.story-figure { margin: 0; aspect-ratio: 16 / 8; border-radius: var(--r-l); overflow: hidden; background: #111; }

.story-layout { display: grid; grid-template-columns: minmax(0, var(--read)); justify-content: center; gap: 56px; margin-top: 40px; }
.story-layout.has-toc { grid-template-columns: 220px minmax(0, var(--read)); justify-content: start; padding-left: max(0px, calc((100% - var(--read)) / 2 - 276px)); }
.toc { position: relative; }
.toc-inner { position: sticky; top: 100px; max-height: calc(100vh - 130px); overflow: auto; }
.toc h2 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink-3); margin-bottom: 10px; letter-spacing: 0; }
.toc ol { list-style: none; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 7px 0 7px 14px; margin-left: -1px; font-size: 14px; line-height: 1.35; color: var(--ink-3); text-decoration: none; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--gold-2); font-weight: 600; }

.prose { font-family: var(--font-read); font-size: clamp(1.12rem, 1.25vw, 1.25rem); line-height: 1.7; color: var(--ink); font-optical-sizing: auto; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { font-family: var(--font-ui); font-size: clamp(1.4rem, 2vw, 1.7rem); line-height: 1.2; margin-top: 2em; letter-spacing: -.02em; }
.prose h3 { font-family: var(--font-ui); font-size: 1.2rem; margin-top: 1.7em; }
.prose h4 { font-family: var(--font-ui); font-size: 1.05rem; margin-top: 1.5em; }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--gold-3); }
.prose a { color: var(--ink); text-decoration-color: var(--gold-2); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { background: var(--gold-tint); }
.prose strong { font-weight: 650; }
.prose blockquote { margin-left: 0; padding: 2px 0 2px 22px; border-left: 3px solid var(--gold-2); color: var(--ink-2); font-style: italic; }
.prose > p:first-child::first-letter { float: left; font-family: var(--font-ui); font-weight: 800; font-size: 3.5em; line-height: .82; margin: .06em .1em 0 0; color: var(--ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-m); }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: .82em; line-height: 1.45; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--bg-soft); font-weight: 650; }

.takeaways { margin-bottom: 36px; padding: 22px 24px; border-radius: var(--r-m); background: var(--bg-soft); }
.takeaways h2 { font-size: 1rem; margin-bottom: 12px; }
.takeaways ul { display: grid; gap: 9px; list-style: none; }
.takeaways li { position: relative; padding-left: 22px; line-height: 1.5; }
.takeaways li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-grad); }

.faqs, .sources { margin-top: 52px; padding-top: 16px; border-top: 2px solid var(--line-strong); }
.faqs h2, .sources h2 { font-size: 1.3rem; margin-bottom: 14px; }
.faqs details { border-bottom: 1px solid var(--line); }
.faqs summary { cursor: pointer; padding: 16px 0; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faqs summary::-webkit-details-marker { display: none; }
.faqs summary::after { content: "+"; font-size: 1.3em; line-height: 1; color: var(--ink-3); transition: transform .25s var(--ease); }
.faqs details[open] summary::after { transform: rotate(45deg); }
.faqs details p { padding: 0 0 18px; color: var(--ink-2); font-family: var(--font-read); font-size: 1.08rem; line-height: 1.6; }
.sources ol { padding-left: 1.4em; display: grid; gap: 8px; font-size: 15px; }
.sources a { color: var(--ink); font-weight: 550; text-decoration-color: var(--gold-2); }
.src-host { color: var(--ink-3); font-size: 13px; margin-left: 4px; }
.disclosure { display: flex; gap: 10px; align-items: flex-start; margin-top: 36px; color: var(--ink-3); font-size: 14px; }
.disclosure .i { margin-top: 2px; color: var(--gold-3); }
.disclosure a { color: var(--ink-2); }
.story-end { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.story-actions { display: flex; gap: 8px; }
[data-save].is-saved .i { fill: var(--gold-2); stroke: var(--gold-3); }

.after { margin-top: 72px; }
.after h2 { font-size: 1.5rem; margin-bottom: 26px; }
.after .pill { margin-top: 30px; }

/* Floating story tools (spatial ornament) */
.ornament-actions {
  position: fixed; right: max(18px, calc((100vw - var(--maxw)) / 2 - 60px)); top: 50%; z-index: 30;
  display: grid; gap: 4px; justify-items: center; padding: 8px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  transform: translateY(-50%);
}
[data-theme="dark"] .ornament-actions { background: #141414; }
.ornament-actions .round { width: 38px; height: 38px; border-color: transparent; background: transparent; }
.ornament-actions .round:hover { background: var(--hover); }
.progress { width: 34px; height: 34px; transform: rotate(-90deg); margin-bottom: 2px; }
.progress circle { fill: none; stroke-width: 3; }
.progress-track { stroke: var(--line); }
.progress-bar { stroke: var(--gold-2); stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; }

.static-page .prose > p:first-child::first-letter { all: unset; }

/* ---------- Search panel (spatial: the page recedes behind it) ---------- */
.layer { position: fixed; inset: 0; z-index: 60; display: grid; justify-items: center; align-items: start; padding: 11vh 16px 16px; }
.layer[hidden] { display: none; }
.layer-backdrop { position: absolute; inset: 0; background: var(--backdrop); }
.layer-window {
  position: relative; width: min(720px, 100%); max-height: 74vh; display: flex; flex-direction: column;
  border-radius: 20px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-pop);
  border: 1px solid var(--line);
  animation: layer-in .45s var(--ease) both;
}
@keyframes layer-in { from { opacity: 0; transform: translateY(-14px) scale(1.03); } to { opacity: 1; transform: none; } }
.search-form { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 20px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.search-form input { flex: 1; min-width: 0; height: 50px; border: 0; background: transparent; color: var(--ink); font: 500 19px/1 var(--font-ui); outline: none; }
.search-form input::placeholder { color: var(--ink-3); }
.search-form input::-webkit-search-cancel-button { display: none; }
.search-form .tool { background: var(--hover); border-color: var(--line); color: var(--ink); }
.search-page { margin-top: 22px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 20px; }
.search-results { list-style: none; overflow-y: auto; padding: 8px; }
.search-results:empty { display: none; }
.search-results a { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; text-decoration: none; }
.search-results [aria-selected="true"] a, .search-results a:hover { background: var(--hover); }
.sr-title { font-weight: 650; line-height: 1.3; }
.sr-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; }
.sr-empty { padding: 18px; color: var(--ink-2); }
.search-hint { padding: 10px 20px 14px; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); }

/* ---------- Footer (black, like the masthead) ---------- */
.site-footer { margin-top: 96px; background: var(--mast); color: var(--mast-ink); }
body.layer-open .site-footer { opacity: .35; }
.footer-window { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr); gap: 40px 56px; padding: 56px var(--gutter) 36px; }
.footer-brand { display: grid; gap: 16px; align-content: start; }
.logo-footer { width: 240px; }
.footer-brand > p { color: var(--mast-ink-2); max-width: 44ch; }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-cols h2 { font-size: 13px; font-weight: 650; color: var(--gold-1); margin-bottom: 14px; letter-spacing: .02em; }
.footer-cols ul { list-style: none; display: grid; gap: 9px; }
.footer-cols a { display: inline-flex; align-items: center; gap: 8px; color: #E4E4E7; text-decoration: none; font-size: 15px; }
.footer-cols a:hover { color: #fff; text-decoration: underline; }
.footer-legal { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid var(--mast-line); color: var(--mast-ink-2); font-size: 13.5px; }

/* ---------- Mobile dock (floating ornament) ---------- */
.dock { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .story-layout.has-toc { grid-template-columns: minmax(0, var(--read)); justify-content: center; padding-left: 0; }
  .toc { display: none; }
}
@media (max-width: 1180px) {
  .tab { padding: 0 9px; font-size: 14.5px; }
  .tool-label, .tool kbd { display: none; }
  .ornament-actions { right: 12px; }
}
@media (max-width: 1060px) {
  .stage { grid-template-columns: 1fr; }
  .rail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .tabs { display: none; }
  .tools { margin-left: auto; }
  .room-body { grid-template-columns: 1fr; }
  .grid-feature { grid-template-columns: 1fr; }
  .signup, .footer-window { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  .topbar-inner { height: 58px; gap: 12px; }
  .logo { width: 160px; }
  .tools .search-open { display: none; }
  .scene { padding-top: 22px; }
  main > * + * { margin-top: 44px; }
  .stack-space { min-height: 500px; margin-top: 24px; perspective: 1200px; }
  .lead[data-pos="1"] { transform: translate3d(3%, -14px, -100px); }
  .lead[data-pos="2"] { transform: translate3d(6%, -26px, -200px); }
  .lead-panel { padding: 22px; transform: none; }
  .lead-dek { display: none; }
  .rail-list { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .room-head .pill { margin-left: 0; }
  .card-row .card-link { grid-template-columns: minmax(0, 1fr) 88px; gap: 14px; }
  .signup { padding: 28px 22px; }
  .footer-window { padding: 40px 20px 110px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .ornament-actions { display: none; }
  .story-figure { aspect-ratio: 16 / 10; }
  .dock {
    position: fixed; z-index: 45; left: 50%; bottom: max(12px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; width: min(380px, calc(100vw - 24px));
    padding: 6px; border-radius: 999px;
    background: #0A0A0A; border: 1px solid #262626; box-shadow: 0 16px 32px -16px rgba(0, 0, 0, .6);
  }
  .dock-item { display: grid; justify-items: center; gap: 2px; padding: 7px 0 5px; border: 0; border-radius: 999px; background: transparent; color: #A1A1AA; text-decoration: none; font-size: 11.5px; font-weight: 600; }
  .dock-item.is-on { color: var(--gold-1); background: #1A1A1A; }
  .layer { padding-top: 12px; }
  .layer-window { max-height: 86vh; }
  .archive-list { columns: 1; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager-count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .topbar, .dock, .ornament-actions, .site-footer, .after, .toc, .story-actions, .layer { display: none !important; }
}

/* ---------- Generic surface (used by the admin panel) ---------- */
.window { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.room.window, .rail.window, .list-head.window, .story-head.window, .story-body.window, .after.window,
.today.window, .archive-month.window, .saved-window.window, .empty.window, .footer-window.window {
  background: none; border: 0; border-radius: 0;
}
.signup.window { background: #0A0A0A; border: 0; border-radius: var(--r-l); }
.topic-tile.window { background: var(--bg); }

/* ==========================================================================
   Hero + Demand Signals cockpit
   ========================================================================== */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 64px; align-items: center; padding: 28px 0 24px; }
.hero-copy { display: grid; gap: 22px; justify-items: start; }
.hero-kicker { color: var(--gold-text); font-weight: 700; font-size: 14px; letter-spacing: .04em; }
.hero-title { font-size: clamp(2.7rem, 5.6vw, 4.8rem); font-weight: 820; letter-spacing: -.045em; line-height: .96; max-width: 13ch; }
.hero-sub { font-family: var(--font-read); font-size: clamp(1.15rem, 1.5vw, 1.32rem); line-height: 1.5; color: var(--ink-2); max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.btn-gold { background: var(--gold-grad); color: #0A0A0A; box-shadow: 0 14px 30px -14px rgba(194, 124, 46, .7); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); opacity: 1; }

.cockpit-wrap { position: relative; perspective: 1600px; padding: 0 0 34px 34px; }
.cockpit {
  position: relative; display: grid; gap: 16px; padding: 22px;
  border-radius: 22px; color: #EDEDED;
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(245, 232, 118, .12), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 100% 28px,
    #0B0B0C;
  border: 1px solid #242424;
  box-shadow: 0 60px 100px -50px rgba(0, 0, 0, .65), 0 20px 40px -24px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
  transform: rotateX(var(--rx, 2deg)) rotateY(var(--ry, -6deg));
  transform-style: preserve-3d;
  transition: transform .6s var(--ease);
}
.ck-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ck-title { font-weight: 700; font-size: 15px; color: #fff; }
.ck-live { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: #A1A1AA; }
.ck-pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-1); }
.ck-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--gold-1); opacity: 0; }
.cockpit.is-on .ck-pulse::after { animation: ck-pulse 2.4s ease-out 4; }
@keyframes ck-pulse { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(3.2); opacity: 0; } }
.ck-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ck-stats > div { display: grid; gap: 4px; padding: 14px; border-radius: 14px; background: #141416; border: 1px solid #222; }
.ck-num { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 780; letter-spacing: -.03em; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.ck-stats > div:first-child .ck-num { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ck-label { font-size: 12.5px; color: #A1A1AA; }
.ck-block { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: #121214; border: 1px solid #222; }
.ck-block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; font-weight: 650; color: #E4E4E7; }
.ck-note { font-weight: 500; color: #71717A; font-size: 12px; }
.ck-heat { display: grid; grid-template-columns: 78px repeat(12, minmax(0, 1fr)); gap: 4px; align-items: center; }
.ck-heat-label { font-size: 11.5px; color: #A1A1AA; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-cell { aspect-ratio: 1.6; border-radius: 4px; background: #1C1C1F; }
.ck-cell.h1 { background: rgba(245, 232, 118, .16); }
.ck-cell.h2 { background: rgba(245, 232, 118, .34); }
.ck-cell.h3 { background: rgba(217, 165, 72, .62); }
.ck-cell.h4 { background: var(--gold-grad); box-shadow: 0 0 12px rgba(245, 232, 118, .35); }
.ck-month { font-size: 10.5px; color: #71717A; }
.ck-bars { list-style: none; display: grid; gap: 9px; }
.ck-bars li { display: grid; grid-template-columns: 86px minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 12.5px; }
.ck-bars a { color: #D4D4D8; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-bars a:hover { color: #fff; text-decoration: underline; }
.ck-bar { height: 8px; border-radius: 99px; background: #1F1F22; overflow: hidden; }
.ck-bar i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--gold-grad); transition: width 1.2s var(--ease); }
.js .cockpit:not(.is-on) .ck-bar i { width: 0; }
.ck-pct { color: #A1A1AA; text-align: right; font-variant-numeric: tabular-nums; }

/* The newest story floats in front of the panel (spatial layer) */
.ck-float {
  position: absolute; left: 0; bottom: 0; z-index: 2; width: min(300px, 70%);
  display: grid; gap: 6px; padding: 16px 18px; border-radius: 16px;
  background: #FFFFFF; color: #0A0A0A; text-decoration: none;
  border: 1px solid #E7E7E7; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .45);
  transform: translate3d(var(--fx, 0), var(--fy, 0), 0);
  transition: transform .6s var(--ease), box-shadow .3s;
}
.ck-float:hover { box-shadow: 0 36px 70px -24px rgba(0, 0, 0, .55); }
.ck-float-label { font-size: 12px; font-weight: 700; color: #8A5A0B; }
.ck-float-title { font-weight: 680; line-height: 1.3; font-size: 15px; }
.ck-float:hover .ck-float-title { text-decoration: underline; }
.ck-float-meta { font-size: 12.5px; color: #71717A; }
[data-theme="dark"] .ck-float { background: rgba(28, 28, 30, .95); color: #F5F5F5; border-color: #2E2E2E; }
[data-theme="dark"] .ck-float-label { color: var(--gold-1); }

.section-head { border-top: 2px solid var(--line-strong); padding-top: 14px; }
.section-head h2 { font-size: 1.6rem; }
main > .section-head + .stage { margin-top: 8px; }

@media (max-width: 1060px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .cockpit-wrap { max-width: 600px; }
}
@media (max-width: 760px) {
  .hero { padding-top: 8px; }
  .cockpit-wrap { padding: 0; }
  .cockpit { transform: none; padding: 16px; }
  .ck-stats > div { padding: 10px; }
  .ck-heat { grid-template-columns: 64px repeat(12, minmax(0, 1fr)); gap: 3px; }
  .ck-float { position: relative; width: auto; margin-top: -10px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ck-pulse { animation: none; }
  .cockpit { transform: none; }
}

/* ==========================================================================
   Type covers: shown when a story has no photo. Black field, gold topic,
   the subject in large type. Scales from hero to thumbnail.
   ========================================================================== */
.tcover {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  width: 100%; height: 100%; padding: 7% 7.5%; overflow: hidden;
  container-type: size;
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(245, 232, 118, .16), transparent 60%),
    radial-gradient(60% 70% at 0% 100%, rgba(194, 124, 46, .10), transparent 70%),
    #0B0B0C;
  color: #fff; font-family: var(--font-ui);
}
.tcover::before { content: ""; position: absolute; inset: 0; opacity: .9; pointer-events: none; }
.tc-nodes::before { background-image: radial-gradient(rgba(255, 255, 255, .09) 1.2px, transparent 1.6px); background-size: 22px 22px; }
.tc-orbit::before { background: repeating-radial-gradient(circle at 85% 20%, transparent 0 26px, rgba(255, 255, 255, .05) 26px 27px); }
.tc-lattice::before { background: repeating-linear-gradient(135deg, transparent 0 18px, rgba(255, 255, 255, .045) 18px 19px); }
.tc-rings::before { background: repeating-radial-gradient(circle at 15% 85%, transparent 0 22px, rgba(255, 255, 255, .05) 22px 23px); }
.tc-pulse::before { background: repeating-linear-gradient(0deg, transparent 0 20px, rgba(255, 255, 255, .045) 20px 21px); }
.tc-arcs::before { background: repeating-conic-gradient(from 0deg at 100% 100%, rgba(255, 255, 255, .045) 0 2deg, transparent 2deg 9deg); }
.tc-cat, .tc-word, .tc-mark { position: relative; }
.tc-cat { font-size: max(11px, 4.2cqw); font-weight: 700; color: var(--gold-1); letter-spacing: .02em; }
.tc-word {
  font-size: clamp(14px, 11cqw, 64px); font-weight: 800; letter-spacing: -.035em; line-height: .98;
  max-width: 92%; text-wrap: balance;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 55%, #E9D9A6 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tc-mark {
  position: absolute; right: 6%; top: 7%; font-size: max(10px, 3.4cqw); font-weight: 800; letter-spacing: -.02em;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: .9;
}
/* Small slots (thumbnails): just the mark and the topic */
@container (max-width: 200px) {
  .tc-word { display: none; }
  .tc-cat { font-size: 11px; margin-top: auto; }
  .tc-mark { font-size: 16px; }
}
.lead .tcover { padding: 6% 6%; }
.lead .tc-word { opacity: .22; font-size: clamp(40px, 14cqw, 160px); align-self: flex-end; text-align: right; }
.lead .tc-cat { display: none; }
.topic-art.tcover { aspect-ratio: 16 / 7; height: auto; }

/* Article photo + credit */
.story-figure-wrap { margin: 0; display: grid; gap: 8px; }
.credit { font-size: 12.5px; color: var(--ink-3); }
.credit a { color: var(--ink-2); }
.subscribe-note { margin-top: 6px; font-size: 12.5px; opacity: .7; }
.subscribe-note a { color: inherit; }
.footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Legal pages */
.legal-page .kicker { margin: 0 0 10px; font: 700 12px/1 var(--ui, inherit); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink, #8a6a1f); }
.legal-updated { margin: 14px 0 0; font-size: 13.5px; color: var(--muted, #666); }
.legal-page .prose table { font-size: 15px; }
.legal-page .prose td, .legal-page .prose th { vertical-align: top; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px; max-width: 880px; margin: 32px auto 0; padding: 0 16px; }
.legal-nav a { padding: 7px 14px; border: 1px solid var(--line, #e5e5e5); border-radius: 999px; font-size: 13.5px; text-decoration: none; color: inherit; }
.legal-nav a:hover, .legal-nav a[aria-current] { border-color: currentColor; }
.legal-nav a[aria-current] { background: var(--ink, #0a0a0a); color: var(--paper, #fff); }

/* Performance: skip rendering work for sections that are off-screen */
.room, .today, .signup, .topic-strip, .site-footer, .grid-3, .related, .more-section { content-visibility: auto; contain-intrinsic-size: auto 600px; }
.site-footer { contain-intrinsic-size: auto 420px; }
