/* ==========================================================================
   The Haunting at Palm House
   Palette from the 2026 Haunting brand guide.
   ========================================================================== */

@font-face {
  font-family: "Fell";
  src: url("../fonts/imfell-roman.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fell";
  src: url("../fonts/imfell-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Fell SC";
  src: url("../fonts/imfell-sc.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --dead-leaves: #B25538;
  --duskwine: #301C1E;
  --mourning-veil: #4B384C;
  --ghost-mist: #507282;
  --abyss: #000000;
  --dried-blood: #431F14;
  --grave-dust: #604D50;
  --witchs-lichen: #9E9A35;
  --bog-water: #192326;
  --aged-bone: #D1BEA4;

  --ink: #0b0809;
  --bone-dim: rgba(209, 190, 164, .62);
  --bone-faint: rgba(209, 190, 164, .22);

  --serif: "Fell", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sc: "Fell SC", "Fell", Georgia, serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--aged-bone);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--dead-leaves); color: var(--aged-bone); }
:focus-visible { outline: 1px dashed var(--aged-bone); outline-offset: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Film grain over everything */
.grain {
  position: fixed; inset: -50%;
  z-index: 100; pointer-events: none;
  background: url("../img/grain.png");
  opacity: .07;
  mix-blend-mode: overlay;
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-4%, 3%); }
  40%  { transform: translate(3%, -5%); }
  60%  { transform: translate(-6%, -2%); }
  80%  { transform: translate(5%, 4%); }
  100% { transform: translate(-2%, 6%); }
}

.eyebrow {
  font-family: var(--sc);
  font-size: clamp(.8rem, 1.1vw, .95rem);
  letter-spacing: .32em;
  color: var(--bone-dim);
  margin: 0;
}

/* Shared line-art styling */
.branch path, .cobweb path, .curl path, .eye .rays, .eye .lid {
  fill: none;
  stroke: var(--aged-bone);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.draw path[pathLength] {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}
.draw.is-drawn path[pathLength] {
  animation: draw var(--dur, 1.4s) cubic-bezier(.55, .1, .3, 1) forwards;
  animation-delay: calc(var(--t, 0s) + var(--delay, 0s));
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ==========================================================================
   1 — HERO
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--abyss);
}

.hero__bg {
  position: absolute; inset: 0; z-index: -5;
}
.hero__bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 60%;
  filter: saturate(.9) contrast(1.05);
  transform-origin: 50% 70%;
  animation: drift 40s ease-in-out infinite alternate;
  opacity: 0;
  transition: opacity 2.4s ease;
}
.is-loaded .hero__bg img { opacity: 1; }
@keyframes drift {
  from { transform: scale(1.12) translate3d(-1.5%, 0, 0); }
  to   { transform: scale(1.02) translate3d(1.5%, -1%, 0); }
}

/* Fog: tileable textures sliding sideways */
.fog {
  position: absolute; left: 0; z-index: -4;
  width: 200%;
  pointer-events: none;
  background-repeat: repeat-x;
  background-size: 50% 100%;
  will-change: transform;
}
.fog--back {
  bottom: 8%; height: 55%;
  background-image: url("../img/fog-a.webp");
  opacity: .28;
  animation: fog 140s linear infinite;
}
.fog--front {
  bottom: -10%; height: 50%;
  background-image: url("../img/fog-b.webp");
  opacity: .42;
  animation: fog 80s linear infinite reverse;
}
@keyframes fog { to { transform: translate3d(-50%, 0, 0); } }

/* Darkness, lit by a candle that follows the cursor (set from JS) */
.candle {
  --x: 50%; --y: 45%; --r: 46vmax;
  position: absolute; inset: 0; z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(circle var(--r) at var(--x) var(--y),
      rgba(255, 170, 90, .10) 0%,
      rgba(255, 150, 80, .04) 22%,
      transparent 40%),
    radial-gradient(circle var(--r) at var(--x) var(--y),
      rgba(5, 3, 4, 0) 0%,
      rgba(5, 3, 4, .18) 36%,
      rgba(5, 3, 4, .66) 76%,
      rgba(5, 3, 4, .86) 100%);
}

