/* ===== Reset & Global ===== */
html, body { height: 100%; margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
:root { --primary-color: #FF3131; }

/* ===== Design Tokens ===== */
body {
  --bg: #f7f5f2;
  --panel: #ffffff;
  --text: #1b2430;
  --muted: #5a6778;
  --line: rgba(27, 36, 48, 0.10);
  --line-strong: rgba(27, 36, 48, 0.14);
  --accent: #ff2b2b;
  --blue: #2d5ea8;
  --shadow: 0 10px 30px rgba(0,0,0,0.06);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --max: 1120px;
  --pad: 20px;
  --nav-h: 72px;
  color: var(--text);
  background: var(--bg);
}

/* ===== Base ===== */
* { box-sizing: border-box; }
a { color: inherit; }
.main { padding-top: var(--nav-h); }
.page { min-height: 100vh; }
.section { padding: 56px 0; }
.section-head { max-width: var(--max); margin: 0 auto 18px auto; padding: 0 var(--pad); }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.h2 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 8px 0; }
.h3 { font-size: 18px; margin: 0; letter-spacing: -0.01em; }
.lead { margin: 0; color: var(--muted); line-height: 1.55; max-width: 72ch; }
.body { margin: 0; color: var(--text); line-height: 1.65; }
.text-link { color: var(--blue); text-decoration: none; font-weight: 600; }
.text-link:hover { text-decoration: underline; }
.muted { color: var(--muted); }

/* ===== Navbar ===== */
.nav-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(247, 245, 242, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-donate-mobile { display: none !important; text-decoration: none; line-height: 1; white-space: nowrap; }

@media (max-width: 768px) {
  .nav-donate-mobile {
    display: inline-flex !important; align-items: center; justify-content: center;
    padding: 10px 14px; border-radius: 10px; font-weight: 700;
  }
}

.nav {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { text-decoration: none; display: grid; gap: 2px; }
.brand-name { font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links > a { text-decoration: none; color: var(--text); font-weight: 600; font-size: 14px; opacity: 0.92; }
.nav-links > a:hover { opacity: 1; text-decoration: underline; }
.nav-ctas { display: flex; align-items: center; gap: 10px; margin-left: 6px; }
.nav-toggle {
  display: none; width: 48px; height: 48px; border: 1px solid var(--line);
  border-radius: 12px; background: rgba(255,255,255,0.7); cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  flex-shrink: 0; -webkit-tap-highlight-color: transparent;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 99px; opacity: 0.9; flex-shrink: 0; }

/* ===== Buttons ===== */
.btn {
  border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  font-weight: 800; letter-spacing: 0.01em; padding: 10px 14px;
  font-family: inherit; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.06s ease, background 0.2s ease, border 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 12px 16px; border-radius: 14px; }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-outline:hover { background: rgba(27, 36, 48, 0.04); }
.btn-solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-solid:hover { opacity: 0.95; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== HERO ===== */
.hero { padding: 34px 0 22px 0; }
.hero-grid {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 26px; align-items: start;
}
.hero-logo-block, .hero-content-block { grid-column: 1; }
.hero-photo-block { grid-column: 2; position: relative; }
.hero-logo-block { display: flex; align-items: flex-start; justify-content: flex-start; padding-top: 6px; padding-bottom: 6px; }
.campaign-logo-img { width: 100%; height: auto; max-width: 520px; display: block; }

@media (min-width: 981px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; grid-template-rows: auto auto; align-items: start; }
  .hero-logo-block { grid-column: 1; grid-row: 1; padding-top: 6px; }
  .hero-content-block { grid-column: 1; grid-row: 2; padding-top: 0; margin-top: -6px; }
  .hero-photo-block { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; }
  .family-frame { height: 100%; min-height: 420px; }
}
@media (max-width: 980px) {
  .hero-logo-block, .hero-photo-block, .hero-content-block { grid-column: auto; grid-row: auto; }
}

.hero-content-block { display: grid; align-content: start; gap: 12px; padding-top: 6px; }
.hero-h1 { margin: 0; font-size: 42px; line-height: 1.08; letter-spacing: -0.03em; }
.hero-sub { margin: 0; color: var(--muted); max-width: 58ch; line-height: 1.6; font-size: 16px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.mini-badges { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.75); font-weight: 700; font-size: 13px;
  color: rgba(27, 36, 48, 0.92);
}
.badge-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--accent); display: inline-block; }

/* Family photo */
.family-frame {
  position: relative; height: 100%; min-height: 420px;
  border-radius: var(--r-lg); border: 1px solid var(--line);
  overflow: hidden; background: #e9eef6;
}
.family-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.family-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.00) 45%, rgba(0,0,0,0.05) 100%);
  pointer-events: none;
}

