/* Quick Vote product page: a polling station's fine stationery on a cream field, matching the live voting site (light only).
   The ballot's counterfoil carries the PIN as its serial number, the voter roll shows who the host has let in.
   Scoped to body[data-product="quick-vote"]. */

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/sourceserif4-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* --- Palette and ground --------------------------------------------------
   The doubled :root beats site.css's light-theme rules for this product, so
   the page keeps its one look in either theme. */

:root:root body[data-product="quick-vote"] {
  color-scheme: light;
  --bg: #E3DCCE;
  --card: #FBF9F4;
  --surface: rgba(255, 255, 255, .4);
  --text: #241B1A;
  --text-2: #5F5450;
  --text-3: #5F5450;
  --hairline: rgba(36, 27, 26, .1);
  --hairline-strong: rgba(36, 27, 26, .18);
  --accent: #241B1A;
  --accent-text: #5A1F1C;
  --accent-on: #FBF9F4;
  --accent-muted: rgba(36, 27, 26, .08);
  --warn: #664200;
  --qv-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --serif: var(--qv-serif);
  --sans: var(--qv-serif);
  --qv-ink: #241B1A;

  background-color: #ECE6DA;
  background-image:
    radial-gradient(ellipse 900px 520px at 72% 260px, rgba(255, 255, 255, .45), transparent 70%),
    url("/assets/textures/guilloche-light.svg");
  background-repeat: no-repeat, repeat;
  background-size: auto, 240px 120px;
  caret-color: #5A1F1C;
}

html:has(body[data-product="quick-vote"]) {
  color-scheme: light;
  background-color: #ECE6DA;
  scrollbar-color: #B8AE9C transparent;
  overflow-x: clip;
}

body[data-product="quick-vote"] {
  overflow-x: clip;
}

@media (max-width: 600px) {
  body[data-product="quick-vote"] { --gutter: 16px; }
}

body[data-product="quick-vote"] ::selection,
body[data-product="quick-vote"]::selection {
  background: rgba(122, 46, 42, .25);
  color: #241B1A;
}

body[data-product="quick-vote"] :is(.qv-ballot, .qv-roll, .facts) ::selection {
  background: #7A2E2A;
  color: #F2F0EB;
}

body[data-product="quick-vote"] :focus-visible:not(.qv-dev *) {
  outline: 3px solid #7A2E2A;
  outline-offset: 3px;
}

/* One look: no light/dark switch here. */
body[data-product="quick-vote"] .theme-toggle { display: none; }

/* --- Type ----------------------------------------------------------------- */

body[data-product="quick-vote"] main {
  color: #241B1A;
  font-family: var(--qv-serif);
  font-size: 1.0625rem;
  font-optical-sizing: auto;
  line-height: 1.65;
}

body[data-product="quick-vote"] .scene h2 {
  color: #241B1A;
  font-family: var(--qv-serif);
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-variation-settings: "opsz" 60;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.015em;
  text-wrap: balance;
}

