/* WorthTheBill.org — Web2.0 scroll narrative, Lenis-native, Cloudflare-static */
:root {
  --accent: #8a5a2b;
  --accent-strong: #6f4119;
  --accent-soft: #a67c4a;
  --ink: #1a1816;
  --ink-soft: #3d392f;
  --muted: #6b6555;
  --muted-light: #8a8472;
  --paper: #f6f2e8;
  --stone: #f4f1e8;
  --stone-deep: #ebe7db;
  --parch: linear-gradient(160deg, #fffaf0, #f0e6d0);
  --line: #d8d2c2;
  --line-strong: #b9b29f;
  --r-card: 12px;
  --r-pill: 999px;
  --shadow-card: 0 12px 32px rgba(34, 31, 25, 0.08), 0 1px 0 rgba(255,255,255,0.9) inset;
  --shadow-float: 0 20px 50px rgba(34,31,25,0.12);
  --w-content: 860px;
  --w-wide: 1040px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

html { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  color: var(--ink);
  line-height: 1.65;
  background: linear-gradient(180deg, var(--stone) 0%, var(--stone-deep) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  font-size: clamp(0.96rem, 0.4vw + 0.9rem, 1.05rem);
  --scroll: 0;
}

/* ── Backdrop: bill as protagonist ────────────────────────────────────── */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 45% at 18% 12%, rgba(255,255,255,0.65) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 88% 88%, rgba(190,180,150,0.10) 0%, transparent 60%),
    linear-gradient(180deg, #faf7ef 0%, #f1ecdf 100%);
  overflow: hidden;
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(244,241,232,0.42);
}
.backdrop-doc {
  width: min(620px, 88vw);
  height: auto;
  opacity: 0.28;
  filter: drop-shadow(0 36px 70px rgba(74,69,56,0.14));
  transform: rotate(-1.4deg) translate3d(0, calc(var(--scroll) * -56px), 0) scale(calc(0.96 + var(--scroll) * 0.04));
  will-change: transform;
  transition: transform 0.08s linear;
}
.bd-sm  { font: 700 14px Georgia, serif; letter-spacing: 1.5px; }
.bd-h   { font: 700 34px Georgia, serif; }
.bd-md  { font: 600 17px Georgia, serif; }
.bd-ital{ font: italic 600 17px Georgia, serif; }
.bd-sec { font: 700 13px Georgia, serif; }
.bd-body{ font: 400 13px Georgia, serif; }

/* ── Topbar + progress rail ───────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250,247,239,0.88);
  backdrop-filter: blur(10px) saturate(1.05);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.logo {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: -0.2px;
  color: var(--accent);
  text-decoration: none;
}
.topnav { display: flex; gap: 18px; align-items: center; }
.topnav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: -0.1px;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.topnav a:hover { color: var(--accent); }
.topnav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.scroll-progress {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--line);
  transform-origin: left;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(var(--scroll));
  transform-origin: left;
  transition: transform 0.08s linear;
}

/* ── Marquee provenance strip ─────────────────────────────────────────── */
.marquee {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(6px);
  overflow: hidden;
  white-space: nowrap;
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding: 10px 0;
  animation: marquee 38s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 28px;
}
.marquee-item em {
  font-style: normal;
  color: var(--accent);
}
.marquee-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Layout primitives ────────────────────────────────────────────────── */
main { position: relative; z-index: 1; }

.panel {
  display: flex;
  align-items: center;
  padding: clamp(42px, 6vw, 72px) clamp(16px, 3vw, 24px);
  scroll-margin-top: 64px;
}
.panel-inner {
  max-width: var(--w-content);
  margin: 0 auto;
  width: 100%;
}
.panel-inner-wide {
  max-width: var(--w-wide);
  margin: 0 auto;
  width: 100%;
}
.panel h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 4.2vw, 2.65rem);
  font-weight: 750;
  letter-spacing: -0.6px;
  line-height: 1.12;
  margin-bottom: 18px;
  text-wrap: balance;
}