/* Election card */
.election-card {
  position: absolute; right: 16px; bottom: 16px; width: min(320px, 86%);
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: rgba(255,255,255,0.86); backdrop-filter: blur(10px);
  box-shadow: var(--shadow); padding: 14px 14px; z-index: 2;
}
.election-row { display: grid; gap: 4px; }
.election-kicker { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 900; color: rgba(27, 36, 48, 0.7); }
.election-date { font-weight: 900; font-size: 14px; }
.election-divider { height: 1px; background: var(--line); margin: 10px 0; }
.election-card-urgent {
  border: 2px solid var(--accent);
  box-shadow: 0 18px 40px rgba(17, 20, 28, 0.18), 0 0 0 6px rgba(255, 74, 74, 0.08);
  animation: electionPulse 3.5s ease-in-out infinite;
}
.election-card-urgent .election-date { font-size: 15px; font-weight: 900; }
.election-card-urgent .election-date.election-day { color: var(--accent); font-size: 16px; }
.election-card-urgent .election-divider { background: rgba(255, 74, 74, 0.35); }

@keyframes electionPulse {
  0%   { box-shadow: 0 18px 40px rgba(17, 20, 28, 0.18), 0 0 0 6px rgba(255, 74, 74, 0.08); }
  50%  { box-shadow: 0 22px 48px rgba(17, 20, 28, 0.22), 0 0 0 8px rgba(255, 74, 74, 0.12); }
  100% { box-shadow: 0 18px 40px rgba(17, 20, 28, 0.18), 0 0 0 6px rgba(255, 74, 74, 0.08); }
}

/* ===== Why I'm Running ===== */
.why-grid {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start;
}
.headshot {
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background: rgba(255,255,255,0.75); overflow: hidden; box-shadow: 0 10px 28px rgba(0,0,0,0.04);
}
.headshot-inner {
  position: relative; overflow: hidden; display: block; background: #f2f3f6;
}
.headshot-img { width: 100%; height: auto; display: block; }
.why-copy { display: grid; gap: 10px; padding: 4px 0; }
.why-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.campaign-quote { margin: 0; padding: 0; }
.quote-text { font-style: italic; font-size: 16px; line-height: 1.65; color: var(--text); }
.quote-attrib { display: block; margin-top: 6px; font-style: normal; font-weight: 900; color: var(--muted); }

/* ===== Involvement Pills ===== */
.involvement-grid {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.pill {
  border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.8);
  padding: 12px 14px; font-weight: 800; display: flex; gap: 10px; align-items: center; line-height: 1.2;
}
.check {
  width: 22px; height: 22px; border-radius: 999px; display: grid; place-content: center;
  background: rgba(255, 43, 43, 0.12); color: var(--accent); font-weight: 900;
}

/* ===== Priority Cards ===== */
.cards-3 {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}
.card {
  position: relative; border-radius: 20px; border: 1px solid rgba(21, 25, 34, 0.10);
  background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(10px);
  box-shadow: 0 18px 45px rgba(17, 20, 28, 0.10); overflow: hidden;
  padding: 18px 18px 16px 18px;
  transition: transform 160ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px;
  background: linear-gradient(90deg, rgba(255, 74, 74, 0.95), rgba(255, 74, 74, 0.45));
}
.card::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -120px; top: -120px;
  background: radial-gradient(circle at center, rgba(255, 74, 74, 0.16), transparent 62%);
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-4px); box-shadow: 0 26px 70px rgba(17, 20, 28, 0.14); border-color: rgba(255, 74, 74, 0.18); }
}
.card-top { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px 0; }
.icon {
  width: 46px; height: 46px; border-radius: 16px; display: grid; place-content: center;
  font-weight: 950; font-size: 16px; color: rgba(21, 25, 34, 0.92);
  border: 1px solid rgba(21, 25, 34, 0.10); background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 12px 24px rgba(17, 20, 28, 0.10);
}
.card .h3 { margin: 0; font-size: 18px; font-weight: 950; letter-spacing: -0.01em; }
.card-body { margin: 0 0 12px 0; color: rgba(21, 25, 34, 0.74); line-height: 1.65; font-weight: 650; }
.card-list { margin: 0; padding-left: 18px; color: rgba(21, 25, 34, 0.92); line-height: 1.6; font-weight: 850; }
.card-list li { margin: 7px 0; }

