/* ==========================================================================
   Casey Billing — Ward 4 | Clarence-Rockland
   Design system: "Clean Modern Civic"
   Hand-authored CSS on a Tailwind-compatible token scale. No build step.
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */

:root {
  /* Semantic colour (never use raw hex in components)
     Brand palette sampled from Casey's logo + poster:
     forest green #22402E · copper #B4592B · cream #F5E6DB · mustard #EAA743 */
  --color-primary:        #22402E;  /* forest green — ink, dark surfaces, headings */
  --color-primary-hover:  #2C523B;
  --color-on-primary:     #FFFFFF;
  --color-accent:         #A9531F;  /* copper — links & primary buttons (4.9:1 on cream) */
  --color-accent-hover:   #8A4218;
  --color-accent-soft:    #F3E3D4;  /* soft copper tint — icon fills, hovers */
  --color-on-accent:      #FFFFFF;
  --color-gold:           #C0842C;  /* mustard-gold rule under labels — decorative on light */
  --color-mustard:        #EAA743;  /* bright mustard — decorative, on dark surfaces only */
  --color-forest-deep:    #16281C;  /* footer */

  --color-background:     #FCFAF5;  /* warm off-white */
  --color-surface:        #FFFFFF;
  --color-surface-warm:   #F6EDE0;  /* cream — alternating sections */
  --color-muted:          #EFE7DA;  /* warm neutral — image placeholders */
  --color-foreground:     #22332A;  /* deep green ink for body text */
  --color-muted-fg:       #55655B;  /* 5.9:1 on --color-background */
  --color-border:         #E8E0D3;
  --color-border-strong:  #D3C7B4;
  --color-ring:           #A9531F;

  /* Type scale */
  --font-heading: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --text-xs:   0.8125rem;  /* 13px — labels only, never body */
  --text-sm:   0.9375rem;  /* 15px */
  --text-base: 1rem;       /* 16px — mobile body minimum */
  --text-lg:   1.125rem;
  --text-xl:   1.375rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.25rem;
  --text-4xl:  3rem;
  --text-5xl:  3.75rem;

  /* Spacing — 4/8px rhythm */
  --space-1: 0.25rem;  --space-2: 0.5rem;   --space-3: 0.75rem;
  --space-4: 1rem;     --space-5: 1.5rem;   --space-6: 2rem;
  --space-7: 3rem;     --space-8: 4rem;     --space-9: 6rem;

  /* Radius + elevation (Soft UI Evolution: softer than flat, no neumorphism) */
  --radius-sm: 8px;  --radius-md: 12px;  --radius-lg: 20px;  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06),
               0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 2px 4px rgba(15, 23, 42, 0.04),
               0 8px 20px -6px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 4px 8px rgba(15, 23, 42, 0.04),
               0 20px 40px -12px rgba(15, 23, 42, 0.16);

  /* Motion — one global rhythm so everything feels related */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-base: 240ms;
  --dur-slow: 400ms;

  /* Layout */
  --container: 1200px;
  --container-prose: 68ch;

  /* Z-index scale */
  --z-base: 0; --z-sticky: 40; --z-header: 60; --z-overlay: 100;
}

/* ---------- 2. Reset & base ---------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Header is sticky — offset anchor targets so headings aren't hidden. */
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* guards the hero's decorative layers */
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.15;
  letter-spacing: -0.018em;
  margin: 0 0 var(--space-4);
  text-wrap: balance;
  font-weight: 600;
}

h1 { font-size: clamp(2.25rem, 6.2vw, var(--text-5xl)); font-weight: 700; }
h2 { font-size: clamp(1.875rem, 4.2vw, var(--text-3xl)); }
h3 { font-size: var(--text-xl); }

