/* Belpire Carnival — visual effects layer.
   Loaded after styles.css. Everything here is decoration: the page works without it,
   and prefers-reduced-motion turns all movement off (bottom of file). */

:root {
  --glow-gold: 0 0 6px rgba(217, 178, 106, .9), 0 0 18px rgba(217, 178, 106, .55), 0 0 42px rgba(217, 178, 106, .25);
  --glow-crimson: 0 0 8px rgba(196, 38, 64, .8), 0 0 26px rgba(122, 22, 37, .6);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Atmosphere: film grain + vignette over everything ---------- */
body { position: relative; }
body::before,
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 60; }
body::before { inset: -10%; }
body::before {
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
body::after { background: radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(0, 0, 0, .55) 100%); }
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- Hero stage ---------- */
.hero-stage { position: relative; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--line); }
.hero-stage > .hero { position: relative; z-index: 5; padding-block: 120px 300px; }
.stage-sky {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 60% 45% at 50% 100%, rgba(122, 22, 37, .55), transparent 70%),
    radial-gradient(ellipse 50% 40% at 20% 0%, rgba(72, 34, 88, .35), transparent 70%),
    radial-gradient(ellipse 45% 35% at 85% 10%, rgba(217, 178, 106, .10), transparent 70%);
}
.beams { position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: screen; }
.beam {
  position: absolute; bottom: -10%; width: 34vw; max-width: 520px; height: 130%;
  background: linear-gradient(to top, rgba(240, 212, 154, .38), rgba(240, 212, 154, .10) 45%, transparent 85%);
  clip-path: polygon(46% 100%, 54% 100%, 100% 0, 0 0);
  filter: blur(6px); transform-origin: 50% 100%; opacity: .55;
}
.beam-l { left: 4%; animation: sweep-l 9s ease-in-out infinite alternate; }
.beam-r { right: 4%; animation: sweep-r 11s ease-in-out infinite alternate; }
@keyframes sweep-l { from { transform: rotate(-28deg); } to { transform: rotate(18deg); } }
@keyframes sweep-r { from { transform: rotate(26deg); } to { transform: rotate(-20deg); } }

.bunting { position: absolute; top: 0; left: 0; width: 100%; height: 70px; z-index: 3; }
.bunting-flags path { transform-box: fill-box; transform-origin: 50% 0; animation: flutter 3.4s ease-in-out infinite; }
.bunting-flags path:nth-child(odd) { animation-delay: -1.7s; }
.bunting-flags path:nth-child(3n) { animation-duration: 4.1s; }
@keyframes flutter { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }

.bigtop { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(1000px, 150vw); height: auto; z-index: 2;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); mask-image: linear-gradient(to bottom, #000 70%, transparent); }
.bigtop-flag { transform-box: fill-box; transform-origin: 0 50%; animation: flag 2.6s ease-in-out infinite; }
@keyframes flag { 0%, 100% { transform: skewY(0) scaleX(1); } 50% { transform: skewY(-8deg) scaleX(.86); } }
.bigtop-lights circle { fill: #F3E6C8; filter: drop-shadow(0 0 4px #D9B26A); animation: twinkle 2.2s ease-in-out infinite; }
.bigtop-lights circle:nth-child(even) { animation-delay: -1.1s; }
.bigtop-lights circle:nth-child(3n) { animation-duration: 3s; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.bigtop-door { filter: drop-shadow(0 0 18px rgba(217, 178, 106, .25)); }

.fog { position: absolute; left: -50%; width: 200%; height: 220px; bottom: -40px; z-index: 4; pointer-events: none; filter: blur(22px); opacity: .55; }
.fog-a { background: radial-gradient(ellipse 18% 60% at 20% 60%, rgba(207, 198, 182, .14), transparent 70%), radial-gradient(ellipse 16% 55% at 62% 70%, rgba(207, 198, 182, .12), transparent 70%); animation: drift 38s linear infinite; }
.fog-b { bottom: -70px; background: radial-gradient(ellipse 20% 60% at 40% 60%, rgba(160, 120, 140, .14), transparent 70%), radial-gradient(ellipse 14% 50% at 85% 65%, rgba(207, 198, 182, .10), transparent 70%); animation: drift 56s linear infinite reverse; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(25%); } }

/* Chasing marquee lights */
.bulbs span { animation: chase 1.6s linear infinite; box-shadow: var(--glow-gold); }
.bulbs span:nth-child(1) { animation-delay: 0s; } .bulbs span:nth-child(2) { animation-delay: .11s; }
.bulbs span:nth-child(3) { animation-delay: .22s; } .bulbs span:nth-child(4) { animation-delay: .33s; }
.bulbs span:nth-child(5) { animation-delay: .44s; } .bulbs span:nth-child(6) { animation-delay: .55s; }
.bulbs span:nth-child(7) { animation-delay: .66s; } .bulbs span:nth-child(8) { animation-delay: .77s; }
.bulbs span:nth-child(9) { animation-delay: .88s; } .bulbs span:nth-child(10) { animation-delay: .99s; }
.bulbs span:nth-child(11) { animation-delay: 1.1s; } .bulbs span:nth-child(12) { animation-delay: 1.21s; }
.bulbs span:nth-child(13) { animation-delay: 1.32s; } .bulbs span:nth-child(14) { animation-delay: 1.43s; }
@keyframes chase { 0%, 100% { opacity: .35; transform: scale(.85); } 12% { opacity: 1; transform: scale(1.15); } 30% { opacity: .55; transform: scale(1); } }

/* Neon headline with an occasional, gentle flicker (never more than 2 dips per 8s) */
.hero h1.neon, .neon { color: #FFF4DE; text-shadow: var(--glow-gold); animation: neon 8s infinite; }
@keyframes neon {
  0%, 47%, 49%, 53%, 100% { opacity: 1; text-shadow: var(--glow-gold); }
  48% { opacity: .55; text-shadow: none; }
  52% { opacity: .7; text-shadow: 0 0 4px rgba(217, 178, 106, .4); }
}
.eyebrow { animation: rise .9s var(--ease-out) both; }
.hero .lede { animation: rise .9s .15s var(--ease-out) both; }
.hero-ctas { animation: rise .9s .3s var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn { position: relative; overflow: hidden; transition: transform .2s var(--ease-out), box-shadow .3s, background-color .2s, border-color .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-gold { box-shadow: 0 0 0 rgba(217, 178, 106, 0); }
.btn-gold:hover { box-shadow: 0 8px 28px rgba(217, 178, 106, .35); }
.btn-gold::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
}
.btn-gold:hover::after { transform: translateX(120%); transition: transform .7s var(--ease-out); }

/* ---------- Section headings: a string of lights under each title ---------- */
h2::after {
  content: ''; display: block; width: 120px; height: 6px; margin-top: 10px;
  background: radial-gradient(circle, #F3E6C8 0 2px, transparent 2.5px) 0 50% / 14px 6px repeat-x;
  filter: drop-shadow(0 0 4px rgba(217, 178, 106, .9)); opacity: .85;
}
.center::after, h2.center::after, .closing h2::after, .lounge-teaser h2::after { margin-inline: auto; }
.legal h2::after, .section-head p::after { display: none; }

/* ---------- Tickets: perforated edges, a little wobble, an ADMIT ONE stamp on hover ---------- */
.ticket {
  position: relative; border-style: solid; border-color: rgba(217, 178, 106, .55);
  -webkit-mask: radial-gradient(circle 9px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 9px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
  background: linear-gradient(160deg, #1B1218, #0E0B10 70%);
  transition: transform .35s var(--ease-out), box-shadow .35s;
}
.ticket::after {
  content: 'ADMIT ONE'; position: absolute; right: 18px; top: 18px;
  font: 700 12px var(--serif); letter-spacing: .2em; color: var(--crimson);
  border: 2px solid var(--crimson); padding: 3px 8px; border-radius: 3px;
  transform: rotate(-12deg) scale(1.6); opacity: 0; transition: transform .35s var(--ease-out), opacity .25s;
  background: rgba(14, 11, 16, .7);
}
.ticket:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
.ticket:hover::after { opacity: 1; transform: rotate(-12deg) scale(1); }
.ticket:nth-child(2):hover { transform: translateY(-4px) rotate(.6deg); }

/* ---------- Cards: tilt toward the cursor + a glint of light ---------- */
.card, .news, .attraction, .night, .ringleader, .placeholder { position: relative; }
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0)); transition: transform .25s var(--ease-out), box-shadow .3s, border-color .3s; will-change: transform; }
.tilt:hover { --lift: -4px; border-color: rgba(217, 178, 106, .6); box-shadow: 0 22px 50px rgba(0, 0, 0, .55), 0 0 0 1px rgba(217, 178, 106, .15); }
.tilt::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 236, 200, .16), transparent 45%);
  opacity: 0; transition: opacity .3s;
}
.tilt:hover::before { opacity: 1; }
.card .capsule { transition: transform .6s var(--ease-out), filter .6s; filter: saturate(.85) brightness(.9); }
.card:hover .capsule { transform: scale(1.06); filter: saturate(1.1) brightness(1); }

/* New feed cards drift in one after another */
.card-grid > *, .news-list > * { animation: rise .6s var(--ease-out) both; }
.card-grid > :nth-child(2), .news-list > :nth-child(2) { animation-delay: .06s; }
.card-grid > :nth-child(3), .news-list > :nth-child(3) { animation-delay: .12s; }
.card-grid > :nth-child(4), .news-list > :nth-child(4) { animation-delay: .18s; }
.card-grid > :nth-child(5), .news-list > :nth-child(5) { animation-delay: .24s; }
.card-grid > :nth-child(n+6), .news-list > :nth-child(n+6) { animation-delay: .3s; }

/* ---------- Tent filter: each tent glows in its own colour ---------- */
.tent-filter button { transition: background-color .25s, color .25s, border-color .25s, box-shadow .3s, transform .2s; }
.tent-filter button:hover { transform: translateY(-2px); }
.tent-filter button[data-tent="horror"][aria-pressed="true"] { background: var(--crimson); border-color: #C42640; color: #FBEFF0; animation: heartbeat 1.6s ease-in-out infinite; }
.tent-filter button[data-tent="party"][aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); box-shadow: var(--glow-gold); }
.tent-filter button[data-tent="other"][aria-pressed="true"] { background: var(--slate); border-color: #5C6E80; color: var(--text); box-shadow: 0 0 18px rgba(92, 110, 128, .55); }
.tent-filter button[data-tent="all"][aria-pressed="true"] { box-shadow: 0 0 18px rgba(237, 230, 216, .35); }
@keyframes heartbeat { 0%, 100% { box-shadow: 0 0 0 rgba(196, 38, 64, 0); } 15% { box-shadow: var(--glow-crimson); } 30% { box-shadow: 0 0 4px rgba(196, 38, 64, .4); } 45% { box-shadow: var(--glow-crimson); } }

/* ---------- Scroll reveals (classes added by fx.js, so no-JS visitors see everything) ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: var(--delay, 0s); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Closing call: a pulsing big-top glow ---------- */
.closing { position: relative; isolation: isolate; }
.closing::before {
  content: ''; position: absolute; inset: 10% 15%; z-index: -1; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(122, 22, 37, .35), transparent 70%); filter: blur(20px);
  animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: .6; transform: scale(.95); } 50% { opacity: 1; transform: scale(1.05); } }

/* Phones: lighter stage */
@media (max-width: 640px) {
  .hero-stage > .hero { padding-block: 84px 190px; }
  .beam { width: 60vw; }
  .bunting { height: 44px; }
}

/* ---------- Motion off for people who ask for it ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .tilt { transform: none !important; }
  .beam-l { transform: rotate(-12deg); }
  .beam-r { transform: rotate(12deg); }
}
