/* ======================================================
   Our Pompano — Civic / Patriotic
   Palette: navy + ivory + restrained red accent
   ====================================================== */

:root,
[data-theme='light'] {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Surfaces — warm ivory */
  --color-bg: #f6f3ec;
  --color-surface: #fdfbf5;
  --color-surface-2: #ffffff;
  --color-surface-offset: #efeadf;
  --color-divider: #e0d9c8;
  --color-border: #cfc6b0;

  /* Text — deep navy */
  --color-text: #14223f;
  --color-text-muted: #4d5773;
  --color-text-faint: #8e96aa;
  --color-text-inverse: #fbf7ec;

  /* Primary — Navy */
  --color-primary: #1a3a73;
  --color-primary-hover: #122c5a;
  --color-primary-active: #0c1f43;
  --color-primary-highlight: #d3dcec;

  /* Accent — restrained civic red */
  --color-accent: #b1232e;
  --color-accent-hover: #8e1924;
  --color-accent-active: #6e131c;
  --color-accent-highlight: #f0d3d5;

  /* Gold (used very sparingly for the seal) */
  --color-gold: #b88a2c;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transition */
  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows — cool navy-toned */
  --shadow-sm: 0 1px 2px oklch(0.2 0.04 260 / 0.08);
  --shadow-md: 0 6px 16px oklch(0.2 0.04 260 / 0.10);
  --shadow-lg: 0 18px 40px oklch(0.2 0.04 260 / 0.14);

  /* Widths */
  --content-narrow: 720px;
  --content-default: 1040px;
  --content-wide: 1240px;

  /* Fonts */
  --font-display: 'Fraunces', 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', 'Helvetica Neue', system-ui, sans-serif;
}

[data-theme='dark'] {
  --color-bg: #0c1426;
  --color-surface: #131c33;
  --color-surface-2: #18223c;
  --color-surface-offset: #1c2745;
  --color-divider: #243155;
  --color-border: #2e3c63;

  --color-text: #ecefe1;
  --color-text-muted: #a3aac0;
  --color-text-faint: #6d7591;
  --color-text-inverse: #14223f;

  --color-primary: #6e92d4;
  --color-primary-hover: #88a8e3;
  --color-primary-active: #a4bdec;
  --color-primary-highlight: #25345a;

  --color-accent: #d96673;
  --color-accent-hover: #e4828d;
  --color-accent-active: #ed9aa3;
  --color-accent-highlight: #3a2227;

  --color-gold: #d4a64a;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 6px 16px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 18px 40px oklch(0 0 0 / 0.55);
}

/* ============== Typography ============== */
body {
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: -0.005em;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

/* ============== Layout helpers ============== */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 4vw, var(--space-10));
}
.container--narrow {
  max-width: var(--content-narrow);
}
section {
  padding-block: clamp(var(--space-16), 9vw, var(--space-24));
}
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--color-accent);
  display: inline-block;
}

/* ============== Header ============== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in oklab, var(--color-border) 60%, transparent);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}
.logo svg { color: var(--color-primary); }
.logo__wordmark {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}
.logo__sub {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  line-height: 1.2;
  margin-top: 2px;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
}
.nav a:hover { color: var(--color-text); }
.theme-toggle {
  color: var(--color-text-muted);
  padding: var(--space-2);
  border-radius: var(--radius-full);
}
.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
}
@media (max-width: 720px) {
  .nav a:not(.btn) { display: none; }
}

/* ============== Buttons ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn--primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn--accent {
  background: var(--color-accent);
  color: #fff;
}
.btn--accent:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn--ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

/* ============== Hero ============== */
.hero {
  position: relative;
  padding-block: clamp(var(--space-20), 14vw, var(--space-32));
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  /* subtle stars-and-stripes texture */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 80% 0%, color-mix(in oklab, var(--color-primary) 18%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse at 0% 100%, color-mix(in oklab, var(--color-accent) 10%, transparent) 0%, transparent 60%);
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 44px,
      color-mix(in oklab, var(--color-primary) 4%, transparent) 44px,
      color-mix(in oklab, var(--color-primary) 4%, transparent) 45px
    );
  z-index: -1;
  opacity: 0.5;
  mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent);
}
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  max-width: 920px;
  margin-inline: auto;
  text-align: center;
}
.hero h1 {
  font-size: var(--text-2xl);
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.hero h1 em {
  font-style: italic;
  color: var(--color-accent);
  font-weight: 500;
}
.hero p.lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-inline: auto;
  max-width: 56ch;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}
