/* ==========================================================================
   Campaign site styles. One file, no build step, no framework.
   Edit the tokens in :root to rebrand the whole site.
   ========================================================================== */

:root {
  --ink:        #17211f;
  --ink-soft:   #4a5a56;
  --ink-faint:  #7c8a86;
  --paper:      #faf7f2;
  --card:       #ffffff;
  --line:       #e3ddd3;

  --brand:      #14453d;   /* deep evergreen */
  --brand-deep: #0d302a;
  --brand-tint: #e8f0ed;
  --accent:     #b4552a;   /* warm clay, used sparingly */

  --radius:     14px;
  --shadow:     0 1px 2px rgba(23, 33, 31, .05), 0 8px 24px rgba(23, 33, 31, .06);
  --measure:    62ch;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #eef2f0;
    --ink-soft:   #b3c1bd;
    --ink-faint:  #8b9a95;
    --paper:      #101917;
    --card:       #182422;
    --line:       #2b3a36;
    --brand:      #6fc0ac;
    --brand-deep: #a8dccd;
    --brand-tint: #1b2f2a;
    --accent:     #e08b5c;
    --shadow:     0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { font-family: var(--font); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1.1em; max-width: var(--measure); }

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--brand); color: #fff; padding: .7rem 1rem; z-index: 99;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- layout ---------- */

.wrap { width: 100%; max-width: 1060px; margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 720px; }
section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-alt { background: var(--brand-tint); }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .8rem; flex-wrap: wrap;
}
.brand {
  font-family: var(--font); font-size: 1.15rem; font-weight: 600;
  color: var(--ink); text-decoration: none; letter-spacing: -.01em;
}
.brand small {
  display: block; font-family: var(--font-ui); font-size: .7rem;
  font-weight: 500; letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-faint);
}
.nav { display: flex; gap: .35rem; flex-wrap: wrap; }
.nav a {
  padding: .45rem .75rem; border-radius: 999px; text-decoration: none;
  font-size: .93rem; font-weight: 500; color: var(--ink-soft);
}
.nav a:hover { background: var(--brand-tint); color: var(--brand); }
.nav a[aria-current="page"] { background: var(--brand); color: #fff; }

/* ---------- hero ---------- */

.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 5vw, 4rem); }
.hero-grid {
  display: grid; gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 820px) {
  /* The portrait column is sized to the image rather than a fraction of the
     row, so the headline keeps the space it needs. */
  .hero-grid { grid-template-columns: minmax(0, 1fr) auto; }
}
.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .9rem;
}
.lede { font-size: clamp(1.08rem, 2vw, 1.25rem); color: var(--ink-soft); }
/* Circular portrait. Deliberately capped at 260px: the source photo is small,
   and a circle at this size reads as an intentional choice rather than an
   image stretched past what it can carry. Raise the cap once a larger
   original is available. */
.portrait {
  border-radius: 50%;
  aspect-ratio: 1;
  object-fit: cover;
  width: min(260px, 68vw);
  max-width: 100%;
  margin-inline: auto;
  display: block;
  background: var(--brand-tint);
  box-shadow: var(--shadow);
  outline: 8px solid var(--brand-tint);
  outline-offset: 0;
}
.portrait-placeholder {
  display: grid; place-items: center; text-align: center;
  color: var(--ink-faint); font-size: .85rem; padding: 1rem;
  border: 2px dashed var(--line); outline: none; aspect-ratio: 1;
}

/* On a phone the face should be the first thing seen, so the portrait moves
   above the headline. On desktop it sits beside it, in source order. */
.hero-portrait { order: -1; }
@media (min-width: 820px) { .hero-portrait { order: 0; } }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.35rem; border-radius: 999px; border: 1.5px solid transparent;
  font: inherit; font-size: .97rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: transform .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }

/* ---------- cards ---------- */

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.2rem, 3vw, 1.8rem);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1.2rem; }
.grid-3 { display: grid; gap: 1.1rem; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
/* Inside a grid the gap already does the spacing. Without this the cards after
   the first are pushed down and the row loses its baseline. */
.grid-3 .card + .card { margin-top: 0; }
.grid-3 .card p:last-child { margin-bottom: 0; }
.grid-3 .card p { max-width: none; }

/* ---------- forms ---------- */

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
.field .hint { font-size: .85rem; color: var(--ink-faint); margin: .25rem 0 0; }

input[type="text"], input[type="email"], textarea {
  width: 100%; padding: .7rem .85rem; font: inherit; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 10px;
}
input:focus, textarea:focus { border-color: var(--brand); }
textarea { min-height: 8.5rem; resize: vertical; }

/* Overrides the bold weight that .field label sets, so the consent wording
   reads as a sentence rather than a heading. */
/* label.consent, not just .consent, so it outranks the bold `.field label`
   rule above and the wording reads as a sentence rather than a heading. */
.field label.consent, .consent {
  display: flex; gap: .7rem; align-items: flex-start;
  font-size: .92rem; font-weight: 400; color: var(--ink-soft); line-height: 1.5;
}
.consent input { margin-top: .25rem; flex: 0 0 auto; width: 1.1rem; height: 1.1rem; }

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

.form-note {
  padding: .8rem 1rem; border-radius: 10px; font-size: .93rem;
  margin-top: 1rem; border: 1.5px solid;
}
.form-note[data-state="ok"]   { background: var(--brand-tint); border-color: var(--brand); color: var(--ink); }
.form-note[data-state="err"]  { background: #fdefe8; border-color: var(--accent); color: #7a3517; }
@media (prefers-color-scheme: dark) {
  .form-note[data-state="err"] { background: #33201a; color: #f0c4ac; }
}

/* ---------- polls ---------- */

.poll { margin-bottom: 1.2rem; }
.poll h3 { margin-bottom: .3rem; }
.poll .helper { font-size: .9rem; color: var(--ink-faint); margin-bottom: 1rem; }

.options { display: grid; gap: .55rem; margin: 0 0 1rem; }
.option {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .9rem; border: 1.5px solid var(--line);
  border-radius: 10px; cursor: pointer; background: var(--card);
}
.option:hover { border-color: var(--brand); }
.option input { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; accent-color: var(--brand); }
.option span { font-size: .96rem; }

.result { margin-bottom: .7rem; }
.result-top {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: .93rem; margin-bottom: .3rem;
}
.result-top .pct { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 600; }
.result-top .picked { color: var(--brand); font-weight: 700; }
.bar { height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > i {
  display: block; height: 100%; background: var(--brand);
  border-radius: 999px; transition: width .5s ease;
}
.result[data-picked="true"] .bar > i { background: var(--accent); }
.tally { font-size: .85rem; color: var(--ink-faint); margin: .6rem 0 0; }

.disclaimer {
  font-size: .86rem; color: var(--ink-faint);
  border-left: 3px solid var(--line); padding-left: .9rem; max-width: var(--measure);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line); background: var(--card);
  padding-block: 2.5rem; font-size: .9rem; color: var(--ink-soft);
}
.site-footer .wrap { display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: 2fr 1fr; } }
.site-footer a { color: var(--ink-soft); }
.authorization {
  font-size: .84rem; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .9rem; max-width: 46ch; margin-top: .8rem;
}
.foot-nav { display: grid; gap: .4rem; align-content: start; }

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