/* ==========================================================================
   WC Votes — shared stylesheet
   Fonts are self-hosted (assets/fonts) so the site makes no third-party requests.
   ========================================================================== */

@font-face {
  font-family: "Barlow Condensed";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("fonts/public-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("fonts/public-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("fonts/public-sans-latin-700-normal.woff2") format("woff2");
}

:root {
  /* Palette: ballot paper, ink, the indigo of a filled oval, and public-notice yellow */
  --paper: #f3f5f9;
  --white: #ffffff;
  --ink: #12193a;
  --ink-deep: #0c1129;
  --indigo: #2d3fcb;
  --indigo-dark: #2130a3;
  --notice: #ffc83d;
  --notice-soft: #fff4d1;
  --slate: #566080;
  --rule: #d3d9e6;
  --error: #b3261e;
  --error-soft: #fdeceb;
  --ok: #17694a;

  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Public Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.02;
  margin: 0;
  letter-spacing: -0.005em;
}
h1, h2 { text-wrap: balance; }
h1 { font-size: clamp(2.9rem, 6.4vw, 5rem); }
h2 { font-size: clamp(2.1rem, 3.8vw, 3rem); }
h3 { font-size: 1.65rem; font-weight: 600; line-height: 1.1; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--indigo); text-underline-offset: 0.18em; }
a:hover { color: var(--indigo-dark); }

:focus-visible {
  outline: 3px solid var(--notice);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--ink);
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: var(--ink);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  z-index: 20;
}
.skip-link:focus { top: 0.75rem; color: var(--white); }

/* ---------- Header ---------- */

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.85rem;
  line-height: 1;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 2.1rem; height: auto; flex: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.site-nav a:not(.button) {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
}
.site-nav a:not(.button):hover { text-decoration: underline; }

