:root {
  --ink: #171313;
  --mustard: #f3a515;
  --sun: #ffd45f;
  --cream: #fff3c7;
  --paper: #ffe29a;
  --burgundy: #8f1f31;
  --burgundy-dark: #5d101f;
  --sky: #6aa6b8;
  --white: #fffdf3;
  --mx: 0;
  --my: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--mustard);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  color: var(--ink);
  background: var(--mustard);
  font-family: "Arial Black", Impact, Haettenschweiler, sans-serif;
  -webkit-font-smoothing: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-noise {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: multiply;
  background-image:
    repeating-radial-gradient(circle at 40% 30%, transparent 0 2px, rgba(23, 19, 19, 0.19) 2px 3px, transparent 3px 7px);
  background-size: 19px 17px;
}

.site-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: 84px minmax(0, 1fr) 46px;
  width: 100vw;
  height: 100svh;
  min-height: 720px;
  overflow: hidden;
  border: 10px solid var(--ink);
  background: var(--mustard);
}

.site-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--mustard) url("assets/broomilla-bg.webp") center / cover no-repeat;
  animation: backgroundDrift 13s ease-in-out infinite alternate;
}

.site-shell::after {
  content: "";
  position: absolute;
  inset: 80px 0 42px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  background:
    repeating-linear-gradient(8deg, transparent 0 50px, rgba(255, 243, 199, 0.38) 51px 53px, transparent 54px 104px);
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(16px, 2.4vw, 44px);
  padding: 10px clamp(20px, 3.2vw, 60px);
  border-bottom: 6px solid var(--ink);
  background: var(--cream);
  box-shadow: 0 7px 0 rgba(143, 31, 49, 0.8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(20px, 1.55vw, 30px);
  letter-spacing: -0.03em;
}

.brand img {
  width: 54px;
  height: 54px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-7deg);
  transition: transform 180ms steps(2, jump-none);
}

.brand:hover img,
.brand:focus-visible img {
  transform: rotate(12deg) scale(1.08);
}

.topbar-warning {
  justify-self: center;
  margin: 0;
  padding: 7px 12px;
  border: 3px dashed var(--ink);
  background: var(--sun);
  font: 900 clamp(11px, 0.85vw, 16px) / 1 "Comic Sans MS", "Trebuchet MS", sans-serif;
  letter-spacing: 0.08em;
  transform: rotate(-1deg);
}

.topbar-warning span {
  color: var(--burgundy);
}

.socials {
  display: flex;
  gap: 12px;
}

.comic-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 16px;
  border: 4px solid var(--ink);
  border-radius: 3px 7px 2px 5px;
  background: var(--white);
  box-shadow: 6px 6px 0 var(--ink);
  font: 900 clamp(12px, 0.78vw, 15px) / 1 "Arial Black", Impact, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transform: rotate(-0.5deg);
  transition: transform 110ms ease, box-shadow 110ms ease, background 110ms ease;
}

.comic-button:hover,
.comic-button:focus-visible {
  outline: none;
  background: var(--sun);
  box-shadow: 3px 3px 0 var(--ink);
  transform: translate(3px, 3px) rotate(1deg);
}

.comic-button:active {
  box-shadow: 0 0 0 var(--ink);
  transform: translate(6px, 6px) rotate(-1deg);
}

.comic-button.accent {
  background: var(--burgundy);
  color: var(--white);
}

.button-icon {
  font-size: 18px;
}

.hero {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(460px, 0.92fr);
  gap: clamp(10px, 2vw, 36px);
  min-height: 0;
  padding: clamp(24px, 3.1vh, 36px) clamp(34px, 4.5vw, 86px) clamp(18px, 2.6vh, 30px);
}

.copy-column {
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.kicker-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(8px, 1vh, 14px);
}