/* Per-card colors */
.cards-3 .card:nth-child(1)::before { background: linear-gradient(90deg, rgba(255, 74, 74, 0.95), rgba(255, 74, 74, 0.35)); }
.cards-3 .card:nth-child(1)::after { background: radial-gradient(circle at center, rgba(255, 74, 74, 0.18), transparent 62%); }
.cards-3 .card:nth-child(2)::before { background: linear-gradient(90deg, rgba(21, 25, 34, 0.92), rgba(21, 25, 34, 0.25)); }
.cards-3 .card:nth-child(2)::after { background: radial-gradient(circle at center, rgba(21, 25, 34, 0.14), transparent 62%); }
.cards-3 .card:nth-child(3)::before { background: linear-gradient(90deg, rgba(45, 94, 168, 0.85), rgba(45, 94, 168, 0.25)); }
.cards-3 .card:nth-child(3)::after { background: radial-gradient(circle at center, rgba(45, 94, 168, 0.14), transparent 62%); }

/* ===== Form ===== */
.form-card { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
form {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: rgba(255,255,255,0.86); box-shadow: var(--shadow); padding: 18px;
}
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.label { font-size: 12px; color: rgba(27, 36, 48, 0.72); font-weight: 900; letter-spacing: 0.02em; }
input, select {
  height: 44px; border-radius: 12px; border: 1px solid var(--line-strong);
  padding: 0 12px; background: #fff; color: var(--text); font-weight: 650; outline: none;
}
input:focus, select:focus { border-color: rgba(255, 43, 43, 0.45); box-shadow: 0 0 0 4px rgba(255, 43, 43, 0.12); }
.form-actions { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-msg {
  color: rgba(27, 36, 48, 0.86); font-weight: 800; padding: 12px 16px;
  border-radius: 12px; border: 1px solid rgba(45, 168, 80, 0.3); background: rgba(45, 168, 80, 0.08);
  animation: successFadeIn 0.3s ease;
}
@keyframes successFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Help checkboxes */
.help-list { margin-top: 10px; display: grid; gap: 12px; }
.help-item { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.help-check { position: absolute; opacity: 0; pointer-events: none; }
.help-box {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--accent);
  background: rgba(255,255,255,0.92); display: inline-block; box-shadow: 0 10px 22px rgba(17,20,28,0.06);
}
.help-text { font-weight: 850; color: rgba(21,25,34,0.92); }
.help-item input:checked + .help-box {
  background: var(--accent); box-shadow: 0 0 0 6px rgba(255,74,74,0.12); position: relative;
}
.help-item input:checked + .help-box::after {
  content: ""; position: absolute; left: 6px; top: 2px;
  width: 6px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.help-error { margin-top: 10px; font-weight: 850; color: var(--accent); }
.field-error {
  margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--accent);
  display: none; align-items: center; gap: 5px; opacity: 0;
  animation: fieldErrorIn 0.2s ease forwards;
}
.field-error.visible { display: flex; }
@keyframes fieldErrorIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
input.invalid { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 43, 43, 0.1); }
input.valid { border-color: rgba(45, 168, 80, 0.5); }

/* ===== Footer ===== */
.footer { padding: 18px 0 26px 0; background: rgba(27, 36, 48, 0.94); color: rgba(255,255,255,0.9); }
.footer-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.footer-disclaimer { margin-top: 6px; font-size: 12px; color: rgba(255,255,255,0.72); font-weight: 650; }
.footer-right { display: flex; gap: 10px; }
.social {
  width: 38px; height: 38px; display: grid; place-content: center;
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06); text-decoration: none; font-weight: 900;
  color: rgba(255,255,255,0.9);
}
.social:hover { background: rgba(255,255,255,0.10); }