@media (max-width: 46rem) {
  .site-nav a:not(.button) { display: none; }
  .site-nav.is-plain a:not(.button) { display: inline; }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  font-family: var(--body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  padding: 0.85rem 1.4rem;
  border-radius: 6px;
  border: 2px solid var(--indigo);
  background: var(--indigo);
  color: var(--white);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.button:hover { background: var(--indigo-dark); border-color: var(--indigo-dark); color: var(--white); }

.button.is-large { font-size: 1.1rem; padding: 1.05rem 1.75rem; }

.button.is-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.button.is-quiet:hover { background: var(--ink); color: var(--white); }

.button.is-notice {
  background: var(--notice);
  border-color: var(--notice);
  color: var(--ink);
}
.button.is-notice:hover { background: #ffd566; border-color: #ffd566; color: var(--ink); }

.button.is-outline-light {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--white);
}
.button.is-outline-light:hover { background: var(--white); border-color: var(--white); color: var(--ink); }

.button-row { display: flex; flex-wrap: wrap; gap: 0.85rem; }

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

.hero { padding-block: clamp(3rem, 7vw, 6rem); }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero h1 { max-width: 16ch; }
.hero h1 span { display: block; }
.hero-lede {
  font-size: clamp(1.15rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  max-width: 34rem;
  margin: 1.5rem 0 2rem;
}

@media (max-width: 56rem) {
  .hero .wrap { grid-template-columns: 1fr; }
}

/* The text thread: the one place the page gets loud */
.thread {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 26rem;
  justify-self: end;
  width: 100%;
}
@media (max-width: 56rem) { .thread { justify-self: start; } }

.msg {
  margin: 0;
  padding: 0.8rem 1.05rem;
  border-radius: 1.2rem;
  font-size: 1rem;
  line-height: 1.42;
  max-width: 88%;
}
.msg-in {
  align-self: flex-start;
  background: var(--white);
  border: 1px solid var(--rule);
  border-bottom-left-radius: 0.3rem;
}
.msg-out {
  align-self: flex-end;
  background: var(--indigo);
  color: var(--white);
  border-bottom-right-radius: 0.3rem;
}
.msg-alert {
  align-self: flex-start;
  background: var(--notice);
  border-bottom-left-radius: 0.3rem;
  max-width: 94%;
  margin-top: 0.9rem;
}
.msg-alert strong { display: block; }

.thread figcaption {
  order: 99;
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--slate);
}

@media (prefers-reduced-motion: no-preference) {
  .thread .msg {
    opacity: 0;
    transform: translateY(8px);
    animation: msg-arrive 0.45s ease-out forwards;
  }
  .thread .msg:nth-of-type(1) { animation-delay: 0.25s; }
  .thread .msg:nth-of-type(2) { animation-delay: 1.0s; }
  .thread .msg:nth-of-type(3) { animation-delay: 1.75s; }
  .thread .msg:nth-of-type(4) { animation-delay: 2.5s; }
  .thread .msg:nth-of-type(5) { animation-delay: 3.5s; }
  @keyframes msg-arrive {
    to { opacity: 1; transform: none; }
  }
}

/* ---------- Page sections ---------- */

.band { padding-block: clamp(3.5rem, 7vw, 6rem); }
.band.is-white { background: var(--white); border-block: 1px solid var(--rule); }
.band.is-ink { background: var(--ink); color: var(--white); }
.band.is-ink a:not(.button) { color: var(--white); }

/* Mission: heading left, reading column right */
.mission {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 5vw, 4.5rem);
}
.mission h2 { max-width: 16ch; }
.mission-body { max-width: 40rem; font-size: 1.125rem; }
.mission-body .button-row { margin-top: 2rem; }
@media (max-width: 56rem) {
  .mission { grid-template-columns: 1fr; }
  .mission h2 { max-width: 18ch; }
}

/* Two kinds of texts */
.kinds-intro { max-width: 40rem; margin: 1rem 0 2.75rem; color: var(--slate); font-size: 1.125rem; }
.kinds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 3px solid var(--ink);
}
.kind { padding: 2rem 2.5rem 0.5rem 0; }
.kind + .kind { padding: 2rem 0 0.5rem 2.5rem; border-left: 1px solid var(--rule); }
.kind h3 { margin-bottom: 0.75rem; }
.kind p { max-width: 32rem; }
.kind-when {
  display: inline-block;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  background: var(--white);
  border: 1px solid var(--rule);
}
.kind.is-alert .kind-when { background: var(--notice); border-color: var(--notice); }
@media (max-width: 46rem) {
  .kinds { grid-template-columns: 1fr; }
  .kind, .kind + .kind { padding: 1.75rem 0 0.75rem; border-left: 0; }
  .kind + .kind { border-top: 1px solid var(--rule); }
}

/* Promises list, with ballot ovals as markers */
.promises {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 5vw, 4.5rem);
  margin-top: clamp(3rem, 6vw, 5rem);
}
.oval-list { list-style: none; margin: 0; padding: 0; max-width: 40rem; }
.oval-list li {
  position: relative;
  padding: 0 0 1.15rem 2.6rem;
}
.oval-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 1.55rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--ink);
}
.oval-list strong { font-weight: 700; }
@media (max-width: 56rem) { .promises { grid-template-columns: 1fr; } }

/* Three reasons, illustrated */
.reasons-head { max-width: 44rem; margin-bottom: 2.75rem; }
.reasons-head p { margin-top: 1rem; font-size: 1.125rem; color: var(--slate); }
.reasons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.75rem, 3.5vw, 3rem);
}
.reason img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1.35rem;
  background: var(--paper);
}
.reason h3 { margin-bottom: 0.6rem; }
@media (max-width: 52rem) { .reasons { grid-template-columns: 1fr; max-width: 30rem; } }