.hero__stars {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  color: var(--color-accent);
}
.hero__stars svg { width: 14px; height: 14px; }

/* ============== Mission ============== */
.mission {
  background: var(--color-surface);
  border-block: 1px solid var(--color-divider);
}
.mission__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-10);
  align-items: start;
}
@media (min-width: 860px) {
  .mission__grid { grid-template-columns: 0.9fr 1.1fr; gap: var(--space-16); }
}
.mission h2 {
  font-size: var(--text-xl);
  line-height: 1.1;
}
.mission p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.mission p strong { color: var(--color-text); font-weight: 600; }

/* ============== Issues ============== */
.issues__intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}
@media (min-width: 860px) {
  .issues__intro { grid-template-columns: 0.9fr 1.1fr; align-items: end; gap: var(--space-16); }
}
.issues__intro h2 {
  font-size: var(--text-xl);
}
.issues__intro p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
}
.issues__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}
.issue-card {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
}
.issue-card__num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--color-accent);
  margin-bottom: var(--space-2);
  display: block;
}
.issue-card h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
  font-family: var(--font-body);
  letter-spacing: 0;
}
.issue-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ============== Candidates ============== */
.candidates {
  background: var(--color-surface);
  border-block: 1px solid var(--color-divider);
}
.candidates__intro {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: var(--space-16);
}
.candidates__intro h2 {
  font-size: var(--text-xl);
  line-height: 1.15;
}
.candidates__intro p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--space-4);
  margin-inline: auto;
}
.candidates__note {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 680px;
  margin: var(--space-6) auto 0;
  padding: 12px 18px;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-primary) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, transparent);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-md, 10px);
}
.candidates__note svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-primary);
  margin-top: 1px;
}
.candidates__note strong { color: var(--color-primary); }

