/* The Popcorn Pop-Off
   A 1973 fight poster printed on a popcorn box.
   Red corner = Bowl A, blue corner = Bowl B. */

@font-face {
  font-family: "Alfa Slab One";
  src: url("/fonts/alfa-slab-one-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-wdth-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
}

:root {
  --butter: #FFD23F;
  --butter-soft: #FFEDA6;
  --red: #D62828;
  --red-deep: #A91D1D;
  --blue: #2152B8;
  --blue-deep: #183F8F;
  --ink: #232042;
  --paper: #FFFCF2;
  --hull: #E9B44C;

  --display: "Alfa Slab One", "Rockwell", "Roboto Slab", Georgia, serif;
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --line: 3px solid var(--ink);
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.55;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 6px;
}
.skip:focus { top: 1rem; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.small { font-size: .95rem; }

/* ---------- Popcorn-box rim ---------- */
.rim {
  height: 22px;
  background: repeating-linear-gradient(90deg, var(--red) 0 26px, var(--paper) 26px 52px);
  border-bottom: var(--line);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5em;
  padding: .85em 1.5em;
  border: var(--line);
  border-radius: 8px;
  font-weight: 800;
  font-stretch: 105%;
  font-size: 1.05rem;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: var(--paper); color: var(--ink); box-shadow: none; }
.btn-ghost:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn-wide { width: 100%; }
@media (prefers-reduced-motion: reduce) {
  .btn, .btn:hover, .btn:active { transition: none; transform: none; }
}

/* ---------- Fight poster ---------- */
.poster {
  position: relative;
  background-color: var(--butter);
  background-image: radial-gradient(rgba(35, 32, 66, .13) 1.1px, transparent 1.6px);
  background-size: 9px 9px;
  border-bottom: var(--line);
  overflow: hidden;
}

.nav {
  display: flex; justify-content: center; gap: .25rem 1.4rem; flex-wrap: wrap;
  padding: .9rem 1rem 0;
  font-weight: 700; font-stretch: 85%; font-size: 1rem;
}
.nav a { text-decoration: none; padding: .25rem .1rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--ink); }

.poster-inner {
  position: relative;
  width: min(100% - 2rem, 860px);
  margin-inline: auto;
  padding: 2.75rem 0 4rem;
  text-align: center;
}

.billing {
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  letter-spacing: .01em;
}

.title {
  position: relative; z-index: 2;
  margin-top: .35rem;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(3.4rem, 14.5vw, 9.6rem);
  line-height: .86;
  letter-spacing: -.01em;
  color: var(--ink);
  text-shadow: .055em .055em 0 var(--red);
}
.title-line { display: block; }

/* popcorn that pops out behind the title on load */
.marquee { position: relative; }
.puffs { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.puff {
  position: absolute;
  left: var(--x); top: var(--y);
  width: calc(var(--s) * var(--k, 1)); height: auto;
  transform: rotate(var(--r));
  animation: pop .55s cubic-bezier(.3, 1.7, .5, 1) var(--d) both;
}
@keyframes pop {
  0%   { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(.2) rotate(0deg); }
  100% { opacity: 1; transform: translate(0, 0) scale(1) rotate(var(--r)); }
}
@media (prefers-reduced-motion: reduce) {
  .puff { animation: none; }
}

/* tale of the tape */
.card {
  position: relative; z-index: 2;
  margin: 2.5rem auto 0;
  max-width: 720px;
}
.card-body { filter: drop-shadow(6px 6px 0 var(--ink)); }
.corners { position: relative; display: grid; grid-template-columns: 1fr 1fr; }
.corner {
  border: var(--line);
  padding: 1rem 1rem 1.15rem;
  color: #fff;
}
.corner-a { background: var(--red); border-radius: 10px 0 0 0; padding-right: 2rem; }
.corner-b { background: var(--blue); border-radius: 0 10px 0 0; border-left: 0; padding-left: 2rem; }
.corner-label { font-style: italic; font-weight: 600; font-size: 1rem; }
.fighter { margin-top: .35rem; line-height: 1; }
.fighter-pre {
  display: block;
  font-weight: 800; font-stretch: 120%;
  font-size: clamp(.95rem, 2.2vw, 1.2rem);
  letter-spacing: .02em;
}
.fighter-name {
  display: block;
  font-family: var(--display);
  font-size: clamp(2.3rem, 8.5vw, 4rem);
  line-height: .95;
  margin-top: .1rem;
}
.vs {
  position: absolute; z-index: 3;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 3.4rem; height: 3.4rem;
  display: grid; place-items: center;
  background: var(--butter);
  border: var(--line);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1;
  padding-bottom: .15rem;
}
@media (max-width: 520px) {
  .vs { width: 2.8rem; height: 2.8rem; font-size: 1.1rem; }
  .corner { padding-inline: .6rem; }
  .corner-a { padding-right: 1.6rem; }
  .corner-b { padding-left: 1.6rem; }
  .puffs { --k: .7; }
}
.tape {
  background: var(--paper);
  border: var(--line);
  border-top: 0;
  border-radius: 0 0 4px 4px;
}
.tape-row {
  display: grid;
  grid-template-columns: 1fr minmax(8.5rem, auto) 1fr;
  align-items: baseline;
  padding: .55rem 1rem;
}
.tape-row + .tape-row { border-top: 2px dashed rgba(35, 32, 66, .35); }
.tape dt {
  order: 2;
  font-size: .9rem; font-weight: 600; font-style: italic;
  color: rgba(35, 32, 66, .8);
}
.tape dd {
  font-weight: 800; font-stretch: 110%; font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}
.tape dd:first-child { order: 1; color: var(--red-deep); }
.tape dd:last-child { order: 3; color: var(--blue-deep); }
.blind {
  margin-top: 1.3rem;
  text-wrap: balance;
  font-style: italic; font-weight: 600;
}

.when {
  position: relative; z-index: 2;
  text-wrap: balance;
  margin-top: 2rem;
  font-weight: 800; font-stretch: 110%;
  font-size: clamp(1.1rem, 2.6vw, 1.45rem);
}
.cta {
  position: relative; z-index: 2;
  margin-top: 1.5rem;
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
}

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section + .section { border-top: var(--line); }
.section h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5.5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -.005em;
}
.lede { margin-top: 1rem; max-width: 60ch; font-size: 1.2rem; text-wrap: pretty; }

/* ---------- PopGPT ---------- */
.section-popgpt { background: var(--butter-soft); }
.popgpt-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 860px) { .popgpt-grid { grid-template-columns: 1fr; } }

