/* ─── VHS Intro ─── */
#vhs-intro {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--f-mono);
  color: var(--c-cream);
  overflow: hidden;
}
#vhs-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.03) 2px,
    rgba(255,255,255,0.03) 4px
  );
  pointer-events: none;
  animation: vhs-scanlines 0.1s steps(2) infinite;
}
@keyframes vhs-scanlines {
  from { transform: translateY(0); }
  to   { transform: translateY(4px); }
}

.vhs-line {
  opacity: 0;
  font-size: 1.2rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0.4em 0;
}
.vhs-line-1 { animation: vhs-type 0.6s 0.3s ease forwards; color: var(--c-gold); }
.vhs-line-2 { animation: vhs-type 0.6s 0.9s ease forwards; color: var(--c-orange); font-size: 1.8rem; }
.vhs-line-3 { animation: vhs-type 0.6s 1.5s ease forwards; font-size: 1.5rem; }

@keyframes vhs-type {
  0%   { opacity: 0; transform: translateX(-10px); filter: blur(4px); }
  50%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateX(0); filter: blur(0); }
}

#vhs-intro.vhs-glitch {
  animation: vhs-distort 0.3s ease;
}
@keyframes vhs-distort {
  0%   { transform: translate(0); filter: hue-rotate(0deg); }
  25%  { transform: translate(-3px, 2px); filter: hue-rotate(90deg); }
  50%  { transform: translate(4px, -1px); filter: hue-rotate(180deg); }
  75%  { transform: translate(-2px, 3px); filter: hue-rotate(270deg); }
  100% { transform: translate(0); filter: hue-rotate(0deg); }
}

#vhs-intro.vhs-out {
  animation: vhs-off 0.8s ease forwards;
}
@keyframes vhs-off {
  0%   { opacity: 1; transform: scaleY(1); }
  50%  { opacity: 1; transform: scaleY(0.005); }
  100% { opacity: 0; transform: scaleY(0); }
}

/* ─── Geo Banner ─── */
.geo-banner {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--c-burgundy);
  color: var(--c-cream);
  font-family: var(--f-mono);
  font-size: 0.95rem;
  padding: var(--s-xs) var(--s-md);
  border: 2px solid var(--c-orange);
  box-shadow: var(--shadow-wonky);
  z-index: var(--z-easter);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  text-align: center;
  max-width: 90vw;
}
.geo-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── More Cowbell ─── */
.cowbell-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-1deg) scale(0.9);
  background: var(--c-cream);
  color: var(--c-ink);
  font-family: var(--f-mono);
  padding: var(--s-md);
  border: 4px solid var(--c-ink);
  box-shadow: var(--shadow-wonky);
  z-index: var(--z-easter);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  text-align: center;
  max-width: 420px;
  width: 90vw;
}
.cowbell-popup.visible {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(-1deg) scale(1);
}
.cowbell-title {
  font-family: var(--f-display);
  font-size: 1.5rem;
  color: var(--c-burgundy);
  margin-bottom: var(--s-sm);
}
.cowbell-question {
  font-size: 1.1rem;
  margin-bottom: var(--s-md);
}
.cowbell-btns {
  display: flex;
  gap: var(--s-sm);
  justify-content: center;
}
.cowbell-btn { font-size: 1.1rem; }

/* ─── Singles Popup (80s/90s style) ─── */
.singles-popup {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--c-cream);
  color: var(--c-ink);
  font-family: var(--f-mono);
  padding: var(--s-md);
  border: 4px solid var(--c-red);
  box-shadow: 0 0 30px rgba(184, 58, 42, 0.4), var(--shadow-wonky);
  z-index: var(--z-easter);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  max-width: 380px;
  width: 90vw;
}
.singles-popup.visible {
  opacity: 1;
  transform: translateY(0);
}
.singles-close {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--c-ink);
  cursor: inherit;
}
.singles-heading {
  font-family: var(--f-display);
  font-size: 1.3rem;
  color: var(--c-red);
  margin-bottom: var(--s-sm);
}
.singles-sub {
  font-size: 0.95rem;
  margin-bottom: var(--s-md);
  line-height: 1.5;
}
.singles-cta {
  width: 100%;
  font-size: 1rem;
}

/* ─── Scroll Entrance & Exit ─── */
.scroll-hidden {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.scroll-reveal {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}
.scroll-exit {
  opacity: 0;
  transform: translateY(-30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
/* Preserve the wonky rotations after reveal */
.survivor-card.scroll-reveal:nth-child(1) { transform: rotate(-1deg); }
.survivor-card.scroll-reveal:nth-child(2) { transform: rotate(1.4deg); }
.survivor-card.scroll-reveal:nth-child(3) { transform: rotate(-0.6deg); }
.survivor-card.scroll-reveal:hover { transform: rotate(0deg) scale(1.02); }

/* Stagger the cards */
.survivor-card:nth-child(1) { transition-delay: 0s; }
.survivor-card:nth-child(2) { transition-delay: 0.15s; }
.survivor-card:nth-child(3) { transition-delay: 0.3s; }

/* ─── Particles Canvas ─── */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* ─── Blood / Gunshot FX Layer ─── */
#fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: calc(var(--z-chaos) + 2);
  overflow: hidden;
}

/* Blood splatter */
.fx-blood {
  position: absolute;
  pointer-events: none;
}
.fx-blood-splat {
  position: absolute;
  border-radius: 50% 40% 55% 45%;
  background: #8B0000;
  opacity: 0.85;
  animation: blood-appear 0.15s ease-out forwards;
}
@keyframes blood-appear {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
.fx-blood-drip {
  position: absolute;
  width: 3px;
  background: linear-gradient(to bottom, #8B0000 60%, transparent);
  border-radius: 0 0 3px 3px;
  animation: drip-down 2.5s ease-in forwards;
  transform-origin: top;
}
@keyframes drip-down {
  0%   { height: 0; opacity: 0.9; }
  100% { height: 120px; opacity: 0.3; }
}
.fx-blood-drop {
  position: absolute;
  border-radius: 50%;
  background: #8B0000;
  animation: blood-fly 0.4s ease-out forwards;
}
@keyframes blood-fly {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.9; }
  100% { transform: translate(var(--bx), var(--by)) scale(0.3); opacity: 0.4; }
}

/* Gunshot crack */
.fx-crack {
  position: absolute;
  pointer-events: none;
}
.fx-crack-hole {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, #000 30%, rgba(200,200,200,0.5) 60%, transparent 80%);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(0,0,0,0.6);
  animation: crack-appear 0.1s ease-out forwards;
}
@keyframes crack-appear {
  from { transform: translate(-50%, -50%) scale(0); }
  to   { transform: translate(-50%, -50%) scale(1); }
}
.fx-crack-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(to right, rgba(200,200,200,0.9), rgba(200,200,200,0.3), transparent);
  transform-origin: left center;
  animation: crack-grow 0.2s ease-out forwards;
}
@keyframes crack-grow {
  from { width: 0; }
  to   { width: var(--crack-len); }
}
.fx-crack-branch {
  position: absolute;
  height: 1px;
  background: linear-gradient(to right, rgba(200,200,200,0.6), transparent);
  transform-origin: left center;
  animation: crack-grow 0.3s 0.1s ease-out forwards;
  width: 0;
}

/* Fade out all FX after delay */
.fx-blood, .fx-crack {
  animation: fx-fade 0.8s 4s ease forwards;
}
@keyframes fx-fade {
  to { opacity: 0; }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  #vhs-intro,
  #particle-canvas { display: none !important; }
  .scroll-hidden {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .fx-blood, .fx-crack { display: none !important; }
}
