/* === TOKENS === */
:root {
  --purple:      #2D1B69;
  --purple-dark: #1A0F40;
  --purple-mid:  #4A2FA0;
  --sky:         #5BA4CF;
  --sky-light:   #EAF4FB;
  --sky-mid:     #A8D4EE;
  --white:       #FFFFFF;
  --off-white:   #F8F9FB;
  --text-dark:   #0F0A2A;
  --text-mid:    #2D2250;
  --text-muted:  #5A5480;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-hand:    'Kalam', cursive;

  --max-width: 1320px;
  --section-pad: 6rem 2.5rem;
  --radius-card: 12px;
  --radius-btn:  6px;
  --transition: 0.2s ease;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; }

/* === LAYOUT === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === THANK YOU POPUP === */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 10, 50, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(3px);
}
.popup-overlay.hidden { display: none; }

.popup-card {
  background: #FFFDF7;
  border-radius: 16px;
  width: 100%;
  max-width: 1060px;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 32px 80px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
}
.popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(255,255,255,0.9);
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--purple-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.popup-close:hover { background: var(--white); }

.popup-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  overflow: hidden;
}
.popup-photo {
  overflow: hidden;
  min-height: 400px;
}
.popup-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}
.popup-note {
  padding: 2.5rem 2.5rem 2rem;
  overflow-y: auto;
  background: #FFFDF7;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.note-line {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: #2D1B69;
  line-height: 1.65;
  margin-bottom: 1rem;
}
.note-salutation {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.note-closing {
  margin-top: 0.5rem;
  margin-bottom: 0;
}
.note-signature {
  font-family: var(--font-hand);
  font-size: 2.4rem;
  color: var(--purple);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 1.75rem;
}
.popup-donate-btn {
  display: inline-block;
  background: var(--purple);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-btn);
  transition: background var(--transition);
  align-self: flex-start;
  margin-bottom: 0.75rem;
}
.popup-donate-btn:hover { background: var(--purple-mid); }
.note-dismiss-hint {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.popup-dismiss-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--sky);
  cursor: pointer;
  text-decoration: underline;
}
.popup-dismiss-link:hover { color: var(--purple); }

@media (max-width: 640px) {
  .popup-inner { grid-template-columns: 1fr; }
  .popup-photo { min-height: 200px; max-height: 220px; }
  .popup-note { padding: 1.5rem; }
  .note-line { font-size: 1.1rem; }
}

/* === HEADER === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--purple);
  border-bottom: 2px solid var(--sky);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--white);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.site-nav a {
  color: var(--sky-mid);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--transition);
}
.site-nav a:hover { color: var(--white); }
.nav-cta {
  background: var(--sky);
  color: var(--purple-dark) !important;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-btn);
  font-weight: 600 !important;
  transition: background var(--transition) !important;
}
.nav-cta:hover { background: var(--white) !important; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
}

/* === HERO === */
.hero {
  background: var(--purple-dark);
  background-image: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 70%, var(--purple-mid) 100%);
  padding: 5rem 1.5rem 4rem;
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 4rem;
  align-items: center;
}
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sky);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 4.5vw, 5.5rem);
  color: var(--white);
  line-height: 1.1;
  font-weight: 700;
  margin-bottom: 1.25rem;
}
.hero-body {
  font-size: clamp(1.1rem, 1.4vw, 1.35rem);
  color: var(--sky-light);
  max-width: 560px;
  margin-bottom: 2rem;
  line-height: 1.75;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* === BUTTONS === */
.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--sky);
  color: var(--purple-dark);
  border-color: var(--sky);
}
.btn-primary:hover {
  background: var(--white);
  border-color: var(--white);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--white);
}

/* === HERO PHOTO === */
.photo-frame {
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 3px solid var(--sky);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  aspect-ratio: 4/5;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* === SECTIONS === */
.section { padding: var(--section-pad); }
.section-white { background: var(--white); }
.section-sky   { background: var(--sky-light); }
.section-purple { background: var(--purple); }

.section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--purple);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.section-sky .section-label {
  background: var(--purple);
  color: var(--sky-mid);
}
.label-light {
  background: rgba(255,255,255,0.18) !important;
  color: var(--sky-mid) !important;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.5vw, 3rem);
  color: var(--purple-dark);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  max-width: 780px;
}
.section-body {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  color: var(--text-mid);
  margin-bottom: 1rem;
  line-height: 1.8;
  max-width: 780px;
}

.section-purple .section h2,
.section-purple h2,
.section-purple .contact-heading {
  color: var(--white);
}
.section-purple .section-body,
.section-purple .contact-body {
  color: var(--sky-mid);
}
.section-purple .priority-body h3,
.section-purple .record-text h3 {
  color: var(--white);
}
.section-purple .priority-body p,
.section-purple .record-text p {
  color: var(--sky-mid);
}
.about-inner {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 4rem;
  align-items: center;
}
.about-photo img {
  width: 100%;
  height: 460px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius-card);
  border: 3px solid var(--sky-mid);
}

/* === PHOTO BREAK === */
.photo-break {
  position: relative;
  height: 560px;
  overflow: hidden;
}
.photo-break img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  object-position: center;
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
}

.photo-break {
  background-image: url('sign-hold.jpg');
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}
.photo-break img { display: none; }
.photo-break-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(26,15,64,0.75) 0%, rgba(26,15,64,0.2) 60%, transparent 100%);
  display: flex;
  align-items: center;
  padding: 3rem;
}
.photo-break-quote {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: var(--white);
  max-width: 500px;
  line-height: 1.4;
  font-style: italic;
}