body[data-product="quick-vote"] .scene .lead {
  color: #241B1A;
  font-family: var(--qv-serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  margin-top: 1.1rem;
}

body[data-product="quick-vote"] .qv-demo {
  margin-top: .9rem;
  color: #5F5450;
  font-size: .95rem;
  line-height: 1.5;
}

body[data-product="quick-vote"] .notes li {
  position: relative;
  padding-left: 26px;
  color: #5F5450;
  font-size: 1rem;
  line-height: 1.65;
}

/* A small ink tick, drawn with borders. */
body[data-product="quick-vote"] .notes li::before {
  top: .42em;
  left: 4px;
  width: 6px;
  height: 11px;
  border: solid #7A2E2A;
  border-width: 0 2px 2px 0;
  border-radius: 0;
  background: none;
  transform: rotate(40deg);
}

body[data-product="quick-vote"] .notes b {
  color: #241B1A;
  font-weight: 600;
}

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

body[data-product="quick-vote"] .btn {
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 4px;
  font-family: var(--qv-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-transform: none;
  transition: background-color .15s ease;
}

body[data-product="quick-vote"] .btn-primary {
  background: #241B1A;
  border: 1px solid #241B1A;
  color: #FBF9F4;
  box-shadow: 0 8px 16px -10px rgba(70, 50, 30, .45);
}

body[data-product="quick-vote"] .btn-primary:hover {
  background: #3A2C2A;
  border-color: #3A2C2A;
  filter: none;
}

body[data-product="quick-vote"] .btn-secondary {
  background: transparent;
  border: 1px solid rgba(36, 27, 26, .4);
  color: #241B1A;
}

body[data-product="quick-vote"] .btn-secondary:hover {
  background: rgba(36, 27, 26, .06);
  filter: none;
}

/* --- Chips: thin outlined pills --------------------------------------------- */

body[data-product="quick-vote"] .chips {
  gap: 8px 10px;
  margin: 1.25rem 0 1.5rem;
}

body[data-product="quick-vote"] .chip,
body[data-product="quick-vote"] .chip-status {
  padding: 4px 13px;
  border: 1px solid rgba(36, 27, 26, .45);
  border-radius: 999px;
  background: transparent;
  color: #5F5450;
  font-family: var(--qv-serif);
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: none;
  text-shadow: none;
}

body[data-product="quick-vote"] .chip-link {
  text-decoration: none;
}

body[data-product="quick-vote"] .chip-link:hover {
  border-color: #241B1A;
  color: #241B1A;
}

body[data-product="quick-vote"] .chip-live::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7A2E2A;
  animation: none;
  box-shadow: none;
}

@keyframes qv-dot {
  50% { opacity: .35; }
}

@media (prefers-reduced-motion: no-preference) {
  body[data-product="quick-vote"] .chip-live::before {
    animation: qv-dot 2.4s ease-in-out infinite;
  }

  body[data-product="quick-vote"] .btn {
    transition: background-color .15s ease, transform .15s ease;
  }

  body[data-product="quick-vote"] .btn-primary:hover {
    transform: translateY(-1px);
  }
}

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

body[data-product="quick-vote"] .scene--hero .scene__copy {
  max-width: none;
}

body[data-product="quick-vote"] .scene--hero .scene__grid {
  align-items: center;
}

@media (min-width: 900px) {
  body[data-product="quick-vote"] .scene--hero .scene__grid {
    grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
    gap: clamp(2rem, 4vw, 3.5rem);
  }
}

body[data-product="quick-vote"] .scene--hero h1 {
  color: #241B1A;
  font-family: var(--qv-serif);
  font-size: clamp(3rem, 6.5vw, 5.5rem);
  font-variation-settings: "opsz" 60;
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.02em;
  text-wrap: balance;
}

body[data-product="quick-vote"] .qv-claim {
  text-wrap: balance;
  margin-top: 1rem;
  color: #5A1F1C;
  font-family: var(--qv-serif);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 400;
  line-height: 1.2;
}

body[data-product="quick-vote"] .scene--hero .lead {
  max-width: 45ch;
  margin-top: 1.5rem;
}

body[data-product="quick-vote"] .qv-made {
  max-width: 45ch;
  margin-top: 1rem;
  color: #5F5450;
  font-size: 1rem;
  line-height: 1.6;
}

body[data-product="quick-vote"] .scene--hero .actions {
  margin-top: 0;
}

@media (max-width: 699px) {
  body[data-product="quick-vote"] .qv-made { font-size: .95rem; }
}

/* --- Ballot paper and voter roll -------------------------------------------- */

body[data-product="quick-vote"] .qv-label:not(.qv-dev *) {
  margin: 0;
  color: #6B5F5B;
  font-size: 1rem;
  font-variant-caps: all-small-caps;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.3;
}

body[data-product="quick-vote"] .qv-ballot-set {
  width: clamp(340px, 34vw, 500px);
  max-width: 100%;
  margin: 0;
  justify-self: center;
  color: var(--qv-ink);
}

body[data-product="quick-vote"] .qv-ballot,
body[data-product="quick-vote"] .qv-roll {
  position: relative;
  box-sizing: border-box;
  border: 1px solid rgba(122, 46, 42, .45);
  border-radius: 3px;
  background-color: #FBF9F4;
  color: #241B1A;
  box-shadow:
    inset 0 0 0 6px #FBF9F4,
    inset 0 0 0 7px rgba(122, 46, 42, .35),
    0 18px 32px -18px rgba(70, 50, 30, .28),
    0 1px 3px rgba(70, 50, 30, .18);
}

body[data-product="quick-vote"] .qv-ballot {
  display: grid;
  grid-template-columns: minmax(128px, 30%) minmax(0, 1fr);
  transform: rotate(-1.5deg);
}

/* Counterfoil: the stub with the serial number, torn off along a perforation. */
body[data-product="quick-vote"] .qv-counterfoil {
  position: relative;
  container-type: inline-size;
  padding: 18px 12px 18px 18px;
}

body[data-product="quick-vote"] .qv-counterfoil::after {
  content: "";
  position: absolute;
  top: 0;
  right: -2px;
  bottom: 0;
  width: 4px;
  background: radial-gradient(circle, #C8B3AA 1.2px, transparent 1.7px) center top / 4px 8px repeat-y;
}

body[data-product="quick-vote"] .qv-serial {
  display: block;
  width: auto;
  margin-top: 6px;
  color: #5A1F1C;
  font-family: var(--qv-serif);
  font-size: min(2.2rem, 24cqi);
  font-variant-numeric: tabular-nums lining-nums;
  font-variation-settings: "opsz" 60;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.01em;
  white-space: nowrap;
}

body[data-product="quick-vote"] .qv-note:not(.qv-dev *) {
  margin: 10px 0 0;
  color: #6B5F5B;
  font-size: .8rem;
  line-height: 1.4;
}

body[data-product="quick-vote"] .qv-ballot-body {
  position: static;
  padding: 18px 18px 36px 22px;
}

body[data-product="quick-vote"] .qv-ballot-foot {
  margin-top: 14px;
  font-size: .95rem;
}

body[data-product="quick-vote"] .qv-ballot-head {
  padding-right: 0;
}

body[data-product="quick-vote"] .qv-question {
  margin: 6px 0 12px;
  padding-right: 0;
  color: #241B1A;
  font-size: 1.2rem;
  font-variation-settings: "opsz" 24;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

body[data-product="quick-vote"] .qv-options {
  margin: 0;
  padding: 0;
  list-style: none;
}

body[data-product="quick-vote"] .qv-options li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #E0D6CF;
  font-size: 1.0625rem;
  line-height: 1.3;
}

body[data-product="quick-vote"] .qv-options li:last-child {
  border-bottom: 1px solid #E0D6CF;
}

body[data-product="quick-vote"] .qv-box {
  position: relative;
  flex: none;
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  border: 1.5px solid #241B1A;
}

body[data-product="quick-vote"] .qv-cross {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  overflow: visible;
  stroke-width: 4;
}

body[data-product="quick-vote"] .qv-seal {
  position: absolute;
  top: auto;
  right: auto;
  bottom: 46px;
  left: 18px;
  width: 64px;
  height: 64px;
  opacity: .35;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .9));
}

