:root {
  --navy: #111f44;
  --navy-deep: #0c1633;
  --navy-mid: #1e2f8a;
  --accent: #f86806;
  --accent-hover: #e05a00;
  --ink: #38424d;
  --muted: #747e88;
  --paper: #ffffff;
  --mist: #f3fefe;
  --fog: #f8f8f8;
  --line: #e6e9ee;
  --header-h: 4.5rem;
  --font: "Outfit", system-ui, sans-serif;
  --font-display: "Source Serif 4", Georgia, serif;
  --shadow: 0 18px 50px rgba(17, 31, 68, 0.12);
  --radius: 2px;
}

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

html {
  /* Same typefaces. Root size tracks zcmc.org.ph body copy, and is never smaller than before. */
  font-size: 17px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 18px;
  }
}

@media (min-width: 1024px) {
  html {
    font-size: 19px;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--muted);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: #fff;
  min-height: var(--header-h);
}

.site-header__inner {
  width: min(1200px, calc(100% - 1.5rem));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  width: 3.5rem;
  height: auto;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand__sub {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.92;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav {
  display: none;
}

.nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
}

.nav__link {
  color: #fff;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--accent);
  text-decoration: none;
}

.nav-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0.4rem;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.nav-toggle span:nth-child(1) { width: 100%; }
.nav-toggle span:nth-child(2) { width: 75%; margin-left: auto; }
.nav-toggle span:nth-child(3) { width: 55%; margin-left: auto; }

body.nav-open .nav {
  display: block;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--navy-deep);
  padding: 1rem 1.25rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.nav-open .nav__list {
  flex-direction: column;
  gap: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.7rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.85);
  background: transparent;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

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

.btn--accent:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn--navy {
  background: var(--navy-mid);
  color: #fff;
}

.btn--navy:hover {
  background: #16256f;
  color: #fff;
}

/* Hero */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: grid;
  place-items: center;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  animation: hero-drift 18s ease-in-out infinite alternate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(12, 22, 51, 0.55) 0%, rgba(17, 31, 68, 0.72) 45%, rgba(12, 22, 51, 0.88) 100%);
}

.hero__content {
  text-align: center;
  padding: 5rem 0 4rem;
  animation: rise-in 900ms ease both;
}

.hero__brand {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font);
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.95);
}

.hero__lead {
  margin: 0 auto 2rem;
  max-width: 40rem;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
}

@keyframes hero-drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(0, -1.5%, 0); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section {
  padding: 5rem 0;
}

.section--tint {
  background: var(--fog);
}

