@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Primary CTA: amber — warm contrast against the cool gradient */
  --cta:           #f59e0b;
  --cta-dark:      #d97706;
  --cta-glow:      rgba(245,158,11,0.35);
  --cta-surface:   rgba(245,158,11,0.12);

  /* Secondary accent: indigo */
  --accent:        #6366f1;
  --accent-bright: #818cf8;
  --accent-glow:   rgba(99,102,241,0.35);

  /* Glass surfaces */
  --surface-1: rgba(255,255,255,0.04);
  --surface-2: rgba(255,255,255,0.08);
  --surface-3: rgba(255,255,255,0.14);
  --surface-4: rgba(255,255,255,0.22);

  /* Text */
  --text-primary:   #ffffff;
  --text-secondary: #c8d4f0;
  --text-muted:     #7a8ebd;

  /* Borders */
  --stroke:        rgba(255,255,255,0.11);
  --stroke-bright: rgba(255,255,255,0.26);
  --stroke-cta:    rgba(245,158,11,0.45);

  /* Fonts */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Layout — wide: fills ~1440p screens at 24px side margins */
  --container: 1440px;

  /* Geometry */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadows */
  --shadow-card:     0 8px 32px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.35);
  --shadow-cta-glow: 0 0 28px var(--cta-glow), 0 4px 12px rgba(0,0,0,0.4);
  --shadow-accent:   0 0 24px var(--accent-glow);

  /* Motion */
  --ease-snap:      cubic-bezier(0.25, 1, 0.5, 1);
  --transition-std: 220ms var(--ease-snap);

  /* Legacy aliases */
  --card:       var(--surface-2);
  --muted:      var(--text-muted);
  --btn-bg:     rgba(245,158,11,0.15);
  --btn-border: rgba(245,158,11,0.45);
  --btn-fg:     var(--text-primary);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background-color: #091a4a; }

body {
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Gradient + animation from first paint — no waiting for JS */
  background-image: linear-gradient(135deg,
    #091a4a 0%,
    #20122f 25%,
    #380a14 50%,
    #20122f 75%,
    #091a4a 100%
  );
  background-size: 400% 400%;
  background-attachment: fixed;
  animation: bg-pan-cycle 30s linear infinite alternate;
}

@keyframes bg-pan-cycle {
  from { background-position: 0%   0%; }
  to   { background-position: 100% 100%; }
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.9rem, 4.5vw, 3.2rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.75rem); }
h4 { font-size: clamp(1.05rem, 2vw, 1.25rem); }

p { color: var(--text-secondary); }

/* ============================================================
   KICKER / BADGE
   ============================================================ */
.kicker {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cta);
  background: var(--cta-surface);
  border: 1px solid var(--stroke-cta);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 16px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: transparent !important;
  background-image: none !important;
  position: relative;
  overflow: hidden;
  border-bottom: none;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 20% 50%, rgba(245,158,11,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 55% 65% at 80% 30%, rgba(99,102,241,0.10) 0%, transparent 60%);
  animation: hero-bloom 10s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes hero-bloom {
  from { opacity: 0.7; }
  to   { opacity: 1.0; }
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 44px 24px 56px;
  display: grid;
  gap: 40px;
  position: relative;
  z-index: 1;
  /* Mobile: single column */
  grid-template-columns: 1fr;
  grid-template-areas:
    "portrait"
    "content"
    "ballot";
}

@media (min-width: 640px) {
  .hero-inner {
    /* Portrait narrower so content gets more room */
    grid-template-columns: 160px 1fr;
    grid-template-areas:
      "portrait content"
      "portrait ballot";
    gap: 20px 32px;
    align-items: start;
  }
}

@media (min-width: 900px) {
  .hero-inner {
    /* Content gets ~1.5× the ballot's share — title breathes, ballot is visible */
    grid-template-columns: 190px 2fr 1.35fr;
    grid-template-areas: "portrait content ballot";
    align-items: center;
    gap: 32px;
    padding: 52px 24px 64px;
  }
}