/* Voter roll: the same paper, smaller, set down across the ballot's lower-left. */
body[data-product="quick-vote"] .qv-roll {
  position: relative;
  z-index: 1;
  width: max(250px, 68%);
  margin-top: -30px;
  padding: 18px 20px 14px;
  transform: rotate(1.2deg);
}

@media (min-width: 900px) {
  body[data-product="quick-vote"] .qv-roll { margin-left: -1.25rem; }
}

body[data-product="quick-vote"] .qv-roll ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

body[data-product="quick-vote"] .qv-roll li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px 4.4rem;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid #E0D6CF;
  font-size: 1rem;
  line-height: 1.3;
}

body[data-product="quick-vote"] .qv-roll li:last-child {
  border-bottom: 1px solid #E0D6CF;
}

body[data-product="quick-vote"] .qv-check {
  position: relative;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border: 1.5px solid #241B1A;
}

body[data-product="quick-vote"] .qv-stroke {
  position: absolute;
  top: 1px;
  left: 1px;
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  overflow: visible;
  stroke-width: 2.6;
}

body[data-product="quick-vote"] .qv-status {
  color: #5A1F1C;
  font-size: .95rem;
  font-weight: 600;
}

body[data-product="quick-vote"] .qv-roll .is-waiting .qv-check {
  border-style: dashed;
  border-color: #9C8C85;
}

body[data-product="quick-vote"] .qv-roll .is-waiting .qv-status {
  color: #7A6A64;
  font-weight: 400;
}

body[data-product="quick-vote"] .qv-ballot-set figcaption {
  margin-top: 1.5rem;
  color: #5F5450;
  font-size: .95rem;
  line-height: 1.5;
}

/* Stacked: the copy and buttons come first, then a flat ballot with the roll below it. */
@media (max-width: 699px) {
  body[data-product="quick-vote"] .qv-ballot-set {
    width: 100%;
    margin-top: .5rem;
  }

  body[data-product="quick-vote"] .qv-ballot,
  body[data-product="quick-vote"] .qv-roll {
    transform: none;
  }

  body[data-product="quick-vote"] .qv-roll {
    width: 100%;
    margin: 1rem 0 0;
  }
}