/* Chapter markers replace shouting kickers */
.chapter {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.chapter::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}
.chapter-num {
  color: var(--muted-light);
  font-weight: 700;
  letter-spacing: 1px;
}

/* ── Hero — pinned story, not full-screen shout ──────────────────────── */
.hero {
  text-align: center;
  padding-top: clamp(36px, 6vw, 64px);
  padding-bottom: clamp(28px, 5vw, 48px);
  min-height: unset;
  align-items: flex-start;
}
.hero .panel-inner { max-width: 740px; }
.hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 6.2vw, 4.1rem);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 0.96;
  margin-bottom: 16px;
  text-wrap: balance;
}
.grad { color: var(--accent); }
.tagline {
  display: inline-block;
  margin: 0 auto 18px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.96rem;
  font-weight: 650;
  color: var(--ink-soft);
  box-shadow: 0 2px 10px rgba(34,31,25,0.04);
}
.hero-copy {
  max-width: 640px;
  margin: 0 auto 22px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(20px, 2.6vw, 28px);
  box-shadow: var(--shadow-card);
}
.hero-copy p { margin-bottom: 12px; color: var(--ink-soft); }
.hero-copy p:last-child { margin-bottom: 0; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* Eyebrow meta under hero */
.hero-meta {
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta i { width: 6px; height: 6px; background: var(--accent-soft); border-radius: 50%; display: inline-block; }

/* Buttons — no scale lift */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 11px 18px;
  border-radius: var(--r-pill);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  box-shadow: 0 6px 18px rgba(138,90,43,0.22);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--line-strong);
}
.btn-secondary:hover { border-color: var(--accent); background: #fff7ec; }

/* ── Bottom Line — 2-col manifesto ───────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(22px, 4vw, 40px);
  align-items: start;
}
.lead {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.flags {
  list-style: none;
  margin: 16px 0 14px;
  border-top: 1px solid var(--line);
}
.flags li {
  padding: 16px 0 16px 30px;
  position: relative;
  border-bottom: 1px solid var(--line);
  line-height: 1.5;
}
.flags li::before {
  content: "";
  position: absolute;
  left: 2px; top: 20px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(138,90,43,0.10);
}
.flags li:last-child { border-bottom: none; }
.flags strong { color: var(--ink); }

/* ── Cards: only peel cards get parchment, hairline + soft shadow ────── */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* Stacked peel on desktop */
.stack {
  display: grid;
  gap: 0;
}
.stack .card {
  position: sticky;
  top: 72px;
  margin-bottom: 18px;
  transition: transform 0.12s linear, box-shadow 0.12s linear;
}
.stack .card:nth-child(1) { z-index: 3; }
.stack .card:nth-child(2) { z-index: 2; top: 84px; }
.stack .card:nth-child(3) { z-index: 1; top: 96px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(18px, 2.4vw, 24px);
  box-shadow: var(--shadow-card);
}
.card h3 { font-size: 1.02rem; margin-bottom: 8px; color: var(--ink); letter-spacing: -0.2px; }
.card h3 span { color: var(--accent); }
.card p { color: var(--ink-soft); font-size: 0.96rem; margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }
.card a {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid rgba(138,90,43,0.32);
  transition: border-color 0.15s ease, color 0.15s ease;
  word-break: break-word;
}
.card a:hover { border-bottom-color: var(--accent-strong); color: var(--accent-strong); }

/* Parchment grain only on peel cards, subtle */
.card--parch {
  position: relative;
  isolation: isolate;
}
.card--parch::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.05;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: multiply;
}