p { margin: 0 0 var(--space-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

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

a { color: var(--color-accent); text-underline-offset: 3px; }

ul { margin: 0; padding: 0; list-style: none; }

/* Visible focus on every interactive element — never remove this. */
:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::selection { background: var(--color-accent); color: #fff; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -100%; left: var(--space-4);
  z-index: var(--z-overlay);
  background: var(--color-primary); color: var(--color-on-primary);
  padding: var(--space-3) var(--space-5);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ---------- 3. Layout ---------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
}
@media (min-width: 768px) { .container { padding-inline: var(--space-6); } }

.section { padding-block: var(--space-8); }
@media (min-width: 768px) { .section { padding-block: var(--space-9); } }

.section--warm { background: var(--color-surface-warm); }
.section--surface { background: var(--color-surface); }

.section__head { max-width: var(--container-prose); margin-bottom: var(--space-7); }
.section__head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}
.eyebrow::before {
  content: ''; width: 24px; height: 2px;
  background: currentColor; border-radius: 2px;
}
.section__head--center .eyebrow::before { display: none; }

.lede {
  font-size: var(--text-lg);
  color: var(--color-muted-fg);
  max-width: 60ch;
}

/* ---------- 4. Buttons --------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  min-height: 48px;                 /* touch target */
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
/* Press feedback that does NOT shift surrounding layout. */
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--color-accent);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-md);
}
.btn--primary:hover { background: var(--color-accent-hover); box-shadow: var(--shadow-lg); }

.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-border-strong);
}
.btn--ghost:hover { background: var(--color-surface); border-color: var(--color-primary); }

.btn--onDark {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}
.btn--onDark:hover { background: rgba(255,255,255,0.16); border-color: #fff; }

.btn[disabled], .btn[aria-disabled='true'] {
  opacity: 0.45; cursor: not-allowed; pointer-events: none;
}

.btn__spinner {
  width: 18px; height: 18px; flex: none;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 5. Header / navigation --------------------------------------- */

.header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: rgba(252, 250, 245, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out);
}
.header.is-scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-sm);
  background: rgba(252, 250, 245, 0.95);
}

.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  min-height: 72px;
}

/* Wordmark: given name over a heavy uppercase surname, a hairline rule, then
   the ward in both languages at once. Both words are Lexend — the hierarchy
   comes from weight, size and tracking rather than a second typeface. */
.brand {
  display: inline-flex; align-items: center; gap: var(--space-3);
  min-height: 44px;                 /* touch target */
  text-decoration: none;
}

/* Campaign wordmark logo (replaces the CSS text wordmark). */
.brand__logo { display: block; height: 44px; width: auto; }
@media (max-width: 560px) { .brand__logo { height: 32px; } }
.footer .brand__logo { height: 40px; }

.brand__stack { display: flex; flex-direction: column; line-height: 1; }

.brand__given {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;           /* open tracking sets it apart from the surname */
  color: var(--color-accent);
  margin-bottom: 1px;
  white-space: nowrap;
}
.brand__surname {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: -0.025em;
  color: var(--color-primary);
  white-space: nowrap;
}

.brand__divider {
  width: 1px; height: 36px; flex: none;
  background: var(--color-border-strong);
}

.brand__ward { display: flex; flex-direction: column; line-height: 1.25; }
.brand__ward-code {
  font-family: var(--font-heading);
  font-size: var(--text-sm); font-weight: 700;
  color: var(--color-accent);
  white-space: nowrap;
}
.brand__ward-full {
  font-size: 0.7rem; font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}

/* Small phones: the header holds brand + language switch + menu on one row.
   Drop the ward block rather than let the name wrap. */
@media (max-width: 560px) {
  .header .brand__divider,
  .header .brand__ward { display: none; }
  .header .brand__given { font-size: 0.8rem; letter-spacing: 0.1em; }
  .header .brand__surname { font-size: 1.25rem; }
  .header__inner { min-height: 64px; gap: var(--space-2); }
  .langswitch__btn { min-width: 38px; padding: 0 var(--space-2); }
  .menu-toggle { width: 44px; height: 44px; }
}