.fn-ref { text-decoration: none; font-weight: 800; color: var(--red-deep); padding-left: .1em; }
.try { margin-top: 1.75rem; font-weight: 700; font-stretch: 90%; }
.chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .7rem; }
.chip {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: .5rem 1rem;
  font-size: 1rem; font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.chip:hover { background: var(--butter); }
.footnote { margin-top: 1.75rem; font-size: .9rem; font-style: italic; }

.chat {
  display: flex; flex-direction: column;
  height: min(600px, 78vh);
  min-height: 440px;
  background: var(--paper);
  border: var(--line);
  border-radius: 14px;
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; gap: .8rem;
  padding: .8rem 1rem;
  background: var(--ink); color: var(--paper);
}
.avatar {
  flex: none;
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  border: 2px solid var(--paper);
  background: var(--butter) url("/favicon.svg") center / 78% no-repeat;
}
.chat-name { font-family: var(--display); font-size: 1.35rem; line-height: 1; }
.chat-status { font-size: .9rem; font-weight: 600; color: var(--butter); margin-top: .2rem; }
.chat-status.level-2 { color: #FFB86B; }
.chat-status.level-3 { color: #FF8A80; animation: wobble .5s ease 2; }
@keyframes wobble {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) { .chat-status.level-3 { animation: none; } }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex; flex-direction: column; gap: .8rem;
  scroll-behavior: smooth;
}
.msg { max-width: 86%; padding: .7rem .95rem; border-radius: 14px; font-size: 1.02rem; line-height: 1.45; }
.msg p + p { margin-top: .5rem; }
.msg-bot { align-self: flex-start; border: 2px solid var(--ink); border-bottom-left-radius: 4px; background: #fff; }
.msg-user { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; }
.msg-note { align-self: center; max-width: 100%; font-size: .92rem; font-style: italic; color: var(--red-deep); text-align: center; padding: .2rem; }

.typing { display: inline-flex; gap: .3rem; padding: .2rem 0; }
.typing span {
  width: .55rem; height: .55rem; border-radius: 50%;
  background: var(--hull);
  animation: hop .9s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; } }

.chat-form { display: flex; gap: .6rem; padding: .75rem; border-top: var(--line); background: var(--paper); }
.chat-form input {
  flex: 1; min-width: 0;
  border: 2px solid var(--ink); border-radius: 8px;
  padding: .7rem .85rem; font-size: 1.02rem;
  background: #fff;
}
.btn-send { box-shadow: none; padding: .7rem 1.1rem; }
.btn-send:hover { transform: none; box-shadow: none; background: var(--blue-deep); }

/* ---------- Ballot ---------- */
.ballot-wrap {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 860px) { .ballot-wrap { grid-template-columns: 1fr; } }
.ballot-copy .small { margin-top: 1rem; max-width: 52ch; }

.ballot {
  background: #fff;
  border: var(--line);
  border-radius: 10px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: 1.5rem clamp(1.1rem, 3vw, 1.75rem) 1.75rem;
}
.ballot-head {
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1.1;
  padding-bottom: .8rem;
  margin-bottom: 1.2rem;
  border-bottom: 2px dashed var(--ink);
}
.field { margin: 0 0 1.25rem; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend {
  display: block; padding: 0;
  font-weight: 700; margin-bottom: .45rem;
}
.optional { font-weight: 500; font-style: italic; }
.field input[type="text"], .field textarea {
  width: 100%;
  border: 2px solid var(--ink); border-radius: 8px;
  padding: .7rem .85rem;
  background: var(--paper);
  font-size: 1.05rem;
}
.field textarea { resize: vertical; }

.sides { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.side {
  display: flex; align-items: center; gap: .55rem;
  border: 2px solid var(--ink); border-radius: 8px;
  padding: .55rem .7rem;
  font-size: 1rem; font-weight: 600;
  cursor: pointer;
}
.side input { accent-color: var(--ink); width: 1.05rem; height: 1.05rem; margin: 0; }
.side:has(input:checked) { background: var(--butter-soft); }
@media (max-width: 420px) { .sides { grid-template-columns: 1fr; } }

.bowls { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.bowl {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 7.5rem;
  border: var(--line); border-radius: 10px;
  cursor: pointer;
  text-align: center;
  background: var(--paper);
  transition: background-color .15s ease, color .15s ease;
}
.bowl input { position: absolute; opacity: 0; pointer-events: none; }
.bowl-a { border-top: 12px solid var(--red); }
.bowl-b { border-top: 12px solid var(--blue); }
.bowl-name { font-family: var(--display); font-size: clamp(1.4rem, 3.2vw, 1.9rem); line-height: 1; }
.bowl-sub { font-size: .95rem; font-style: italic; font-weight: 600; margin-top: .35rem; }
.bowl-a:has(input:checked) { background: var(--red); color: #fff; }
.bowl-b:has(input:checked) { background: var(--blue); color: #fff; }
.bowl:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 3px; }
.bowl:has(input:checked)::after {
  content: "✓";
  position: absolute; top: .4rem; right: .6rem;
  font-weight: 800; font-size: 1.2rem;
}

.form-error {
  margin-bottom: 1rem;
  padding: .7rem .9rem;
  border: 2px solid var(--red);
  border-radius: 8px;
  background: #FDECEC;
  color: var(--red-deep);
  font-weight: 600; font-size: 1rem;
}

.passport {
  text-align: center;
  background: var(--butter);
  background-image: radial-gradient(rgba(35, 32, 66, .12) 1px, transparent 1.5px);
  background-size: 8px 8px;
  border: var(--line); border-radius: 10px;
  padding: 1.75rem 1.25rem;
}
.passport:focus { outline: none; }
.passport-head { font-family: var(--display); font-size: 1.8rem; line-height: 1; }
.passport-name { margin-top: 1rem; font-weight: 700; font-size: 1.2rem; }
.passport-number {
  display: inline-block;
  margin: .6rem 0 .9rem;
  padding: .45rem .9rem;
  background: var(--paper);
  border: 2px dashed var(--ink);
  font-weight: 800; font-stretch: 120%;
  font-size: 1.3rem; letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}
.passport-note { font-style: italic; margin-bottom: 1.25rem; }
.passport.stamped { animation: stamp .35s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes stamp { from { transform: scale(1.12) rotate(-2deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .passport.stamped { animation: none; } }

.closed p + p { margin-top: .5rem; }
.cast-here { margin-top: 1.25rem; padding-top: 1rem; border-top: 2px dashed rgba(35, 32, 66, .4); }
.cast-here ul { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .98rem; }

.results { margin-top: 2rem; }
.results h3 { font-weight: 800; font-size: 1.2rem; margin-bottom: .6rem; }
.results-bar {
  display: flex; height: 2.75rem;
  border: var(--line); border-radius: 8px; overflow: hidden;
  font-weight: 800; color: #fff;
}
.results-bar span { display: flex; align-items: center; padding: 0 .7rem; white-space: nowrap; min-width: max-content; flex-basis: 0; }
.results-bar .ra { background: var(--red); }
.results-bar .rb { background: var(--blue); }
.results-bar span + span { border-left: 3px solid var(--ink); }
.results .small { margin-top: .5rem; }

/* ---------- Record book ---------- */
.legend {
  list-style: none; padding: 0;
  display: flex; flex-wrap: wrap; gap: .5rem 1.4rem;
  margin-top: 1.5rem;
  font-size: .98rem; font-weight: 600;
}
.legend li { display: flex; align-items: center; gap: .45rem; }
.key { width: 1.1rem; height: 1.1rem; border-radius: 4px; border: 2px solid var(--ink); display: inline-block; }
.key-andy { background: var(--red); }
.key-bob { background: var(--blue); }
.key-tie { background: linear-gradient(135deg, var(--red) 50%, var(--blue) 50%); }
.key-open { background: var(--paper); border-style: dashed; }
.key-star { border: 0; width: auto; height: auto; color: var(--red-deep); font-size: 1.1rem; line-height: 1; }

.years { margin-top: 2rem; display: grid; gap: .7rem; }
.decade { display: grid; grid-template-columns: 4.5rem 1fr; align-items: center; gap: .8rem; }
.decade-label { font-weight: 800; font-stretch: 90%; font-size: 1.05rem; }
.decade-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .45rem; }
.slot { aspect-ratio: 1.25; }
.year {
  position: relative;
  aspect-ratio: 1.25;
  border: 2px solid var(--ink); border-radius: 6px;
  background: var(--paper);
  border-style: dashed;
  font-weight: 700; font-stretch: 85%;
  font-size: clamp(.8rem, 1.6vw, 1.05rem);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  padding: 0;
}
.year:hover { background: var(--butter-soft); }
.year.w-andy { background: var(--red); color: #fff; border-style: solid; }
.year.w-bob { background: var(--blue); color: #fff; border-style: solid; }
.year.w-tie { background: linear-gradient(135deg, var(--red) 50%, var(--blue) 50%); color: #fff; border-style: solid; }
.year.is-now { background: var(--butter); border-style: solid; }
.year.has-star::after {
  content: "★";
  position: absolute; top: -.55rem; right: -.4rem;
  font-size: .95rem; line-height: 1;
  color: var(--red-deep);
  text-shadow: 0 0 0 var(--paper), -1px -1px 0 var(--paper), 1px 1px 0 var(--paper), 1px -1px 0 var(--paper), -1px 1px 0 var(--paper);
}
.year.w-andy.has-star::after { color: var(--ink); }
.year[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
@media (max-width: 640px) {
  .decade { grid-template-columns: 1fr; gap: .35rem; }
  .decade-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .year { font-size: .95rem; }
}

.year-detail {
  margin-top: 2rem;
  max-width: 640px;
  border: var(--line); border-radius: 10px;
  background: #fff;
  padding: 1.25rem 1.5rem;
  display: grid; grid-template-columns: auto 1fr; gap: .2rem 1.5rem; align-items: start;
}
.yd-year { grid-row: span 4; font-family: var(--display); font-size: clamp(2.4rem, 7vw, 3.4rem); line-height: .95; }
.yd-winner { font-weight: 800; font-size: 1.2rem; }
.yd-winner.andy { color: var(--red-deep); }
.yd-winner.bob { color: var(--blue-deep); }
.yd-line { font-size: 1.02rem; }
.yd-muted { font-style: italic; font-size: 1rem; }
@media (max-width: 480px) {
  .year-detail { grid-template-columns: 1fr; }
  .yd-year { grid-row: auto; }
}

/* ---------- Fight night program (also used by the archives) ---------- */
.program { list-style: none; padding: 0; margin: 2.5rem 0 0; }
.round {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: 1.25rem 2.5rem;
  padding: 1.75rem 0;
  border-top: var(--line);
}
.round:last-child { border-bottom: var(--line); }
.round-label { font-style: italic; font-weight: 700; font-size: .95rem; color: var(--red-deep); }
.round h3 { font-weight: 800; font-stretch: 105%; font-size: 1.45rem; line-height: 1.15; margin: .2rem 0 .5rem; }
.round-text p:last-child { max-width: 42ch; text-wrap: pretty; }
.round { align-items: center; }
@media (max-width: 760px) { .round { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Illustrations ---------- */
.art {
  position: relative;
  border: var(--line); border-radius: 12px;
  background-color: var(--butter);
  background-image: radial-gradient(rgba(35, 32, 66, .12) 1.1px, transparent 1.6px);
  background-size: 9px 9px;
  box-shadow: 5px 5px 0 var(--ink);
  overflow: hidden;
}
.art svg { display: block; width: 100%; height: auto; }
.art text { font-family: var(--display); }
.art-round { max-width: 400px; width: 100%; justify-self: start; }
.art-small { width: 100%; max-width: 300px; margin-bottom: .4rem; box-shadow: 4px 4px 0 var(--ink); }
.art-wide { max-width: 440px; }

/* every animated part scales and rotates around its own center */
.art g[class] { transform-box: fill-box; transform-origin: center; }
.art:not(.is-live) * { animation-play-state: paused !important; }

.art .hop { animation: hop-fig 1.5s ease-in-out infinite; }
@keyframes hop-fig { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-12px); } }

.art .lift { animation: lift 1.6s ease-in-out infinite; }
.art .lift-late { animation-delay: .8s; }
@keyframes lift { 0%, 100% { transform: translateY(8px); } 50% { transform: translateY(-10px); } }
.art .sweat { animation: sweat 1.6s ease-in infinite; }
@keyframes sweat { 0% { transform: translate(0, 0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-6px, 18px); opacity: 0; } }

.art .lid { transform-origin: 20% 100%; animation: lid 3s ease-in-out infinite; }
@keyframes lid {
  0%, 30%, 100% { transform: translateY(0) rotate(0); }
  36% { transform: translateY(0) rotate(-4deg); } 42% { transform: translateY(0) rotate(4deg); }
  50% { transform: translateY(-34px) rotate(-18deg); } 80% { transform: translateY(-34px) rotate(-18deg); }
}
.art .kernel { animation: kernel 3s ease-out infinite; opacity: 0; }
.art .k1 { --kx: -46px; } .art .k2 { --kx: 44px; animation-delay: .08s; } .art .k3 { --kx: 4px; animation-delay: .16s; }
@keyframes kernel {
  0%, 46% { transform: translate(0, 10px) scale(.4); opacity: 0; }
  60% { transform: translate(calc(var(--kx) * .6), -56px) scale(1); opacity: 1; }
  80% { transform: translate(var(--kx), -30px) scale(1); opacity: 1; }
  92%, 100% { transform: translate(var(--kx), 0) scale(.6); opacity: 0; }
}

.art .pop { animation: popup 1.8s cubic-bezier(.3, 1.3, .6, 1) infinite; }
.art .p1 { --px: -16px; } .art .p2 { --px: 14px; animation-delay: .3s; } .art .p3 { --px: -2px; animation-delay: .9s; }
.art .p4 { --px: -12px; animation-delay: .5s; } .art .p5 { --px: 18px; animation-delay: .1s; } .art .p6 { --px: 0px; animation-delay: 1.1s; }
@keyframes popup {
  0% { transform: translate(0, 24px) scale(.3); opacity: 0; }
  35% { transform: translate(calc(var(--px) * .5), -52px) scale(1) rotate(20deg); opacity: 1; }
  75% { transform: translate(var(--px), -18px) scale(1) rotate(50deg); opacity: 1; }
  100% { transform: translate(var(--px), 20px) scale(.8) rotate(70deg); opacity: 0; }
}
.art .flame-row { animation: flicker .35s ease-in-out infinite alternate; }

.art .eyes-right { animation: glance-right 3.2s ease-in-out infinite; }
.art .eyes-left { animation: glance-left 3.2s ease-in-out infinite; }
@keyframes glance-right { 0%, 20%, 100% { transform: translateX(0); } 30%, 70% { transform: translateX(5px); } }
@keyframes glance-left { 0%, 20%, 100% { transform: translateX(0); } 30%, 70% { transform: translateX(-5px); } }
.art .vs-pulse { transform-box: fill-box; transform-origin: center; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }

.art .ballot-drop { animation: drop 2.6s ease-in infinite; }
@keyframes drop {
  0% { transform: translateY(-20px); opacity: 0; }
  15% { transform: translateY(0); opacity: 1; }
  45% { transform: translateY(0) rotate(-3deg); }
  80% { transform: translateY(86px) rotate(0); opacity: 1; }
  88%, 100% { transform: translateY(96px); opacity: 0; }
}

.art .bag { animation: reveal 3.4s ease-in-out infinite; }
@keyframes reveal {
  0%, 25% { transform: translateY(0); }
  45%, 80% { transform: translateY(-150px) rotate(-8deg); }
  100% { transform: translateY(0); }
}
.art .confetti { animation: confetti 3.4s ease-out infinite; opacity: 0; }
.art .c1 { animation-delay: .1s; } .art .c2 { animation-delay: .2s; } .art .c3 { animation-delay: .05s; }
@keyframes confetti { 0%, 40% { transform: translateY(20px) scale(.3); opacity: 0; } 55% { transform: translateY(-10px) scale(1) rotate(30deg); opacity: 1; } 80% { opacity: 1; } 95%, 100% { transform: translateY(30px) rotate(90deg); opacity: 0; } }

.art .flame { transform-origin: 50% 100%; animation: flicker .45s ease-in-out infinite alternate; }
@keyframes flicker { from { transform: scale(1, 1) rotate(-3deg); } to { transform: scale(.88, 1.12) rotate(3deg); } }
.art .plus-one { animation: hop-fig 1.4s ease-in-out infinite; }

.art .scribble { stroke-dasharray: 140; animation: write 2.8s linear infinite; }
@keyframes write { 0% { stroke-dashoffset: 140; } 50%, 100% { stroke-dashoffset: 0; } }
.art .pencil { animation: wiggle 2.8s ease-in-out infinite; }
@keyframes wiggle { 0%, 50%, 100% { transform: translate(0, 0); } 10% { transform: translate(-6px, 3px); } 25% { transform: translate(4px, -2px); } 40% { transform: translate(-3px, 2px); } }
.art .stamp { animation: stamp 2.8s cubic-bezier(.2, 1.4, .5, 1) infinite; }
@keyframes stamp { 0%, 52% { transform: scale(1.8); opacity: 0; } 62% { transform: scale(.94); opacity: 1; } 68%, 92% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

.art .sweep { animation: sweep 3.2s ease-in-out infinite alternate; }
@keyframes sweep { from { transform: translate(-40px, 6px) rotate(-6deg); } to { transform: translate(24px, -4px) rotate(4deg); } }

.art .swap-a { animation: swap-a 3.6s ease-in-out infinite; }
.art .swap-b { animation: swap-b 3.6s ease-in-out infinite; }
@keyframes swap-a { 0%, 25% { transform: translate(0, 0); } 40% { transform: translate(50px, -34px); } 55%, 75% { transform: translate(100px, 0); } 90%, 100% { transform: translate(0, 0); } }
@keyframes swap-b { 0%, 25% { transform: translate(0, 0); } 40% { transform: translate(-50px, 20px); } 55%, 75% { transform: translate(-100px, 0); } 90%, 100% { transform: translate(0, 0); } }

.art .pencil-write { animation: pencil-move 2.8s linear infinite; }
@keyframes pencil-move { 0% { transform: translate(-108px, 6px); } 50% { transform: translate(-48px, 6px); } 60%, 100% { transform: translate(0, 0); } }

@media (prefers-reduced-motion: reduce) {
  .art *, .art g[class] { animation: none !important; opacity: 1; }
  .art .kernel, .art .confetti, .art .stamp { opacity: 0; }
  .art .pop { opacity: 1; }
}

/* ---------- Controversies ---------- */
.section-docket { background: var(--butter-soft); }
.docket {
  margin-top: 2.25rem;
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 820px) { .docket { grid-template-columns: minmax(0, 1fr); } }
.matter {
  min-width: 0;
  background: var(--paper);
  border: var(--line); border-radius: 10px;
  padding: 1.4rem 1.5rem 1.2rem;
  display: flex; flex-direction: column; gap: .7rem;
}
.matter h3 { font-family: var(--display); font-weight: 400; font-size: 1.7rem; line-height: 1.05; }
.matter p { font-size: 1.05rem; text-wrap: pretty; }

/* ---------- Record book extras ---------- */
.record-foot {
  margin-top: 2rem;
  display: grid; gap: 2rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.record-foot .year-detail { margin-top: 0; }
.record-media .small { margin-top: 1rem; max-width: 46ch; }
@media (max-width: 820px) { .record-foot { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Constitution ---------- */
.const-wrap { display: block; }
.const-note { margin-top: 1.5rem; max-width: 60ch; }
.charter {
  max-width: 68ch;
  background: #fff;
  border: var(--line); border-radius: 6px;
  box-shadow: 8px 8px 0 var(--ink);
  padding: clamp(1.5rem, 4vw, 2.75rem);
}
.charter h2 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
.charter-sub { margin-top: .6rem; font-style: italic; }
.charter h3 {
  margin: 1.8rem 0 .6rem;
  font-weight: 800; font-stretch: 105%; font-size: 1.2rem;
  padding-bottom: .3rem;
  border-bottom: 2px solid var(--ink);
}
.charter ul { padding-left: 1.2rem; display: grid; gap: .55rem; }
.charter li { font-size: 1.05rem; line-height: 1.6; }
.charter .illegible { background: var(--butter-soft); font-style: italic; padding: 0 .2em; }
.charter .amendment {
  list-style: none; margin-left: -1.2rem;
  font-family: "Bradley Hand", "Segoe Print", "Chalkboard SE", "Comic Sans MS", cursive;
  font-size: 1.35rem; color: #4A4A4A;
  transform: rotate(-2deg);
  transform-origin: left center;
}
/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--paper); border-top: var(--line); }
.footer .rim { border-bottom-color: var(--paper); }
.footer-inner { padding: 2.5rem 0 3rem; text-align: center; }
.footer-title { font-family: var(--display); font-size: 1.8rem; color: var(--butter); }
.footer .small { margin-top: 1rem; opacity: .85; }
.footer a { color: var(--paper); }
