/* ════════════════════════════════════════════════════════════════
   Common Growth · St. Francis
   Visual system: City of St. Francis civic brand (maroon / paper /
   Libre Franklin / arched sign motif), spatial feel adapted from a
   modern editorial layout (generous whitespace, hairline structure,
   floating nav, quiet scroll motion).
   ════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 17px; -webkit-text-size-adjust: 100%; }

/* Horizontal-overflow guard. Off-page boxes that are hidden but still in layout
   (notably the .term-tip::after tooltips: position:absolute, width:270px, hidden
   only via opacity:0) extend the page's scroll width and let narrow viewports
   slide sideways. Clip horizontal overflow at the root so it can never widen the
   page; vertical scrolling and each .table-wrap's own overflow-x:auto are
   unaffected. Must be on BOTH html and body — root overflow propagation means
   neither alone takes effect. overflow-x:clip (where supported) avoids creating a
   scroll container, so it never interferes with position:sticky. */
html, body { overflow-x: hidden; }
@supports (overflow-x: clip) { html, body { overflow-x: clip; } }

body {
  font-family: 'Libre Franklin', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Tokens ── */
:root {
  --maroon:      #6E1A2C;
  --maroon-deep: #4E101F;
  --maroon-tint: #F4EAEC;   /* quiet maroon wash for fills */
  --maroon-on:   #FBEFF1;   /* text on maroon */
  --ink:         #1C1619;
  --white:       #FFFFFF;
  --paper:       #FAF6F3;
  --paper-2:     #F3EDE8;   /* slightly deeper paper for quiet bands */
  --gray:        #978C91;
  --border:      #EAE4E6;

  /* seal accents — used sparingly, never as primary fields */
  --gold:        #F4B400;
  --lake:        #2EA7DC;
  --brick:       #9E4A35;
  --slate:       #41607F;   /* steelman / concede coding */

  --focus:       rgba(200, 72, 95, .45);
  --shadow:      0 4px 12px rgba(28, 22, 25, .10);
  --shadow-lg:   0 10px 30px rgba(28, 22, 25, .14);
  --ease:        cubic-bezier(.2, 0, 0, 1);
  --dur:         190ms;

  /* the signature arched-sign top */
  --arch: 50% 50% 8px 8px / 30% 30% 8px 8px;

  --content: 820px;   /* prose measure */
  --wide:    1140px;  /* feature / hero / footer band */
}

/* ── Typography ── */
h1, h2, h3, h4, h5 { font-family: inherit; color: var(--ink); }
h1 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.04; font-size: clamp(2.4rem, 6vw, 4.1rem); }
h2 { font-weight: 700; letter-spacing: -0.01em; line-height: 1.12; font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 1rem; }
h3 { font-weight: 700; letter-spacing: -0.01em; line-height: 1.18; font-size: 1.4rem; margin: 2rem 0 0.6rem; }
h4 { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1.2rem; }
ul, ol { margin: 0 0 1.2rem 1.4rem; }
li { margin-bottom: 0.55rem; }
strong { font-weight: 700; color: var(--ink); }
em { font-style: italic; }

a { color: var(--maroon); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; transition: color var(--dur) var(--ease); }
a:hover { color: var(--maroon-deep); }

/* Overline / label — maroon, uppercase, tracked */
.overline, .panel-eyebrow, .page-eyebrow, .response-label {
  font-weight: 600; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--maroon);
}

/* Monospace for data / dates / codes */
.mono, .data-table td.number, .timeline-date, .source-type {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

/* ── Hover definitions (glossary) ── */
.term-tip {
  border-bottom: 2px dotted var(--maroon);
  cursor: help; position: relative; font-weight: 600; color: var(--ink);
}
.term-tip::after {
  content: attr(data-tip);
  position: absolute; bottom: 135%; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--white);
  padding: 0.7rem 0.9rem; border-radius: 8px;
  font-size: 0.78rem; font-weight: 400; line-height: 1.45;
  width: 270px; max-width: 80vw; white-space: normal;
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  z-index: 2000; box-shadow: var(--shadow-lg);
}
.term-tip:hover::after, .term-tip:focus::after { opacity: 1; transform: translateX(-50%) translateY(-6px); }

