/* ==========================================================================
   A NIGHT OF FRIGHTS & DELIGHTS — Halloween Invitation
   css/style.css — Victorian playbill / gothic editorial

   01 Tokens & reset        06 Header / nav / ticker
   02 Type & utilities      07 Hero
   03 Scene & grain         08 Plates (rites)
   04 Buttons               09 Haunt / dress / rsvp / footer
   05 Cursor                10 Cauldron / toast / modal
   ========================================================================== */

/* ========================= 00. FONTS (self-hosted) ======================
   Latin-subset variable fonts, served from /assets/fonts. Self-hosting removes
   the render-blocking third-party request and lets us preload the two faces
   that paint above the fold.
   ======================================================================= */
@font-face {
  font-family: "Playfair Display Var";
  src: url("/assets/fonts/playfair-display-var.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Lora Var";
  src: url("/assets/fonts/lora-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Lora Var";
  src: url("/assets/fonts/lora-italic-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Caveat Var";
  src: url("/assets/fonts/caveat-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}

/* ========================= 01. TOKENS & RESET =========================== */
:root {
  --ink: #08080b;
  --ink-2: #0e0e12;
  --char: #16161b;
  --char-2: #1f1f26;

  --bone: #ece5d6;
  --bone-dim: #b9b2a4;
  --bone-faint: #7d786e;

  --blood: #b3121f;
  --blood-lite: #d8202b;
  --blood-deep: #6d0a12;

  --gold: #c9a227;

  --rule: rgba(236, 229, 214, 0.16);
  --rule-strong: rgba(236, 229, 214, 0.3);
  --rule-blood: rgba(179, 18, 31, 0.6);

  --font-display: "Playfair Display Var", "Playfair Display", "Didot", Georgia,
    "Songti SC", "Noto Serif CJK SC", serif;
  --font-serif: "Lora Var", "Lora", Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  --font-script: "Caveat Var", "Caveat", "Segoe Script", cursive;

  /* spacing scale — one rhythm for every section */
  --sp-1: clamp(10px, 1.2vw, 14px);
  --sp-2: clamp(16px, 2vw, 22px);
  --sp-3: clamp(24px, 3vw, 34px);
  --sp-4: clamp(32px, 4.4vw, 52px);
  --sp-5: clamp(56px, 8vw, 104px);

  --pad: clamp(20px, 5vw, 72px);
  --maxw: 1280px;
  --header-h: 82px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.72;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, p, figure, blockquote, dl, dd, figcaption { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
address { font-style: normal; }
strong { font-weight: 600; color: #fff; }

::selection { background: var(--blood); color: #fff; }

:focus-visible {
  outline: 1px solid var(--bone);
  outline-offset: 3px;
}

/* ======================= 02. TYPE & UTILITIES =========================== */
.section {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(60px, 7.6vw, 108px) var(--pad);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 18px;
}
.kicker span { color: var(--blood-lite); letter-spacing: 0; }

.section__head { max-width: 760px; margin-bottom: clamp(42px, 6vw, 76px); }

/* Two-column editorial header: title left, standfirst aligned to the baseline */
.section__head--split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(18px, 4vw, 64px);
  align-items: end;
  max-width: none;
}
.section__head--split .section__lead {
  margin-top: 0;
  max-width: 42ch;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--rule);
}
.section__head--left { text-align: left; margin-bottom: clamp(28px, 4vw, 44px); }

.section__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 7.2vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: -0.004em;
  text-transform: uppercase;
  color: #f4efe4;
  text-wrap: balance;
}
.section__title em {
  font-family: var(--font-script);
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.25em;
  line-height: 0.6;
  color: var(--blood-lite);
}

.section__lead {
  margin-top: var(--sp-2);
  max-width: 52ch;
  color: var(--bone-dim);
  font-size: 1.03rem;
  line-height: 1.8;
  text-wrap: pretty;
}

.section__foot {
  margin-top: clamp(40px, 5vw, 60px);
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--bone-faint);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ========================= 03. SCENE & GRAIN ============================ */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1100px 700px at 70% -10%, rgba(90, 20, 30, 0.24), transparent 62%),
    radial-gradient(900px 600px at 8% 20%, rgba(30, 34, 58, 0.5), transparent 60%),
    linear-gradient(180deg, #08080b 0%, #0b0b11 55%, #08080b 100%);
}

.scene__fog {
  position: absolute;
  inset: -25%;
  opacity: 0.5;
  background:
    radial-gradient(closest-side, rgba(120, 130, 160, 0.14), transparent) 12% 34% / 62% 54% no-repeat,
    radial-gradient(closest-side, rgba(120, 130, 160, 0.1), transparent) 78% 70% / 58% 50% no-repeat;
  animation: fogDrift 52s ease-in-out infinite alternate;
  will-change: transform;
}

.scene__particles { position: absolute; inset: 0; }
#particleCanvas { width: 100%; height: 100%; }

.scene__sprites { position: absolute; inset: 0; }

/* Fine film grain over everything — the anti-"web-gradient" texture */
.scene__grain {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

@keyframes fogDrift {
  0%   { transform: translate3d(-2%, 0, 0) scale(1); }
  50%  { transform: translate3d(2%, -2%, 0) scale(1.06); }
  100% { transform: translate3d(-1%, 2%, 0) scale(1.02); }
}

/* Floating sprite base (bats & mist, drawn by JS) */
.sprite {
  position: absolute;
  opacity: 0;
  will-change: transform, opacity;
  animation-name: spriteFloat;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
.sprite svg { width: 100%; height: auto; }

@keyframes spriteFloat {
  0%   { opacity: 0; transform: translate3d(-10vw, 0, 0) rotate(-3deg) scale(var(--s, 1)); }
  12%  { opacity: var(--o, 0.4); }
  50%  { transform: translate3d(52vw, -5vh, 0) rotate(3deg) scale(calc(var(--s, 1) * 1.05)); }
  88%  { opacity: var(--o, 0.4); }
  100% { opacity: 0; transform: translate3d(114vw, 2vh, 0) rotate(-2deg) scale(var(--s, 1)); }
}

.sprite--bat {
  color: #0a0a11;
  filter: drop-shadow(0 0 1px rgba(196, 204, 222, 0.45)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.9));
}
.sprite--mist { opacity: 0.9; }

.sprite__inner { width: 100%; animation: spriteBob 7s ease-in-out infinite alternate; }
@keyframes spriteBob {
  from { transform: translateY(-7px); }
  to   { transform: translateY(7px); }
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 140;
  background: transparent;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--blood-lite);
  transition: width 0.12s linear;
}

/* ============================ 04. BUTTONS =============================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 30px;
  border-radius: 0;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  background: none;
  transition: background 0.35s var(--ease), color 0.35s var(--ease),
    border-color 0.35s var(--ease), transform 0.35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

/* Blood block button with a clipped corner */
.btn--blood {
  background: var(--blood);
  color: #fff6ee;
  border: 1px solid var(--blood);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.btn--blood:hover { background: var(--blood-lite); border-color: var(--blood-lite); }
.btn--blood:active { transform: translateY(1px); }

/* Hairline outline button */
.btn--line {
  color: var(--bone);
  border: 1px solid var(--rule-strong);
  background: rgba(236, 229, 214, 0.02);
}
.btn--line:hover {
  border-color: var(--bone);
  background: var(--bone);
  color: var(--ink);
}
.btn--line.is-copied {
  background: var(--bone);
  border-color: var(--bone);
  color: var(--ink);
}

.btn--lg { padding: 16px 34px; font-size: 1.1rem; }
.btn--xl { padding: 19px 44px; font-size: 1.32rem; letter-spacing: 0.18em; }

.btn__arrow {
  font-family: var(--font-serif);
  font-size: 0.9em;
  transition: transform 0.35s var(--ease);
}
.btn:hover .btn__arrow { transform: translateX(5px); }
.btn__icon { font-size: 1em; opacity: 0.9; }
.btn--copy.is-copied .btn__icon { animation: popIn 0.5s var(--ease); }

@keyframes popIn {
  0% { transform: scale(0.5); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ============================= 05. CURSOR =============================== */
.cursor-ember,
.cursor-trail { display: none; }

@media (hover: hover) and (pointer: fine) {
  body.has-custom-cursor,
  body.has-custom-cursor a,
  body.has-custom-cursor button,
  body.has-custom-cursor [role="button"] { cursor: none; }

  .cursor-ember {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bone);
    pointer-events: none;
    opacity: 0;
    transform: translate3d(-50%, -50%, 0);
    transition: opacity 0.3s ease, width 0.25s ease, height 0.25s ease, background 0.25s ease;
    will-change: transform;
  }
  .cursor-ember.is-active { opacity: 1; }
  .cursor-ember.is-hover {
    width: 34px;
    height: 34px;
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--blood-lite);
  }

  /* Thin trailing rule, no glow */
  .cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9998;
    display: block;
    width: 24px;
    height: 24px;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(-50%, -50%, 0);
    /* the trailing ring lags the dot for free, without a JS render loop */
    transition: opacity 0.4s ease, transform 0.55s cubic-bezier(0.16, 0.8, 0.3, 1);
    will-change: transform;
  }
  .cursor-trail.is-active { opacity: 1; }
  .cursor-trail::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(236, 229, 214, 0.35);
    border-radius: 50%;
    animation: trailPulse 3s ease-in-out infinite;
  }
  @keyframes trailPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.18); opacity: 0.2; }
  }
}

/* ======================= 06. HEADER / NAV / TICKER ====================== */
.topbar {
  position: relative;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px var(--pad);
  background: var(--blood-deep);
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
  font-family: var(--font-serif);
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 240, 230, 0.82);
}
.topbar__right { color: rgba(255, 240, 230, 0.6); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  padding: 0 var(--pad);
  background: rgba(8, 8, 11, 0.78);
  backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid var(--rule);
  transition: background 0.4s ease, border-color 0.4s ease, height 0.4s ease;
}
.site-header.is-stuck {
  height: 66px;
  background: rgba(8, 8, 11, 0.95);
  border-bottom-color: var(--rule-strong);
}