/* Plain cards for references etc */
.card--plain { background: #fff; }

.muted { color: var(--muted); font-size: 0.9rem; }
.src {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 12px;
}
.src .cite, .cite {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px dashed rgba(138,90,43,0.38);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.src .cite:hover, .cite:hover { color: var(--accent-strong); border-bottom-color: var(--accent-strong); }

/* ── 2027 Data — horizontal measure strip ─────────────────────────────── */
.measure {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-top: 18px;
}
.measure-col {
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  position: relative;
}
.measure-col:last-child { border-right: none; }
.measure-col strong {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.measure-col p { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.5; }
.measure-rule {
  height: 2px;
  background: var(--line);
  margin-top: 18px;
  position: relative;
  overflow: hidden;
}
.measure-rule i {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 100%;
  background: var(--accent);
  transform: scaleX(var(--section-progress, 0));
  transform-origin: left;
  transition: transform 0.08s linear;
}

/* Preview search mock — static, disabled */
.search-mock {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-card);
}
.search-mock input {
  flex: 1;
  border: none;
  background: transparent;
  font: 600 0.95rem inherit;
  color: var(--ink-soft);
  outline: none;
}
.search-mock input::placeholder { color: var(--muted-light); }
.search-mock button {
  flex: none;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  opacity: 0.9;
}
.search-mock button:disabled { cursor: not-allowed; }
.search-mock small { font-size: 0.78rem; color: var(--muted); margin-left: 6px; }

/* ── Countdown — pills, not torn blocks ───────────────────────────────── */
.countdown {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.cd-block {
  min-width: 78px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 14px 12px 12px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.cd-num {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 4.5vw, 1.95rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cd-label {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.countdown-label {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── References & FAQ ─────────────────────────────────────────────────── */
.refs .ref {
  margin-bottom: 14px;
  font-size: 0.93rem;
  line-height: 1.55;
  scroll-margin-top: 84px;
}
.refs .ref:last-of-type { margin-bottom: 6px; }
.refs .ref a { word-break: break-all; }
.refs .ref em { font-style: italic; }

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 16px 4px;
}
.faq details:last-child { border-bottom: none; }
.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  position: relative;
  padding-right: 28px;
  font-size: 0.98rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 2px; top: -2px;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.18s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent); }
.faq p { margin-top: 10px; color: var(--ink-soft); }

/* ── Reveal — heading wipe + soft rise, body copy stays readable ─────── */
html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
html.js .reveal.visible { opacity: 1; transform: none; }
html.js .reveal--heading {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease, transform 0.5s ease;
}
html.js .reveal--heading.visible { clip-path: inset(0 0 0 0); }

/* ── Section rule dividers ────────────────────────────────────────────── */
.rule {
  height: 1px;
  background: var(--line);
  margin: 0;
}

/* ── Footer ───────────────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 20px 40px;
  color: var(--muted);
  font-size: 0.84rem;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(6px);
}
footer p { margin-bottom: 8px; }
.footlinks {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.84rem;
}
.footlinks a {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid rgba(138,90,43,0.32);
}
.footlinks a:hover { border-bottom-color: var(--accent-strong); color: var(--accent-strong); }
.footlinks span { color: var(--line); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .measure { grid-template-columns: 1fr 1fr; }
  .measure-col { border-bottom: 1px solid var(--line); }
  .measure-col:nth-child(2n) { border-right: none; }
  .measure-col:nth-last-child(-n+2) { border-bottom: none; }
  .stack .card { position: relative; top: auto !important; }
}

@media (max-width: 640px) {
  .topbar-inner { justify-content: center; }
  .topnav { gap: 12px; flex-wrap: wrap; justify-content: center; }
  .hero { padding-top: 28px; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.8rem); }
  .tagline { font-size: 0.92rem; }
  .measure { grid-template-columns: 1fr; }
  .measure-col { border-right: none; border-bottom: 1px solid var(--line); }
  .measure-col:last-child { border-bottom: none; }
  .backdrop-doc { width: 94vw; }
  .marquee-track { animation-duration: 26s; }
}

/* ── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal, html.js .reveal--heading { opacity: 1; transform: none; clip-path: none; transition: none; }
  .faq summary::after { transition: none; }
  .backdrop-doc { transform: rotate(-1.4deg) !important; transition: none !important; }
  .marquee-track { animation: none; transform: none; }
  .scroll-progress span, .measure-rule i { transition: none; }
}