/* Contact band */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 5vw, 4.5rem);
  align-items: end;
}
.contact p { max-width: 36rem; margin-top: 1.1rem; font-size: 1.125rem; color: #d7dcf0; }
.contact .button-row { justify-content: flex-end; }
@media (max-width: 56rem) {
  .contact { grid-template-columns: 1fr; align-items: start; }
  .contact .button-row { justify-content: flex-start; }
}

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

.site-footer {
  background: var(--ink-deep);
  color: #c4cae3;
  padding-block: 2.75rem;
  font-size: 0.95rem;
}
.site-footer a { color: var(--white); }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr);
  gap: 2rem;
}
.footer-project { color: var(--white); font-weight: 600; margin-bottom: 0.4rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.footer-legal {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
@media (max-width: 46rem) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Sign-up page ---------- */

.signup { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.signup .wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.signup h1 { font-size: clamp(2.6rem, 5vw, 3.9rem); max-width: 16ch; }
.signup-lede { font-size: 1.15rem; max-width: 36rem; margin: 1.1rem 0 2rem; }
@media (max-width: 56rem) { .signup .wrap { grid-template-columns: 1fr; } }

.form-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-top: 5px solid var(--ink);
  border-radius: 10px;
  padding: clamp(1.4rem, 3vw, 2.25rem);
  max-width: 38rem;
}

.field { margin-bottom: 1.35rem; }
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.field .optional { font-weight: 400; color: var(--slate); }
.field .hint { font-size: 0.93rem; color: var(--slate); margin: 0 0 0.45rem; }
.field input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid #8d97b3;
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
}
.field input:focus-visible {
  outline: 3px solid var(--notice);
  outline-offset: 0;
  box-shadow: none;
  border-color: var(--ink);
}
.field-error {
  display: none;
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--error);
}
.field.has-error input { border-color: var(--error); background: var(--error-soft); }
.field.has-error .field-error { display: block; }

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 34rem) { .field-pair { grid-template-columns: 1fr; gap: 0; } }

/* Honeypot: hidden from people, visible to bots */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Opt-in: checkbox beside the required language, Submit directly below */
.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.1rem 1.15rem;
  margin: 0.25rem 0 0;
}
.consent input[type="checkbox"] {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0.15rem 0 0;
  accent-color: var(--indigo);
  cursor: pointer;
}
.consent label {
  font-size: 0.97rem;
  line-height: 1.5;
  cursor: pointer;
}
.consent.has-error { border-color: var(--error); background: var(--error-soft); }
.consent-error {
  display: none;
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--error);
}
.consent-error.is-visible { display: block; }
.consent-note {
  display: none;
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--slate);
}
.consent-note.is-visible { display: block; }

.submit-row { margin-top: 1.1rem; }
.submit-row .button { min-width: 11rem; }
.submit-row .button[disabled] { opacity: 0.6; cursor: progress; }

.form-status {
  display: none;
  margin-top: 1.1rem;
  padding: 0.9rem 1.05rem;
  border-radius: 8px;
  background: var(--error-soft);
  border: 1px solid var(--error);
  color: var(--error);
  font-weight: 600;
}
.form-status.is-visible { display: block; }

.done { display: none; }
.done.is-visible { display: block; }
.done h2 { font-size: clamp(2rem, 3.5vw, 2.6rem); margin-bottom: 0.9rem; }
.done .oval-mark { width: 3.4rem; margin-bottom: 1.25rem; }
.test-mode {
  margin-top: 1.5rem;
  padding: 0.9rem 1.05rem;
  border-radius: 8px;
  background: var(--notice-soft);
  border: 1px solid var(--notice);
  font-size: 0.95rem;
}

.expect { padding-top: 0.5rem; }
.expect h2 { font-size: 1.9rem; margin-bottom: 1.25rem; }
.expect .oval-list li { padding-bottom: 1rem; }

/* ---------- Long-form pages (privacy) ---------- */

.prose-page { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.prose { max-width: 44rem; }
.prose h1 { font-size: clamp(2.6rem, 5vw, 3.9rem); margin-bottom: 0.75rem; }
.prose .updated { color: var(--slate); margin-bottom: 2.25rem; }
.prose h2 { font-size: 1.9rem; margin: 2.75rem 0 0.85rem; }
.prose h3 { font-size: 1.4rem; margin: 1.75rem 0 0.6rem; }
.prose ul { padding-left: 1.3rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.45rem; }
.prose .required-language {
  background: var(--white);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--indigo);
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
}

/* ---------- 404 ---------- */
.notfound { padding-block: clamp(4rem, 10vw, 8rem); }
.notfound p { max-width: 34rem; margin: 1.25rem 0 2rem; font-size: 1.15rem; }