.brand { display: inline-flex; align-items: baseline; gap: 12px; }
.brand__mark { color: var(--blood-lite); font-size: 0.9rem; }
.brand__text { display: grid; gap: 2px; }
.brand__main {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.24rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f5f0e5;
}
.brand__sub {
  font-family: var(--font-serif);
  font-size: 0.55rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

.site-nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 34px); }
.site-nav a {
  position: relative;
  font-family: var(--font-serif);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--bone-dim);
  padding: 5px 0;
  transition: color 0.3s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--blood-lite);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.site-nav a:hover { color: var(--bone); }
.site-nav a.is-active { color: var(--bone); }
.site-nav a:hover::after,
.site-nav a.is-active::after { transform: scaleX(1); transform-origin: left; }

.site-nav__cta {
  padding: 10px 18px !important;
  border: 1px solid var(--blood);
  color: #f4e9e3 !important;
  background: var(--blood);
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  font-size: 0.94rem !important;
  letter-spacing: 0.12em !important;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  transition: background 0.3s ease;
}
.site-nav__cta::after { display: none; }
.site-nav__cta:hover { background: var(--blood-lite); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  border: 1px solid var(--rule);
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 1px;
  background: var(--bone);
  transition: transform 0.35s var(--ease), opacity 0.25s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  left: var(--pad);
  right: var(--pad);
  z-index: 119;
  display: grid;
  gap: 0;
  background: #0c0c11;
  border: 1px solid var(--rule-strong);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.mobile-menu a {
  padding: 16px 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
  transition: background 0.25s ease, color 0.25s ease;
}
.mobile-menu a:last-child { border-bottom: 0; }
.mobile-menu a:hover { background: var(--blood); color: #fff; }

/* Ticker */
.ticker {
  position: relative;
  z-index: 3;
  overflow: hidden;
  background: var(--blood);
  border-top: 1px solid rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
  padding: 11px 0;
}
.ticker__track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: tickerScroll 38s linear infinite;
}
.ticker__track span {
  padding: 0 clamp(14px, 2.2vw, 28px);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff3ea;
  white-space: nowrap;
}
.ticker__track i {
  font-style: normal;
  font-size: 0.6rem;
  color: rgba(255, 240, 230, 0.55);
}
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================== 07. HERO ================================ */
.hero {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - var(--header-h) - 30px);
  min-height: calc(100svh - var(--header-h) - 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(80px, 11vh, 130px) var(--pad) clamp(90px, 12vh, 140px);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.hero__backdrop { position: absolute; inset: 0; z-index: -1; }
.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  filter: saturate(0.82) contrast(1.06) brightness(0.94);
  transform: scale(1.02);
  animation: heroDrift 40s ease-in-out infinite alternate;
}
.hero__wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 8, 11, 0.72) 0%, rgba(8, 8, 11, 0.32) 26%, rgba(8, 8, 11, 0.42) 58%, rgba(8, 8, 11, 0.94) 92%, var(--ink) 100%),
    radial-gradient(ellipse at 50% 48%, rgba(8, 8, 11, 0.1), rgba(8, 8, 11, 0.78) 96%);
}
@keyframes heroDrift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to   { transform: scale(1.08) translate3d(-1.2%, -0.8%, 0); }
}

