:root {
  color-scheme: light;
  --bg: #fff7e1;
  --ink: #251b2d;
  --muted: #6b5263;
  --panel: #ffffff;
  --line: #2c1f36;
  --red: #e3313f;
  --blue: #1857c8;
  --yellow: #ffd236;
  --green: #44b94d;
  --pink: #f05aa7;
  --shadow: 0 24px 70px rgb(37 27 45 / 18%);
  --radius: 8px;
  --motion-scale: 7;
  --squeak-rate: 6;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 20%, rgb(255 210 54 / 72%) 0 8rem, transparent 8.2rem),
    radial-gradient(circle at 90% 12%, rgb(240 90 167 / 44%) 0 10rem, transparent 10.2rem),
    linear-gradient(135deg, #fff7e1 0%, #dff4ff 46%, #fff1f7 100%);
  overflow-x: hidden;
}

body,
button,
input {
  font: inherit;
}

button,
input {
  color: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transform: translateY(-150%);
}

.skip-link:not(:focus):not(:focus-visible) {
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  width: auto;
  height: auto;
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--line);
  overflow: visible;
  clip-path: none;
  transform: translateY(0);
}

.show-shell {
  width: min(1180px, calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.topbar,
.nav,
.hero-show,
.hero-actions,
.control-panel,
.site-footer {
  display: flex;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.topbar h1,
.copy h2,
.control-panel h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1;
}

.topbar h1 {
  font-size: clamp(1.6rem, 4vw, 2.45rem);
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  gap: 0.35rem;
  padding: 0.25rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 78%);
  box-shadow: 0 10px 0 rgb(37 27 45 / 8%);
}

.nav a {
  min-width: 5.4rem;
  padding: 0.55rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible,
.nav a[aria-current="page"] {
  background: var(--yellow);
  color: var(--ink);
  outline: none;
}

.show-stage {
  display: grid;
  gap: 1rem;
}

.hero-show {
  position: relative;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, 4vw, 3rem);
  min-height: calc(100vh - 160px);
  padding: clamp(1rem, 4vw, 2.5rem);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgb(255 255 255 / 92%) 0 38%, rgb(255 255 255 / 52%) 38% 100%),
    repeating-linear-gradient(90deg, #ff6969 0 4.5rem, #ffd236 4.5rem 9rem, #4bc8ff 9rem 13.5rem, #7bd66f 13.5rem 18rem);
  box-shadow: var(--shadow), 0 12px 0 var(--line);
  overflow: hidden;
}

.copy {
  z-index: 2;
  flex: 0 1 440px;
}

.copy h2 {
  max-width: 11ch;
  font-size: clamp(2.7rem, 8vw, 6.4rem);
}

.copy p:not(.eyebrow) {
  max-width: 42rem;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-weight: 700;
  line-height: 1.55;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.button {
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--line);
  font-weight: 950;
  cursor: pointer;
}

.button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--line);
}

.button.primary {
  background: var(--red);
  color: white;
}

.button.secondary {
  background: var(--yellow);
}

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

.stage {
  position: relative;
  flex: 1 1 560px;
  min-height: min(70vh, 720px);
  isolation: isolate;
}

.spotlight {
  position: absolute;
  inset: 8% 4% 0;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgb(255 255 255 / 88%) 0 30%, rgb(255 210 54 / 42%) 31% 54%, transparent 55%),
    conic-gradient(from 10deg, rgb(227 49 63 / 40%), rgb(24 87 200 / 36%), rgb(68 185 77 / 38%), rgb(240 90 167 / 38%), rgb(227 49 63 / 40%));
  animation: spin 10s linear infinite;
}

.clown {
  position: absolute;
  right: clamp(-5rem, -7vw, -1rem);
  bottom: clamp(-7rem, -12vw, -3rem);
  z-index: 2;
  width: min(72vw, 740px);
  max-width: none;
  filter: drop-shadow(0 30px 18px rgb(37 27 45 / 24%));
  transform-origin: 50% 85%;
  animation:
    bounce calc(1.9s - (var(--motion-scale) * 0.09s)) cubic-bezier(0.2, 0.7, 0.15, 1) infinite,
    wiggle calc(1.2s - (var(--motion-scale) * 0.035s)) ease-in-out infinite;
}

.confetti-field {
  position: absolute;
  inset: -10%;
  z-index: 3;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -12%;
  width: 0.72rem;
  height: 1.15rem;
  border: 2px solid rgb(37 27 45 / 18%);
  border-radius: 3px;
  background: var(--piece-color, var(--red));
  opacity: 0.94;
  animation: confetti-fall var(--fall-speed, 6s) linear infinite;
  animation-delay: var(--fall-delay, 0s);
}

.control-panel {
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 8px 0 rgb(37 27 45 / 12%);
}

.control-panel h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.field {
  display: grid;
  flex: 1 1 210px;
  gap: 0.45rem;
  min-width: 190px;
}

.field span,
.status {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

input[type="range"] {
  accent-color: var(--red);
}

.status {
  min-width: 8.5rem;
  margin: 0;
}

.site-footer {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.site-footer a {
  color: var(--blue);
}

@keyframes bounce {
  0%,
  100% {
    translate: 0 0;
    scale: 1;
  }

  45% {
    translate: 0 calc(-2.2rem - var(--motion-scale) * 0.45rem);
    scale: 1.02 0.98;
  }

  70% {
    translate: 0 0.45rem;
    scale: 0.97 1.03;
  }
}

@keyframes wiggle {
  0%,
  100% {
    rotate: -2deg;
  }

  50% {
    rotate: 3deg;
  }
}

@keyframes spin {
  to {
    rotate: 360deg;
  }
}

@keyframes confetti-fall {
  0% {
    translate: 0 -10%;
    rotate: 0deg;
  }

  100% {
    translate: var(--drift, 0) 120vh;
    rotate: 720deg;
  }
}

@media (max-width: 860px) {
  .topbar,
  .hero-show,
  .control-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .nav a {
    flex: 1;
  }

  .hero-show {
    min-height: auto;
  }

  .copy h2 {
    max-width: 10ch;
  }

  .stage {
    min-height: 520px;
  }

  .field {
    flex: 0 1 auto;
    min-width: 0;
  }

  .clown {
    right: 50%;
    bottom: -4rem;
    width: min(118vw, 650px);
    transform: translateX(50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