.sticker {
  margin: 0;
  padding: 8px 13px;
  border: 4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  font: 900 clamp(13px, 0.95vw, 18px) / 1 "Comic Sans MS", sans-serif;
  letter-spacing: 0.04em;
  transform: rotate(-2.4deg);
}

.sticker-burgundy {
  background: var(--burgundy);
  color: var(--white);
}

.scribble-note {
  margin: 0;
  font: 900 clamp(16px, 1.2vw, 23px) / 1 "Comic Sans MS", cursive;
  transform: rotate(6deg);
}

.hero-title {
  display: flex;
  align-items: flex-end;
  margin: 0;
  font-size: clamp(78px, 8.35vw, 160px);
  line-height: 0.76;
  letter-spacing: -0.085em;
  text-transform: uppercase;
  filter: drop-shadow(7px 7px 0 var(--cream));
}

.hero-title span {
  display: inline-block;
  transform-origin: 50% 80%;
  -webkit-text-stroke: clamp(1px, 0.14vw, 3px) var(--ink);
  animation: titleWobble 2.8s steps(2, jump-none) calc(var(--i) * -0.13s) infinite;
}

.hero-title span:nth-child(3n + 1) {
  color: var(--burgundy);
}

.hero-title span:nth-child(3n + 2) {
  color: var(--ink);
}

.hero-title span:nth-child(3n) {
  color: var(--cream);
}

.tagline {
  margin: clamp(15px, 1.7vh, 22px) 0 0;
  font: 900 clamp(24px, 2.15vw, 41px) / 0.98 "Comic Sans MS", "Trebuchet MS", sans-serif;
  letter-spacing: -0.05em;
}

.tagline em {
  color: var(--burgundy);
  font-style: normal;
  text-decoration: underline wavy var(--ink) 3px;
  text-underline-offset: 8px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: clamp(18px, 2vh, 26px);
}