.hero__inner {
  position: relative;
  width: 100%;
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__script {
  font-family: var(--font-script);
  font-size: clamp(1.5rem, 3.6vw, 2.35rem);
  line-height: 1;
  color: var(--blood-lite);
  transform: rotate(-2.4deg);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
  margin-bottom: 6px;
}

.hero__title { display: flex; flex-direction: column; align-items: center; }
.hero__title-line {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.15rem, 3.1vw, 1.85rem);
  letter-spacing: 0.015em;
  text-transform: none;
  color: rgba(236, 229, 214, 0.82);
}
.hero__title-big {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.9rem, 11.4vw, 9rem);
  line-height: 0.86;
  letter-spacing: -0.018em;
  text-transform: uppercase;
  color: #f7f2e7;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.9);
  margin: 0.04em 0 0.08em;
}
.hero__title-big em {
  font-family: var(--font-script);
  font-style: normal;
  text-transform: none;
  font-size: 0.58em;
  line-height: 1;
  letter-spacing: 0;
  color: var(--blood-lite);
  padding: 0 0.06em;
}
.hero__title-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--blood-lite);
  font-size: 0.7rem;
  margin: 6px 0 12px;
}
.hero__title-rule::before,
.hero__title-rule::after {
  content: "";
  width: clamp(38px, 12vw, 110px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule-strong));
}
.hero__title-rule::after { background: linear-gradient(90deg, var(--rule-strong), transparent); }

.hero__title-sub {
  font-family: var(--font-serif);
  font-size: clamp(0.62rem, 1.7vw, 0.82rem);
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--bone-dim);
  padding-left: 0.4em;
}

.hero__tagline {
  margin-top: clamp(16px, 2.6vw, 26px);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.26rem);
  color: #ded6c7;
  max-width: 34ch;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9);
}

/* Countdown — a hairline ledger strip, not a glass pill */
.countdown {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  margin-top: clamp(26px, 4vw, 40px);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  background: rgba(8, 8, 11, 0.62);
}
.countdown__unit {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: clamp(64px, 15vw, 104px);
  padding: 12px clamp(8px, 1.6vw, 20px) 10px;
  border-right: 1px solid var(--rule);
}
.countdown__unit:first-child { border-left: 1px solid var(--rule); }
.countdown__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 5vw, 2.7rem);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: #f7f2e7;
}
.countdown__num.is-tick { animation: numTick 0.5s var(--ease); }
@keyframes numTick {
  0% { transform: translateY(0); color: #f7f2e7; }
  40% { transform: translateY(-3px); color: var(--blood-lite); }
  100% { transform: translateY(0); color: #f7f2e7; }
}
.countdown__label {
  font-family: var(--font-serif);
  font-size: 0.5rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bone-faint);
}
.countdown__until {
  flex-basis: 100%;
  padding: 9px 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-serif);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-faint);
}
.countdown__until strong { color: var(--bone); font-weight: 500; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: clamp(26px, 3.6vw, 38px);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-top: clamp(22px, 3vw, 32px);
  font-family: var(--font-serif);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bone-faint);
}
.hero__meta li[aria-hidden] { color: var(--blood-lite); letter-spacing: 0; }

.hero__scroll {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--bone-faint);
  z-index: 3;
}
.hero__scroll-text {
  font-family: var(--font-serif);
  font-size: 0.52rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}
.hero__scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(180deg, var(--rule-strong), transparent);
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 14px;
  background: var(--blood-lite);
  animation: lineFall 2.4s ease-in-out infinite;
}
@keyframes lineFall {
  0% { transform: translateY(-16px); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(48px); opacity: 0; }
}

/* ============================ 08. PLATES ================================ */
.plates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
}

.plate {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #101015 0%, #0b0b0f 100%);
  border: 1px solid var(--rule);
  transition: border-color 0.5s var(--ease), transform 0.5s var(--ease);
}
.plate::after {
  /* inner engraved frame */
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(236, 229, 214, 0.07);
  pointer-events: none;
  transition: border-color 0.5s var(--ease);
  z-index: 3;
}
.plate:hover { border-color: var(--rule-strong); transform: translateY(-4px); }
.plate:hover::after { border-color: rgba(179, 18, 31, 0.5); }

.plate__media {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #05050a;
}
.plate__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.74) contrast(1.06) brightness(0.9);
  transform: scale(1.01);
  transition: transform 1.1s var(--ease);
}
.plate__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 8, 11, 0.45) 0%, transparent 32%, rgba(8, 8, 11, 0.82) 100%),
    linear-gradient(0deg, rgba(109, 10, 18, 0.28), transparent 60%);
  pointer-events: none;
}
.plate:hover .plate__media img {
  transform: scale(1.055);
}
.plate__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 50% 40%, rgba(255, 236, 214, 0.08), transparent 62%);
  opacity: 0;
  transition: opacity 0.7s var(--ease);
  pointer-events: none;
}
.plate:hover .plate__media::before,
.plate:focus-within .plate__media::before { opacity: 1; }

.plate__num {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(236, 229, 214, 0.4);
  background: rgba(8, 8, 11, 0.55);
  font-family: var(--font-serif);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--bone);
  transition: background 0.4s ease, border-color 0.4s ease;
}
.plate:hover .plate__num { background: var(--blood); border-color: var(--blood); color: #fff; }

.plate__body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: clamp(20px, 2.4vw, 30px);
  border-top: 1px solid var(--rule);
}