.hero__branches {
  position: absolute; inset: 0; z-index: -2;
  pointer-events: none;
}
.hero__branches .branch {
  position: absolute; bottom: 0;
  height: min(92%, 860px); width: auto;
  opacity: .5;
}
.hero__branches .branch--l { left: 0; }
.hero__branches .branch--r { right: 0; transform: scaleX(-1); }

/* Bats spawned from JS */
.bat {
  position: absolute; z-index: -1;
  width: var(--s, 46px); height: auto;
  fill: var(--abyss);
  pointer-events: none;
  offset-rotate: 0deg;
  animation: batfly var(--fly, 7s) cubic-bezier(.45, .05, .55, .95) forwards;
}
.bat svg { width: 100%; height: auto; display: block; animation: flap .16s ease-in-out infinite alternate; transform-origin: 50% 40%; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(.35); } }
@keyframes batfly { from { offset-distance: 0%; } to { offset-distance: 100%; } }

.hero__content {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 6rem var(--gutter) 7rem;
  max-width: 54rem;
}

.hero__content > * {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(6px);
  transition: opacity 1.6s ease, transform 1.6s cubic-bezier(.2, .7, .2, 1), filter 1.6s ease;
  transition-delay: calc(var(--i, 0) * 180ms + 500ms);
}
.is-loaded .hero__content > * { opacity: 1; transform: none; filter: none; }

.hero h1 { margin: 1.4rem 0 0; line-height: 0; }
.hero h1 img {
  width: min(80vw, 620px);
  height: auto;
  filter: drop-shadow(0 6px 30px rgba(0, 0, 0, .65)) drop-shadow(0 0 1px rgba(0, 0, 0, .8));
  animation: flicker 9s infinite;
}
@keyframes flicker {
  0%, 18%, 22%, 61%, 63%, 100% { opacity: 1; }
  19% { opacity: .82; }
  21% { opacity: .94; }
  62% { opacity: .88; }
}

.lockup {
  display: flex; align-items: center; justify-content: center; gap: .9rem;
  margin: .9rem 0 0;
  font-family: var(--sc);
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  letter-spacing: .22em;
  color: var(--aged-bone);
  text-shadow: 0 2px 18px rgba(0, 0, 0, .8);
}
.lockup .curl { width: clamp(46px, 9vw, 96px); height: auto; }
.lockup .curl path { stroke-width: 1.1; }
.lockup .curl .dia { fill: var(--aged-bone); stroke: none; }
.lockup .curl--l { transform: scaleX(-1); }

.dates {
  margin: 2.2rem 0 0;
  font-style: italic;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--aged-bone);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .9);
}
.dates .sep { color: var(--dead-leaves); padding: 0 .55em; font-style: normal; }
.nights {
  display: block;
  margin-top: .35rem;
  font-family: var(--sc);
  font-style: normal;
  font-size: .78em;
  letter-spacing: .26em;
  color: var(--witchs-lichen);
  min-height: 1.5em;
}

/* Ticket-stub reservation button.
   The glow lives on the wrapper because the notch mask would clip it. */