.candidate-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
/* Tablet: 2-up. Last (5th) card spans both columns so it doesn't sit alone in a left cell. */
@media (min-width: 640px) {
  .candidate-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .candidate-grid > .candidate:nth-child(5):last-child {
    grid-column: 1 / -1;
    max-width: calc(50% - var(--space-6) / 2);
    margin-inline: auto;
  }
}
/* Desktop: 3-up. The last 2 cards center together on row 2, giving a clean 3 + 2 layout. */
@media (min-width: 980px) {
  .candidate-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .candidate-grid > .candidate {
    grid-column: span 2;
  }
  /* When exactly 5 cards exist, shift cards 4 and 5 to center them on the second row. */
  .candidate-grid > .candidate:nth-child(4):nth-last-child(2) {
    grid-column: 2 / span 2;
    max-width: none;
    margin-inline: 0;
  }
  .candidate-grid > .candidate:nth-child(5):last-child {
    grid-column: 4 / span 2;
    max-width: none;
    margin-inline: 0;
  }
}
.candidate {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-interactive),
              box-shadow var(--transition-interactive),
              border-color var(--transition-interactive);
}
.candidate:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
}
.candidate__media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: linear-gradient(155deg,
    color-mix(in oklab, var(--color-primary) 22%, var(--color-surface-offset)),
    var(--color-surface-offset));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.candidate__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.candidate__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6);
  color: var(--color-text-muted);
}
.candidate__placeholder svg { color: var(--color-text-faint); width: 64px; height: 64px; }
.candidate__placeholder span {
  display: block;
  font-size: var(--text-sm);
  margin-top: var(--space-3);
  max-width: 22ch;
}
.candidate__district {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}
.candidate__badge {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}
.candidate__body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}
.candidate__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--color-text);
  line-height: 1.1;
}
.candidate__role {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.candidate__bio {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  flex: 1;
}
.candidate__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
}
.candidate__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  color: var(--color-primary);
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.candidate__link:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}
.candidate__link svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ============== Vote section ============== */
.vote {
  position: relative;
  isolation: isolate;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  overflow: hidden;
}
.vote::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 90% 50%, color-mix(in oklab, white 8%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse at 0% 100%, color-mix(in oklab, var(--color-accent) 28%, transparent) 0%, transparent 50%);
  z-index: -1;
}
.vote::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -8deg,
    transparent 0 32px,
    color-mix(in oklab, white 4%, transparent) 32px 33px
  );
  z-index: -1;
  opacity: 0.5;
}
.vote__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
}
@media (min-width: 860px) {
  .vote__inner { grid-template-columns: 1.3fr 1fr; gap: var(--space-16); }
}
.vote .eyebrow { color: #f3c5c9; }
.vote .eyebrow::before { background: #f3c5c9; }
.vote h2 {
  font-size: var(--text-xl);
  color: var(--color-text-inverse);
  margin-bottom: var(--space-4);
}
.vote p {
  font-size: var(--text-base);
  color: color-mix(in oklab, var(--color-text-inverse) 80%, transparent);
  margin-bottom: var(--space-6);
}
.vote__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.vote .btn--primary {
  background: #fff;
  color: var(--color-primary);
}
.vote .btn--primary:hover {
  background: #f6f3ec;
  color: var(--color-primary-active);
}
.vote .btn--ghost {
  color: #fff;
  border-color: color-mix(in oklab, white 35%, transparent);
}
.vote .btn--ghost:hover {
  border-color: #fff;
  color: #fff;
  background: color-mix(in oklab, white 8%, transparent);
}
.vote__checklist {
  display: grid;
  gap: var(--space-3);
}
.vote__check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: color-mix(in oklab, white 6%, transparent);
  border: 1px solid color-mix(in oklab, white 14%, transparent);
}
.vote__check svg {
  flex-shrink: 0;
  color: #f3c5c9;
  margin-top: 2px;
}
.vote__check strong {
  display: block;
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 2px;
}
.vote__check span {
  font-size: var(--text-xs);
  color: color-mix(in oklab, var(--color-text-inverse) 70%, transparent);
}

/* ============== Vote tools (Vote.org widgets) ============== */
.vote-tools {
  background: var(--color-bg);
  border-block: 1px solid var(--color-divider);
}
.vote-tools__intro {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: var(--space-10);
}
.vote-tools__intro h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}
.vote-tools__intro p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-inline: auto;
}
.vote-tools__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
  padding: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-full);
  max-width: max-content;
  margin-inline: auto;
}
.vote-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.vote-tab:hover { color: var(--color-text); }
.vote-tab[aria-selected="true"] {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.vote-tab svg { width: 16px; height: 16px; }

.vote-tools__panel {
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: clamp(var(--space-4), 2vw, var(--space-6));
  box-shadow: var(--shadow-md);
  max-width: 760px;
  margin-inline: auto;
}
.vote-tools__panel[hidden] { display: none; }
.vote-tools__panel iframe {
  width: 100%;
  min-height: 920px;
  border: none;
  display: block;
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
}
.vote-tools__footnote {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.vote-tools__footnote a { color: var(--color-text-muted); text-decoration: underline; text-underline-offset: 3px; }
.vote-tools__footnote a:hover { color: var(--color-primary); }

/* ============== Footer ============== */
.footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-12);
}
.footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  align-items: start;
}
@media (min-width: 760px) {
  .footer__inner { grid-template-columns: 1.3fr 1fr; }
}
.footer p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 50ch;
}
.footer__small {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-6);
}
.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.footer__links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer__links a:hover { color: var(--color-primary); }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