.plate__meta {
  font-family: var(--font-serif);
  font-size: 0.56rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--blood-lite);
}
.plate__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.42rem, 2.4vw, 1.85rem);
  line-height: 1.02;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #f4efe4;
  text-wrap: balance;
}
.plate__sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--bone-dim);
}
.plate__text {
  font-size: 0.94rem;
  line-height: 1.75;
  color: var(--bone-dim);
  margin-top: 2px;
}
.plate__list {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.plate__list li {
  position: relative;
  padding-left: 16px;
  font-family: var(--font-serif);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-faint);
}
.plate__list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.6rem;
  color: var(--blood-lite);
}

/* ======================= 09. HAUNT / DRESS / RSVP ======================= */
.haunt {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
@media (min-width: 1081px) {
  .haunt__detail {
    position: sticky;
    top: calc(var(--header-h) + 28px);
  }
}

.haunt__plate { margin: 0; }
.haunt__plate img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  filter: saturate(0.6) contrast(1.06) brightness(0.88);
}
.haunt__caption {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.78rem;
  color: var(--bone-faint);
  max-width: 46ch;
}

.haunt__detail { padding-top: 8px; }
.haunt__label {
  font-family: var(--font-serif);
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--blood-lite);
  margin-bottom: 14px;
}
.haunt__address {
  font-family: var(--font-serif);
  font-size: clamp(1.12rem, 2.4vw, 1.56rem);
  line-height: 1.6;
  color: #f4efe4;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.haunt__rule {
  height: 1px;
  margin: clamp(22px, 3vw, 30px) 0;
  background: linear-gradient(90deg, var(--rule-strong), transparent);
  position: relative;
}
.haunt__rule::after {
  content: "✦";
  position: absolute;
  left: 0;
  top: -0.62em;
  color: var(--blood-lite);
  font-size: 0.6rem;
  background: var(--ink);
  padding-right: 10px;
}

/* Ledger with dotted leaders */
.ledger { display: grid; margin-bottom: clamp(24px, 3vw, 32px); }
.ledger > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px dotted rgba(236, 229, 214, 0.16);
}
.ledger dt {
  order: 0;
  font-family: var(--font-serif);
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bone-faint);
  white-space: nowrap;
}
.ledger > div::after {
  content: "";
  order: 1;
  flex: 1;
  border-bottom: 1px dotted rgba(236, 229, 214, 0.18);
  transform: translateY(-3px);
}
.ledger dd {
  order: 2;
  flex: 0 0 auto;
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: var(--bone);
  text-align: right;
}
.btn--copy { width: 100%; }
.haunt__hint {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 0.7rem;
  font-style: italic;
  color: var(--bone-faint);
}

/* Dress */
.section--dress { padding-top: clamp(20px, 4vw, 40px); }
.dress {
  position: relative;
  text-align: center;
  padding: clamp(44px, 7vw, 92px) clamp(22px, 5vw, 72px);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background:
    linear-gradient(180deg, rgba(8, 8, 11, 0.86), rgba(8, 8, 11, 0.94)),
    url("../assets/velvet.jpg") center / cover no-repeat;
}
.dress .kicker { justify-content: center; }
.dress__script {
  font-family: var(--font-script);
  font-size: clamp(1.5rem, 3.6vw, 2.2rem);
  color: var(--blood-lite);
  transform: rotate(-1.6deg);
  margin-bottom: 10px;
}
.dress__body {
  max-width: 56ch;
  margin: 22px auto 0;
  color: var(--bone-dim);
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
  line-height: 1.85;
}
.dress__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  margin-top: 32px;
}
.dress__list li {
  padding: 0 clamp(14px, 2.4vw, 26px);
  border-right: 1px solid var(--rule-strong);
  font-family: var(--font-serif);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.dress__list li:last-child { border-right: 0; }

/* RSVP */
.section--rsvp { padding-bottom: clamp(80px, 10vw, 150px); }
.rsvp {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--rule-strong);
  background:
    linear-gradient(100deg, rgba(8, 8, 11, 0.96) 0%, rgba(8, 8, 11, 0.88) 52%, rgba(8, 8, 11, 0.8) 100%),
    url("../assets/hero-haunt.jpg") center / cover no-repeat;
  position: relative;
}
.rsvp::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(236, 229, 214, 0.1);
  pointer-events: none;
}

.rsvp__stub {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 3.4vw, 40px);
  border-right: 1px dashed rgba(236, 229, 214, 0.35);
  background: rgba(8, 8, 11, 0.72);
  text-align: left;
}
.rsvp__stub::before,
.rsvp__stub::after {
  content: "";
  position: absolute;
  right: -7px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid var(--rule-strong);
}
.rsvp__stub::before { top: -7px; }
.rsvp__stub::after { bottom: -7px; }
.rsvp__stub-top {
  font-family: var(--font-serif);
  font-size: 0.56rem;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--blood-lite);
}
.rsvp__stub-mid {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #f4efe4;
}
.rsvp__stub-bot {
  font-family: var(--font-serif);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

.rsvp__content {
  padding: clamp(30px, 5vw, 64px);
  text-align: left;
}
.rsvp__lead {
  max-width: 44ch;
  margin: 20px 0 30px;
  color: var(--bone-dim);
  font-size: 1rem;
  line-height: 1.8;
}
.rsvp__fine {
  margin-top: 24px;
  font-family: var(--font-serif);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-faint);
  word-break: break-word;
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--rule);
  padding: 48px var(--pad) 56px;
  text-align: center;
}
.site-footer__inner { max-width: var(--maxw); margin: 0 auto; }
.site-footer__mark { color: var(--blood-lite); font-size: 0.7rem; margin-bottom: 12px; }
.site-footer__line {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone);
}
.site-footer__fine {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--bone-faint);
}

