:root {
  --bg: #0f1522;
  --bg-2: #161e30;
  --gold: #b8893a;
  --gold-light: #e0b660;
  --mauve: #8f5c6c;
  --text: #d8cfc0;
  --muted: #9a9384;
  --heading: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --body: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, #1d2740 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, #141c2c 0%, transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.25rem;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: var(--gold-light); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 2.5rem 1rem 3rem;
  position: relative;
  z-index: 1;
}

.tagline,
.title {
  font-family: var(--heading);
  color: var(--gold);
  margin: 0;
  letter-spacing: 0.02em;
  text-shadow: 0 0 18px rgba(224, 182, 96, 0.25);
}

.tagline {
  font-size: clamp(1.6rem, 5vw, 3.2rem);
  text-transform: uppercase;
}

.title {
  font-size: clamp(2.4rem, 9vw, 5.5rem);
  text-transform: uppercase;
  line-height: 1.05;
  margin-top: -0.5rem;
  display: inline-block;
  position: relative;
  text-shadow: 0 0 14px rgba(170, 20, 20, 0.55), 0 2px 0 #3a0a0a;
  animation: title-flicker 7s infinite;
}

@keyframes title-flicker {
  0%, 91%, 93%, 95%, 100% { opacity: 1; transform: none; }
  92% { opacity: 0.4; transform: translateX(-2px) skewX(-3deg); }
  94% { opacity: 0.8; transform: translateX(2px); }
}

.drips {
  position: absolute;
  left: 0;
  right: 0;
  top: 78%;
  height: 0;
  pointer-events: none;
}

.drips i {
  position: absolute;
  top: 0;
  width: 0.09em;
  height: 0;
  background: linear-gradient(180deg, #5e0909, #a51212);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  animation: drip 9s ease-in infinite;
}

.drips i::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.08em;
  width: 0.14em;
  height: 0.14em;
  translate: -50% 0;
  border-radius: 50%;
  background: #a51212;
}

.drips i:nth-child(1) { left: 6%; animation-delay: 0s; }
.drips i:nth-child(2) { left: 19%; animation-delay: 3.1s; animation-duration: 11s; }
.drips i:nth-child(3) { left: 33%; animation-delay: 1.4s; }
.drips i:nth-child(4) { left: 48%; animation-delay: 5.2s; animation-duration: 12s; }
.drips i:nth-child(5) { left: 63%; animation-delay: 2.3s; }
.drips i:nth-child(6) { left: 78%; animation-delay: 6.7s; animation-duration: 10s; }
.drips i:nth-child(7) { left: 92%; animation-delay: 4s; }

@keyframes drip {
  0% { height: 0; opacity: 1; }
  60% { height: 0.55em; opacity: 1; }
  85% { height: 0.7em; opacity: 1; }
  100% { height: 0.75em; opacity: 0; }
}

.date {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  color: var(--mauve);
  margin: 0.5rem 0 1.5rem;
}

.hero-art {
  position: relative;
  width: min(100%, 820px);
  aspect-ratio: 4 / 3;
  margin: 1rem auto 0;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 55%, #000 60%, transparent 100%), linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 55%, #000 60%, transparent 100%), linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-composite: intersect;
}

.hero-svg,
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-photo {
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-art.has-photo .hero-photo { opacity: 1; }
.hero-art.has-photo .hero-svg { display: none; }

.cloud, .figure, .tree-eyes, .hand, .noose { transform-box: fill-box; transform-origin: center; }

.cloud-a { animation: cloud-drift 38s ease-in-out infinite alternate; }
.cloud-b { animation: cloud-drift 52s ease-in-out infinite alternate-reverse; }

@keyframes cloud-drift {
  from { transform: translateX(-140px); }
  to { transform: translateX(220px); }
}

.figure { opacity: 0; animation: figure 13s infinite; }

@keyframes figure {
  0%, 55%, 80%, 100% { opacity: 0; }
  60%, 75% { opacity: 1; }
}

.tree-eyes { animation: tree-eyes 6s infinite; }
.tree-eyes-2 { animation-duration: 8.5s; animation-delay: 2s; }

@keyframes tree-eyes {
  0%, 30%, 100% { opacity: 0; transform: scaleY(1); }
  36%, 50%, 56%, 80% { opacity: 1; transform: scaleY(1); }
  53% { opacity: 1; transform: scaleY(0.1); }
}

.door-glow { animation: pulse 3s ease-in-out infinite; }
.red-window { animation: pulse 5s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.95; }
}

.hand { animation: reach 5s ease-in-out infinite; transform-origin: bottom center; }