/* ════════════════ Header / floating nav ════════════════ */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1500;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem clamp(1rem, 4vw, 2rem);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}
/* solid state, applied by JS once scrolled past the hero */
header.scrolled {
  background: rgba(250, 246, 243, 0.88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

/* Brand: the SF sign mark (sf-sign.svg — black-outlined arch, "SF").
   One file, used everywhere: nav, avatars, footer. */
.nav-brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.nav-brand .emblem {
  width: 28px; height: 30px; flex: none;
  background: url("sf-sign.svg") center / contain no-repeat;
}
.nav-brand .wordmark { line-height: 1.05; }
.nav-brand .wm-eyebrow {
  display: block; font-weight: 600; font-size: 0.6rem; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--gray);
}
.nav-brand .wm-name { display: block; font-weight: 800; font-size: 1.02rem; letter-spacing: -0.01em; color: var(--ink); }
header:not(.scrolled) .nav-brand .wm-eyebrow { color: rgba(255,255,255,.7); }
header:not(.scrolled) .nav-brand .wm-name { color: var(--white); }

/* Hamburger (mobile) */
.hamburger {
  background: none; border: none; cursor: pointer; z-index: 1600;
  display: flex; flex-direction: column; gap: 5px; padding: 0.5rem;
}
.hamburger div { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: all var(--dur) var(--ease); }
header:not(.scrolled) .hamburger div { background: var(--white); }
.hamburger.open div { background: var(--ink); }
.hamburger.open .line1 { transform: rotate(-45deg) translate(-5px, 6px); }
.hamburger.open .line2 { opacity: 0; }
.hamburger.open .line3 { transform: rotate(45deg) translate(-5px, -6px); }

/* Nav drawer (mobile) */
nav {
  position: fixed; top: 0; right: -110%; width: 300px; max-width: 82vw; height: 100vh;
  background: var(--maroon); padding: 5.5rem 1.75rem 2rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: right var(--dur) var(--ease); z-index: 1400;
  box-shadow: -10px 0 40px rgba(28,22,25,.3); overflow-y: auto;
}
nav.open { right: 0; }
nav a {
  color: var(--maroon-on); text-decoration: none; font-size: 1.05rem; font-weight: 600;
  padding: 0.65rem 0; border-bottom: 1px solid rgba(255,255,255,.14);
  transition: color var(--dur) var(--ease), padding-left var(--dur) var(--ease);
}
nav a:hover, nav a.active { color: var(--white); padding-left: 0.3rem; }
nav a.active { color: var(--white); }

/* ── Desktop nav ── */
@media (min-width: 860px) {
  .hamburger { display: none; }
  nav {
    position: static; width: auto; height: auto; max-width: none; background: none;
    padding: 0; flex-direction: row; gap: 0.4rem; box-shadow: none; overflow: visible;
  }
  nav a {
    border: none; padding: 0.4rem 0.85rem; font-size: 0.85rem; font-weight: 600;
    border-radius: 999px; color: var(--ink);
  }
  nav a:hover { padding-left: 0.85rem; background: var(--maroon-tint); color: var(--maroon); }
  nav a.active { background: var(--maroon); color: var(--maroon-on); }
  header:not(.scrolled) nav a { color: rgba(255,255,255,.92); }
  header:not(.scrolled) nav a:hover { background: rgba(255,255,255,.16); color: var(--white); }
  header:not(.scrolled) nav a.active { background: var(--white); color: var(--maroon); }
}

/* ════════════════ Hero (home) ════════════════ */
.hero {
  position: relative;
  background: var(--maroon); color: var(--maroon-on);
  min-height: 86vh; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 8rem clamp(1.4rem, 6vw, 5rem) clamp(2.5rem, 6vw, 4.5rem);
  overflow: hidden;
}
/* thin white keyline, echoing the arched street signs */
.hero::after {
  content: ''; position: absolute; inset: 14px; pointer-events: none; z-index: 3;
  border: 1.5px solid rgba(255,255,255,.32); border-radius: 4px;
}
.hero-eyebrow {
  font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--gold); margin-bottom: 1rem;
}
.hero h1 { color: var(--white); font-size: clamp(2.2rem, 5.4vw, 4rem); max-width: 18ch; margin-bottom: 1.3rem; }
.hero h1 span { color: var(--gold); }
.lead-statement {
  font-size: clamp(1.25rem, 2.6vw, 1.8rem); font-weight: 500; line-height: 1.34;
  color: var(--ink); letter-spacing: -0.005em; margin-bottom: 1.4rem;
}
.hero .lede { font-size: clamp(1.05rem, 2vw, 1.35rem); color: rgba(255,255,255,.92); max-width: 60ch; margin-bottom: 1.1rem; line-height: 1.5; font-weight: 500; }
.hero .sub { font-size: 0.95rem; color: rgba(255,255,255,.72); max-width: 64ch; line-height: 1.6; }
.hero .scroll-cue {
  margin-top: 2.4rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.16em;
  color: rgba(255,255,255,.6); font-weight: 600;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* ════════════════ Page title (deep-dive pages) ════════════════ */
.page-title {
  position: relative; background: var(--maroon); color: var(--maroon-on);
  padding: 8rem clamp(1.4rem, 6vw, 5rem) clamp(2.4rem, 5vw, 3.8rem);
  text-align: center; overflow: hidden;
}
.page-title::after {
  content: ''; position: absolute; inset: 14px; pointer-events: none;
  border: 1.5px solid rgba(255,255,255,.3); border-radius: 4px;
}
.page-title .page-eyebrow { color: var(--gold); margin-bottom: 0.8rem; }
.page-title h1 { color: var(--white); font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 0.7rem; }
.page-title .page-lede { font-size: 1.08rem; color: rgba(255,255,255,.86); max-width: 640px; margin: 0 auto; line-height: 1.55; font-weight: 500; }

/* ════════════════ Sections ════════════════ */
section {
  max-width: var(--content); margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.4rem, 5vw, 1.5rem) 0;
  scroll-margin-top: 96px;   /* anchor jumps clear the fixed header */
}
section:last-of-type { padding-bottom: clamp(3.5rem, 8vw, 6.5rem); }
.section-divider { width: 48px; height: 3px; background: var(--maroon); border: none; margin-bottom: 1.6rem; border-radius: 2px; }
section > p, section > ul, section > ol { max-width: 68ch; }