/* ============================ 404 PAGE ================================== */
.error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--pad);
  background:
    radial-gradient(900px 620px at 50% 18%, rgba(90, 20, 30, 0.28), transparent 64%),
    radial-gradient(800px 560px at 82% 88%, rgba(30, 34, 58, 0.4), transparent 62%),
    var(--ink);
  text-align: center;
}
.error {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(30px, 6vw, 58px) clamp(22px, 5vw, 56px);
  border: 1px solid var(--rule-strong);
  background: rgba(11, 11, 16, 0.7);
  position: relative;
}
.error::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(236, 229, 214, 0.09);
  pointer-events: none;
}
.error__script {
  font-family: var(--font-script);
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  color: var(--blood-lite);
  transform: rotate(-2deg);
}
.error__code {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(4.6rem, 20vw, 9rem);
  line-height: 0.9;
  color: #f7f2e7;
  margin: 8px 0 6px;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.9);
}
.error__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bone);
}
.error__body {
  max-width: 40ch;
  margin: 16px 0 28px;
  color: var(--bone-dim);
  font-size: 0.98rem;
  line-height: 1.85;
}
.error__fine {
  margin-top: 26px;
  font-family: var(--font-serif);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

/* ====================== 10. CAULDRON / TOAST / MODAL ==================== */
.cauldron {
  position: fixed;
  right: clamp(14px, 2.4vw, 30px);
  bottom: clamp(14px, 2.4vw, 30px);
  z-index: 100;
  width: clamp(76px, 8.6vw, 96px);
  height: clamp(76px, 8.6vw, 96px);
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background:
    radial-gradient(circle at 50% 42%, rgba(179, 18, 31, 0.22) 0%, transparent 62%),
    radial-gradient(circle at 50% 35%, #17171d 0%, #08080b 74%);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 1), inset 0 0 22px rgba(179, 18, 31, 0.12);
  transition: transform 0.4s var(--ease), border-color 0.4s ease, box-shadow 0.4s ease;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}
.cauldron:hover {
  transform: translateY(-3px);
  border-color: rgba(179, 18, 31, 0.85);
  box-shadow: 0 22px 46px -18px rgba(0, 0, 0, 1), inset 0 0 30px rgba(179, 18, 31, 0.24),
    0 0 30px -10px rgba(255, 106, 61, 0.55);
}
.cauldron:focus-visible { outline: 2px solid var(--bone); outline-offset: 4px; }
.cauldron:active { transform: scale(0.96); }

.cauldron__svg { width: 78%; height: 78%; overflow: visible; }

.cauldron__halo {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(179, 18, 31, 0.45);
  opacity: 0.7;
  animation: haloRing 4.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes haloRing {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.1); opacity: 0.15; }
}

/* second, slower halo ring for depth */
.cauldron__pulse {
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(255, 106, 61, 0.22);
  animation: haloRing 6.5s ease-in-out infinite reverse;
  pointer-events: none;
}

/* --- brew internals --- */
.cauldron__glow { animation: brewGlow 3.4s ease-in-out infinite; transform-origin: 60px 42px; }
.cauldron__brew { animation: brewGlow 3s ease-in-out infinite reverse; }
@keyframes brewGlow {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.cauldron__swirl {
  transform-origin: 60px 44px;
  animation: swirlTurn 7s linear infinite;
  opacity: 0.9;
}
@keyframes swirlTurn {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.cauldron__bubble { animation: bubblePop 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.cauldron__bubble--2 { animation-delay: 0.7s; }
.cauldron__bubble--3 { animation-delay: 1.3s; }
.cauldron__bubble--4 { animation-delay: 1.9s; }
.cauldron__bubble--5 { animation-delay: 2.4s; }
@keyframes bubblePop {
  0% { opacity: 0.25; transform: translateY(2px) scale(0.7); }
  45% { opacity: 1; transform: translateY(-2px) scale(1.15); }
  70% { opacity: 0.8; transform: translateY(-3px) scale(1); }
  100% { opacity: 0.2; transform: translateY(1px) scale(0.6); }
}

.cauldron__spark { animation: sparkRise 2.6s ease-out infinite; }
.cauldron__spark--2 { animation-delay: 0.9s; }
.cauldron__spark--3 { animation-delay: 1.7s; }
@keyframes sparkRise {
  0% { opacity: 0; transform: translateY(3px) scale(0.6); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-9px) scale(0.2); }
}

/* --- steam: five plumes at different depths --- */
.cauldron__steam { position: absolute; top: 2%; left: 50%; width: 44%; height: 46%; transform: translateX(-50%); pointer-events: none; }
.cauldron__steam i {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 200, 0.5), rgba(236, 229, 214, 0) 70%);
  animation: steamRise 4s ease-in infinite;
}
.cauldron__steam i:nth-child(2) { left: 22%; animation-delay: 0.8s; animation-duration: 4.6s; }
.cauldron__steam i:nth-child(3) { left: 50%; animation-delay: 1.6s; animation-duration: 5.2s; width: 8px; height: 8px; }
.cauldron__steam i:nth-child(4) { left: 74%; animation-delay: 2.3s; animation-duration: 4.2s; }
.cauldron__steam i:nth-child(5) { left: 38%; animation-delay: 3s; animation-duration: 5.6s; }
@keyframes steamRise {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.5); }
  22% { opacity: 0.75; }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(2.2); }
}

/* --- fire beneath the pot --- */
.cauldron__fire {
  position: absolute;
  bottom: 6%;
  left: 50%;
  width: 46%;
  height: 20%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: -1;
  filter: blur(0.4px);
}
.cauldron__fire i {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 10px;
  height: 16px;
  border-radius: 50% 50% 42% 42%;
  background: linear-gradient(180deg, rgba(255, 176, 102, 0.9), rgba(179, 18, 31, 0.2));
  transform-origin: 50% 100%;
  animation: flameDance 1.5s ease-in-out infinite alternate;
}
.cauldron__fire i:nth-child(2) { left: 28%; width: 8px; height: 12px; animation-delay: 0.3s; animation-duration: 1.9s; }
.cauldron__fire i:nth-child(3) { left: 70%; width: 9px; height: 13px; animation-delay: 0.6s; animation-duration: 1.7s; }
@keyframes flameDance {
  from { transform: translateX(-50%) scaleY(0.85) scaleX(0.92) rotate(-4deg); opacity: 0.65; }
  to { transform: translateX(-50%) scaleY(1.15) scaleX(1.05) rotate(5deg); opacity: 1; }
}

/* --- the click: a squash-and-stretch stir + colour flash --- */
.cauldron__ring {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(179, 18, 31, 0.6);
  opacity: 0;
  pointer-events: none;
}
.cauldron.is-stirring .cauldron__ring { animation: cauldronRing 0.9s ease-out; }
@keyframes cauldronRing {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(2.1); }
}