/* ===== Responsive ===== */

/* -- Tablet & below (980px) -- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-logo-block { order: 1; justify-content: center; padding-top: 0; }
  .hero-photo-block { order: 2; }
  .hero-content-block { order: 3; padding-top: 6px; }
  .campaign-logo-img { max-width: 420px; margin: 0 auto 10px auto; }
  .hero-h1 { font-size: 34px; }
  .family-frame { min-height: 340px; }
  .why-grid { grid-template-columns: 1fr; }
  .involvement-grid { grid-template-columns: 1fr; }
  .cards-3 { grid-template-columns: 1fr; gap: 14px; }
  .section-head-row { align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px; }
}

/* -- Nav collapse (860px) -- */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute; top: calc(var(--nav-h) - 6px); right: var(--pad); left: var(--pad);
    display: none; flex-direction: column; align-items: stretch; gap: 10px; padding: 14px;
    border: 1px solid var(--line); border-radius: var(--r-lg);
    background: rgba(255,255,255,0.96); box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
  }
  .nav-links.open { display: flex; }
  .nav-links > a {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 15px;
  }
  .nav-links > a:active { background: rgba(0,0,0,0.04); }
  .nav-ctas { margin-left: 0; justify-content: stretch; flex-direction: column; }
  .nav-ctas .btn { width: 100%; text-align: center; padding: 14px 16px; font-size: 15px; }
}

/* -- Mobile (600px) -- */
@media (max-width: 600px) {
  :root { --pad: 16px; }

  .section { padding: 40px 0; }
  .h2 { font-size: 24px; }

  /* Hero mobile */
  .hero { padding: 20px 0 16px 0; }
  .hero-h1 { font-size: 26px; line-height: 1.12; }
  .hero-sub { font-size: 15px; }
  .campaign-logo-img { max-width: 300px; }
  .family-frame { min-height: 260px; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; text-align: center; padding: 14px 16px; min-height: 48px; display: flex; align-items: center; justify-content: center; }
  .mini-badges { gap: 8px; }
  .badge { font-size: 12px; padding: 8px 10px; gap: 8px; }

  /* Election card mobile - prevent overflow */
  .election-card {
    position: relative; right: auto; bottom: auto;
    width: 100%; margin-top: 12px;
    border-radius: var(--r-md);
  }

  /* Why section */
  /* headshot uses auto height now */

  /* Form - single column on small screens */
  .form-grid { grid-template-columns: 1fr; }

  /* Inputs: 16px font prevents iOS auto-zoom */
  input, select { font-size: 16px; height: 48px; }

  /* Buttons: minimum 48px touch target */
  .btn { min-height: 48px; padding: 12px 16px; font-size: 15px; }
  .btn-lg { padding: 14px 18px; min-height: 52px; font-size: 16px; }

  /* Help checkboxes - larger touch targets */
  .help-item {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.6);
    min-height: 48px;
  }
  .help-box { width: 26px; height: 26px; flex-shrink: 0; }
  .help-text { font-size: 14px; }

  /* Cards */
  .card { padding: 16px 14px; }
  .card-body { font-size: 14px; }

  /* Pills */
  .pill { padding: 12px; font-size: 14px; }

  /* Footer mobile */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .social { width: 44px; height: 44px; }

  /* Success message */
  .form-msg { text-align: center; width: 100%; padding: 14px 16px; font-size: 15px; }

  /* Form actions stack on mobile */
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { width: 100%; }
}

/* -- Small mobile (380px) -- */
@media (max-width: 380px) {
  :root { --pad: 12px; }
  .hero-h1 { font-size: 22px; }
  .hero-sub { font-size: 14px; }
  .brand-name { font-size: 14px; }
  .brand-sub { font-size: 11px; }
  .nav-donate-mobile { padding: 8px 12px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .election-card-urgent { animation: none; }
}