.section-title {
  margin: 0 0 2rem;
  text-align: center;
  font-family: var(--font);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.section-title--left {
  text-align: left;
}

.section-subtitle {
  margin: 2.5rem 0 1.25rem;
  text-align: center;
  font-size: 1.35rem;
  color: var(--ink);
}

.section-lead {
  margin: -1rem auto 2.5rem;
  max-width: 40rem;
  text-align: center;
}

.about-figure {
  margin: 0 auto 1rem;
  max-width: 28rem;
  border: 1px solid var(--line);
  padding: 0.65rem;
  background: #fff;
  box-shadow: var(--shadow);
  animation: rise-in 800ms ease both;
}

.about-figure img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.split-cards {
  display: grid;
  gap: 1.5rem;
  margin-top: 1rem;
}

.info-block h4 {
  margin: 0 0 0.6rem;
  color: var(--navy);
  font-size: 1.15rem;
}

.info-block p {
  margin: 0;
}

.participate {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.participate__copy p {
  margin: 0 0 1rem;
}

.participate__media {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.participate__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 700ms ease;
}

.participate__media:hover img {
  transform: scale(1.03);
}

.topic-strip {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.topic-strip li {
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--mist);
  color: var(--ink);
  font-weight: 500;
}

.phases {
  display: grid;
  gap: 1.5rem;
}

.phase {
  padding: 1.5rem 1.35rem 1.35rem;
  border-top: 3px solid var(--navy);
  background: #fff;
  box-shadow: 0 1px 0 var(--line);
}

.phase__label {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.phase h3 {
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.35;
}

.phase ul {
  margin: 0;
  padding-left: 1.15rem;
}

.phase li + li {
  margin-top: 0.45rem;
}

/* Contact */
.contact {
  display: grid;
  gap: 2rem;
}

.contact__email {
  font-size: 1.05rem;
  color: var(--ink);
}

.contact-form {
  display: grid;
  gap: 0.85rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, white);
  border-color: var(--accent);
}

.consent {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--ink);
}

.consent input {
  width: auto;
  margin-top: 0.3rem;
}

.form-status {
  margin: 0;
  color: var(--navy);
  font-weight: 500;
}

/* Footer */
.site-footer {
  background: #1a3350;
  color: rgba(255, 255, 255, 0.78);
  padding-top: 3.5rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  padding-bottom: 2.5rem;
}

.footer-brand img {
  width: 7rem;
  margin-bottom: 1rem;
}

.footer-brand p {
  margin: 0;
  max-width: 28rem;
}

.footer-heading {
  margin: 0 0 0.85rem;
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-links li + li {
  margin-top: 0.45rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.1rem 0;
  font-size: 0.9rem;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom strong {
  color: #fff;
}

@media (min-width: 768px) {
  .split-cards {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .participate {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .topic-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .phases {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

@media (min-width: 992px) {
  .nav {
    display: block;
  }

  .nav-toggle {
    display: none;
  }

  .topic-strip {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Curiosity bubble */
.curiosity {
  position: fixed;
  z-index: 40;
  left: max(0.75rem, env(safe-area-inset-left));
  right: max(0.75rem, env(safe-area-inset-right));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.65rem;
  pointer-events: none;
  container-type: inline-size;
}

.curiosity__bubble,
.curiosity.is-open .curiosity__panel {
  pointer-events: auto;
}

.curiosity__panel {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateX(0.75rem);
  transition:
    max-width 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 200ms ease,
    transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.curiosity.is-open .curiosity__panel {
  max-width: min(22rem, calc(100cqi - 4.6rem));
  opacity: 1;
  transform: translateX(0);
}

.curiosity__card {
  position: relative;
  width: min(22rem, calc(100cqi - 4.6rem));
  padding: 0.85rem 2.75rem 0.95rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.curiosity__kicker {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.curiosity__question {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: break-word;
  transition: opacity 160ms ease, transform 160ms ease;
}

.curiosity__question.is-leaving {
  opacity: 0;
  transform: translateY(4px);
}

.curiosity__close {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.curiosity__close svg {
  width: 1rem;
  height: 1rem;
}

.curiosity__close:hover,
.curiosity__close:focus-visible {
  color: var(--navy);
  background: var(--fog);
}

.curiosity__bubble {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 1px solid rgba(17, 31, 68, 0.06);
  border-radius: 999px;
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 8px 24px rgba(17, 31, 68, 0.16);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.curiosity__bubble:focus-visible,
.curiosity__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.curiosity__icon {
  width: 1.55rem;
  height: 1.55rem;
}

.curiosity__badge {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px #fff;
  transform: scale(0);
  opacity: 0;
}

.curiosity.is-unread .curiosity__badge {
  transform: scale(1);
  opacity: 1;
}

.curiosity.is-open .curiosity__badge {
  opacity: 0;
  transform: scale(0);
}

.curiosity.is-unread:not(.is-open) .curiosity__bubble {
  animation: curiosity-glow 2.4s ease-in-out infinite;
}

@keyframes curiosity-glow {
  0%,
  100% {
    box-shadow:
      0 8px 24px rgba(17, 31, 68, 0.16),
      0 0 0 0 rgba(248, 104, 6, 0.5);
  }
  55% {
    box-shadow:
      0 8px 24px rgba(17, 31, 68, 0.16),
      0 0 0 9px rgba(248, 104, 6, 0);
  }
}

@media (hover: hover) and (pointer: fine) {
  .curiosity__bubble:hover {
    transform: translateY(-2px);
  }
}

@media (min-width: 768px) {
  .curiosity {
    left: max(1.25rem, env(safe-area-inset-left));
    right: max(1.25rem, env(safe-area-inset-right));
    bottom: max(1.25rem, env(safe-area-inset-bottom));
  }
}

.location-list {
  list-style: none;
  margin: 0 auto 2rem;
  padding: 0;
  max-width: 40rem;
  display: grid;
  gap: 0.55rem;
}

.location-list li {
  color: var(--ink);
  background: var(--mist);
  padding: 0.7rem 0.95rem;
  border-left: 3px solid var(--navy);
}

.location-list strong {
  color: var(--navy);
  font-weight: 600;
}

.county-map {
  margin: 0.5rem auto 0;
  max-width: 1120px;
}

.county-map__canvas {
  position: relative;
  background: #f6f1e4;
  border: 1px solid #1c2430;
  box-shadow: 0 16px 40px rgba(17, 31, 68, 0.12);
  padding: 0.45rem;
}

.county-map__national,
.county-map__canvas > .county-map__inset {
  width: 100%;
  height: auto;
  display: block;
}

.county-map__canvas > .county-map__inset {
  margin-top: 0.7rem;
  background: #fffdf8;
}

.county-map__status {
  margin: 0.4rem 0.2rem;
  color: var(--ink);
}

.county-map .water {
  fill: #d5ebf7;
}

.county-map .county {
  fill: #fffdf8;
  stroke: #1c2430;
  stroke-width: 0.8;
  cursor: pointer;
}

.county-map .county.has-center {
  fill: #d9e8f7;
}

.county-map__inset .county {
  stroke-width: 1.6;
}

.county-map .county:hover,
.county-map .county:focus-visible {
  stroke: #1d4f91;
  stroke-width: 2.8;
  outline: none;
}

.county-map__inset .county:hover,
.county-map__inset .county:focus-visible {
  stroke-width: 5;
}

.county-map .county-label,
.county-map .inset-label,
.county-map .inset-title {
  font-family: "Patrick Hand", cursive;
  text-transform: uppercase;
  pointer-events: none;
}

.county-map .neighbor-label {
  font-family: var(--font);
  letter-spacing: 0.14em;
  pointer-events: none;
}

.county-map .pin {
  cursor: pointer;
}

.county-map .pin:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.county-map .pin:hover path,
.county-map .pin:focus-visible path {
  stroke: #1c2430;
}

.county-map__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem 1.25rem;
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  color: var(--ink);
  font-size: 0.88rem;
}

.county-map__swatch {
  display: inline-block;
  width: 0.95rem;
  height: 0.7rem;
  margin-right: 0.35rem;
  vertical-align: -0.1em;
  border: 1px solid #1c2430;
  background: #fffdf8;
}

.county-map__swatch--center {
  background: #d9e8f7;
}

.county-map__swatch--pin {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #1d4f91;
  border-color: #fff;
  box-shadow: 0 0 0 1px #1c2430;
}

.county-map__caption {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.county-map__tooltip {
  position: fixed;
  z-index: 70;
  width: max-content;
  max-width: min(18rem, calc(100vw - 1rem));
  padding: 0.65rem 0.75rem;
  background: var(--paper);
  color: var(--navy);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  pointer-events: none;
  line-height: 1.35;
}

.county-map__tooltip[hidden] {
  display: none;
}

.county-map__tooltip p {
  margin: 0;
}

.county-map__tooltip-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
}

.county-map__tooltip-meta,
.county-map__tooltip-names {
  margin-top: 0.2rem;
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.92rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__media img,
  .hero__content,
  .about-figure,
  .participate__media img,
  .curiosity__panel,
  .curiosity__question,
  .curiosity__bubble {
    animation: none;
    transition: none;
  }

  .curiosity.is-unread:not(.is-open) .curiosity__bubble {
    box-shadow:
      0 8px 24px rgba(17, 31, 68, 0.16),
      0 0 0 3px rgba(248, 104, 6, 0.55);
  }
}