@keyframes reach {
  0%, 100% { transform: translateY(8px) rotate(-4deg); }
  50% { transform: translateY(0) rotate(5deg); }
}

.noose { animation: sway 6s ease-in-out infinite; transform-origin: top center; }

@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

.reveal { opacity: 0; transition: opacity 0.6s ease-out; }
.struck .reveal { opacity: 1; transition: none; }
.struck .hero-art { filter: brightness(1.6) contrast(1.15) saturate(0.6); }
.hero-art { transition: filter 0.5s ease-out; }

.windows .flicker { animation: flicker 4s infinite; }
.windows .flicker:nth-child(odd) { animation-delay: 1.3s; }

@keyframes flicker {
  0%, 18%, 22%, 60%, 64%, 100% { opacity: 1; }
  20%, 62% { opacity: 0.35; }
}

.btn {
  display: inline-block;
  font-family: var(--heading);
  font-size: 1.2rem;
  color: var(--bg);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  padding: 0.6rem 2rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 0 20px rgba(224, 182, 96, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 32px rgba(224, 182, 96, 0.6);
}

/* ---------- Content ---------- */
main {
  width: min(100% - 2rem, 900px);
  margin: 0 auto;
  display: grid;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.card {
  background: linear-gradient(180deg, rgba(29, 39, 64, 0.75), rgba(18, 25, 40, 0.85));
  border: 1px solid rgba(184, 137, 58, 0.3);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.card h2 {
  font-family: var(--heading);
  color: var(--gold);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 1.25rem;
}

.info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 0;
}

.info dt {
  font-family: var(--heading);
  color: var(--mauve);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.info dd { margin: 0; }

.contest .big {
  font-family: var(--heading);
  font-size: clamp(2rem, 7vw, 3.5rem);
  color: var(--gold-light);
  margin: 0;
}

.contest em { color: #c9474f; font-style: normal; }

.rooms {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

.rooms li {
  background: rgba(15, 21, 34, 0.6);
  border: 1px solid rgba(143, 92, 108, 0.35);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  transition: transform 0.25s, border-color 0.25s;
}

.rooms li:hover {
  transform: translateY(-4px) rotate(-1deg);
  border-color: var(--gold);
}

.room-icon { font-size: 2.2rem; display: block; }

.rooms h3 {
  font-family: var(--heading);
  color: var(--gold-light);
  font-size: 1.15rem;
  margin: 0.5rem 0 0.25rem;
}

.rooms p { margin: 0; color: var(--muted); }

.form-wrap {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 1rem;
}

.form-wrap iframe {
  display: block;
  width: 100%;
  height: 1000px;
  border: 0;
}

footer {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 3rem 1rem;
}

/* ---------- Sound toggle ---------- */
.sound-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--gold-light);
  background: rgba(15, 21, 34, 0.8);
  border: 1px solid rgba(184, 137, 58, 0.5);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.sound-toggle:hover { border-color: var(--gold-light); }

/* ---------- Critters ---------- */
.critters {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.critter {
  position: absolute;
  pointer-events: auto;
  will-change: transform;
}

.critter svg { display: block; width: 100%; height: 100%; }

/* Ghost: travels across, bobs, fades */
.ghost {
  top: var(--y);
  left: 0;
  width: var(--size);
  height: calc(var(--size) * 1.2);
  animation: fly-ltr var(--dur) linear forwards;
  cursor: pointer;
}

.ghost.rtl { animation-name: fly-rtl; }
.ghost.rtl .bob { transform: scaleX(-1); }

.ghost .bob {
  width: 100%;
  height: 100%;
  animation: bob 2.4s ease-in-out infinite;
  opacity: 0.75;
  filter: drop-shadow(0 0 14px rgba(190, 205, 255, 0.6));
}

.ghost.poof { animation-play-state: paused; }
.ghost.poof .bob { animation: poof 0.5s ease-out forwards; }

@keyframes bob {
  0%, 100% { translate: 0 0; rotate: -4deg; }
  50% { translate: 0 -24px; rotate: 4deg; }
}

@keyframes poof {
  to { transform: scale(1.8); opacity: 0; filter: blur(8px); }
}

/* Witch: sweeps across in an arc */
.witch {
  top: var(--y);
  left: 0;
  width: var(--size);
  height: calc(var(--size) * 0.6);
  animation: witch-ltr var(--dur) ease-in-out forwards;
}

.witch.rtl { animation-name: witch-rtl; }
.witch.rtl svg { transform: scaleX(-1); }

@keyframes witch-ltr {
  0% { transform: translate(-20vw, 0) rotate(-6deg); }
  50% { transform: translate(50vw, -8vh) rotate(0deg); }
  100% { transform: translate(120vw, 4vh) rotate(6deg); }
}

@keyframes witch-rtl {
  0% { transform: translate(120vw, 0) rotate(6deg); }
  50% { transform: translate(50vw, -8vh) rotate(0deg); }
  100% { transform: translate(-20vw, 4vh) rotate(-6deg); }
}

@keyframes fly-ltr {
  from { transform: translateX(-20vw); }
  to { transform: translateX(120vw); }
}

@keyframes fly-rtl {
  from { transform: translateX(120vw); }
  to { transform: translateX(-20vw); }
}

/* Spider: drops on a thread, wiggles, climbs back up */
.spider {
  top: 0;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  animation: drop var(--dur) ease-in-out forwards;
  pointer-events: none;
}

.spider::before {
  content: "";
  position: absolute;
  bottom: 60%;
  left: 50%;
  width: 1px;
  height: 200vh;
  background: rgba(220, 220, 230, 0.45);
}

.spider svg { animation: wiggle 0.9s ease-in-out infinite; transform-origin: 50% 0; }

@keyframes drop {
  0% { transform: translateY(-120%); }
  35%, 65% { transform: translateY(var(--drop)); }
  100% { transform: translateY(-120%); }
}

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

/* Bats */
.bat {
  top: var(--y);
  left: 0;
  width: var(--size);
  height: calc(var(--size) * 0.5);
  animation: fly-ltr var(--dur) linear forwards;
  pointer-events: none;
}

.bat.rtl { animation-name: fly-rtl; }

.bat .flap {
  width: 100%;
  height: 100%;
  animation: flap 0.25s ease-in-out infinite alternate, bob 1.6s ease-in-out infinite;
}

@keyframes flap {
  from { transform: scaleY(1); }
  to { transform: scaleY(0.4); }
}

/* ---------- Atmosphere ---------- */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  background: radial-gradient(ellipse 75% 70% at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.8) 100%);
}

.fog {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45vh;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='400'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.004 0.018' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.72  0 0 0 0 0.76  0 0 0 0 0.86  0 0 0 1.6 -0.6'/></filter><rect width='100%' height='100%' filter='url(%23f)'/></svg>");
  background-size: 900px 100%;
  background-repeat: repeat-x;
  -webkit-mask-image: linear-gradient(to top, #000 20%, transparent);
  mask-image: linear-gradient(to top, #000 20%, transparent);
  animation: fog-drift 60s linear infinite;
}

.fog-front { z-index: 12; opacity: 0.3; height: 32vh; animation-duration: 45s; }

@keyframes fog-drift {
  from { background-position-x: 0; }
  to { background-position-x: -900px; }
}

.lightning {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 11;
  background: radial-gradient(ellipse at 50% 20%, rgba(215, 225, 255, 0.9), rgba(150, 170, 230, 0.4));
  opacity: 0;
}

.lightning.strike { animation: strike 1s ease-out; }

@keyframes strike {
  0% { opacity: 0; }
  4% { opacity: 0.55; }
  12% { opacity: 0.05; }
  22% { opacity: 0.4; }
  40%, 100% { opacity: 0; }
}

.cobweb {
  position: fixed;
  top: 0;
  width: min(26vw, 220px);
  height: min(26vw, 220px);
  pointer-events: none;
  z-index: 8;
}

.cobweb-left { left: 0; }
.cobweb-right { right: 0; transform: scaleX(-1); }

/* Wraith: a face that rushes at the viewer */
.wraith {
  left: 50%;
  top: 50%;
  width: 50vmin;
  height: 70vmin;
  margin: -35vmin 0 0 -25vmin;
  pointer-events: none;
  animation: lunge 1.6s cubic-bezier(0.5, 0, 0.9, 0.4) forwards;
  filter: blur(1px) drop-shadow(0 0 30px rgba(200, 210, 255, 0.5));
}

@keyframes lunge {
  0% { transform: scale(0.1); opacity: 0; }
  55% { transform: scale(0.9); opacity: 0.55; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* Glowing eyes in the dark */
.eyes {
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: calc(var(--size) / 3);
  pointer-events: none;
  filter: drop-shadow(0 0 6px #ff1a1a);
  animation: eyes-life var(--dur) ease-in-out forwards;
}

.eyes svg { animation: blink 2.2s infinite; }

@keyframes eyes-life {
  0%, 100% { opacity: 0; }
  15%, 85% { opacity: 1; }
}

@keyframes blink {
  0%, 44%, 52%, 100% { transform: scaleY(1); }
  48% { transform: scaleY(0.05); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .critters, .lightning { display: none; }
  .fog, .title, .drips i, .hero-svg * { animation: none !important; }
  .windows .flicker { animation: none; }
}