.cauldron.is-stirring { animation: potStir 0.62s cubic-bezier(0.3, 1.4, 0.4, 1); }
@keyframes potStir {
  0% { transform: scale(1) rotate(0deg); }
  22% { transform: scale(1.14, 0.88) rotate(-5deg); }
  45% { transform: scale(0.94, 1.1) rotate(4deg); }
  68% { transform: scale(1.05, 0.96) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.cauldron.is-stirring .cauldron__swirl { animation-duration: 0.85s; }
.cauldron.is-stirring .cauldron__brew { animation: brewFlash 0.7s ease-out; }
@keyframes brewFlash {
  0% { opacity: 0.6; }
  30% { opacity: 1; filter: brightness(1.7); }
  100% { opacity: 0.9; filter: brightness(1); }
}

/* sparks that fly out of the button itself on each stir */
.cauldron__sparks { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.cauldron__sparks i {
  position: absolute;
  top: 46%;
  left: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd9b8, rgba(255, 106, 61, 0) 70%);
  animation: sparkFly 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes sparkFly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx, 0), var(--ty, -30px)) scale(0.2); }
}

/* --- ephemeral magic that escapes the pot into the page --- */
.brew-world {
  position: fixed;
  inset: 0;
  z-index: 96;
  pointer-events: none;
  overflow: hidden;
}
/* rising embers */
.brew-ember {
  position: absolute;
  width: var(--size, 6px);
  height: var(--size, 6px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 200, 0.95), rgba(255, 106, 61, 0.55) 45%, rgba(179, 18, 31, 0) 72%);
  animation: emberRise var(--dur, 2.4s) ease-out forwards;
}
@keyframes emberRise {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.4); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--dx, 0px), var(--dy, -40vh), 0) scale(1.1); }
}

/* ghostly wisps */
.brew-wisp {
  position: absolute;
  width: var(--size, 110px);
  height: var(--size, 110px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 220, 240, 0.22), rgba(180, 190, 215, 0.06) 55%, transparent 72%);
  animation: wispDrift var(--dur, 3.4s) ease-out forwards;
}
@keyframes wispDrift {
  0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 20px), var(--dy, -34vh)) scale(1.8); }
}

/* handwritten charm words */
.brew-charm {
  position: absolute;
  font-family: var(--font-script);
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  color: #ffd8b4;
  white-space: nowrap;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.95), 0 0 22px rgba(255, 106, 61, 0.5);
  animation: charmFloat var(--dur, 2.6s) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes charmFloat {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.85) rotate(-3deg); }
  18% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -110px) scale(1.02) rotate(3deg); }
}

/* one-off warm flash across the whole page */
.brew-flash {
  position: fixed;
  inset: 0;
  z-index: 94;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at var(--fx, 85%) var(--fy, 90%), rgba(255, 138, 62, 0.4), rgba(179, 18, 31, 0.14) 34%, transparent 68%);
  mix-blend-mode: screen;
  animation: brewFlashOut 0.75s ease-out forwards;
}
@keyframes brewFlashOut {
  0% { opacity: 0; }
  18% { opacity: 1; }
  100% { opacity: 0; }
}

/* the tooltip also updates with each stir */
.cauldron__tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translate(6px, -50%);
  white-space: nowrap;
  padding: 7px 12px;
  border: 1px solid var(--rule-strong);
  background: #0c0c11;
  color: var(--bone);
  font-family: var(--font-serif);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s var(--ease);
}
.cauldron:hover .cauldron__tooltip,
.cauldron:focus-visible .cauldron__tooltip { opacity: 1; transform: translate(0, -50%); }

/* Ripples */
.ripple-layer { position: fixed; inset: 0; z-index: 95; pointer-events: none; overflow: hidden; }
.ripple {
  position: absolute;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  border: 1px solid rgba(179, 18, 31, 0.6);
  animation: rippleOut 1.5s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.ripple--alt { border-color: rgba(236, 229, 214, 0.4); }
@keyframes rippleOut {
  0% { transform: scale(0.2); opacity: 0.9; }
  100% { transform: scale(14); opacity: 0; }
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 22px;
  border: 1px solid var(--rule-strong);
  background: #0c0c11;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 1);
  color: var(--bone);
  font-family: var(--font-serif);
  font-size: 0.84rem;
  transform: translate(-50%, 140%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s var(--ease), opacity 0.35s ease;
  max-width: min(92vw, 460px);
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast__icon { color: var(--blood-lite); font-size: 0.8rem; }

/* Surprise modal */
.lightning {
  position: fixed;
  inset: 0;
  z-index: 320;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 255, 255, 0.9), rgba(255, 40, 60, 0.5) 32%, rgba(120, 0, 20, 0.2) 60%, transparent 78%),
    rgba(255, 0, 40, 0.14);
  mix-blend-mode: screen;
}
.lightning.is-zap { animation: lightningZap 1.05s steps(1, end) forwards; }
@keyframes lightningZap {
  0% { opacity: 0; }
  6% { opacity: 1; }
  12% { opacity: 0.1; }
  18% { opacity: 0.95; }
  26% { opacity: 0.05; }
  34% { opacity: 0.7; }
  46% { opacity: 0.02; }
  60% { opacity: 0.32; }
  100% { opacity: 0; }
}

body.is-shaking { animation: screenShake 0.62s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes screenShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  10% { transform: translate3d(-9px, 5px, 0) rotate(-0.35deg); }
  20% { transform: translate3d(8px, -6px, 0) rotate(0.4deg); }
  30% { transform: translate3d(-7px, -3px, 0) rotate(-0.3deg); }
  42% { transform: translate3d(6px, 4px, 0) rotate(0.25deg); }
  55% { transform: translate3d(-5px, 2px, 0) rotate(-0.2deg); }
  70% { transform: translate3d(3px, -2px, 0) rotate(0.12deg); }
  85% { transform: translate3d(-2px, 1px, 0); }
}

.surprise {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 28px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.surprise.is-open { opacity: 1; visibility: visible; }
.surprise__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 6, 0.9);
  backdrop-filter: blur(6px);
}

