/* ================================================================
   Sean Hunt for Mayor — Middlesex Centre
   Rural-warmth design system
   ================================================================ */

:root {
  --cream: #faf6ec;
  --wheat: #f1e9d4;
  --wheat-deep: #e6dab9;
  --gold: #d9a441;
  --gold-deep: #b9852c;
  --field: #6f8f4e;
  --field-deep: #4c6b35;
  --navy: #213a5c;
  --navy-deep: #172b45;
  --ink: #2b3440;
  --ink-soft: #55606e;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(33, 58, 92, 0.10);
  --font-display: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.015em;
}

h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }

p { margin: 0 0 1em; }

a { color: var(--field-deep); }
a:hover { color: var(--navy); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------------- Nav ---------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 236, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(33, 58, 92, 0.08);
  transition: box-shadow 0.25s ease;
}
.site-nav.scrolled { box-shadow: 0 4px 18px rgba(33, 58, 92, 0.10); }

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand span { color: var(--gold-deep); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--field-deep); }

.nav-cta {
  background: var(--navy);
  color: var(--white) !important;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
}
.nav-cta:hover { background: var(--navy-deep); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  width: 24px;
  height: 2.5px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid rgba(33, 58, 92, 0.1);
    display: none;
    padding: 0.5rem 0 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 0.8rem 1.5rem;
    font-size: 1.05rem;
  }
  .nav-cta {
    margin: 0.5rem 1.5rem 0;
    text-align: center;
    border-radius: var(--radius);
  }
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  min-height: min(88vh, 780px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-art,
.hero-art svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Aerial drone video hero — sits over the illustration, fades in only
   once it is actually playing; the SVG scene remains the fallback. */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
  z-index: 1;
}
.hero-video.playing { opacity: 1; }
.hero-scrim { z-index: 2; }
.hero-inner { z-index: 3; }

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(250, 246, 236, 0.97) 0%, rgba(250, 246, 236, 0.88) 34%, rgba(250, 246, 236, 0.42) 60%, rgba(250, 246, 236, 0) 80%),
    linear-gradient(to top, rgba(250, 246, 236, 0.55), rgba(250, 246, 236, 0) 30%);
}

@media (max-width: 640px) {
  .hero-scrim {
    background:
      linear-gradient(to bottom, rgba(250, 246, 236, 0.95) 0%, rgba(250, 246, 236, 0.85) 52%, rgba(250, 246, 236, 0.4) 78%, rgba(250, 246, 236, 0.05) 100%);
  }
}

.hero-inner {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 5.5rem 1.25rem 4.5rem;
  width: 100%;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--field-deep);
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0 0 0.35em;
  line-height: 1.02;
}
/* soft cream halo lifts type off the video without hard shadows */
.hero .kicker,
.hero h1,
.hero .tagline,
.hero .hero-communities {
  text-shadow:
    0 1px 2px rgba(250, 246, 236, 0.95),
    0 0 12px rgba(250, 246, 236, 0.85),
    0 0 28px rgba(250, 246, 236, 0.6);
}

.hero-name {
  display: block;
  font-size: clamp(3rem, 8.5vw, 5.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy-deep);
}
.hero-office {
  display: block;
  font-size: clamp(1.4rem, 3.6vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #9a6b16;
}

.tagline {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 30ch;
  margin-bottom: 0.9rem;
}

.hero-communities {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  max-width: 46ch;
  margin-bottom: 1.8rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.6rem;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover { background: var(--navy-deep); color: var(--white); }

.btn-secondary {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}
.btn-secondary:hover { background: rgba(33, 58, 92, 0.07); color: var(--navy); }

.vote-pill {
  display: inline-block;
  background: var(--wheat);
  border: 1px solid var(--wheat-deep);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-size: 0.95rem;
  text-decoration: none;
}
.vote-pill:hover { background: var(--wheat-deep); color: var(--navy); }
.vote-pill strong { color: var(--field-deep); }

/* ---------------- Sections ---------------- */

.section { padding: 4.5rem 0; }
.section-tinted { background: var(--wheat); }

.section-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section-inner.narrow { max-width: 760px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--gold-deep);
  margin-bottom: 0.5rem;
}

.section-lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* ---------------- About ---------------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(280px, 5fr) 7fr;
  gap: 3rem;
  align-items: start;
}

