/* WorthTheBill.org — modern continuous-scroll design with legislation paper backdrop */

:root {
  --accent: #8a5a2b;
  --accent-strong: #6f4119;
  --ink: #221f19;
  --ink-soft: #44403a;
  --muted: #6b6555;
  --paper: #f6f2e8;
  --parch: linear-gradient(160deg, #f8f2e2, #efe3ca);
  --line: #e0d9c8;
}

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

/* Focus rings for keyboard users */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Native smooth anchors as fallback when Lenis is disabled (touch devices) */
html { scroll-behavior: smooth; }

/* Lenis smooth scroll */
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", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  line-height: 1.65;
  background: var(--paper);
  overflow-x: hidden;
}

/* ── Paper bill backdrop ─────────────────────────────────────────────── */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.55), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(190, 180, 150, 0.14), transparent 50%),
    linear-gradient(180deg, #faf7ef, #f1ecdf);
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(246, 242, 232, 0.55);
}
.backdrop-doc {
  width: min(620px, 90vw);
  height: auto;
  opacity: 0.3;
  filter: drop-shadow(0 40px 80px rgba(74, 69, 56, 0.16));
  transform: rotate(-1.5deg);
}
.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; }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 247, 239, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
  color: #8a5a2b;
}
.topnav { display: flex; gap: 20px; }
.topnav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.15s ease;
}
.topnav a:hover, .topnav a.active { color: var(--accent); }

/* ── Continuous scroll panels ────────────────────────────────────────── */
main { position: relative; z-index: 1; }

.panel {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 64px 24px;
  scroll-margin-top: 68px;
}
.panel-inner {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}
.panel-inner h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 26px;
}
.kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

/* Hero */
.hero { text-align: center; padding-top: 84px; }
.hero .panel-inner { max-width: 720px; }
.hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 22px;
  text-shadow: 0 1px 0 #fff, 0 2px 12px rgba(246, 242, 232, 0.9);
}
.grad { color: #8a5a2b; }
.tagline {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto 30px;
  padding: 14px 20px 16px;
  display: inline-block;
  text-shadow: 0 1px 0 #fff;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-copy {
  max-width: 640px;
  margin: 0 auto 30px;
  text-align: left;
  padding: 24px 28px 28px;
}
.hero-copy p { margin-bottom: 14px; font-size: 1.08rem; color: var(--ink-soft); }
.hero-copy p:last-child { margin-bottom: 0; }

/* ── Cards ───────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
/* ── Parchment cards: torn edges + paper grain (background only, so text is never clipped) ── */
.card, .hero-copy, .tagline, .cd-block {
  position: relative;
  isolation: isolate;
  background: transparent;
}
.card::before, .hero-copy::before, .tagline::before, .cd-block::before {
  content: "";
  position: absolute;
  inset: -8px -6px -16px -6px;
  z-index: -1;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E"),
    linear-gradient(160deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 45%),
    var(--parch);
  background-size: 160px 160px, auto, auto;
  background-blend-mode: multiply, normal, normal;
  clip-path: url(#parch-a);
}

.card {
  padding: 28px 26px 30px;
}
.grid .card:nth-child(2)::before { clip-path: url(#parch-b); }
.grid .card:nth-child(3)::before { clip-path: url(#parch-c); }
.hero-copy::before { clip-path: url(#parch-b); }
.tagline::before { clip-path: url(#parch-c); }
.cd-block::before { clip-path: url(#parch-a); inset: -6px; }
.cd-block:nth-child(even)::before { clip-path: url(#parch-b); }
.card::before, .hero-copy::before, .tagline::before, .cd-block::before {
  filter: drop-shadow(0 14px 26px rgba(120, 100, 60, 0.22));
}
.card h2 { font-size: 1.35rem; margin-bottom: 12px; }
.card h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--accent); }
.card p { margin-bottom: 10px; }
.card a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid rgba(138, 90, 43, 0.3);
  transition: border-color 0.15s ease;
  word-break: break-word;
}
.card a:hover { border-bottom-color: var(--accent-strong); color: var(--accent-strong); }
.muted { color: var(--muted); font-size: 0.92rem; }

/* Lists (red flags) */
.flags {
  list-style: none;
  margin: 14px 0 16px;
}
.flags li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 12px;
}
.flags li::before {
  content: "🚩";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 1rem;
}

/* Source citations */
.src {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 14px;
}

/* Countdown */
.countdown {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}
.cd-block {
  min-width: 92px;
  padding: 18px 14px 20px;
  text-align: center;
}
.cd-num {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}
.cd-label {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.countdown-label {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.5px;
}

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

/* ── Scroll reveal (only hides content when JS is active, so pages are never blank) ── */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
html.js .reveal.visible { opacity: 1; transform: none; }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .faq summary::after { transition: none; }
}

/* Footer */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 34px 20px 44px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
  background: rgba(250, 247, 239, 0.7);
}
footer p { margin-bottom: 10px; }
.footlinks {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.footlinks a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid rgba(138, 90, 43, 0.3);
}
.footlinks a:hover { border-bottom-color: var(--accent-strong); color: var(--accent-strong); }
.footlinks span { color: var(--line); }

@media (max-width: 560px) {
  .topbar-inner { justify-content: center; }
  .hero { padding-top: 48px; }
  .panel { align-items: flex-start; padding: 40px 16px; }
  .backdrop-doc { width: 94vw; }
}