/* Hero portrait */
.hero-portrait {
  grid-area: portrait;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  object-fit: cover;
  object-position: top center;
  aspect-ratio: 3/4;
  box-shadow:
    0 12px 48px rgba(0,0,0,0.60),
    0 0 0 1px rgba(255,255,255,0.10),
    0 0 40px rgba(99,102,241,0.18);
  border: 2px solid rgba(255,255,255,0.12);
  display: block;
}

@media (min-width: 640px) {
  .hero-portrait {
    max-width: none;
    border-radius: var(--radius-xl);
  }
}

/* Hero content */
.hero-content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.hero h2 {
  margin-bottom: 18px;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.45);
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 80%;
  line-height: 1.75;
}

/* Hero policy points — used on platform sub-pages */
.hero-points {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 80%;
}

.hero-points li {
  font-size: 1.28rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 28px;
  position: relative;
}

.hero-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--cta);
  box-shadow: 0 0 8px var(--cta-glow);
}

/* Hero split layout — text left, image right on Quick Links pages */
.hero-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
  width: 100%;
}
@media (min-width: 768px) {
  .hero-split {
    grid-template-columns: 3fr 2fr;
  }
}
.hero-split__text {
  display: flex;
  flex-direction: column;
}
.hero-split__img {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-split__img img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: var(--radius-lg);
  opacity: 0.85;
}
.hero-split--tall .hero-split__img {
  align-self: center;
}
.hero-split--tall .hero-split__img img {
  max-width: none;
}

/* Hero action buttons — Back + Read More row */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

/* Ballot banner — responsive container */
#ballotBanner {
  grid-area: ballot;
  min-width: 0; /* prevent grid blowout */
  width: 100%;
}

/* Tighter card frame around the canvas */
#ballotBanner .card {
  padding: 8px;
  border-top-width: 1px; /* inherit normal border, not accent top */
}

/* Canvas scales with its container, preserves 700×240 aspect ratio */
#ballotCanvas {
  width: 100%;
  height: auto;
  aspect-ratio: 700 / 240;
  display: block;
  border-radius: 6px;
}

#ballotFallback {
  width: 100%;
  height: auto;
  aspect-ratio: 700 / 240;
  object-fit: cover;
  border-radius: 6px;
}

/* ============================================================
   LAYOUT CONTAINERS
   ============================================================ */
.section {
  max-width: var(--container);
  margin: 56px auto;
  padding: 0 24px;
}

.page {
  max-width: var(--container);
  margin: 40px auto;
  padding: 0 24px;
}

.section > h3,
.section > h2 {
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(245,158,11,0.40);
  display: inline-block;
}

/* ============================================================
   GRID
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface-1);
  border: 1px solid var(--stroke);
  border-top: 3px solid rgba(245,158,11,0.50);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--shadow-card);
  transition:
    transform var(--transition-std),
    background var(--transition-std),
    border-color var(--transition-std),
    box-shadow var(--transition-std);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card:hover {
  transform: translateY(-6px);
  background: var(--surface-3);
  border-color: rgba(245,158,11,0.70);
  box-shadow: var(--shadow-card), 0 0 32px rgba(245,158,11,0.12);
}

.card h4 { color: #fff; font-size: 1.1rem; }
.card p   { color: var(--text-secondary); font-size: 0.95rem; flex: 1; }

/* ============================================================
   CONTENT BLOCKS
   ============================================================ */
.content {
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: var(--shadow-card);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  text-decoration: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.20);
  font-weight: 600;
  font-size: 0.9rem;
  transition:
    background var(--transition-std),
    box-shadow var(--transition-std),
    transform var(--transition-std),
    border-color var(--transition-std),
    color var(--transition-std);
  cursor: pointer;
}

.btn:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.38);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.btn.primary {
  background: linear-gradient(135deg, rgba(245,158,11,0.45) 0%, rgba(180,115,5,0.40) 100%);
  color: #f5f5f5;
  border: 1px solid rgba(245,158,11,0.40);
  box-shadow: none;
  font-weight: 700;
  font-size: 0.95rem;
}

.btn.primary:hover {
  background: linear-gradient(135deg, rgba(245,158,11,0.60) 0%, rgba(180,115,5,0.55) 100%);
  box-shadow: 0 0 20px rgba(245,158,11,0.25);
  transform: translateY(-2px);
  color: #fff;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--stroke);
  margin-top: 48px;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}