.about-photo {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: rotate(-1.2deg);
  border: 6px solid var(--white);
}
.about-photo img { border-radius: 8px; }

.photo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1200 / 816;
  background: var(--field);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
}

.fact-chips {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.fact-chips li {
  background: var(--wheat);
  border: 1px solid var(--wheat-deep);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--field-deep);
}

@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-photo { max-width: 440px; }
}

/* ---------------- Ward map ---------------- */

.ward-block {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 3rem;
  align-items: center;
  margin-top: 4rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(33, 58, 92, 0.06);
  padding: 2.5rem;
  max-width: 1070px;
}

.ward-map { max-width: 420px; margin: 0 auto; }
.ward-map svg { width: 100%; height: auto; display: block; }

/* Recolourable ward fills — official boundary geometry (MIDC_Wards2022) */
:root {
  --ward-1: #dcc46e;
  --ward-2: #d9a441;
  --ward-3: #7d9455;
  --ward-4: #5c7ea3;
  --ward-5: #a9805a;
}
.ward-1 { fill: var(--ward-1); }
.ward-2 { fill: var(--ward-2); }
.ward-3 { fill: var(--ward-3); }
.ward-4 { fill: var(--ward-4); }
.ward-5 { fill: var(--ward-5); }

.map-roads polyline { stroke: rgba(250, 246, 236, 0.85); stroke-width: 2.2; }
.map-roads .map-roads-minor polyline { stroke-width: 1.1; stroke: rgba(250, 246, 236, 0.6); }

.map-ward-labels text {
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: 3px;
  opacity: 0.85;
}
.map-places circle { fill: var(--navy); }
.map-places text {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 25px;
  fill: var(--ink);
  paint-order: stroke;
  stroke: rgba(250, 246, 236, 0.75);
  stroke-width: 4px;
}

.ward-copy h3 { font-size: 1.5rem; }
.ward-copy p { color: var(--ink-soft); }
.ward-note { font-size: 0.82rem; }

@media (max-width: 820px) {
  .ward-block { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem; }
}

/* ---------------- Plan ---------------- */

.plank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.4rem;
  margin-top: 2rem;
}

.plank {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
  box-shadow: 0 4px 16px rgba(33, 58, 92, 0.06);
  border-top: 4px solid var(--field);
}
.plank:nth-child(even) { border-top-color: var(--gold); }

.plank-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--wheat);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.plank-icon svg {
  width: 26px;
  height: 26px;
  fill: var(--field-deep);
}
.plank:nth-child(even) .plank-icon svg { fill: var(--gold-deep); }

.plank p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

.plan-closer {
  margin-top: 3rem;
  max-width: 68ch;
  border-left: 4px solid var(--gold);
  padding-left: 1.5rem;
}
.plan-closer h3 {
  font-size: 1.45rem;
  margin-bottom: 0.6em;
}
.plan-closer p {
  font-size: 1.12rem;
  color: var(--ink);
}
.plan-closer p:last-child { margin-bottom: 0; }

/* ---------------- Updates ---------------- */

.update {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 2.2rem;
  box-shadow: 0 4px 16px rgba(33, 58, 92, 0.06);
  margin-top: 1.6rem;
}
.update-date {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-deep);
  margin-bottom: 0.3rem;
}
.update-sig {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
  font-size: 1.05rem;
}

/* ---------------- Form ---------------- */

#signup-form {
  margin-top: 2rem;
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 4px 16px rgba(33, 58, 92, 0.06);
}

.form-row { margin-bottom: 1.1rem; }

