@font-face {
  font-family: Fraunces;
  src: url("/fonts/fraunces-head.woff2") format("woff2");
  font-weight: 560;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/inter-450.woff2") format("woff2");
  font-weight: 450;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/inter-display-650.woff2") format("woff2");
  font-weight: 650;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #FAF9F6;
  --ink: #141414;
  --muted: #5C5B53;
  --line: #DAD7CE;
  --paper: #FFFDF8;
  --stone: #EEEAE0;
  --sage: #E3EADF;
  --sage-ink: #5A7458;
  --product: #F8ECE6;
  --accent: #C2462B;
  --on-accent: #FFFDF9;
  --accent-text: #A83620;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414;
  --ink: #FAF9F6;
  --muted: #C2BFB4;
  --line: #45433B;
  --paper: #211F1C;
  --stone: #262520;
  --sage: #222B23;
  --sage-ink: #A9BFA6;
  --product: #281D19;
  --accent: #E5573A;
  --on-accent: #141414;
  --accent-text: #FF917B;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141414;
    --ink: #FAF9F6;
    --muted: #C2BFB4;
    --line: #45433B;
    --paper: #211F1C;
    --stone: #262520;
    --sage: #222B23;
    --sage-ink: #A9BFA6;
    --product: #281D19;
    --accent: #E5573A;
    --on-accent: #141414;
    --accent-text: #FF917B;
  }
}

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

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 450 16px/1.6 Inter, system-ui, sans-serif;
}

h1, h2, p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--bg); }

:focus-visible {
  outline: 3px solid var(--sage-ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  top: 0;
  left: 1rem;
  transform: translateY(-130%);
  background: var(--paper);
  color: var(--ink);
  padding: 10px 16px;
  z-index: 4;
  text-decoration: none;
}
.skip:focus { transform: none; }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.topbar {
  min-height: 78px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  font-weight: 650;
  letter-spacing: -.035em;
  font-size: 19px;
  text-decoration: none;
}
.brand img { width: 36px; height: 36px; flex: none; }
.footer .brand { font-size: 16px; }
.footer .brand img { width: 30px; height: 30px; }
.mark-dark { display: none; }

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  margin-left: auto;
  font-weight: 600;
  font-size: 13px;
}
.topbar nav a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.topbar nav a:hover { text-decoration: underline; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle[aria-pressed="true"] {
  background: var(--product);
  color: var(--accent-text);
  border-color: var(--accent);
}
.theme-toggle .sun,
.theme-toggle[aria-pressed="true"] .moon { display: none; }
.theme-toggle[aria-pressed="true"] .sun { display: block; }

.hero { padding: 48px 0 28px; }
.eyebrow,
.kicker,
.totals {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .13em;
  line-height: 1.4;
  text-transform: uppercase;
}
.hero .eyebrow,
.panel .eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 14px;
}
.status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage-ink);
}
h1 {
  font: 560 clamp(40px, 5.4vw, 72px)/.99 Fraunces, Georgia, serif;
  letter-spacing: -.015em;
  text-wrap: balance;
  max-width: 16ch;
}
.lede {
  max-width: 62ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(16px, 1.4vw, 18px);
}

.section-rule {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  margin-bottom: 14px;
  color: var(--muted);
}
.totals { color: var(--accent-text); letter-spacing: .08em; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}
.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper);
}
.card-other { grid-column: 1 / -1; }
.card:has(input:checked),
.card.is-open {
  border-color: var(--accent);
  background: var(--product);
  box-shadow: inset 0 0 0 1px var(--accent);
}
@media (hover: hover) {
  .card:hover { border-color: var(--muted); }
  .card:has(input:checked):hover,
  .card.is-open:hover { border-color: var(--accent); }
}

.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
}
.choice input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: none;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  background: var(--bg);
  display: grid;
  place-items: center;
}
.choice input:checked {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 4px var(--bg);
}
.kicker { display: block; color: var(--accent-text); margin-bottom: 6px; }
.title {
  display: block;
  font: 560 clamp(22px, 2vw, 28px)/1.12 Fraunces, Georgia, serif;
  letter-spacing: -.04em;
}
.blurb {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.other-fields { display: none; }
.card-other:has(input:checked) .other-fields,
.card-other.is-open .other-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field { display: grid; gap: 6px; min-width: 0; font-size: 14px; font-weight: 600; }
.field em,
.optional { font-style: normal; font-weight: 450; color: var(--muted); }
.field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--ink);
  font-weight: 450;
}
.field input::placeholder { color: var(--muted); }

.tally { display: grid; gap: 6px; margin-top: auto; }
.tally-line {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.tally progress {
  appearance: none;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  background: var(--line);
  color: var(--accent);
}
.tally progress::-webkit-progress-bar {
  background: var(--line);
  border-radius: 99px;
}
.tally progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 99px;
}
.tally progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 99px;
}

.voted-button {
  align-self: flex-start;
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--sage);
  color: var(--ink);
  font-weight: 650;
  font-size: 13px;
}

.panel {
  margin-top: 18px;
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--sage);
}
.panel-copy p:last-child { color: var(--muted); max-width: 46ch; }
.panel h2 {
  font: 560 clamp(28px, 3vw, 40px)/1.05 Fraunces, Georgia, serif;
  letter-spacing: -.045em;
  margin-bottom: 8px;
}
.panel fieldset {
  margin: 0;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  display: grid;
  gap: 12px;
}
.panel legend { padding: 0 6px; font-weight: 650; }
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}
.consent a {
  font-weight: 650;
  color: var(--accent-text);
  white-space: nowrap;
}
.consent input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  flex: none;
  accent-color: var(--accent);
}
.button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
}
.button:hover { opacity: .9; }
.button:disabled {
  cursor: default;
  opacity: 1;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}
.result:empty { display: none; }
.result:not(:empty) {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}
.result.is-error:not(:empty) { background: var(--product); }
.noscript { color: var(--muted); }

.footer {
  border-top: 1px solid var(--line);
  margin-top: 56px;
  padding-block: 17px 28px;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.footer-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 18px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.footer-links a {
  font-weight: 600;
  font-size: 14px;
  text-underline-offset: 4px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.footer-links a[aria-current="page"] { text-decoration: underline; }
.text-link { font-weight: 600; font-size: 14px; text-underline-offset: 4px; }
.footer p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
.footer p a { text-underline-offset: 2px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mark-light { display: none; }
  :root:not([data-theme="light"]) .mark-dark { display: block; }
}
:root[data-theme="dark"] .mark-light { display: none; }
:root[data-theme="dark"] .mark-dark { display: block; }

@media (min-width: 860px) {
  .panel {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    align-items: start;
  }
  .panel .result,
  .panel .button,
  .panel .noscript { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .topbar { min-height: 64px; }
  .topbar nav {
    order: 3;
    flex: 1 0 100%;
    margin-left: 0;
    gap: 4px 14px;
  }
  .brand { font-size: 17px; }
  .hero { padding-top: 28px; }
  h1 { font-size: clamp(36px, 11vw, 52px); }
  .cards,
  .card-other .other-fields,
  .card-other.is-open .other-fields,
  .card-other:has(input:checked) .other-fields { grid-template-columns: 1fr; }
  .footer-side { justify-content: flex-start; }
  .panel { grid-template-columns: 1fr; }
}

@media (forced-colors: active) {
  .button { border: 1px solid ButtonText; }
  .choice input { border-color: CanvasText; }
  .tally progress { forced-color-adjust: auto; }
}