.surprise__card {
  position: relative;
  width: min(520px, 100%);
  max-height: min(92svh, 900px);
  overflow-y: auto;
  overflow-x: hidden;
  background: #0b0b10;
  border: 1px solid var(--rule-strong);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 1);
  transform: translateY(-56px) scale(0.94);
  opacity: 0;
  transition: transform 0.6s var(--ease), opacity 0.4s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--blood) #0b0b10;
}
.surprise__card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(236, 229, 214, 0.1);
  pointer-events: none;
}
.surprise.is-open .surprise__card { transform: none; opacity: 1; }

.surprise__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(236, 229, 214, 0.4);
  background: rgba(8, 8, 11, 0.7);
  color: var(--bone);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.surprise__close:hover { background: var(--blood); border-color: var(--blood); color: #fff; }

.surprise__media { position: relative; aspect-ratio: 1 / 1.02; overflow: hidden; background: #05050a; }
.surprise__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
  filter: saturate(0.92) contrast(1.06) brightness(0.94);
  animation: trappedZoom 16s ease-in-out infinite alternate;
  /* the portrait is swapped at random per visit; a tiny fade hides the swap */
  transition: opacity 0.28s ease;
}
.surprise.is-swapping .surprise__img { opacity: 0.35; }
@keyframes trappedZoom {
  from { transform: scale(1.02); }
  to   { transform: scale(1.1); }
}
.surprise__media-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 8, 11, 0.3) 0%, transparent 22%, rgba(8, 8, 11, 0.2) 55%, rgba(11, 11, 16, 0.98) 100%),
    linear-gradient(0deg, rgba(109, 10, 18, 0.35), transparent 55%);
  pointer-events: none;
}
.surprise__stamp {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 60, 80, 0.75);
  background: rgba(80, 0, 14, 0.45);
  color: #ffdfe2;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: rotate(-5deg);
}
.surprise__admit {
  position: absolute;
  bottom: 14px;
  right: 16px;
  font-family: var(--font-serif);
  font-size: 0.52rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(236, 229, 214, 0.62);
}

.surprise__body {
  position: relative;
  margin-top: -18px;
  padding: 0 clamp(20px, 4vw, 34px) clamp(24px, 3.4vw, 32px);
  text-align: center;
}
.surprise__kicker {
  font-family: var(--font-script);
  font-size: clamp(1.2rem, 3.4vw, 1.5rem);
  color: var(--blood-lite);
  transform: rotate(-2deg);
  margin-bottom: 6px;
}
.surprise__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.95rem, 7.4vw, 2.9rem);
  line-height: 1;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: #fdf8ee;
  animation: trappedPulse 3s ease-in-out infinite;
}
@keyframes trappedPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.018); }
}
.surprise__sub {
  margin: 14px auto 0;
  max-width: 36ch;
  font-size: clamp(0.9rem, 1.9vw, 1rem);
  line-height: 1.7;
  color: var(--bone-dim);
}
.surprise__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}
.surprise__fine {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.72rem;
  color: var(--bone-faint);
}

.confetti-canvas { position: fixed; inset: 0; z-index: 350; pointer-events: none; }

/* ============================== RESPONSIVE ==============================
   Breakpoints: 1080 (haunt/ticket stack) · 960 (plates stack) · 860 (nav)
   · 720 (phone) · 420 (small phone) · landscape phones.
   Every fixed element respects safe-area insets on notched devices.
   ======================================================================= */

/* ---------- 1080px: stack the two-column blocks ---------- */
@media (max-width: 1080px) {
  .haunt { grid-template-columns: 1fr; gap: var(--sp-4); }
  .haunt__plate img { max-height: 62vh; object-fit: cover; }
  .rsvp { grid-template-columns: 1fr; }
  .rsvp__stub {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-right: 0;
    border-bottom: 1px dashed rgba(236, 229, 214, 0.35);
    text-align: left;
  }
  .rsvp__stub::before,
  .rsvp__stub::after { right: auto; left: 50%; margin-left: -6.5px; }
  .rsvp__stub::before { top: auto; bottom: -7px; }
  .rsvp__stub::after { top: -7px; bottom: auto; }
  .rsvp__stub-mid { text-align: center; }
}

/* ---------- 960px: plates become horizontal panels ---------- */
@media (max-width: 960px) {
  .section__head--split { grid-template-columns: 1fr; align-items: start; gap: var(--sp-2); }
  .section__head--split .section__lead { padding-bottom: 0; border-bottom: 0; max-width: 56ch; }
  .plates { grid-template-columns: 1fr; gap: clamp(18px, 2.6vw, 26px); }
  .plate { flex-direction: row; align-items: stretch; }
  .plate__media { flex: 0 0 40%; aspect-ratio: 3 / 3.4; }
  .plate__body { flex: 1; justify-content: center; border-top: 0; border-left: 1px solid var(--rule); }
  .section__head { max-width: 100%; }
}

/* ---------- 860px: navigation collapses ---------- */
@media (max-width: 860px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .topbar__right { display: none; }
  .topbar { justify-content: center; }
  /* Solid header: backdrop-filter is expensive on mobile GPUs */
  .site-header,
  .site-header.is-stuck {
    background: rgba(8, 8, 11, 0.96);
    backdrop-filter: none;
  }
  .scene__grain { opacity: 0.08; mix-blend-mode: normal; }
  .plate { transform: none !important; }
  .surprise__backdrop { backdrop-filter: none; background: rgba(4, 4, 6, 0.95); }
}