/* Narrow phones: the counterfoil becomes a strip across the top, torn off along a horizontal perforation. */
@media (max-width: 519px) {
  body[data-product="quick-vote"] .qv-ballot {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-product="quick-vote"] .qv-counterfoil {
    container-type: normal;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 12px;
    padding: 16px 64px 16px 20px;
  }

  body[data-product="quick-vote"] .qv-counterfoil::after {
    top: auto;
    right: 0;
    bottom: -2px;
    left: 0;
    width: auto;
    height: 4px;
    background: radial-gradient(circle, #C8B3AA 1.2px, transparent 1.7px) left center / 8px 4px repeat-x;
  }

  body[data-product="quick-vote"] .qv-serial {
    width: auto;
    margin-top: 0;
    font-size: 2.2rem;
    white-space: nowrap;
  }

  body[data-product="quick-vote"] .qv-note:not(.qv-dev *) {
    flex-basis: 100%;
    margin-top: 0;
  }

  body[data-product="quick-vote"] .qv-ballot-body {
    position: static;
    padding-left: 20px;
  }

  body[data-product="quick-vote"] .qv-ballot-head,
  body[data-product="quick-vote"] .qv-question {
    padding-right: 0;
  }

  body[data-product="quick-vote"] .qv-seal {
    top: 12px;
    right: 14px;
    bottom: auto;
    left: auto;
    width: 48px;
    height: 48px;
  }
}

/* --- Details: the facts as a notice sheet ------------------------------------ */

body[data-product="quick-vote"] .facts {
  display: block;
  max-width: 44rem;
  margin: 1.75rem 0 0;
  padding: 18px 22px 8px;
  border: 1px solid rgba(122, 46, 42, .45);
  border-radius: 3px;
  background: #FBF9F4;
  color: #241B1A;
  box-shadow:
    inset 0 0 0 6px #FBF9F4,
    inset 0 0 0 7px rgba(122, 46, 42, .35),
    0 18px 32px -18px rgba(70, 50, 30, .28),
    0 1px 3px rgba(70, 50, 30, .18);
}

body[data-product="quick-vote"] .facts::before {
  content: "Notice";
  display: block;
  padding-bottom: 8px;
  color: #6B5F5B;
  font-size: 1rem;
  font-variant-caps: all-small-caps;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.3;
}

body[data-product="quick-vote"] .facts li {
  padding: 12px 0;
  border-top: 1px solid #E0D6CF;
  color: #241B1A;
  font-size: 1rem;
  line-height: 1.55;
}

body[data-product="quick-vote"] .facts li::before {
  content: none;
}

/* --- Phone ------------------------------------------------------------------ */

body[data-product="quick-vote"] .stage .phone {
  box-shadow:
    0 0 0 1px rgba(36, 27, 26, .18),
    0 28px 44px -22px rgba(70, 50, 30, .35),
    0 2px 4px rgba(70, 50, 30, .18);
}

/* --- Projects drawer --------------------------------------------------------- */

body[data-product="quick-vote"] dialog.drawer {
  background-color: #ECE6DA;
  background-image: none;
}

body[data-product="quick-vote"] dialog.drawer .drawer-head h2 {
  font-family: var(--qv-serif);
  font-weight: 600;
}

body[data-product="quick-vote"] dialog.drawer .drawer-link[aria-current="page"] {
  background: rgba(36, 27, 26, .08);
}

body[data-product="quick-vote"] dialog.drawer .drawer-link .src-badge {
  background: transparent;
  border: 1px solid rgba(36, 27, 26, .45);
  color: #5A1F1C;
}

body[data-product="quick-vote"] dialog.drawer .drawer-foot .drawer-all {
  min-height: 48px;
  border: 1px solid #241B1A;
  border-radius: 4px;
  background: #241B1A;
  color: #FBF9F4;
  font-family: var(--qv-serif);
  font-weight: 600;
}

body[data-product="quick-vote"] dialog.drawer .drawer-foot .drawer-all:hover {
  background: #3A2C2A;
  border-color: #3A2C2A;
}

/* --- Motion: the ballot is marked once on load -------------------------------- */

@keyframes qv-rise {
  from { opacity: 0; translate: 0 12px; }
}

@keyframes qv-draw {
  0% { stroke-dashoffset: 1; opacity: 0; }
  1% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  body[data-product="quick-vote"] .qv-ballot {
    animation: qv-rise 500ms cubic-bezier(.16, 1, .3, 1) backwards;
  }

  body[data-product="quick-vote"] .qv-cross path,
  body[data-product="quick-vote"] .qv-stroke path {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: qv-draw 500ms ease-out backwards;
  }

  body[data-product="quick-vote"] .qv-cross path:nth-child(1) { animation-delay: 300ms; }
  body[data-product="quick-vote"] .qv-cross path:nth-child(2) { animation-delay: 480ms; }

  body[data-product="quick-vote"] .qv-roll li:nth-child(1) .qv-stroke path { animation-delay: 1000ms; }
  body[data-product="quick-vote"] .qv-roll li:nth-child(2) .qv-stroke path { animation-delay: 1250ms; }
  body[data-product="quick-vote"] .qv-roll li:nth-child(3) .qv-stroke path { animation-delay: 1500ms; }
}
