:root {
  --mustard: #F0AF1E;
  --brown: #3A2410;
  --glow: #FFE24D;
  --red: #C4361B;
  --paper: #FFF6DE;
  --emission: 0;
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
  --font-mono: "Space Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--mustard);
  color: var(--brown);
  font-family: var(--font-serif);
  overflow-x: hidden;
  cursor: url("assets/cursor-hay.png") 4 28, auto;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--brown); }

#squeeze {
  transition: padding-inline .25s ease;
  padding-inline: clamp(8px, calc(40px - var(--emission) * 30px), 40px);
}

/* ---------- masthead ---------- */
.masthead { padding-top: 14px; }
.masthead-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 3px solid var(--brown);
  padding-bottom: 10px;
  flex-wrap: wrap;
}
.seal-mark { color: var(--brown); flex: 0 0 auto; }
.masthead-name { display: flex; flex-direction: column; margin-right: auto; }
.masthead-title { font-family: var(--font-display); font-weight: 600; letter-spacing: .04em; font-size: 1.05rem; text-transform: uppercase; }
.masthead-sub { font-family: var(--font-serif); font-style: italic; font-size: .74rem; opacity: .78; }
.masthead-nav { display: flex; gap: 16px; font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.masthead-nav a { text-decoration: none; border-bottom: 1px solid transparent; }
.masthead-nav a:hover { border-color: var(--brown); }
.masthead-chrome { display: flex; align-items: center; gap: 10px; }

.ca-chip {
  background: var(--brown);
  color: var(--paper);
  border: none;
  border-radius: 3px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: .68rem;
  display: flex;
  gap: 6px;
  align-items: center;
}
.ca-chip .ca-label { opacity: .7; }
.ca-chip.small { padding: 3px 8px; }
.x-link { color: var(--brown); display: flex; }

.canary {
  font-family: var(--font-mono);
  font-size: .66rem;
  opacity: .65;
  padding: 6px 2px;
}

/* ---------- hero ---------- */
.ticker-tape {
  font-family: var(--font-mono);
  font-size: .66rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .03em;
  opacity: .7;
  margin: 10px 0 0;
}
.hero { text-align: center; padding: 24px 0 10px; overflow: visible; }
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(2.2rem, calc(9vw + var(--emission) * 6vw), 16vw);
  letter-spacing: calc(.01em + var(--emission) * .5em);
  line-height: .92;
  margin: 6px 0 4px;
  white-space: nowrap;
  transition: letter-spacing .2s ease, font-size .2s ease;
}
.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(.85rem, calc(1rem + var(--emission) * .6rem), 1.6rem);
  margin: 0 0 18px;
  transition: font-size .2s ease;
}

.supply-row {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.supply-block { display: flex; flex-direction: column; }
.supply-label { font-family: var(--font-mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .04em; opacity: .75; }
.supply-value { font-family: var(--font-mono); font-weight: 700; font-size: 1.5rem; }
.supply-block.ghost { opacity: .62; }
.supply-block.ghost .supply-value { color: var(--red); }

.horse-stage {
  position: relative;
  height: clamp(180px, 32vw, 380px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 0 auto;
}
.horse-img {
  width: clamp(160px, 26vw, 320px);
  transform: scale(calc(1 + var(--emission) * 2.4)) rotate(calc(var(--emission) * -3deg));
  transform-origin: bottom center;
  transition: transform .18s ease-out, filter .18s ease;
  filter: drop-shadow(0 14px 18px rgba(58,36,16,.35));
  will-change: transform;
}
.horse-stage.reach .horse-img { filter: drop-shadow(0 14px 18px rgba(58,36,16,.45)) brightness(1.03); }

.print-btn {
  background: var(--red);
  color: var(--paper);
  border: 3px solid var(--brown);
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 1.05rem;
  padding: 16px 34px;
  box-shadow: 0 6px 0 var(--brown);
  user-select: none;
  touch-action: none;
}
.print-btn:active, .print-btn.printing {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--brown);
}
.print-hint { font-family: var(--font-mono); font-size: .68rem; opacity: .7; margin-top: 8px; }

body.shake { animation: horseshake .35s ease; }
@keyframes horseshake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 3px); }
  40% { transform: translate(5px, -4px); }
  60% { transform: translate(-4px, 4px); }
  80% { transform: translate(6px, -2px); }
}

/* ---------- panels ---------- */
.panel {
  max-width: calc(760px - var(--emission) * 260px);
  margin: 0 auto 46px;
  transition: max-width .2s ease;
}
.panel-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 1.3rem;
  border-bottom: 2px solid var(--brown);
  padding-bottom: 6px;
  margin-bottom: 6px;
}
.panel-sub { font-size: .88rem; opacity: .82; margin-top: 0; }