.form-row label,
.form-checks legend {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.opt { font-weight: 500; color: var(--ink-soft); }

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--wheat-deep);
  border-radius: 10px;
  font: inherit;
  background: var(--cream);
  color: var(--ink);
}
input:focus, textarea:focus {
  outline: 2px solid var(--field);
  outline-offset: 1px;
  border-color: var(--field);
}

.form-checks {
  border: 0;
  padding: 0;
  margin: 0 0 1.1rem;
}
.form-checks label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.5rem;
  font-size: 0.98rem;
}
.form-checks input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--field-deep);
}

.form-status {
  margin: 0.9rem 0 0;
  font-weight: 600;
  min-height: 1.4em;
}
.form-status.ok { color: var(--field-deep); }
.form-status.err { color: #a4442c; }

.fine-print {
  margin: 1rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ---------------- Donate ---------------- */

.rules-list {
  padding-left: 1.2rem;
  margin: 1.2rem 0 1.4rem;
}
.rules-list li { margin-bottom: 0.55rem; }

/* ---------------- Vote (navy) ---------------- */

.section-navy {
  background: var(--navy);
  color: #e8ecf2;
}
.section-navy h2, .section-navy h3 { color: var(--white); }
.section-navy .eyebrow { color: var(--gold); }
.section-navy .section-lede { color: #c3cddb; }
.section-navy a { color: var(--gold); }
.section-navy a:hover { color: #f0c169; }

.vote-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
  margin-top: 2rem;
}

.vote-step {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
}
.vote-step p { color: #c3cddb; margin: 0; font-size: 0.98rem; }
.vote-step strong { color: var(--white); }

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy-deep);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 0.9rem;
}

.vote-official {
  margin-top: 2rem;
  font-size: 0.95rem;
  color: #c3cddb;
}

/* ---------------- Footer ---------------- */

.site-footer {
  background: var(--navy-deep);
  color: #b9c4d3;
  padding: 2.8rem 0;
  text-align: center;
}
.footer-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.footer-name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.15rem;
  color: var(--white);
  margin-bottom: 0.4rem;
}
.footer-contact a { color: var(--gold); text-decoration: none; }
.footer-contact a:hover { text-decoration: underline; }
.footer-legal { font-size: 0.9rem; margin: 0.8rem 0 0.3rem; }
.footer-fine { font-size: 0.8rem; opacity: 0.7; margin: 0; }

/* ---------------- Hero scene motion ---------------- */

.hero-art .cloud-1 { animation: drift 46s ease-in-out infinite alternate; }
.hero-art .cloud-2 { animation: drift 64s ease-in-out infinite alternate-reverse; }
.hero-art .cloud-3 { animation: drift 38s ease-in-out infinite alternate; }
@keyframes drift {
  from { transform: translateX(-26px); }
  to   { transform: translateX(32px); }
}

.hero-art .sun-glow { animation: glowpulse 16s ease-in-out infinite alternate; }
@keyframes glowpulse {
  from { opacity: 0.7; }
  to   { opacity: 1; }
}

.hero-art .wheat-shimmer {
  opacity: 0.2;
  animation: shimmer 7s ease-in-out infinite alternate;
}
@keyframes shimmer {
  from { opacity: 0.16; }
  to   { opacity: 0.45; }
}

.hero-art .birds { animation: fly 70s linear infinite; }
@keyframes fly {
  from { transform: translateX(-160px); }
  to   { transform: translateX(1620px); }
}
.hero-art .birds-bob { animation: bob 3.8s ease-in-out infinite alternate; }
@keyframes bob {
  from { transform: translateY(-5px); }
  to   { transform: translateY(5px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art .cloud-1,
  .hero-art .cloud-2,
  .hero-art .cloud-3,
  .hero-art .sun-glow,
  .hero-art .wheat-shimmer,
  .hero-art .birds,
  .hero-art .birds-bob { animation: none; }
}