.nav { display: none; }
@media (min-width: 1024px) {
  .nav { display: flex; align-items: center; gap: var(--space-1); }
}
.nav__link {
  position: relative;
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  font-size: var(--text-sm); font-weight: 600;
  text-decoration: none;
  white-space: nowrap;   /* French labels are longer — never let them wrap */
  transition: color var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out);
}
.nav__link:hover { background: var(--color-accent-soft); color: var(--color-accent-hover); }
/* Active state: not colour alone — an underline bar carries it too. */
.nav__link::after {
  content: ''; position: absolute; left: var(--space-3); right: var(--space-3);
  bottom: 6px; height: 2px; border-radius: 2px;
  background: var(--color-accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.nav__link[aria-current] { color: var(--color-accent-hover); }
.nav__link[aria-current]::after { transform: scaleX(1); }

.header__actions { display: flex; align-items: center; gap: var(--space-3); }

/* Language switch — segmented control */
.langswitch {
  display: inline-flex; padding: 3px;
  background: var(--color-muted, #EDF1F6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
}
.langswitch__btn {
  min-width: 46px; min-height: 44px;   /* touch target */
  padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-muted-fg);
  font-family: var(--font-heading);
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.langswitch__btn[aria-pressed='true'] {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.langswitch__btn:hover[aria-pressed='false'] { color: var(--color-primary); }

.header__cta { display: none; }
@media (min-width: 640px) { .header__cta { display: inline-flex; } }

/* Menu toggle */
.menu-toggle {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px;
  background: transparent; border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  cursor: pointer; color: var(--color-primary);
  transition: background-color var(--dur-base) var(--ease-out);
}
.menu-toggle:hover { background: var(--color-surface); }
@media (min-width: 1024px) { .menu-toggle { display: none; } }

.menu-toggle__bars { display: block; width: 20px; height: 14px; position: relative; }
.menu-toggle__bars span {
  position: absolute; left: 0; width: 100%; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform var(--dur-base) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}
.menu-toggle__bars span:nth-child(1) { top: 0; }
.menu-toggle__bars span:nth-child(2) { top: 6px; }
.menu-toggle__bars span:nth-child(3) { top: 12px; }
.menu-toggle[aria-expanded='true'] .menu-toggle__bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded='true'] .menu-toggle__bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded='true'] .menu-toggle__bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile drawer */
.mobilenav {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  visibility: hidden;
}
.mobilenav.is-open { visibility: visible; }

.mobilenav__scrim {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.5);   /* 50% — keeps foreground legible */
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}
.mobilenav.is-open .mobilenav__scrim { opacity: 1; }

.mobilenav__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(88vw, 380px);
  background: var(--color-surface);
  padding: var(--space-5) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom));
  padding-top: calc(var(--space-5) + env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: var(--space-2);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-out);
  box-shadow: var(--shadow-lg);
}
.mobilenav.is-open .mobilenav__panel { transform: translateX(0); }

.mobilenav__close {
  align-self: flex-end;
  width: 48px; height: 48px; margin-bottom: var(--space-2);
  display: grid; place-items: center;
  background: transparent; border: 1px solid var(--color-border);
  border-radius: var(--radius-md); cursor: pointer; color: var(--color-primary);
}
.mobilenav__link {
  display: flex; align-items: center;
  min-height: 52px; padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  font-family: var(--font-heading); font-size: var(--text-lg); font-weight: 600;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.mobilenav__link:hover, .mobilenav__link:active { background: var(--color-accent-soft); }
.mobilenav__link[aria-current] {
  background: var(--color-accent-soft); color: var(--color-accent-hover);
  box-shadow: inset 3px 0 0 var(--color-accent);
}
.mobilenav__cta { margin-top: var(--space-4); }

/* ---------- 6. Hero ------------------------------------------------------ */

.hero {
  position: relative;
  overflow: hidden;                 /* clips the parallax layers */
  background: var(--color-primary);
  color: #fff;
  padding-block: var(--space-8) var(--space-9);
  isolation: isolate;
}
@media (min-width: 768px) { .hero { padding-block: var(--space-9); } }

/* Photographic backdrop. The gradient over it is what keeps the headline
   legible — without it the sky in the top-right drops text contrast below AA. */
.hero__bg { position: absolute; inset: 0; z-index: -3; overflow: hidden; }
.hero__bg img {
  /* Oversized and offset so the parallax shift never exposes an edge. */
  position: absolute; top: -8%; left: 0;
  width: 100%; height: 116%;
  object-fit: cover;
  object-position: center 45%;   /* favours the town, not the empty sky */
}
.hero__bg::after {
  content: ''; position: absolute; inset: 0;
  /* Mobile: text spans the full width, so darken evenly top-to-bottom. */
  background:
    linear-gradient(180deg,
      rgba(15,32,22,0.95) 0%,
      rgba(15,32,22,0.90) 50%,
      rgba(15,32,22,0.93) 100%);
}
@media (min-width: 900px) {
  /* Desktop: copy sits left, so let the right side of the photo breathe.
     Two stacked gradients — one horizontal for the copy, one vertical to
     stop the bright sky along the top edge from washing out the header. */
  .hero__bg::after {
    background:
      linear-gradient(180deg, rgba(15,32,22,0.55) 0%, rgba(15,32,22,0) 38%),
      linear-gradient(95deg,
        rgba(15,32,22,0.97) 0%,
        rgba(15,32,22,0.93) 34%,
        rgba(15,32,22,0.74) 62%,
        rgba(15,32,22,0.55) 100%);
  }
}

.hero__inner {
  display: grid; gap: var(--space-7);
  align-items: center;
}
@media (min-width: 900px) {
  .hero__inner { grid-template-columns: 1.05fr 0.95fr; gap: var(--space-8); }
}

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: #F1E7D8;
  margin-bottom: var(--space-5);
}
.hero__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-mustard); flex: none;
}