/* === PRIORITIES === */
.priority-list {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.priority-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--sky-mid);
  align-items: start;
}
.priority-item:first-child { border-top: 1px solid var(--sky-mid); }
.priority-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--purple);
  line-height: 1;
  padding-top: 0.2rem;
  opacity: 0.55;
}
.priority-body h3 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.4vw, 1.5rem);
  color: var(--purple-dark);
  margin-bottom: 0.5rem;
  font-weight: 700;
}
.priority-body p {
  font-size: clamp(1rem, 1.1vw, 1.15rem);
  color: var(--text-mid);
  line-height: 1.75;
}

/* === RECORD === */
.record-item {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
  padding: 3rem 0;
  border-bottom: 1px solid #DDE2EC;
  align-items: center;
}
.record-item:last-child { border-bottom: none; }
.record-item-plain {
  display: block;
}
.record-item-plain .record-number {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.record-left { display: flex; flex-direction: column; gap: 1rem; }
.record-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--sky);
  line-height: 1;
}
.record-text h3 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.5vw, 1.6rem);
  color: var(--purple-dark);
  margin-bottom: 0.6rem;
  font-weight: 700;
}
.record-text p {
  font-size: clamp(1rem, 1.1vw, 1.15rem);
  color: var(--text-mid);
  line-height: 1.8;
}
.record-photo img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius-card);
  border: 2px solid var(--sky-mid);
}

/* === CONTACT === */
.contact-inner { max-width: 620px; }
.contact-heading {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.5vw, 3rem);
  color: var(--white);
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.contact-body {
  color: var(--sky-mid);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.contact-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 500;
  border-left: 3px solid var(--sky);
  padding-left: 1rem;
  transition: border-color var(--transition);
}
.contact-link:hover { border-color: var(--white); }
.contact-link-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sky);
}

/* === FOOTER === */
.site-footer {
  background: var(--purple-dark);
  padding: 2rem 1.5rem;
  text-align: center;
}
.footer-inner p {
  font-size: 0.85rem;
  color: var(--sky-mid);
  line-height: 1.8;
}
.footer-inner a {
  color: var(--sky-mid);
  text-decoration: underline;
  transition: color var(--transition);
}
.footer-inner a:hover { color: var(--white); }

/* === SCROLL ANIMATIONS === */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* === MOBILE === */
@media (max-width: 800px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .hero-photo { order: -1; max-width: 260px; }
  .photo-frame { aspect-ratio: 1/1; }

  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--purple-dark);
    padding: 1.5rem;
    gap: 1.25rem;
    border-bottom: 2px solid var(--sky);
    z-index: 99;
  }
  .site-nav.open a { font-size: 1rem; }
  .hamburger { display: flex; }
  .header-inner { position: relative; }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .about-photo img { height: 300px; }

  .photo-break { height: 300px; background-attachment: scroll; }
  .photo-break-overlay { padding: 1.5rem; }

  .record-item {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .record-item-plain {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .record-photo img { height: 220px; }

  .priority-item {
    grid-template-columns: 48px 1fr;
    gap: 1rem;
  }

  .section { padding: 3.5rem 1.25rem; }
}

/* === MAP === */
.map-container {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid #DDE2EC;
}
.map-header {
  margin-bottom: 1.25rem;
}
.map-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  color: var(--purple-dark);
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.map-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}
#precinct-map {
  width: 100%;
  height: 500px;
  border-radius: var(--radius-card);
  overflow: hidden;
  z-index: 0;
  box-shadow: 0 8px 32px rgba(26, 15, 64, 0.25);
}

/* Animated pin */
.map-pin-wrapper {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-pin-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(91, 164, 207, 0.35);
  animation: pin-pulse 2s ease-out infinite;
}
.map-pin {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--purple);
  border: 2.5px solid var(--sky);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
  z-index: 1;
  transition: transform 0.15s ease;
}
.map-pin:hover { transform: scale(1.1); }
.map-pin-number {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sky);
  line-height: 1;
}

@keyframes pin-pulse {
  0%   { transform: scale(0.8); opacity: 0.8; }
  70%  { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(0.8); opacity: 0; }
}

/* Dark map popup */
.leaflet-popup-content-wrapper {
  background: #1A0F40 !important;
  border: 1px solid var(--sky) !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5) !important;
  color: var(--white) !important;
}
.leaflet-popup-tip {
  background: #1A0F40 !important;
}
.leaflet-popup-close-button {
  color: var(--sky-mid) !important;
}
.map-popup-num {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sky);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.map-popup strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--white);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.map-popup p {
  font-size: 0.88rem;
  color: var(--sky-mid);
  line-height: 1.65;
  margin: 0;
}

@media (max-width: 800px) {
  #precinct-map { height: 360px; }
}
@media (min-width: 1400px) {
  #precinct-map { height: 600px; }
}

/* === LARGE SCREENS === */
@media (min-width: 1400px) {
  :root { --section-pad: 8rem 3rem; }

  .hero { padding: 7rem 3rem 6rem; }
  .hero-inner { grid-template-columns: 1fr 480px; gap: 6rem; }

  .about-inner { grid-template-columns: 1fr 440px; gap: 5rem; }
  .about-photo img { height: 560px; }

  .photo-break { height: 680px; }

  .record-item { grid-template-columns: 1fr 400px; gap: 4rem; }
  .record-photo img { height: 340px; }
  .record-number { font-size: 3.8rem; }

  .priority-num { font-size: 2.6rem; }

  .site-logo { font-size: 1.4rem; }
  .site-nav a { font-size: 1rem; }
  .header-inner { height: 72px; }
}