/* americanhousing-style split: heading left, hairline + body right */
.split { display: grid; gap: 1.4rem; align-items: start; }
@media (min-width: 760px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 3rem; }
  .split .split-body { border-left: 1px solid var(--border); padding-left: 2.5rem; }
}
.split h2 { margin-bottom: 0; }

/* ════════════════ On-this-page contents ════════════════ */
/* Primary: a contents card under the title (all screen sizes). */
.page-toc {
  max-width: var(--content); margin: clamp(2.2rem, 5vw, 3.2rem) auto 0;
  padding: 0 clamp(1.4rem, 5vw, 1.5rem);
}
.page-toc-inner {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.page-toc-head {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700;
  color: var(--maroon); background: var(--maroon-tint);
  padding: 0.7rem 1.25rem; border-bottom: 1px solid var(--border);
}
.page-toc-list { list-style: none; margin: 0; padding: 0.35rem 0; }
.page-toc-list li { margin: 0; }
.page-toc-list a {
  display: flex; gap: 0.85rem; align-items: baseline;
  padding: 0.55rem 1.25rem; text-decoration: none; color: var(--ink);
  border-left: 3px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.page-toc-list a:hover { background: var(--maroon-tint); border-left-color: var(--maroon); }
.page-toc-list .toc-n {
  flex: 0 0 auto; min-width: 1.4ch; text-align: right;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; font-weight: 500; color: var(--maroon);
}
.page-toc-list .toc-t { display: flex; flex-direction: column; gap: 0.08rem; }
.page-toc-list .toc-t strong { font-weight: 600; font-size: 0.97rem; line-height: 1.3; }
.page-toc-list .toc-t em { font-style: normal; font-size: 0.82rem; color: var(--gray); line-height: 1.4; }

/* Enhancement: a compact sticky rail in the left margin on wide screens,
   built from .page-toc by app.js. Hidden (display:none) below the breakpoint. */
.toc-rail { display: none; }
@media (min-width: 1300px) {
  .toc-rail {
    display: block; position: fixed; top: 120px;
    left: calc((100vw - var(--content)) / 2 - 224px);
    width: 196px; max-height: calc(100vh - 170px); overflow-y: auto;
    z-index: 900; font-size: 0.8rem; line-height: 1.3;
    opacity: 0; pointer-events: none;       /* hidden over the title band */
    transition: opacity var(--dur) var(--ease);
  }
  .toc-rail.visible { opacity: 1; pointer-events: auto; }
  .toc-rail ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
  .toc-rail li { margin: 0; }
  .toc-rail a {
    display: block; padding: 0.32rem 0 0.32rem 0.9rem; margin-left: -1px;
    color: var(--gray); text-decoration: none; border-left: 2px solid transparent;
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  }
  .toc-rail a:hover { color: var(--maroon); }
  .toc-rail a.active { color: var(--maroon); font-weight: 600; border-left-color: var(--maroon); }
}
@media (prefers-reduced-motion: no-preference) {
  .toc-rail a { scroll-behavior: smooth; }
}

/* ════════════════ Cards (signature: maroon cap + overline) ════════════════ */
.card, .chart-card, .summary-panel {
  background: var(--white); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.6rem 1.6rem 1.4rem; margin: 1.75rem 0; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* signature variant: 8px maroon cap bar on top */
.summary-panel { padding-top: 1.9rem; }
.summary-panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: var(--maroon);
}
.summary-panel:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.summary-panel h3 { margin-top: 0; margin-bottom: 0.6rem; color: var(--ink); }
.summary-panel .panel-eyebrow { margin-bottom: 0.4rem; }
.summary-panel .panel-finding {
  background: var(--maroon-tint); padding: 0.9rem 1.05rem; border-radius: 8px;
  margin: 0.9rem 0 1.1rem; font-size: 0.95rem;
}
.summary-panel .panel-finding strong { color: var(--maroon); }

/* CTA link with arrow */
.panel-cta {
  display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.3rem;
  font-weight: 700; font-size: 0.9rem; text-decoration: none; color: var(--maroon);
  transition: gap var(--dur) var(--ease), color var(--dur) var(--ease);
}
.panel-cta::after { content: '\2192'; transition: transform var(--dur) var(--ease); }
.panel-cta:hover { color: var(--maroon-deep); }
.panel-cta:hover::after { transform: translateX(4px); }

/* ════════════════ Buttons ════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 0.95rem; line-height: 1;
  padding: 0.85rem 1.4rem; border-radius: 8px; text-decoration: none;
  border: 1.5px solid transparent; transition: background var(--dur) var(--ease),
  color var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn-primary { background: var(--maroon); color: var(--maroon-on); }
.btn-primary:hover { background: var(--maroon-deep); color: var(--maroon-on); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary { background: var(--white); color: var(--maroon); border-color: var(--maroon); }
.btn-secondary:hover { background: var(--maroon-tint); color: var(--maroon); }
.btn-secondary:active { transform: translateY(1px); }

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

/* ════════════════ Tables ════════════════ */
.table-wrap { overflow-x: auto; margin: 1.6rem 0; border: 1px solid var(--border); border-radius: 10px; }
.table-wrap.has-tips { overflow: visible; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
  background: var(--maroon); color: var(--maroon-on); padding: 0.65rem 0.85rem; text-align: left;
  font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
}
.data-table td { padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) { background: var(--paper); }
.data-table .highlight-row { background: var(--maroon-tint); font-weight: 700; color: var(--maroon); }
.data-table td.number { text-align: right; }
.data-table .term-yr { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.78rem; font-weight: 600; color: var(--gray); }

/* ════════════════ Blockquote ════════════════ */
blockquote {
  border-left: 4px solid var(--maroon); margin: 1.9rem 0; padding: 1rem 1.5rem;
  background: var(--paper-2); font-size: 1.12rem; font-weight: 500; font-style: italic; color: var(--ink);
  border-radius: 0 8px 8px 0;
}
blockquote cite { display: block; margin-top: 0.7rem; font-style: normal; font-size: 0.82rem; font-weight: 400; color: var(--gray); }

/* ════════════════ Callout boxes (steelman pattern) ════════════════ */
.alert-box, .concede-box {
  padding: 1.3rem 1.5rem; margin: 1.6rem 0; border-radius: 12px;
  border: 1px solid var(--border); background: var(--white); box-shadow: var(--shadow);
  position: relative; padding-left: 1.5rem;
}
.alert-box { border-left: 6px solid var(--maroon); background: var(--maroon-tint); border-color: #ECD9DD; }
.alert-box h4 { color: var(--maroon); margin-bottom: 0.4rem; }
.concede-box { border-left: 6px solid var(--slate); background: var(--paper-2); }
.concede-box h4 { color: var(--slate); margin-bottom: 0.4rem; }
.alert-box .response-label { color: var(--maroon); }
.concede-box .response-label { color: var(--slate); }
.response-label { display: block; margin-bottom: 0.25rem; font-size: 0.68rem; letter-spacing: 0.1em; }

/* ════════════════ Accordion ════════════════ */
.accordion-trigger {
  background: var(--white); border: 1px solid var(--border); padding: 0.95rem 1.1rem; width: 100%;
  text-align: left; font-family: inherit; font-weight: 700; font-size: 0.98rem; color: var(--ink);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  border-radius: 8px; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.accordion-trigger:hover { background: var(--maroon-tint); border-color: #ECD9DD; }
.accordion-icon { color: var(--maroon); font-weight: 700; }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.32s var(--ease); padding: 0 1.1rem; }
.accordion-content.open { padding: 1.1rem; border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; margin-bottom: 1rem; }

/* ── Click-to-define glossary ── */
.define { display: grid; gap: 1rem; margin: 1.4rem 0; }
@media (min-width: 720px) {
  .define { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.35fr); gap: 1.4rem; align-items: start; }
}
.define-terms { display: flex; flex-direction: column; gap: 0.5rem; }
.define-term {
  font-family: inherit; text-align: left; cursor: pointer; width: 100%;
  background: var(--white); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.75rem 0.95rem; font-weight: 700; font-size: 0.95rem; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.define-term::after { content: '\2192'; opacity: 0; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.define-term:hover { background: var(--maroon-tint); border-color: #ECD9DD; }
.define-term.active { background: var(--maroon); color: var(--maroon-on); border-color: var(--maroon); }
.define-term.active::after { opacity: 1; }
.define-panel { background: var(--paper-2); border: 1px solid var(--border); border-radius: 12px; padding: 1.3rem 1.4rem; }
@media (min-width: 720px) { .define-panel { position: sticky; top: 90px; min-height: 170px; } }
.define-hint { display: none; color: var(--gray); font-style: italic; margin: 0; }
.define-def h4 { color: var(--maroon); margin-bottom: 0.45rem; }
.define-def p { margin: 0; font-size: 0.95rem; }
.define-def + .define-def { margin-top: 1rem; }
/* progressive enhancement: with JS, the panel shows only the selected term */
.define.is-interactive .define-hint { display: block; }
.define.is-interactive .define-def { display: none; }
.define.is-interactive.has-active .define-hint { display: none; }
.define.is-interactive .define-def.active { display: block; }

/* ════════════════ Timeline ════════════════ */
.timeline { position: relative; padding-left: 1.7rem; margin: 1.9rem 0; border-left: 2px solid var(--border); }
.timeline-item { position: relative; margin-bottom: 1.6rem; padding-left: 0.6rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -2.15rem; top: 0.35rem; width: 13px; height: 13px;
  border-radius: 50%; background: var(--maroon); border: 3px solid var(--paper);
}
.timeline-date { font-size: 0.76rem; font-weight: 500; color: var(--maroon); text-transform: uppercase; letter-spacing: 0.04em; }
.timeline-text { font-size: 0.95rem; margin-top: 0.2rem; margin-bottom: 0; }
.timeline-src, .src { display: block; margin-top: 0.4rem; font-size: 0.76rem; line-height: 1.45; color: var(--gray); font-style: italic; }

/* ════════════════ Response / asks box (signature card, arch top) ════════════════ */
.response-box {
  background: var(--white); border: 1px solid var(--border); border-radius: 16px;
  padding: 2.4rem; margin: 1.9rem 0; text-align: center; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.response-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: var(--maroon); }
.response-box h3 { margin-top: 0.4rem; }
.response-box p { color: #4a4247; }

/* ════════════════ Sources ════════════════ */
.source-list { list-style: none; margin: 1.25rem 0; }
.source-list li { padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.source-type {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.07em;
  background: var(--maroon); color: var(--maroon-on); padding: 0.18rem 0.5rem; border-radius: 999px;
  margin-right: 0.55rem; display: inline-block; vertical-align: middle; font-weight: 500;
}

/* ════════════════ Charts ════════════════ */
.chart-card { padding: 1.5rem 1.5rem 1.3rem; }
.chart-title { font-weight: 700; font-size: 1.05rem; color: var(--ink); margin-bottom: 0.15rem; text-align: center; }
.chart-subtitle { font-size: 0.78rem; color: var(--gray); text-align: center; margin-bottom: 1rem; }
.chart-caption { font-size: 0.82rem; color: var(--gray); text-align: center; margin-top: 0.7rem; font-style: italic; line-height: 1.5; }
.chart-canvas-wrap { position: relative; width: 100%; height: 320px; }
.map-wrap { width: 100%; background: var(--paper-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 0.25rem 0; }
.map-wrap img { display: block; width: 100%; height: auto; }
.chart-takeaway {
  background: var(--maroon-tint); border-left: 4px solid var(--maroon);
  padding: 0.9rem 1.15rem; margin: 1rem 0 0.5rem; font-size: 0.92rem; color: var(--ink);
  border-radius: 0 8px 8px 0;
}
.chart-takeaway strong { color: var(--maroon); }
@media (max-width: 600px) { .chart-canvas-wrap { height: 280px; } }

/* ════════════════ Cross-link block ════════════════ */
.cross-link {
  background: var(--paper-2); border-left: 3px solid var(--slate);
  padding: 0.8rem 1.1rem; margin: 1.4rem 0; font-size: 0.88rem; border-radius: 0 8px 8px 0;
}
.cross-link a { color: var(--slate); font-weight: 700; }
.cross-link a:hover { color: #2f4a63; }

/* ════════════════ Footer (maroon, motto) ════════════════ */
footer {
  background: var(--maroon); color: rgba(255,255,255,.74);
  padding: clamp(3rem, 7vw, 4.5rem) 1.5rem 2.75rem; text-align: center;
  font-size: 0.88rem; line-height: 1.8; margin-top: clamp(3.5rem, 8vw, 6.5rem);
  position: relative;
}
footer .footer-emblem {
  width: 42px; height: 44px; margin: 0 auto 1rem;
  background: url("sf-sign.svg") center / contain no-repeat;
}
footer .footer-name { color: var(--white); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
footer .footer-motto { color: var(--gold); font-style: italic; font-size: 0.92rem; margin: 0.2rem 0 0.4rem; }
footer strong { color: rgba(255,255,255,.92); }
footer .footer-nav { margin: 1.2rem 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1.6rem; }
footer .footer-nav a {
  color: rgba(255,255,255,.85); text-decoration: none; font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; transition: color var(--dur) var(--ease);
}
footer .footer-nav a:hover { color: var(--white); }
footer .footer-fine { max-width: 60ch; margin: 0.6rem auto 0; font-size: 0.82rem; color: rgba(255,255,255,.6); }
footer .footer-fine a { color: rgba(255,255,255,.8); }
footer .footer-fine a:hover { color: var(--white); }

/* ════════════════ Scroll reveal ════════════════ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: none; }

/* ════════════════ Responsive ════════════════ */
@media (max-width: 600px) {
  html { font-size: 16px; }
  section { padding-top: 3.2rem; }
  .hero { padding-top: 6.5rem; min-height: 88vh; }
  .response-box { padding: 1.75rem 1.4rem; }
}

/* ════════════════ Imagery: placeholders, galleries, features ════════════════ */
figure { margin: 0; }
.media { margin: 1.75rem 0; }
/* Real images and inline-SVG "blueprint" placeholders share one frame (see images.md) */
.media > img, .media > picture > img, .media > svg.ph-svg {
  display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); background: var(--paper-2);
}
.ph-svg { font-family: 'Libre Franklin', system-ui, Arial, sans-serif; }
.media figcaption { font-size: 0.82rem; color: var(--gray); text-align: center; margin-top: 0.6rem; font-style: italic; line-height: 1.5; }

/* Full-width image / gallery band between sections */
.band { max-width: var(--wide); margin: 0 auto; padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.4rem, 5vw, 1.5rem) 0; }
.band-head { text-align: center; max-width: 640px; margin: 0 auto 2rem; }
.band-head .section-divider { margin-left: auto; margin-right: auto; }
.band-head h2 { margin-bottom: 0.6rem; }
.band-head p { color: #4a4247; }

/* Gallery (carousel analog) */
.gallery { display: grid; grid-template-columns: 1fr; gap: 1.1rem; margin: 1.75rem 0; }
.gallery .media { margin: 0; }
@media (min-width: 720px) {
  .gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .gallery.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .gallery.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Developer-incentive figure under a gallery item */
.dev-cost { text-align: center; margin-top: 0.7rem; }
.dev-cost .amount { display: block; font-size: clamp(1.2rem, 3.4vw, 1.55rem); font-weight: 800; color: var(--maroon); letter-spacing: -0.01em; line-height: 1.1; white-space: nowrap; }
.dev-cost .amount sup { font-size: 0.55em; font-weight: 700; }
.dev-cost .amount-pending { color: var(--gray); }
.dev-cost .label { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gray); font-weight: 600; margin-top: 0.15rem; }
.figure-note { max-width: 760px; margin: 1.8rem auto 0; text-align: center; font-size: 0.8rem; color: var(--gray); line-height: 1.65; }
.figure-note a { color: var(--maroon); font-weight: 600; }
.figure-note .mk { color: var(--maroon); font-weight: 700; }
.figure-note sup { color: var(--maroon); font-weight: 700; }
.figure-total { max-width: 720px; margin: 2rem auto 0; text-align: center; }
.figure-total .figure-total-amount { display: block; font-size: clamp(2.2rem, 5.5vw, 3.4rem); font-weight: 800; color: var(--maroon); letter-spacing: -0.02em; line-height: 1; }
.figure-total p { margin: 0.7rem 0 0; color: #4a4247; font-size: 1.02rem; }

/* Feature: image beside text */
.feature { display: grid; gap: 1.5rem; align-items: center; margin: 2.5rem 0; }
.feature .feature-media { margin: 0; }
.feature .feature-body > :first-child { margin-top: 0; }
@media (min-width: 820px) {
  .feature { grid-template-columns: 1.25fr 1fr; gap: 3rem; }
  .feature.reverse .feature-media { order: 2; }
}

/* 2x2 step grid (causal chain) */
.step-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 2rem 0 0.5rem; }
@media (min-width: 680px) { .step-grid { grid-template-columns: 1fr 1fr; gap: 1.25rem; } }
.step-card { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem 1.5rem 1.4rem; box-shadow: var(--shadow); }
.step-card .step-num { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 999px; background: var(--maroon); color: var(--maroon-on); font-weight: 800; font-size: 1rem; }
.step-card h3 { margin: 0.8rem 0 0.45rem; font-size: 1.14rem; line-height: 1.25; }
.step-card p { margin: 0; font-size: 0.95rem; color: #3a3338; }

/* Deep-dive carousel (horizontal swipe) */
.dive-track {
  display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 1.5rem 0 0; padding: 0.75rem 0.25rem 1.5rem;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--maroon) var(--border);
}
.dive-track::-webkit-scrollbar { height: 8px; }
.dive-track::-webkit-scrollbar-thumb { background: var(--maroon); border-radius: 999px; }
.dive-track::-webkit-scrollbar-track { background: var(--border); border-radius: 999px; }
.dive-card {
  flex: 0 0 300px; max-width: 300px; scroll-snap-align: start;
  background: var(--white); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.6rem 1.4rem 1.4rem; box-shadow: var(--shadow);
  position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.dive-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: var(--maroon); }
.dive-card .panel-eyebrow { margin: 0.3rem 0 0.4rem; }
.dive-card h3 { margin: 0 0 0.55rem; font-size: 1.2rem; line-height: 1.2; }
.dive-card p { font-size: 0.92rem; color: #3a3338; margin: 0 0 1.1rem; flex: 1 0 auto; }
.dive-card .panel-cta { margin-top: auto; }
@media (max-width: 600px) { .dive-card { flex-basis: 82vw; max-width: 82vw; } }

/* Summary-panel thumbnail */
.panel-media { margin: 0 0 1.1rem; }
.panel-media .ph-svg, .panel-media img { border-radius: 8px; }

/* Optional hero / page-title background photo (drop <img class="hero-bg"> as first child) */
.hero-bg, .page-title-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; border: none; border-radius: 0; }
.hero > *:not(.hero-bg), .page-title > *:not(.page-title-bg) { position: relative; z-index: 2; }
/* hero scrim is bottom-weighted: photo reads up top, title stays legible lower-left */
.hero:has(.hero-bg)::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(58,12,22,.94) 0%, rgba(74,16,30,.55) 40%, rgba(110,26,44,.10) 100%);
}
.page-title:has(.page-title-bg)::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(78,16,31,.74) 0%, rgba(110,26,44,.90) 100%);
}

/* ════════════════ Reduced motion ════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