.hero h1 { color: #fff; margin-bottom: var(--space-5); }
.hero__accent { color: var(--color-mustard); }

.hero__lede {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.82);
  max-width: 54ch;
  margin-bottom: var(--space-6);
}
@media (min-width: 768px) { .hero__lede { font-size: var(--text-xl); } }

.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* Portrait */
.hero__figure { position: relative; }
.hero__portrait {
  position: relative;
  aspect-ratio: 4 / 5;               /* reserved — prevents CLS */
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(150deg, #2C523B, #22402E);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow-lg);
}
.hero__portrait img { width: 100%; height: 100%; object-fit: cover; }

.placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-3);
  text-align: center; padding: var(--space-5);
  color: rgba(255,255,255,0.55);
  font-size: var(--text-sm);
}
.placeholder--light { color: var(--color-muted-fg); background: var(--color-muted, #EDF1F6); }
.placeholder code {
  font-size: var(--text-xs);
  background: rgba(255,255,255,0.10);
  padding: 2px 8px; border-radius: 6px;
}
.placeholder--light code { background: rgba(15,23,42,0.07); }

/* Floating stat card over the portrait */
.hero__badge {
  position: absolute; left: var(--space-4); bottom: calc(-1 * var(--space-5));
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-width: calc(100% - var(--space-8));
}
.hero__badge-day {
  font-family: var(--font-heading);
  font-size: var(--text-2xl); font-weight: 700; line-height: 1;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;   /* no width jitter as it counts down */
}
.hero__badge-label { font-size: var(--text-sm); font-weight: 600; line-height: 1.3; }
.hero__badge-sub { font-size: var(--text-xs); color: var(--color-muted-fg); }

/* ---------- 7. Cards & grids --------------------------------------------- */

.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--color-border-strong); }

.card__icon {
  width: 48px; height: 48px; flex: none;
  display: grid; place-items: center;
  background: var(--color-accent-soft);
  color: var(--color-accent-hover);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-1);
}
.card__icon svg { width: 24px; height: 24px; }

.card h3 { margin-bottom: 0; }
.card p { color: var(--color-muted-fg); font-size: var(--text-sm); }