.ticket-wrap {
  margin-top: 2.2rem;
  filter: drop-shadow(0 0 18px rgba(178, 85, 56, .45)) drop-shadow(0 6px 16px rgba(0, 0, 0, .6));
  animation: ember 3.6s ease-in-out infinite;
}
@keyframes ember {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(178, 85, 56, .35)) drop-shadow(0 6px 16px rgba(0, 0, 0, .6)); }
  50%      { filter: drop-shadow(0 0 28px rgba(178, 85, 56, .65)) drop-shadow(0 6px 16px rgba(0, 0, 0, .6)); }
}
.ticket {
  --notch: 9px;
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center;
  padding: 1.1rem 2.8rem 1.05rem;
  background: var(--dead-leaves);
  color: #FBF4E8;
  text-decoration: none;
  -webkit-mask:
    radial-gradient(circle var(--notch) at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
          mask:
    radial-gradient(circle var(--notch) at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
  transition: background-color .4s ease, color .4s ease, transform .4s cubic-bezier(.2, .7, .2, 1);
}
.ticket::before {
  content: "";
  position: absolute; inset: 5px 14px;
  border: 1px dashed rgba(251, 244, 232, .5);
  pointer-events: none;
  transition: border-color .4s ease;
}
.ticket__main {
  font-family: var(--sc);
  font-size: 1.2rem;
  letter-spacing: .24em;
  line-height: 1.2;
}
.ticket__sub {
  font-style: italic;
  font-size: .84rem;
  opacity: .85;
  margin-top: .15rem;
}
.ticket:hover, .ticket:focus-visible {
  background: var(--aged-bone);
  color: var(--duskwine);
  transform: translateY(-2px) rotate(-1deg);
}
.ticket:hover::before, .ticket:focus-visible::before { border-color: rgba(48, 28, 30, .45); }

.address {
  margin-top: 1.5rem;
  font-style: normal;
  font-size: 1.02rem;
  color: var(--bone-dim);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .9);
}
.address a { text-decoration: none; border-bottom: 1px solid var(--bone-faint); transition: color .3s, border-color .3s; }
.address a:hover { color: var(--aged-bone); border-color: var(--aged-bone); }

.descend {
  position: absolute; left: 50%; bottom: 1.6rem;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  text-decoration: none;
  font-family: var(--sc);
  font-size: .75rem;
  letter-spacing: .34em;
  color: var(--bone-dim);
  opacity: 0;
  transition: opacity 2s ease 2.4s, color .3s;
}
.is-loaded .descend { opacity: 1; }
.descend:hover { color: var(--aged-bone); }
.descend__drip {
  width: 1px; height: 44px;
  background: linear-gradient(var(--bone-dim), transparent);
  transform-origin: top;
  animation: drip 2.8s cubic-bezier(.6, 0, .3, 1) infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ==========================================================================
   2 — THE TALE + PRESS
   ========================================================================== */

.tale {
  position: relative;
  padding: clamp(6rem, 14vw, 11rem) var(--gutter) clamp(3.5rem, 7vw, 5rem);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(75, 56, 76, .32), transparent 70%),
    linear-gradient(var(--abyss), var(--ink) 18%, #120a0c);
  overflow: hidden;
}
.tale .cobweb {
  position: absolute; top: 0; left: 0;
  width: clamp(150px, 26vw, 320px); height: auto;
  opacity: .32;
}
.tale .cobweb path { stroke-width: .8; }
.cobweb .silk { stroke-width: .6; }
.cobweb .spider { fill: var(--aged-bone); }
.cobweb .spider path { fill: none; stroke: var(--aged-bone); stroke-width: 1; }
.cobweb .spider {
  opacity: 0; transition: opacity .8s ease 1.9s;
  animation: dangle 6s ease-in-out infinite alternate;
  transform-box: fill-box;
}
.cobweb.is-drawn .spider { opacity: 1; }
@keyframes dangle { from { translate: 0 -6px; } to { translate: 0 8px; } }

.tale__inner { max-width: 46rem; margin: 0 auto; text-align: center; }

.tale h2 {
  margin: 1.2rem 0 2.4rem;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(2.3rem, 6vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -.01em;
}
.tale h2 em { font-style: normal; color: var(--dead-leaves); }

.tale__copy {
  margin: 0;
  font-size: clamp(1.28rem, 2.3vw, 1.62rem);
  line-height: 1.55;
  text-align: left;
  hyphens: manual;
}
.tale__copy::first-letter {
  float: left;
  font-family: var(--sc);
  font-size: 4.6em;
  line-height: .8;
  padding: .06em .12em 0 0;
  color: var(--dead-leaves);
}
.tale__copy + .tale__copy { margin-top: 1.4rem; }
.tale__copy--small {
  font-style: italic;
  color: var(--bone-dim);
  font-size: clamp(1.1rem, 1.8vw, 1.28rem);
}
.tale__copy--small::first-letter { all: unset; }

/* Divider: rule — sunburst eye — rule */
.divider {
  display: flex; align-items: center; gap: 1.2rem;
  max-width: 46rem;
  margin: clamp(4rem, 9vw, 6.5rem) auto;
}
.divider::before, .divider::after {
  content: "";
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--bone-faint) 40%, var(--bone-faint));
}
.divider::after { transform: scaleX(-1); }
.eye { width: 88px; height: 88px; flex: none; overflow: visible; }
.eye .rays { stroke-width: 1; opacity: .55; transform-origin: center; animation: spin 90s linear infinite; }
.eye .lid { stroke-width: 1.3; fill: var(--ink); }
.eye .iris circle { fill: var(--witchs-lichen); }
.eye .iris .pupil { fill: var(--abyss); }
.eye .iris .glint { fill: var(--aged-bone); }
.eye .iris { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.eye .lid, .eye .iris { animation: blink 7s infinite; transform-origin: center; transform-box: fill-box; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink {
  0%, 46%, 50%, 100% { scale: 1 1; }
  48% { scale: 1 .08; }
}

/* Press register */
.press { max-width: 52rem; margin: 0 auto; }
.press__head { text-align: center; margin-bottom: 2.6rem; }
.press__head h3 {
  margin: .9rem 0 0;
  font-weight: 400; font-style: italic;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.1;
}
.press ol { list-style: none; margin: 0; padding: 0; counter-reset: press; }
.press li { counter-increment: press; }
.press a {
  position: relative;
  display: flex; align-items: baseline; gap: .9rem;
  padding: 1.05rem .2rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(209, 190, 164, .1);
  transition: color .35s ease, padding .5s cubic-bezier(.2, .7, .2, 1);
}
.press li:first-child a { border-top: 1px solid rgba(209, 190, 164, .1); }
.press a::before {
  content: counter(press, upper-roman) ".";
  font-family: var(--sc);
  font-size: .78rem;
  letter-spacing: .1em;
  color: var(--dead-leaves);
  min-width: 2.4rem;
}
.press__pub {
  font-family: var(--sc);
  font-size: 1.02rem;
  letter-spacing: .2em;
  white-space: nowrap;
}
.press__leader {
  flex: 1;
  min-width: 2rem;
  border-bottom: 1px dotted var(--bone-faint);
  transform: translateY(-.3em);
}
.press__title {
  font-style: italic;
  color: var(--bone-dim);
  text-align: right;
  transition: color .35s ease;
}
.press__arrow {
  font-family: var(--serif);
  color: var(--bone-dim);
  transition: transform .4s cubic-bezier(.2, .7, .2, 1), color .35s;
}
.press a:hover, .press a:focus-visible { padding-left: .9rem; }
.press a:hover .press__title, .press a:focus-visible .press__title { color: var(--aged-bone); }
.press a:hover .press__arrow, .press a:focus-visible .press__arrow { color: var(--dead-leaves); transform: translate(3px, -3px); }

@media (max-width: 640px) {
  .press a { display: grid; grid-template-columns: 2.4rem 1fr auto; row-gap: .2rem; }
  .press a::before { grid-row: 1 / span 2; padding-top: .2rem; }
  .press__pub { grid-column: 2; white-space: normal; }
  .press__leader { display: none; }
  .press__title { grid-column: 2; grid-row: 2; text-align: left; }
  .press__arrow { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
}

/* ==========================================================================
   3 — GALLERY
   ========================================================================== */

.gallery {
  position: relative;
  padding: clamp(3.5rem, 7vw, 5.5rem) 0 clamp(4rem, 8vw, 6rem);
  background:
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(80, 114, 130, .16), transparent 70%),
    linear-gradient(#120a0c, var(--bog-water) 30%, #0c1213);
  overflow: hidden;
}
.gallery .cobweb {
  position: absolute; top: 0; right: 0;
  width: clamp(120px, 20vw, 240px); height: auto;
  transform: scaleX(-1);
  opacity: .26;
}
.gallery .cobweb path { stroke-width: .8; }
.gallery__head {
  text-align: center;
  padding: 0 var(--gutter);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.gallery__head h2 {
  margin: .9rem 0 0;
  font-weight: 400; font-style: italic;
  font-size: clamp(2.1rem, 5.4vw, 3.8rem);
  line-height: 1.05;
}

.rows {
  display: grid;
  gap: clamp(1.75rem, 3.5vw, 3rem);
  -webkit-mask: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.row {
  --h: clamp(260px, 42vh, 540px);
  --gap: clamp(1.25rem, 2.6vw, 2.5rem);
  overflow: hidden;
}
.track {
  display: flex;
  align-items: flex-start;
  width: max-content;
  animation: marquee var(--dur, 160s) linear infinite;
  will-change: transform;
}
.row--rev .track { animation-direction: reverse; }
.row:hover .track { animation-play-state: paused; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

.shot {
  margin: 0 var(--gap) 0 0;
  flex: none;
}
.shot__frame, .shot > img {
  display: block;
  height: var(--h);
  width: auto;
}
.shot img {
  height: var(--h);
  width: auto;
  max-width: none;
  filter: brightness(.9) saturate(.95);
  transition: filter .7s ease;
}
.shot:hover img { filter: brightness(1.05) saturate(1.05); }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.foot {
  position: relative;
  padding: clamp(4rem, 8vw, 6rem) var(--gutter) 2.2rem;
  background: var(--abyss);
  text-align: center;
}
.foot__mark { width: 64px; height: auto; margin: 0 auto 1.6rem; fill: var(--aged-bone); opacity: .85; }
.foot__cta {
  margin: 0;
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.25;
}
.foot__cta a {
  color: var(--aged-bone);
  text-decoration: none;
  background: linear-gradient(var(--dead-leaves), var(--dead-leaves)) 0 100% / 0 1px no-repeat;
  transition: background-size .6s cubic-bezier(.2, .7, .2, 1), color .3s;
  padding-bottom: .1em;
}
.foot__cta a:hover { background-size: 100% 1px; color: #e8d8c0; }
.foot__addr { margin: 1rem 0 0; font-style: normal; color: var(--bone-dim); }
.foot__addr a { text-decoration: none; }
.foot__addr a:hover { color: var(--aged-bone); }
.foot__legal {
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(209, 190, 164, .1);
  max-width: 60rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 2rem;
  font-family: var(--sc);
  font-size: .74rem;
  letter-spacing: .18em;
  color: rgba(209, 190, 164, .45);
}
.foot__legal p { margin: 0; }
@media (max-width: 640px) { .foot__legal { justify-content: center; text-align: center; } }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(4px);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.2, .7, .2, 1), filter 1.2s ease;
  transition-delay: var(--delay, 0s);
}
.reveal.is-in { opacity: 1; transform: none; filter: none; }
.no-js .reveal, .no-js .hero__content > *, .no-js .hero__bg img, .no-js .descend { opacity: 1; transform: none; filter: none; }
.no-js .draw path[pathLength] { stroke-dashoffset: 0; }

@media (max-width: 720px) {
  .hero__branches .branch { height: 62%; opacity: .38; }
  .hero__content { padding-top: 5rem; padding-bottom: 6.5rem; }
  .row { --h: clamp(230px, 36vh, 360px); }
  .divider { gap: .8rem; }
  .eye { width: 72px; height: 72px; }
}

/* Respect reduced motion: keep everything visible and still */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .draw path[pathLength] { stroke-dashoffset: 0; }
  .cobweb .spider { opacity: 1; }
  .rows { -webkit-mask: none; mask: none; }
  .row { overflow-x: auto; scrollbar-width: none; }
  .row::-webkit-scrollbar { display: none; }
  .track [aria-hidden="true"] { display: none; }
}
.foot__addr span { display: inline-block; }