/* space-o-meter */
.space-bar-wrap {
  height: 22px;
  border: 2px solid var(--brown);
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper);
}
.space-bar { height: 100%; background: var(--red); transition: width .2s ease; }
.space-readout { font-family: var(--font-mono); font-weight: 700; margin: 8px 0 0; }
.overflow-banner {
  margin-top: 10px;
  background: var(--red);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: .04em;
  padding: 8px 12px;
  border-radius: 3px;
  animation: overflowpulse 1.1s ease-in-out infinite;
}
@keyframes overflowpulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* split-flap board */
.split-board {
  border: 2px solid var(--brown);
  border-radius: 6px;
  background: var(--brown);
  padding: 4px;
}
.split-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  background: var(--paper);
  padding: 8px 12px;
  border-radius: 3px;
  margin-bottom: 3px;
}
.split-row:last-child { margin-bottom: 0; }
.split-item { font-family: var(--font-serif); font-size: .86rem; }
.split-digits { display: flex; gap: 2px; }
.split-unit { font-family: var(--font-mono); font-size: .68rem; opacity: .7; }
.flap {
  display: inline-block;
  width: 1.1ch;
  text-align: center;
  background: var(--brown);
  color: var(--glow);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .95rem;
  border-radius: 2px;
  padding: 2px 1px;
  position: relative;
  overflow: hidden;
}
.flap.dot { background: transparent; color: var(--brown); width: .5ch; }
.flap.flip { animation: flapflip .16s ease; }
@keyframes flapflip {
  0% { transform: scaleY(1); }
  45% { transform: scaleY(.05); }
  55% { transform: scaleY(.05); }
  100% { transform: scaleY(1); }
}
.cpi-footnote { font-size: .78rem; font-style: italic; opacity: .75; margin-top: 10px; }

/* policy */
.statement { background: var(--paper); border: 1px solid var(--brown); border-radius: 4px; padding: 16px 18px; font-size: .92rem; line-height: 1.55; }
.statement-sign { font-family: var(--font-mono); font-size: .74rem; opacity: .7; margin-bottom: 0; }
.report-btn {
  margin-top: 12px;
  background: var(--brown);
  color: var(--paper);
  border: none;
  border-radius: 4px;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* vote */
.vote-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.vote-btn {
  background: var(--paper);
  border: 2px solid var(--brown);
  border-radius: 5px;
  padding: 10px 14px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .03em;
  font-size: .82rem;
  text-transform: uppercase;
}
.vote-btn[data-vote="cut"] { color: var(--red); }
.vote-btn.chosen { background: var(--brown); color: var(--paper); }
.vote-you { font-family: var(--font-mono); font-size: .78rem; margin: 10px 0 18px; }
.vote-history-label { font-family: var(--font-mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .03em; opacity: .7; }
.vote-bar-row { display: grid; grid-template-columns: 54px 1fr 40px; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: .74rem; margin-top: 5px; }
.vote-bar { height: 10px; background: var(--paper); border: 1px solid var(--brown); border-radius: 3px; overflow: hidden; }
.vote-bar div { height: 100%; background: var(--brown); }
.vote-bar-row.cut .vote-bar div { background: var(--red); }
.vote-joke { font-size: .78rem; font-style: italic; opacity: .78; margin-bottom: 0; }

/* chart */
.chart-wrap { position: relative; background: var(--paper); border: 1px solid var(--brown); border-radius: 4px; padding: 10px; }
#horseChart { width: 100%; height: auto; display: block; cursor: crosshair; }
.chart-tooltip {
  position: absolute;
  background: var(--brown);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: .7rem;
  padding: 6px 9px;
  border-radius: 3px;
  pointer-events: none;
  max-width: 210px;
  transform: translate(-50%, -120%);
}

/* footer */
.site-footer { border-top: 3px solid var(--brown); padding: 16px 0 40px; }
.footer-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-family: var(--font-mono); font-size: .78rem; }
.footer-links { display: flex; align-items: center; gap: 12px; }
.footer-links a { text-decoration: none; font-size: .74rem; }
.footer-disclaimer { font-size: .68rem; opacity: .65; margin: 10px 0 0; }

/* report modal */
.report-modal {
  position: fixed; inset: 0; background: rgba(58,36,16,.82);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; padding: 20px;
}
.report-modal[hidden] { display: none; }
.report-inner {
  background: var(--paper); border-radius: 6px; padding: 22px;
  max-width: 420px; width: 100%; text-align: center; position: relative;
}
.report-close {
  position: absolute; top: 8px; right: 10px; background: none; border: none;
  font-size: 1.6rem; line-height: 1; color: var(--brown);
}
.report-img { width: 60%; margin: 10px auto 14px; }
.report-caption { font-family: var(--font-serif); font-style: italic; font-size: .9rem; }
.report-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-family: var(--font-mono); font-size: .78rem; }
.report-nav button { background: var(--brown); color: var(--paper); border: none; border-radius: 3px; padding: 6px 10px; }

/* toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--brown); color: var(--paper);
  font-family: var(--font-mono); font-size: .82rem;
  padding: 10px 18px; border-radius: 5px; z-index: 9500;
}
.toast[hidden] { display: none; }

@media (max-width: 640px) {
  .masthead-nav { display: none; }
  .split-row { grid-template-columns: 1fr auto; }
  .split-unit { display: none; }
  .footer-row { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
