/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --bg: #FFFFFF;
  --fg: #111827;
  --primary: #3B82F6;
  --primary-dark: #2563EB;
  --primary-light: #EFF6FF;
  --secondary: #10B981;
  --accent: #F59E0B;
  --accent-dark: #D97706;
  --accent-light: #FEF3C7;
  --muted: #F3F4F6;
  --muted-fg: #6B7280;
  --border: #E5E7EB;
  --dark: #111827;
  --dark-soft: #1F2937;

  --font: 'Outfit', system-ui, sans-serif;
  --radius: 6px;
  --radius-lg: 8px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h: 4rem;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }

/* Label utility: uppercase tracked Outfit — used where old system used JetBrains Mono */
.mono {
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Nav ───────────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1.5rem;
  gap: 1.5rem;
}

.site-name {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
}

a.site-name { text-decoration: none; color: var(--fg); }

.nav-links {
  display: flex;
  gap: 1rem;
  margin-left: auto;
  align-items: center;
}

.nav-why {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-fg);
  transition: color 200ms var(--ease);
}
.nav-why:hover { color: var(--fg); }

.nav-twitter {
  display: flex;
  align-items: center;
  color: var(--muted-fg);
  transition: color 200ms var(--ease);
}
.nav-twitter:hover { color: var(--fg); }

/* Primary button — used in nav and footer */
.btn-cta {
  display: inline-flex;
  align-items: center;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  transition: all 200ms var(--ease);
  white-space: nowrap;
}
.btn-cta:hover { background: var(--primary-dark); transform: scale(1.05); }
.btn-cta:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Hero section ──────────────────────────────────────────────────────── */
.hero-section {
  background: var(--primary);
  color: white;
  padding: 2.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}

/* Decorative circle — scaled down for compact hero */
.hero-section::before {
  content: '';
  position: absolute;
  top: -4rem;
  right: -4rem;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

/* Rotated square — bottom-left */
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -3.5rem;
  left: -3.5rem;
  width: 14rem;
  height: 14rem;
  background: rgba(255, 255, 255, 0.04);
  transform: rotate(45deg);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin: 0 auto;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.hero-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: live-pulse 2s ease-in-out infinite;
}

.live-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: white;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Two-column layout: Day N left, context right */
.hero-body {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0;
}

