/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  --navy:       #0a0a0a;
  --navy-mid:   #111111;
  --navy-card:  #161616;
  --navy-hover: #1e1e1e;
  --navy-border:#2a2a2a;
  --cream:      #e8e4dc;
  --cream-dim:  #888480;
  --red:        #ffd100;
  --red-bright: #ffe033;
  --gold:       #ffd100;

  --font-display: 'Fraunces', Georgia, serif;
  --font-serif:   'Libre Baskerville', Georgia, serif;
  --font-sans:    'DM Sans', system-ui, sans-serif;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--navy);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ─── Grain texture ──────────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .035;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ─── Layout ─────────────────────────────────────────────── */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── Header ─────────────────────────────────────────────── */
.site-header {
  padding: 2.5rem 0 0;
  border-bottom: 1px solid var(--navy-border);
}

.header-eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 1.5rem;
}

.header-eyebrow a {
  color: var(--red);
  transition: color .2s;
}
.header-eyebrow a:hover { color: var(--red-bright); }

.header-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--cream-dim);
  text-decoration: none;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: .7rem;
  font-weight: 500;
  transition: color .2s;
}
.nav-link:hover,
.nav-link--active { color: var(--red); }

.masthead {
  text-align: center;
  margin-bottom: .75rem;
}

.masthead a { display: inline-block; }

.site-logo {
  max-width: 280px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.site-tagline {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: .9rem;
  color: var(--cream-dim);
  letter-spacing: .02em;
  margin-bottom: 1.5rem;
}

.masthead-rule {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 0;
}

.rule-line {
  flex: 1;
  height: 1px;
  background: var(--navy-border);
}

.rule-accent {
  width: 3.5rem;
  height: 3px;
  background: var(--red);
  flex-shrink: 0;
}

/* ─── Section header ─────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2rem 0 1.25rem;
  border-bottom: 1px solid var(--navy-border);
  margin-bottom: 0;
}

.section-label {
  font-family: var(--font-sans);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.petition-count {
  font-family: var(--font-sans);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

/* ─── Petition list ──────────────────────────────────────── */
.petitions-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ─── Petition card ──────────────────────────────────────── */
.petition-card {
  position: relative;
  display: block;
  background: var(--navy-card);
  border-left: 3px solid var(--red);
  padding: 1.75rem 1.75rem 1.5rem;
  margin-top: 1px;
  transition: background .18s, border-color .18s;
  animation: fadeSlide .4s ease both;
}

.petition-card:hover {
  background: var(--navy-hover);
  border-left-color: var(--red-bright);
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.petition-card:nth-child(1)  { animation-delay: .05s; }
.petition-card:nth-child(2)  { animation-delay: .10s; }
.petition-card:nth-child(3)  { animation-delay: .15s; }
.petition-card:nth-child(4)  { animation-delay: .20s; }
.petition-card:nth-child(5)  { animation-delay: .25s; }
.petition-card:nth-child(6)  { animation-delay: .28s; }
.petition-card:nth-child(7)  { animation-delay: .31s; }
.petition-card:nth-child(8)  { animation-delay: .34s; }
.petition-card:nth-child(n+9){ animation-delay: .36s; }

.petition-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--cream);
  margin-bottom: .75rem;
  display: block;
  transition: color .18s;
}

.petition-card:hover .petition-title { color: #fff; }

.petition-excerpt {
  font-family: var(--font-sans);
  font-size: .875rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--cream-dim);
  margin-bottom: 1.25rem;
}

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

.petition-signers {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
}

.signers-mark {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
}

.petition-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cream);
  background: transparent;
  border: 1px solid var(--navy-border);
  padding: .5rem 1rem;
  transition: background .18s, border-color .18s, color .18s;
  text-decoration: none;
  white-space: nowrap;
}

.petition-cta:hover {
  background: var(--red);
  border-color: var(--red);
  color: #000;
}

.cta-arrow {
  transition: transform .18s;
  font-size: .9em;
}

.petition-cta:hover .cta-arrow { transform: translateX(3px); }

/* ─── Skeleton ───────────────────────────────────────────── */
.skeleton-wrapper { padding: 0; }

.skeleton-card {
  background: var(--navy-card);
  border-left: 3px solid var(--navy-border);
  padding: 1.75rem;
  margin-top: 1px;
}

.sk-title,
.sk-body,
.sk-footer {
  background: linear-gradient(
    90deg,
    var(--navy-mid) 25%,
    var(--navy-hover) 50%,
    var(--navy-mid) 75%
  );
  background-size: 200% 100%;
  border-radius: 2px;
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.sk-title     { height: 1.2rem; width: 75%; margin-bottom: 1rem; }
.sk-body      { height: .8rem; width: 100%; margin-bottom: .5rem; }
.sk-body--short { width: 55%; }
.sk-footer    { height: .8rem; width: 30%; margin-top: 1.25rem; }

/* ─── Error state ────────────────────────────────────────── */
.error-state {
  padding: 4rem 2rem;
  text-align: center;
  animation: fadeSlide .4s ease both;
}

.error-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 2px solid var(--red);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--red);
  margin-bottom: 1.25rem;
}

.error-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin-bottom: .5rem;
}

.error-body {
  font-size: .875rem;
  color: var(--cream-dim);
}

.retry-btn {
  background: none;
  border: none;
  color: var(--red);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.retry-btn:hover { color: var(--red-bright); }

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--navy-border);
  font-size: .75rem;
  color: var(--cream-dim);
  text-align: center;
}

.site-footer a {
  color: var(--red);
  transition: color .2s;
}
.site-footer a:hover { color: var(--red-bright); }

/* ─── Main padding ───────────────────────────────────────── */
.main { padding-bottom: 2rem; }

/* ─── Utility ────────────────────────────────────────────── */
[hidden] { display: none !important; }

/* ─── Prose pages (about, privacy) ──────────────────────── */
.prose-page {
  padding: 2rem 0 3rem;
  font-family: var(--font-serif);
  font-size: .975rem;
  line-height: 1.8;
  color: var(--cream);
}

.prose-page p {
  margin-bottom: 1.25rem;
}

.prose-page h3 {
  font-family: var(--font-sans);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  margin: 2.5rem 0 .75rem;
}

.prose-page h4 {
  font-family: var(--font-serif);
  font-size: .975rem;
  font-weight: 700;
  color: var(--cream);
  margin: 1.5rem 0 .5rem;
}

.prose-page ul {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.prose-page li {
  margin-bottom: .4rem;
}

.prose-page a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}

.prose-page a:hover { color: var(--red-bright); }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 540px) {
  .petition-footer { flex-direction: column; align-items: flex-start; }
  .petition-cta    { width: 100%; justify-content: center; }
  .header-eyebrow  { flex-direction: column; gap: .5rem; }
  .header-nav      { gap: 1rem; }
  .site-logo       { max-width: 220px; }
}