.card__num {
  position: absolute; top: var(--space-5); right: var(--space-6);
  font-family: var(--font-heading);
  font-size: var(--text-sm); font-weight: 700;
  color: #A9531F;                    /* copper — decorative index number */
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

/* ---------- 8. Meet Casey ------------------------------------------------ */

.bio { display: grid; gap: var(--space-7); align-items: start; }
@media (min-width: 900px) { .bio { grid-template-columns: 0.85fr 1.15fr; gap: var(--space-8); } }

.bio__media {
  aspect-ratio: 4 / 5;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-muted, #EDF1F6);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}
.bio__media img { width: 100%; height: 100%; object-fit: cover; }

.bio__body { max-width: var(--container-prose); }
.bio__body p { color: var(--color-muted-fg); }
.bio__body p:first-of-type {
  font-size: var(--text-lg);
  color: var(--color-foreground);
}

.factlist {
  display: grid; gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}
@media (min-width: 560px) { .factlist { grid-template-columns: repeat(2, 1fr); } }

.fact { display: flex; align-items: flex-start; gap: var(--space-3); }
.fact__icon {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border-radius: var(--radius-sm);
}
.fact__icon svg { width: 18px; height: 18px; }
.fact__label { font-size: var(--text-xs); color: var(--color-muted-fg); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.fact__value { font-size: var(--text-sm); font-weight: 600; }

/* ---------- 9. Community stats ------------------------------------------- */

.stats {
  display: grid; gap: var(--space-5);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }

.stat {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
}
.stat__value {
  font-family: var(--font-heading);
  font-size: clamp(1.875rem, 5vw, var(--text-3xl));
  font-weight: 700; line-height: 1;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;  /* prevents reflow while counting */
  margin-bottom: var(--space-2);
}
.stat__label { font-size: var(--text-sm); color: var(--color-muted-fg); }

/* Community cards — label with a gold rule, photo, copy, arrow link. */

.rulelabel {
  display: flex; align-items: center; gap: var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-primary);
  margin: 0 0 var(--space-4);
}
.rulelabel::after {
  content: ''; flex: 1 1 auto;
  height: 2px; border-radius: 2px;
  background: var(--color-gold);
}

.ccard { display: flex; flex-direction: column; }

.ccard__media {
  position: relative;
  aspect-ratio: 4 / 3;               /* reserved — prevents CLS */
  margin-bottom: var(--space-4);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-muted, #EDF1F6);
  border: 1px solid var(--color-border);
}
.ccard__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.ccard:hover .ccard__media img { transform: scale(1.04); }

.ccard p {
  color: var(--color-muted-fg);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}
.ccard .post__link { margin-top: auto; }

/* ---------- 10. News ----------------------------------------------------- */

.post {
  display: flex; flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.post:hover { box-shadow: var(--shadow-md); border-color: var(--color-border-strong); }

.post__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--color-muted, #EDF1F6);
  border-bottom: 1px solid var(--color-border);
}
.post__media img { width: 100%; height: 100%; object-fit: cover; }

.post__body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.post__meta {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-xs); color: var(--color-muted-fg);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
}
.post__tag { color: var(--color-accent); }
.post h3 { font-size: var(--text-lg); margin-bottom: 0; }
.post p { font-size: var(--text-sm); color: var(--color-muted-fg); }

.post__link {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 44px;
  font-weight: 600; font-size: var(--text-sm);
  color: var(--color-accent-hover);
  text-decoration: none;
}
.post__link svg { width: 16px; height: 16px; transition: transform var(--dur-base) var(--ease-out); }
.post__link:hover { text-decoration: underline; }
.post__link:hover svg { transform: translateX(3px); }

/* Empty state — shown when there are no posts yet */
.empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding: var(--space-8) var(--space-5);
  text-align: center;
  background: var(--color-surface);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  color: var(--color-muted-fg);
}
.empty svg { width: 40px; height: 40px; color: var(--color-border-strong); }

/* ---------- 11. Volunteer / contact -------------------------------------- */

.contact { display: grid; gap: var(--space-7); align-items: start; }
@media (min-width: 900px) { .contact { grid-template-columns: 1.1fr 0.9fr; gap: var(--space-8); } }

.form {
  display: grid; gap: var(--space-5);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
@media (min-width: 640px) { .form { padding: var(--space-7); } }

.field { display: grid; gap: var(--space-2); }

.field__label {
  font-size: var(--text-sm); font-weight: 600;
  display: flex; align-items: center; gap: var(--space-1);
}
.field__req { color: #B91C1C; }

.field__hint { font-size: var(--text-xs); color: var(--color-muted-fg); }

.input, .textarea, .select {
  width: 100%;
  min-height: 48px;                  /* touch-friendly */
  padding: var(--space-3) var(--space-4);
  font-family: inherit;
  font-size: var(--text-base);       /* 16px — stops iOS zoom-on-focus */
  color: var(--color-foreground);
  background: var(--color-background);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out);
}
.input:hover, .textarea:hover, .select:hover { border-color: #94A3B8; }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  background: var(--color-surface);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(169, 83, 31, 0.18);
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.6; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-8);
}

/* Error state: colour + icon + text, never colour alone */
.field.has-error .input,
.field.has-error .textarea,
.field.has-error .select { border-color: #B91C1C; background: #FEF2F2; }

.field__error {
  display: none;
  align-items: flex-start; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: 600; color: #B91C1C;
}
.field.has-error .field__error { display: flex; }
.field__error svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }

.checkgroup { display: grid; gap: var(--space-2); }
.check {
  display: flex; align-items: flex-start; gap: var(--space-3);
  min-height: 44px; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.check:hover { background: var(--color-accent-soft); border-color: var(--color-border-strong); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--color-accent); flex: none; }
.check span { font-size: var(--text-sm); }

.form__status {
  display: none;
  align-items: flex-start; gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.form__status.is-visible { display: flex; }
.form__status--ok { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.form__status--err { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.form__status svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }

/* Contact panel */
.contactcard {
  padding: var(--space-6);
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.contactcard h3 { color: #fff; }
.contactcard p { color: rgba(255,255,255,0.76); font-size: var(--text-sm); }

.contactlist { display: grid; gap: var(--space-4); margin-top: var(--space-5); }
.contactlist a, .contactlist span { color: #fff; }
.contactlist__row { display: flex; align-items: flex-start; gap: var(--space-3); }
.contactlist__icon {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-md);
  color: var(--color-mustard);
}
.contactlist__icon svg { width: 20px; height: 20px; }
.contactlist__label {
  font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 700;
  color: rgba(255,255,255,0.6);
}
.contactlist__value {
  display: inline-flex; align-items: center; min-height: 44px;  /* touch target */
  font-size: var(--text-base); font-weight: 600;
  text-decoration: none;
}
.contactlist__value:hover { text-decoration: underline; }

.socials { display: flex; gap: var(--space-3); margin-top: var(--space-6); }
.socials a {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-md);
  color: #fff;
  transition: background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.socials a:hover { background: rgba(255,255,255,0.2); border-color: #fff; }
.socials svg { width: 22px; height: 22px; }

/* ---------- 12. Footer --------------------------------------------------- */

.footer {
  background: var(--color-forest-deep); color: rgba(255,255,255,0.72);
  padding-block: var(--space-7) var(--space-6);
  font-size: var(--text-sm);
}
.footer__top {
  display: grid; gap: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
@media (min-width: 768px) { .footer__top { grid-template-columns: 1.4fr 1fr 1fr; } }

/* Wordmark inverted for the dark footer */
.footer .brand__given     { color: #7DD3FC; }
.footer .brand__surname   { color: #FFFFFF; }
.footer .brand__divider   { background: rgba(255,255,255,0.25); }
.footer .brand__ward-code { color: #7DD3FC; }
.footer .brand__ward-full { color: rgba(255,255,255,0.72); }

.footer h4 {
  color: #fff; font-size: var(--text-sm);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: var(--space-4);
}
.footer__links { display: grid; gap: var(--space-1); }
.footer__links a {
  display: inline-flex; align-items: center; min-height: 44px;  /* touch target */
  color: rgba(255,255,255,0.68); text-decoration: none;
}
.footer__links a:hover { color: #fff; text-decoration: underline; }

.footer__bottom {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  justify-content: space-between; align-items: center;
  padding-top: var(--space-5);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.52);
}
/* Elections Ontario style authorization statement */
.footer__auth {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: rgba(255,255,255,0.05);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.72);
}

/* ---------- 13. Animation ------------------------------------------------ */

/* Content is visible by default. JS opts in to the hidden start state only
   after confirming GSAP loaded AND motion is allowed — so no-JS, slow-network,
   and reduced-motion users always see everything. */
[data-reveal] { opacity: 1; }

html.anim-ready [data-reveal] { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.anim-ready [data-reveal] { opacity: 1; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 13b. Community Impact timeline ------------------------------- */

.timeline { display: grid; gap: var(--space-6); }

.timeline__item {
  position: relative;
  padding-left: var(--space-5);
  border-left: 2px solid var(--color-border-strong);
  padding-bottom: var(--space-2);
}
.timeline__item:last-child { border-left-color: transparent; }
/* Copper node on the spine, aligned to the year. */
.timeline__item::before {
  content: '';
  position: absolute; left: -8px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid var(--color-background);
  box-shadow: 0 0 0 1px var(--color-border-strong);
}
@media (min-width: 640px) { .timeline__item { padding-left: var(--space-6); } }

.timeline__inner { display: grid; gap: var(--space-4); align-items: center; }
@media (min-width: 768px) {
  .timeline__inner { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: var(--space-6); }
}

.timeline__media {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-muted);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.timeline__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.timeline__item:hover .timeline__media img { transform: scale(1.03); }

.timeline__year {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}
.timeline__year::before {
  content: ''; width: 16px; height: 2px; border-radius: 2px;
  background: var(--color-gold);
}
.timeline__title { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.timeline__desc { color: var(--color-muted-fg); font-size: var(--text-sm); margin: 0; }

/* ---------- 13c. Survey -------------------------------------------------- */

.survey__form {
  max-width: 820px; margin-inline: auto;
  display: grid; gap: var(--space-6);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
@media (min-width: 640px) { .survey__form { padding: var(--space-7); } }

.callout {
  display: flex; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-accent-soft);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-foreground);
  font-size: var(--text-sm);
}
.callout svg { width: 22px; height: 22px; flex: none; color: var(--color-accent); margin-top: 2px; }
.callout p { margin: 0; }

.qblock {
  display: grid; gap: var(--space-3);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}
.qblock:first-of-type { border-top: 0; padding-top: 0; }
.qlabel {
  font-family: var(--font-heading);
  font-size: var(--text-base); font-weight: 600;
  color: var(--color-primary); margin: 0;
}
.qlabel .qnum { color: var(--color-accent); margin-right: var(--space-2); }
.qnote { font-size: var(--text-xs); color: var(--color-muted-fg); margin: 0; }
.qblock legend { padding: 0; }
.qblock fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-3); }

.ranklist { display: grid; gap: var(--space-2); }
.rankrow { display: flex; align-items: center; gap: var(--space-3); }
.rankrow .ranknum {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  background: var(--color-accent-soft); color: var(--color-accent-hover);
  border-radius: var(--radius-full);
  font-family: var(--font-heading); font-size: var(--text-xs); font-weight: 700;
}
.rankrow .input { flex: 1; min-height: 44px; }

.radiorow { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.radiopill {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 44px; padding: var(--space-2) var(--space-5);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  cursor: pointer; font-size: var(--text-sm); font-weight: 600;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.radiopill:hover { background: var(--color-accent-soft); }
.radiopill input { width: 18px; height: 18px; accent-color: var(--color-accent); }
.radiopill:has(input:checked) {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

/* ---------- 13d. Interior page header + home extras ---------------------- */

/* Header band at the top of every interior page (no hero there). */
.pagehead {
  background: var(--color-surface-warm);
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--space-8) var(--space-7);
}
.pagehead__inner { max-width: var(--container-prose); }
.pagehead__inner--center { margin-inline: auto; text-align: center; }
.pagehead h1 {
  font-size: clamp(1.9rem, 4.4vw, var(--text-4xl));
  margin-bottom: var(--space-4);
}
.pagehead .lede { margin-bottom: 0; }
.pagehead__inner--center .lede { margin-inline: auto; }

/* Home — three-pillar commitment cards reuse .card; nothing extra needed. */
.pillar__icon {
  width: 48px; height: 48px; flex: none;
  display: grid; place-items: center;
  background: var(--color-primary); color: #fff;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-1);
}
.pillar__icon svg { width: 24px; height: 24px; }

/* Home — quick links to the other pages. */
.linkcard {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  min-height: 64px;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--color-primary);
  font-family: var(--font-heading); font-weight: 600; font-size: var(--text-lg);
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.linkcard:hover { border-color: var(--color-accent); box-shadow: var(--shadow-md); }
.linkcard svg { width: 20px; height: 20px; flex: none; color: var(--color-accent); transition: transform var(--dur-base) var(--ease-out); }
.linkcard:hover svg { transform: translateX(3px); }

/* Home — closing call-to-action band. */
.ctaband {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.ctaband h2 { color: #fff; }
.ctaband p { color: rgba(255,255,255,0.82); max-width: 54ch; margin-inline: auto; margin-bottom: var(--space-6); }
.ctaband .hero__actions { justify-content: center; }

/* ---------- 14. Print ---------------------------------------------------- */

@media print {
  .header, .mobilenav, .hero__bg, .socials { display: none !important; }
  .hero { color: #000; }
  .hero h1, .hero__lede { color: #000 !important; }
  body { background: #fff; color: #000; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