.hero-left {
  padding-right: 2.5rem;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-right {
  padding-left: 2.5rem;
}

.day-counter {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.day-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  align-self: flex-end;
  padding-bottom: 0.55em;
}

.day-number {
  font-size: clamp(3.5rem, 10vw, 6rem);
  font-weight: 800;
  line-height: 1;
  color: white;
  letter-spacing: -0.04em;
}

.hero-context {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
  margin-bottom: 0.625rem;
  max-width: 36rem;
}

.hero-context:last-child { margin-bottom: 0; }
.hero-why-link { color: white; text-underline-offset: 3px; white-space: nowrap; }

.hero-context strong {
  color: white;
  font-weight: 600;
}

/* ── Entry ticker strip ────────────────────────────────────────────────── */
.ticker-strip {
  overflow: hidden;
  background: var(--dark);
  height: 2.75rem;
  display: flex;
  align-items: center;
  cursor: default;
}

.ticker-inner {
  display: flex;
  width: max-content;
  align-items: center;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
  will-change: transform;
}

.ticker-strip:hover .ticker-inner,
.ticker-strip:focus-within .ticker-inner,
.ticker-strip.paused .ticker-inner {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.5rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.ticker-name { font-weight: 600; }
.ticker-time { font-size: 0.7rem; color: rgba(255, 255, 255, 0.35); }
.ticker-sep { color: rgba(255, 255, 255, 0.15); padding: 0 0.4rem; }

.ticker-stance.stance-support { color: #93C5FD; }  /* blue-300 on dark */
.ticker-stance.stance-opposition { color: #FCA5A5; }  /* red-300 on dark */
.ticker-stance.stance-concern { color: rgba(255,255,255,0.55); }
.ticker-stance.stance-neutral { color: rgba(255,255,255,0.45); }

/* ── Summary strip ─────────────────────────────────────────────────────── */
.summary-counts {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.summary-count { display: flex; flex-direction: column; gap: 0.15rem; }

.summary-count .num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.summary-count .lbl {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

/* Multi-color stat numbers — each uses a distinct palette color */
.summary-count.stance-support .num { color: var(--primary); }
.summary-count.stance-opposition .num { color: #DC2626; }
.summary-count.stance-concern .num { color: var(--muted-fg); }
.summary-count.stance-total .num { color: var(--secondary); }

.sparkline-wrap { margin-left: auto; display: flex; align-items: center; }
.sparkline { display: block; }

/* ── Sticky filter bar ─────────────────────────────────────────────────── */
#filter-sentinel { height: 1px; }

.filter-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 1.5rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
  z-index: 10;
  transition: box-shadow 200ms var(--ease);
}

.filter-bar.sticky {
  position: sticky;
  top: var(--nav-h);
  box-shadow: 0 4px 0 var(--muted);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-fg);
  margin-right: 0.125rem;
}

.filter-btn {
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.875rem;
  border-radius: var(--radius);
  background: var(--muted);
  color: var(--muted-fg);
  border: 2px solid transparent;
  transition: all 200ms var(--ease);
}

.filter-btn:hover {
  background: var(--border);
  color: var(--fg);
  transform: scale(1.03);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.filter-btn.active:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.filter-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Quote ticker ──────────────────────────────────────────────────────── */
.quote-ticker {
  background: var(--primary-light);
  padding: 2.5rem 1.5rem;
  text-align: center;
  min-height: 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quote-text {
  max-width: 42rem;
  transition: opacity 400ms var(--ease);
}

.quote-text.fade-out { opacity: 0; }

.quote-body {
  display: block;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 500;
  font-style: italic;
  color: var(--fg);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.quote-attr {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted-fg);
  font-style: normal;
}

/* ── Entries section ───────────────────────────────────────────────────── */
.entries-section { padding: 0 0 4rem; background: var(--bg); }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.section-heading {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* ── Table ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

#entries-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

#entries-table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-fg);
  background: var(--muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

#entries-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.entry-row { transition: background 150ms var(--ease); }
.entry-row:hover { background: var(--primary-light); }

.col-date { white-space: nowrap; color: var(--muted-fg); font-size: 0.75rem; }

.col-name a { font-weight: 600; color: var(--fg); transition: color 200ms var(--ease); }
.col-name a:hover { color: var(--primary); }

.col-role { font-size: 0.7rem; color: var(--muted-fg); white-space: nowrap; }
.col-target { font-size: 0.7rem; color: var(--muted-fg); white-space: nowrap; }

.col-quote {
  max-width: 28rem;
  line-height: 1.65;
  color: var(--muted-fg);
  font-size: 0.84rem;
}
.no-quote {
  color: var(--muted-fg);
  font-style: italic;
  opacity: 0.6;
}

.col-source { white-space: nowrap; }

.source-link {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  transition: color 200ms var(--ease);
}
.source-link:hover { color: var(--primary-dark); }

/* Stance badges — colored background pills */
.stance-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius);
}

.stance-support .stance-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.stance-opposition .stance-badge {
  background: #FEE2E2;
  color: #DC2626;
}

.stance-concern .stance-badge {
  background: var(--muted);
  color: var(--muted-fg);
}

.stance-neutral .stance-badge {
  background: var(--muted);
  color: var(--muted-fg);
}

/* Sort buttons */
.sort-btn {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-fg);
  display: flex;
  align-items: center;
  gap: 0.3em;
  padding: 0;
  transition: color 200ms var(--ease);
}
.sort-btn:hover { color: var(--primary); }
.sort-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sort-indicator { color: var(--primary); min-width: 0.75em; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

.result-count {
  font-size: 0.7rem;
  color: var(--muted-fg);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Outline button with fill-on-hover — design system "Outline" button variant */
.load-more-btn {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  background: transparent;
  transition: all 200ms var(--ease);
}

.load-more-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.03);
}

.load-more-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.empty-state {
  padding: 3rem 1.5rem;
  color: var(--muted-fg);
  font-size: 0.8rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--dark);
  color: white;
  padding: 2.5rem 1.5rem;
}

.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

.footer-cta {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.5rem 1.125rem;
  border-radius: var(--radius);
  transition: all 200ms var(--ease);
  white-space: nowrap;
}

.footer-cta-primary { background: var(--primary); color: white; }
.footer-cta-primary:hover { background: var(--primary-dark); transform: scale(1.05); }

.footer-cta-ghost {
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.75);
}
.footer-cta-ghost:hover { border-color: rgba(255,255,255,0.6); color: white; transform: scale(1.05); }

.footer-cta:focus-visible { outline: 2px solid white; outline-offset: 2px; }

.last-synced {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
}

.footer-disclaimer {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.7;
}

.footer-disclaimer a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Why page ──────────────────────────────────────────────────────────── */
.why-page { max-width: 40rem; margin: 0 auto; padding: 3.5rem 1.5rem 5rem; }

.why-page h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 2.5rem;
}

.why-page h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2.5rem 0 0.875rem;
}

.why-page p { color: var(--muted-fg); line-height: 1.8; margin-bottom: 1.25rem; }

.why-page blockquote {
  border-left: 4px solid var(--primary);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--primary-light);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.why-page blockquote p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  font-style: italic;
  color: var(--fg);
  line-height: 1.7;
}
.why-page blockquote footer {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  font-style: normal;
  color: var(--muted-fg);
}
.why-page blockquote footer a {
  color: var(--primary-dark);
}

.why-page a { color: var(--primary); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.why-page a:hover { color: var(--primary-dark); }

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ticker-inner { animation: none !important; }
  .live-dot { animation: none !important; }
  .quote-text { transition: none !important; }
  * { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* ── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero-section { padding: 2rem 1rem; }
  .hero-body { grid-template-columns: 1fr; }
  .hero-left {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
  }
  .hero-right { padding-left: 0; }
  .summary-counts { gap: 1.5rem; }
  .filter-bar { gap: 1rem; padding: 0.75rem 1rem; }
  .filter-group { gap: 0.3rem; }
  .section-header { padding: 1.5rem 1rem 1rem; }
  #entries-table th, #entries-table td { padding: 0.65rem 0.75rem; }
  .col-quote { max-width: 14rem; }
  .footer-top { flex-direction: column; align-items: flex-start; }
  .nav-inner { padding: 0 1rem; }
}
