:root {
  --bg-a: #fdf7d6;
  --bg-b: #fcb23a;
  --bg-c: #f85032;
  --ink: #111111;
  --panel: rgba(255, 255, 255, 0.76);
  --accent-green: #caff00;
  --accent-red: #ff2d2d;
  --accent-yellow: #ffe600;
  --accent-blue: #08d9ff;
  --shadow-strong: 0 14px 36px rgba(0, 0, 0, 0.2);
  --radius: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Space Mono", "Courier New", monospace;
  background:
    radial-gradient(circle at 12% 8%, #fff7be 0%, transparent 20%),
    radial-gradient(circle at 85% 35%, #ff7d42 0%, transparent 32%),
    radial-gradient(circle at 42% 96%, #ffd000 0%, transparent 28%),
    linear-gradient(120deg, var(--bg-a), var(--bg-b), var(--bg-c));
  overflow-x: clip;
  position: relative;
}

.noise-overlay,
.scan-overlay,
.frame-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.noise-overlay {
  background-image: repeating-radial-gradient(
    circle at 0 0,
    rgba(0, 0, 0, 0.08) 0,
    rgba(0, 0, 0, 0.08) 1px,
    transparent 2px,
    transparent 5px
  );
  mix-blend-mode: multiply;
  opacity: 0.4;
  z-index: 0;
}

.scan-overlay {
  background-image: linear-gradient(
    rgba(255, 255, 255, 0.12) 0,
    rgba(255, 255, 255, 0.12) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.5;
  z-index: 0;
}

.frame-rain {
  z-index: 0;
  opacity: 0.43;
  overflow: hidden;
  mix-blend-mode: multiply;
}

.frame-bit {
  position: absolute;
  left: var(--x, 50%);
  top: -7vh;
  color: rgba(0, 0, 0, 0.8);
  font-size: clamp(0.65rem, 1.4vw, 0.9rem);
  white-space: nowrap;
  transform: rotate(var(--rot, -8deg));
  animation: frameDrop var(--dur, 11s) linear infinite;
  animation-delay: var(--delay, 0s);
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 2;
}

.site-header {
  position: sticky;
  top: 0;
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}

.signal-tape {
  position: sticky;
  top: 71px;
  z-index: 3;
  overflow: hidden;
  border-top: 2px solid rgba(0, 0, 0, 0.12);
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
  background: linear-gradient(90deg, #111, #2a2a2a);
  color: #fff;
}

.signal-tape p {
  margin: 0;
  padding: 0.45rem 1rem;
  white-space: nowrap;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  animation: tapeScroll 13s linear infinite;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 2rem;
  letter-spacing: 0.06em;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.section {
  margin-block: clamp(1.2rem, 4vw, 3rem);
}

.hero {
  min-height: 72vh;
  display: grid;
  align-content: center;
  gap: 1rem;
  padding: clamp(1rem, 4vw, 2.4rem);
  border: 3px solid rgba(0, 0, 0, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.88),
    rgba(255, 240, 167, 0.88)
  );
  box-shadow: var(--shadow-strong);
}

.kicker {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Bebas Neue", Impact, sans-serif;
  letter-spacing: 0.04em;
  line-height: 0.94;
  margin: 0;
}

h1 {
  font-size: clamp(3.1rem, 11vw, 9.6rem);
  max-width: 16ch;
  text-shadow: 3px 3px 0 #ffffff, -3px -3px 0 rgba(0, 0, 0, 0.1);
}

h1 span {
  color: var(--accent-red);
  display: inline-block;
  animation: pulseTitle 1.2s steps(2, jump-none) infinite;
}

.hero-subhead {
  font-size: clamp(1rem, 2.1vw, 1.2rem);
  max-width: 65ch;
  margin: 0;
}

.hero-marquee {
  margin: 0.4rem 0 0;
  padding: 0.46rem 0.75rem;
  border: 2px dashed #1e1e1e;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff, #f2ffe7, #fff);
  white-space: nowrap;
  overflow: hidden;
  font-weight: 700;
  animation: horizontalJitter 120ms steps(2, jump-none) infinite;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.button {
  border: 2px solid #1f1f1f;
  border-radius: 999px;
  padding: 0.72rem 1.1rem;
  font-size: 0.96rem;
  text-decoration: none;
  color: #1f1f1f;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.12);
}

.button-primary {
  background: linear-gradient(90deg, var(--accent-yellow), #fff);
}

.button-secondary {
  background: linear-gradient(90deg, var(--accent-blue), #fff);
}

.badge-rack {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.badge-rack li {
  background: #1f1f1f;
  color: #ffffff;
  border-radius: 999px;
  padding: 0.42rem 0.78rem;
  font-size: 0.8rem;
  transform: rotate(var(--tilt, 0deg));
}

.badge-rack li:nth-child(odd) {
  --tilt: -2deg;
}

.badge-rack li:nth-child(even) {
  --tilt: 2deg;
}

.counter-rack {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 0.8rem;
}

.counter-rack article {
  padding: 0.8rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.counter-label {
  margin: 0;
  font-size: 0.86rem;
}

.counter {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  margin: 0.15rem 0 0;
}

.panel {
  border: 3px solid rgba(0, 0, 0, 0.22);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-strong);
  padding: clamp(1rem, 3vw, 1.6rem);
}

.lore-grid {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.lore-card {
  background: linear-gradient(160deg, #fff8d6, #fff);
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 0.9rem;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.lore-card:hover,
.lore-card:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 16px 22px rgba(0, 0, 0, 0.14);
}

.signal-grid {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.signal-card {
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 0.8rem;
  background: linear-gradient(155deg, #ffffff, #e9ffe9 58%, #fff9de);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.09);
}

.signal-card h3 {
  font-size: 1.5rem;
}

.altar-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.9rem;
}

.diagnostic-card {
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 0.9rem;
  background: linear-gradient(160deg, #ffffff, #fff6dc);
}

.switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.switch {
  border: 2px solid #1a1a1a;
  border-radius: 999px;
  background: #fff;
  padding: 0.45rem 0.75rem;
  font-family: inherit;
  cursor: pointer;
}

.switch.active {
  background: var(--accent-green);
}

.log-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
  max-height: 220px;
  overflow: auto;
}

.log-card li {
  padding: 0.35rem 0.48rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 0.83rem;
  border-left: 3px solid rgba(0, 0, 0, 0.22);
}

.quote-belt {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
}

blockquote {
  margin: 0;
  border-left: 5px solid #202020;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  font-size: 0.95rem;
}

.finale {
  text-align: center;
}

.site-footer {
  padding: 1rem;
  text-align: center;
  font-size: 0.86rem;
  background: rgba(255, 255, 255, 0.74);
}

.chaos-2 .hero,
.chaos-2 .panel {
  filter: saturate(1.14);
}

.chaos-2 .signal-tape p {
  animation-duration: 8s;
}

.chaos-3 h1 span {
  animation-duration: 600ms;
}

.chaos-3 .lore-card:nth-child(odd) {
  transform: rotate(-1.2deg);
}

.chaos-3 .lore-card:nth-child(even) {
  transform: rotate(1.2deg);
}

.chaos-4 .section {
  animation: shakeSection 220ms linear infinite;
}

.chaos-4 .frame-bit {
  opacity: 0.8;
  text-shadow: -1px 0 #fff, 1px 0 #f4ff00;
}

.chaos-5 {
  filter: hue-rotate(-20deg) contrast(1.08);
}

.chaos-5 h1 span {
  animation: pulseTitle 350ms steps(2, jump-none) infinite;
}

.chaos-5 .hero-marquee {
  letter-spacing: 0.05em;
}

.hotdog-mode {
  animation: hotdogGlobal 180ms steps(2, jump-none) infinite;
}

.hotdog-mode .section {
  animation: hotdogSection 130ms linear infinite;
}

.hotdog-mode .frame-bit {
  animation-duration: 1.9s;
  opacity: 0.9;
}

.hotdog-flash-a .site-header,
.hotdog-flash-a .signal-tape {
  background: linear-gradient(90deg, #fffb00, #ff2d2d) !important;
  color: #000;
}

.hotdog-flash-b .panel,
.hotdog-flash-b .hero {
  box-shadow: 0 0 0 4px #000, 0 0 24px #ff2d2d, 0 0 40px #08d9ff;
}

.hotdog-burst {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.hotdog-burst span {
  position: absolute;
  max-width: 34ch;
  padding: 0.25rem 0.38rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: #000;
  font-size: 0.69rem;
  transform: rotate(var(--spin, 0deg));
  animation: hotdogChip 600ms linear infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes pulseTitle {
  0%,
  100% {
    transform: skewX(0deg);
  }
  50% {
    transform: skewX(-7deg);
  }
}

@keyframes frameDrop {
  0% {
    transform: translateY(-7vh) rotate(var(--rot, -8deg));
  }
  100% {
    transform: translateY(110vh) rotate(calc(var(--rot, -8deg) * -1));
  }
}

@keyframes tapeScroll {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-120%);
  }
}

@keyframes horizontalJitter {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(1px);
  }
  100% {
    transform: translateX(-1px);
  }
}

@keyframes shakeSection {
  0% {
    transform: translateX(0);
  }
  33% {
    transform: translateX(1px);
  }
  66% {
    transform: translateX(-1px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes hotdogGlobal {
  0% {
    filter: hue-rotate(0deg) contrast(1.2) saturate(1.2);
  }
  50% {
    filter: hue-rotate(22deg) contrast(1.35) saturate(1.4);
  }
  100% {
    filter: hue-rotate(-18deg) contrast(1.2) saturate(1.3);
  }
}

@keyframes hotdogSection {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(1px, -1px) rotate(-0.3deg);
  }
  50% {
    transform: translate(-2px, 1px) rotate(0.2deg);
  }
  75% {
    transform: translate(1px, 1px) rotate(-0.2deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes hotdogChip {
  0% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    flex-direction: column;
    align-items: flex-start;
  }

  .signal-tape {
    position: static;
  }

  .counter-rack {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.6rem, 16vw, 5rem);
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0s !important;
  }

  .frame-rain {
    display: none;
  }
}