/* ---------- 720px: phone layout ---------- */
@media (max-width: 720px) {
  :root { --header-h: 64px; }

  .topbar { padding-left: max(var(--pad), env(safe-area-inset-left)); padding-right: max(var(--pad), env(safe-area-inset-right)); }
  .site-header { padding-left: max(var(--pad), env(safe-area-inset-left)); padding-right: max(var(--pad), env(safe-area-inset-right)); }
  .nav-toggle { width: 44px; height: 44px; }

  /* Plates stack vertically again, media on top */
  .plate { flex-direction: column; }
  .plate__media { flex: none; aspect-ratio: 4 / 4.4; }
  .plate__media img { object-position: center 46%; }
  .plate__body { border-left: 0; border-top: 1px solid var(--rule); }

  /* Hero */
  .hero {
    padding: clamp(44px, 9vh, 76px) var(--pad) clamp(76px, 11vh, 104px);
    min-height: auto;
  }
  .hero__wash {
    background:
      linear-gradient(180deg, rgba(8, 8, 11, 0.82) 0%, rgba(8, 8, 11, 0.58) 28%, rgba(8, 8, 11, 0.66) 62%, rgba(8, 8, 11, 0.97) 92%, var(--ink) 100%),
      radial-gradient(ellipse at 50% 42%, rgba(8, 8, 11, 0.4), rgba(8, 8, 11, 0.88) 100%);
  }
  .hero__script { font-size: clamp(1.3rem, 5.4vw, 1.8rem); }
  .hero__title-big { font-size: clamp(2.5rem, 12.6vw, 4.2rem); line-height: 0.88; letter-spacing: -0.02em; }
  .hero__title-line { font-size: clamp(1rem, 3.6vw, 1.3rem); }
  .hero__title-rule { margin: 8px 0 10px; }
  .hero__title-sub { font-size: 0.56rem; letter-spacing: 0.28em; padding-left: 0.28em; }
  .hero__tagline { font-size: 0.98rem; margin-top: var(--sp-2); }
  .hero__scroll { display: none; }

  /* Countdown: four equal cells that never overflow */
  .countdown { width: 100%; margin-top: var(--sp-3); }
  .countdown__unit { flex: 1 1 0; min-width: 0; padding: 10px 2px 9px; gap: 2px; }
  .countdown__num { font-size: clamp(1.5rem, 7.4vw, 2.1rem); }
  .countdown__label { font-size: 0.42rem; letter-spacing: 0.14em; }
  .countdown__until { font-size: 0.56rem; letter-spacing: 0.1em; padding: 8px 10px; }

  .hero__actions { width: 100%; flex-direction: column; gap: 10px; margin-top: var(--sp-3); }
  .hero__actions .btn { width: 100%; }
  .hero__meta { font-size: 0.52rem; letter-spacing: 0.14em; gap: 4px 10px; margin-top: var(--sp-2); }

  /* Tickets */
  .rsvp__stub { flex-direction: column; align-items: flex-start; gap: 10px; }
  .rsvp__stub-mid { text-align: left; }
  .rsvp__content { padding: 26px 20px 32px; }
  .rsvp__content .btn { width: 100%; }

  .dress { padding-left: 20px; padding-right: 20px; }
  .dress__list { flex-direction: column; gap: 16px; }
  .dress__list li { border-right: 0; }

  /* Ledger stacks label above value on narrow screens */
  .ledger > div { flex-wrap: wrap; row-gap: 2px; }
  .ledger > div::after { display: none; }
  .ledger dd { text-align: left; flex-basis: 100%; }

  /* Fixed furniture + safe areas */
  .cauldron {
    width: 60px;
    height: 60px;
    right: calc(clamp(12px, 2.4vw, 30px) + env(safe-area-inset-right));
    bottom: calc(clamp(12px, 2.4vw, 30px) + env(safe-area-inset-bottom));
  }
  .cauldron__tooltip { display: none; }
  .toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    transform: translateY(140%);
    font-size: 0.78rem;
    padding: 11px 16px;
    max-width: none;
  }
  .toast.is-visible { transform: translateY(0); }

  .surprise { padding: 12px; }
  .surprise__media { aspect-ratio: 1 / 1.02; }
  .surprise__body { padding-left: 18px; padding-right: 18px; }
  .surprise__actions .btn { flex: 1 1 140px; }

  .section { padding-left: max(var(--pad), env(safe-area-inset-left)); padding-right: max(var(--pad), env(safe-area-inset-right)); }

  /* keep the floating cauldron from covering footer copy */
  .site-footer { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
}

/* ---------- 420px: small phones ---------- */
@media (max-width: 420px) {
  :root { --pad: 18px; }
  .brand__main { font-size: 1.05rem; letter-spacing: 0.02em; }
  .brand__sub { font-size: 0.46rem; letter-spacing: 0.22em; }
  .brand__mark { display: none; }
  .topbar { font-size: 0.46rem; letter-spacing: 0.14em; padding-top: 7px; padding-bottom: 7px; }
  .hero__title-big { font-size: clamp(2.2rem, 13vw, 3.2rem); }
  .hero__title-sub { letter-spacing: 0.2em; padding-left: 0.2em; }
  .countdown__label { font-size: 0.38rem; letter-spacing: 0.1em; }
  .countdown__until { font-size: 0.5rem; }
  .countdown__num { font-size: 1.45rem; }
  .plate__num { width: 36px; height: 36px; top: 12px; left: 12px; font-size: 0.7rem; }
  .rsvp__fine, .haunt__hint { font-size: 0.62rem; }
}

/* ---------- Touch devices: no hover-only affordances, bigger targets ---------- */
@media (hover: none) {
  .btn,
  .site-nav a,
  .mobile-menu a { min-height: 44px; }
  .surprise__close { width: 44px; height: 44px; }
  .btn { min-height: 48px; }
  .plate,
  .dress__list li { transform: none !important; }
  .plate::after { border-color: rgba(236, 229, 214, 0.12); }
  .cursor-ember,
  .cursor-trail { display: none !important; }
  .hero__img { animation: none; }
}

/* ---------- Landscape phones ---------- */
@media (orientation: landscape) and (max-height: 540px) {
  .hero { min-height: auto; padding-top: 40px; padding-bottom: 56px; }
  .hero__title-big { font-size: clamp(2.2rem, 7vw, 3.4rem); }
  .hero__tagline, .hero__meta, .hero__scroll { display: none; }
  .countdown { margin-top: 18px; }
  .countdown__until { display: none; }
  .hero__title-rule { margin: 2px 0 6px; }
}

/* ---------- Short desktop viewports ---------- */
@media (max-height: 780px) and (min-width: 861px) {
  .hero { padding-top: 56px; padding-bottom: 84px; }
  .hero__scroll { display: none; }
  .hero__title-big { font-size: clamp(2.8rem, 8.4vw, 6rem); }
  .hero__tagline { margin-top: 14px; }
}

/* ============================= MOTION SAFETY ============================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__img { animation: none; }
  .sprite { display: none; }
  .cauldron__steam,
  .cauldron__halo,
  .cauldron__pulse,
  .cauldron__fire,
  .cauldron__swirl,
  .cauldron__glow,
  .brew-world { display: none; }
  .cauldron.is-stirring { animation: none; }
}