.ca-button {
  min-width: min(390px, 32vw);
  min-height: 58px;
  justify-content: flex-start;
  padding-inline: 21px;
  overflow: hidden;
  background: var(--cream);
  font-size: clamp(15px, 1.05vw, 21px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ca-button.copied {
  background: #9adf88;
  animation: copiedShake 360ms steps(2, jump-none) 1;
}

.ca-button.copy-failed {
  background: #ff8b76;
}

.copy-symbol {
  font-size: 24px;
  transform: rotate(8deg);
}

.copy-hint {
  font: 900 12px / 1.05 "Comic Sans MS", cursive;
  transform: rotate(7deg);
}

.lore-card {
  position: relative;
  width: min(890px, 100%);
  margin-top: auto;
  padding: clamp(18px, 1.8vw, 28px) clamp(18px, 2vw, 32px) clamp(16px, 1.5vw, 24px);
  border: 5px solid var(--ink);
  border-radius: 3px 8px 4px 10px;
  background: rgba(255, 243, 199, 0.96);
  box-shadow: 10px 10px 0 var(--burgundy), 15px 15px 0 var(--ink);
  transform: rotate(-0.7deg);
}

.tape {
  position: absolute;
  width: 92px;
  height: 28px;
  border: 2px solid rgba(23, 19, 19, 0.3);
  background: rgba(255, 217, 104, 0.84);
}

.tape-one {
  top: -15px;
  left: 11%;
  transform: rotate(-4deg);
}

.tape-two {
  top: -14px;
  right: 8%;
  transform: rotate(6deg);
}

.lore-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lore-label {
  margin: 0 0 5px;
  color: var(--burgundy);
  font: 900 clamp(12px, 0.85vw, 16px) / 1 "Comic Sans MS", sans-serif;
  letter-spacing: 0.08em;
}

.classification {
  padding: 5px 8px;
  border: 3px solid var(--burgundy);
  color: var(--burgundy);
  font-size: 11px;
  transform: rotate(4deg);
}

.lore-card h2 {
  margin: 2px 0 8px;
  font-size: clamp(20px, 1.45vw, 29px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.lore-card > p:not(.lore-label) {
  margin: 0;
  max-width: 790px;
  font: 800 clamp(13px, 0.82vw, 16px) / 1.28 "Trebuchet MS", Arial, sans-serif;
}

.fact-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.fact-row li {
  display: grid;
  gap: 3px;
  padding: 7px 9px;
  border: 3px solid var(--ink);
  background: var(--white);
  transform: rotate(calc((var(--n, 0) - 1) * 1deg));
}

.fact-row li:nth-child(1) { --n: 0; }
.fact-row li:nth-child(2) { --n: 1; }
.fact-row li:nth-child(3) { --n: 2; }
.fact-row b { font-size: 10px; color: var(--burgundy); }
.fact-row span { font: 900 clamp(11px, 0.75vw, 15px) / 1 "Comic Sans MS", sans-serif; }

.character-column {
  position: relative;
  z-index: 5;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  perspective: 900px;
}

.character-button {
  position: relative;
  z-index: 4;
  display: grid;
  place-items: center;
  width: min(48vw, 820px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  cursor: pointer;
  transform: translate(calc(var(--mx) * 22px), calc(var(--my) * 17px)) rotateX(calc(var(--my) * -4deg)) rotateY(calc(var(--mx) * 5deg));
  transition: transform 180ms ease-out;
}

.character-button:focus-visible {
  outline: 6px dashed var(--cream);
  outline-offset: -20px;
}

.character-art {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(12px 16px 0 rgba(23, 19, 19, 0.88));
  user-select: none;
  animation: characterFloat 3.4s ease-in-out infinite;
  transition: filter 160ms ease;
}

.character-button:hover .character-art,
.character-button:focus-visible .character-art {
  filter: drop-shadow(17px 20px 0 var(--burgundy-dark));
  animation: characterTurbo 210ms steps(2, jump-none) infinite;
}

.character-shadow {
  position: absolute;
  bottom: 7%;
  left: 21%;
  z-index: 1;
  width: 60%;
  height: 10%;
  border-radius: 50%;
  background: rgba(23, 19, 19, 0.32);
  filter: blur(12px);
  animation: shadowPulse 3.4s ease-in-out infinite;
}

.character-button.barrel-roll {
  animation: barrelRoll 900ms cubic-bezier(0.2, 0.7, 0.3, 1) 1;
}

.flight-trail {
  position: absolute;
  inset: 22% 32% 15% -10%;
  z-index: 2;
  pointer-events: none;
  transform: rotate(-15deg);
}

.flight-trail i {
  position: absolute;
  left: 0;
  width: 78%;
  height: 7px;
  border: 3px solid var(--ink);
  border-left: 0;
  border-right: 0;
  background: var(--cream);
  animation: trailZip 640ms linear infinite;
}

.flight-trail i:nth-child(1) { top: 15%; width: 72%; animation-delay: -100ms; }
.flight-trail i:nth-child(2) { top: 38%; width: 54%; animation-delay: -360ms; }
.flight-trail i:nth-child(3) { top: 60%; width: 83%; animation-delay: -220ms; }
.flight-trail i:nth-child(4) { top: 80%; width: 46%; animation-delay: -480ms; }

.speech-bubble {
  position: absolute;
  top: 3%;
  right: 0;
  z-index: 7;
  max-width: 250px;
  margin: 0;
  padding: 13px 17px;
  border: 4px solid var(--ink);
  border-radius: 50% 44% 48% 38%;
  background: var(--white);
  box-shadow: 6px 6px 0 var(--ink);
  font: 900 clamp(13px, 1vw, 19px) / 1.04 "Comic Sans MS", sans-serif;
  text-align: center;
  transform: rotate(3deg);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -22px;
  left: 28%;
  width: 28px;
  height: 28px;
  border-right: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  background: var(--white);
  transform: skew(18deg) rotate(34deg);
}

.speech-bubble.bubble-pop {
  animation: bubblePop 320ms steps(2, jump-none) 1;
}

.orbit-star {
  position: absolute;
  z-index: 6;
  color: var(--cream);
  -webkit-text-stroke: 3px var(--ink);
  filter: drop-shadow(4px 4px 0 var(--burgundy));
  animation: starSpin 4s steps(6, jump-none) infinite;
}

.star-one { top: 16%; left: 2%; font-size: clamp(42px, 3.6vw, 69px); }
.star-two { right: 2%; bottom: 22%; font-size: clamp(32px, 2.8vw, 54px); animation-direction: reverse; }
.star-three { left: 14%; bottom: 3%; font-size: clamp(24px, 2vw, 39px); animation-duration: 2.9s; }

.bonk-stamp {
  position: absolute;
  right: 0;
  bottom: 7%;
  z-index: 7;
  padding: 7px 11px;
  border: 4px solid var(--ink);
  background: var(--burgundy);
  color: var(--white);
  box-shadow: 5px 5px 0 var(--ink);
  font-size: clamp(20px, 1.8vw, 35px);
  transform: rotate(-12deg);
  animation: bonkBounce 2.2s steps(2, jump-none) infinite;
}

.poke-note {
  position: absolute;
  right: 7%;
  bottom: 2%;
  z-index: 8;
  margin: 0;
  font: 900 clamp(11px, 0.8vw, 15px) / 1 "Comic Sans MS", cursive;
  text-align: center;
  transform: rotate(7deg);
}

.poke-note span {
  color: var(--burgundy);
  font-size: 0.86em;
}

.ticker {
  position: relative;
  z-index: 20;
  overflow: hidden;
  border-top: 5px solid var(--ink);
  background: var(--burgundy);
  color: var(--white);
}

.ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  height: 100%;
  white-space: nowrap;
  animation: tickerMove 18s linear infinite;
}

.ticker-track span,
.ticker-track b {
  display: inline-block;
  padding-inline: 20px;
  font-size: clamp(13px, 0.95vw, 18px);
  letter-spacing: 0.08em;
}

.ticker-track b {
  color: var(--sun);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 72px;
  z-index: 100;
  padding: 14px 18px;
  border: 4px solid var(--ink);
  background: #9adf88;
  box-shadow: 7px 7px 0 var(--ink);
  font: 900 16px / 1 "Comic Sans MS", cursive;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 30px) rotate(-2deg) scale(0.8);
  transition: opacity 160ms ease, transform 180ms steps(3, jump-none);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) rotate(2deg) scale(1);
}

@keyframes backgroundDrift {
  0% { background-position: 49% 50%; transform: scale(1.01); }
  100% { background-position: 51% 50%; transform: scale(1.035); }
}

@keyframes titleWobble {
  0%, 100% { transform: rotate(calc((var(--i) - 4) * 0.3deg)) translateY(0); }
  35% { transform: rotate(calc((4 - var(--i)) * 0.42deg)) translateY(-3px) skewX(-2deg); }
  70% { transform: rotate(calc((var(--i) - 3) * 0.24deg)) translateY(2px); }
}

@keyframes characterFloat {
  0%, 100% { transform: translateY(5px) rotate(-1.6deg); }
  50% { transform: translateY(-15px) rotate(1.8deg); }
}

@keyframes characterTurbo {
  0% { transform: translate(-3px, 1px) rotate(-2deg); }
  50% { transform: translate(4px, -2px) rotate(2deg); }
  100% { transform: translate(-1px, 3px) rotate(-1deg); }
}

@keyframes shadowPulse {
  0%, 100% { transform: scaleX(0.88); opacity: 0.25; }
  50% { transform: scaleX(1.08); opacity: 0.38; }
}

@keyframes trailZip {
  from { transform: translateX(28%); opacity: 0; }
  25% { opacity: 1; }
  to { transform: translateX(-38%); opacity: 0; }
}

@keyframes starSpin {
  to { transform: rotate(1turn) scale(1.12); }
}

@keyframes bonkBounce {
  0%, 88%, 100% { transform: rotate(-12deg) scale(1); }
  92% { transform: rotate(4deg) scale(1.2); }
  96% { transform: rotate(-18deg) scale(0.92); }
}

@keyframes tickerMove {
  to { transform: translateX(-50%); }
}

@keyframes copiedShake {
  0%, 100% { transform: rotate(-1deg); }
  25% { transform: translateX(-5px) rotate(-3deg); }
  75% { transform: translateX(5px) rotate(3deg); }
}

@keyframes bubblePop {
  0% { transform: rotate(3deg) scale(0.7); }
  55% { transform: rotate(-4deg) scale(1.13); }
  100% { transform: rotate(3deg) scale(1); }
}

@keyframes barrelRoll {
  0% { transform: translate(calc(var(--mx) * 22px), calc(var(--my) * 17px)) rotate(0deg) scale(1); }
  42% { transform: translate(-45px, -40px) rotate(-190deg) scale(0.82); }
  76% { transform: translate(24px, 8px) rotate(-370deg) scale(1.06); }
  100% { transform: translate(calc(var(--mx) * 22px), calc(var(--my) * 17px)) rotate(-360deg) scale(1); }
}

@media (max-width: 1300px) {
  .topbar-warning { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .hero { grid-template-columns: minmax(0, 1.02fr) minmax(390px, 0.98fr); padding-inline: 34px; }
  .hero-title { font-size: clamp(74px, 8.9vw, 118px); }
  .character-button { width: min(51vw, 680px); }
  .lore-card > p:not(.lore-label) { font-size: 13px; }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .site-shell { height: auto; min-height: 100svh; grid-template-rows: auto auto 46px; }
  .topbar { min-height: 78px; }
  .social-link { padding-inline: 11px; }
  .hero { grid-template-columns: 1fr; overflow: hidden; padding: 30px 24px 46px; }
  .copy-column { align-items: center; text-align: center; }
  .kicker-row { justify-content: center; }
  .scribble-note { display: none; }
  .hero-title { font-size: clamp(62px, 15.5vw, 120px); }
  .ca-button { min-width: min(420px, 70vw); justify-content: center; }
  .lore-card { margin-top: 32px; text-align: left; }
  .character-column { grid-row: 1; min-height: 480px; }
  .character-button { width: min(82vw, 630px); }
  .speech-bubble { right: 6%; }
  .bonk-stamp { right: 5%; }
}

@media (max-width: 620px) {
  .site-shell { border-width: 6px; }
  .topbar { padding: 9px 12px; border-bottom-width: 5px; }
  .brand span { display: none; }
  .brand img { width: 48px; height: 48px; }
  .socials { gap: 7px; }
  .social-link { min-height: 42px; padding: 8px 10px; border-width: 3px; box-shadow: 4px 4px 0 var(--ink); font-size: 10px; }
  .hero { padding-inline: 14px; }
  .character-column { min-height: 385px; }
  .speech-bubble { top: 0; right: 1%; max-width: 180px; font-size: 11px; }
  .bonk-stamp { font-size: 18px; }
  .poke-note { display: none; }
  .hero-title { font-size: 17vw; }
  .tagline { font-size: 24px; }
  .action-row { flex-direction: column; gap: 12px; }
  .ca-button { width: calc(100vw - 54px); min-width: 0; }
  .copy-hint { display: none; }
  .lore-card { padding: 22px 14px 15px; box-shadow: 7px 7px 0 var(--burgundy), 11px 11px 0 var(--ink); }
  .lore-heading { align-items: flex-start; }
  .classification { font-size: 8px; }
  .fact-row { grid-template-columns: 1fr; }
  .ticker-track span, .ticker-track b { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .page-noise { display: none; }
}
