:root {
  --ink: #07090a;
  --paper: #efe7d1;
  --orange: #ff641f;
  --orange-hot: #ff9b32;
  --red: #ba1919;
  --blue: #8ec5d7;
  --acid: #d9e353;
  --px: 0;
  --py: 0;
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow: hidden;
  background: var(--ink);
  color: #fff8e8;
  font-family: "Trebuchet MS", Arial, sans-serif;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: -4rem;
  padding: .75rem 1rem;
  background: #fff;
  color: #000;
  font-weight: 900;
}
.skip-link:focus { top: 1rem; }

.experience {
  position: relative;
  isolation: isolate;
  width: 100vw;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  background: #091016;
}

.background {
  position: absolute;
  z-index: -8;
  inset: -4%;
  background: url("assets/haunted-night.jpg") center / cover no-repeat;
  transform: translate3d(calc(var(--px) * -1.1rem), calc(var(--py) * -.7rem), 0) scale(1.07);
  animation: background-breathe 16s ease-in-out infinite alternate;
  will-change: transform;
}

.vignette {
  position: absolute;
  z-index: -4;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 5, 8, .72) 0%, rgba(4, 7, 10, .18) 48%, rgba(4, 7, 10, .27) 100%),
    radial-gradient(ellipse at center, transparent 38%, rgba(0, 0, 0, .64) 112%),
    linear-gradient(0deg, rgba(3, 5, 6, .68), transparent 32%);
}

.grain {
  position: absolute;
  z-index: 20;
  inset: -50%;
  pointer-events: none;
  opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
  animation: grain .18s steps(2) infinite;
  mix-blend-mode: soft-light;
}

.fog {
  position: absolute;
  z-index: -2;
  left: -30%;
  right: -30%;
  bottom: -10%;
  height: 42%;
  pointer-events: none;
  filter: blur(22px);
  opacity: .34;
  background:
    radial-gradient(ellipse at 18% 60%, rgba(200, 225, 224, .7), transparent 25%),
    radial-gradient(ellipse at 48% 80%, rgba(190, 217, 218, .62), transparent 28%),
    radial-gradient(ellipse at 78% 55%, rgba(196, 224, 220, .65), transparent 27%);
  animation: fog-drift 21s linear infinite alternate;
}

.fog--two {
  bottom: 5%;
  opacity: .18;
  transform: scale(.8);
  animation-duration: 29s;
  animation-direction: alternate-reverse;
}

.lightning {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 61% 7%, rgba(220, 242, 255, .9), rgba(123, 177, 211, .16) 24%, transparent 58%);
  mix-blend-mode: screen;
}

.experience.is-flashing .lightning { animation: lightning .62s steps(1); }

#embers {
  position: absolute;
  z-index: 12;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.topbar {
  position: absolute;
  z-index: 30;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.25rem, 2.5vw, 2.6rem) clamp(1.25rem, 4vw, 5rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  color: #fff;
  text-decoration: none;
  transform: rotate(-1.5deg);
}

.brand__stamp {
  display: grid;
  place-items: center;
  width: 3.15rem;
  aspect-ratio: 1;
  border: 2px solid var(--orange);
  border-radius: 50% 46% 52% 44%;
  color: var(--orange-hot);
  background: rgba(2, 3, 4, .54);
  box-shadow: 0 0 0 4px rgba(255, 100, 31, .12), inset 0 0 1rem #000;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 1.45rem;
  letter-spacing: -.08em;
}

.brand__copy { display: grid; line-height: 1; }
.brand__copy strong { font-family: Impact, "Arial Black", sans-serif; font-size: 1.1rem; letter-spacing: .11em; }
.brand__copy small { margin-top: .33rem; color: #aab2b4; font-size: .64rem; letter-spacing: .21em; }

.socials { display: flex; gap: .75rem; }

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 3rem;
  padding: 0 1rem;
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff;
  background: rgba(2, 5, 8, .62);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .22);
  backdrop-filter: blur(10px);
  text-decoration: none;
  font-size: .77rem;
  font-weight: 900;
  letter-spacing: .12em;
  transition: transform .25s ease, border-color .25s, background .25s;
}

.social-link svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.social-link:hover, .social-link:focus-visible { transform: translateY(-3px) rotate(-1deg); border-color: #fff; background: rgba(7, 9, 11, .86); }
.social-link--orange { border-color: rgba(255, 100, 31, .65); color: #ffd2b8; }

.hero {
  position: relative;
  z-index: 2;
  width: min(100%, 1920px);
  height: 100%;
  min-height: 640px;
  margin: 0 auto;
}

.hero__copy {
  position: absolute;
  z-index: 6;
  top: 19%;
  left: clamp(1.5rem, 5vw, 6rem);
  width: min(42vw, 760px);
  transform: translate3d(calc(var(--px) * .45rem), calc(var(--py) * .3rem), 0);
  will-change: transform;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .6rem;
  color: #d9e0df;
  font-size: clamp(.72rem, .8vw, .93rem);
  font-weight: 900;
  letter-spacing: .25em;
}

.eyebrow__dot {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 .3rem rgba(255, 100, 31, .16), 0 0 1.2rem var(--orange);
  animation: pulse 1.4s ease-in-out infinite;
}

.title {
  position: relative;
  display: grid;
  margin: 0;
  width: max-content;
  max-width: 100%;
  color: var(--paper);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(5rem, 9.1vw, 10.8rem);
  font-weight: 900;
  line-height: .72;
  letter-spacing: -.055em;
  text-transform: uppercase;
  transform: skewY(-3deg) rotate(-1deg);
  filter: drop-shadow(.08em .08em 0 rgba(0, 0, 0, .72));
}

.title span { display: block; }
.title__accent {
  color: var(--orange);
  -webkit-text-stroke: clamp(1px, .12vw, 3px) #2a0901;
  text-shadow: .025em .025em 0 #ffc159, .07em .07em 0 #671007;
}

.title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(176, 218, 229, .26);
  transform: translate(.035em, -.025em);
  clip-path: polygon(0 42%, 100% 36%, 100% 58%, 0 64%);
}

.tagline {
  margin: clamp(1.2rem, 2vh, 2rem) 0 0;
  color: #e7e4d9;
  font-family: Georgia, serif;
  font-size: clamp(1rem, 1.35vw, 1.62rem);
  line-height: 1.28;
  letter-spacing: .02em;
  text-shadow: 0 2px 12px #000;
}

.tagline strong { color: var(--orange-hot); font-style: italic; }

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: clamp(1.25rem, 2.5vh, 2.2rem);
}

.ca-button, .wake-button {
  position: relative;
  min-height: 3.65rem;
  border: 0;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .08em;
  transition: transform .2s ease, filter .2s ease;
}

.ca-button {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .75rem 1.1rem;
  border: 2px solid #dbd2bb;
  color: #15130f;
  background: var(--paper);
  box-shadow: .35rem .38rem 0 rgba(0, 0, 0, .65);
  transform: rotate(-1deg);
}

.ca-button__label { color: #8b1b13; }
.ca-button svg { width: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; }
.ca-button:hover, .ca-button:focus-visible { transform: rotate(1deg) translateY(-3px); filter: brightness(1.08); }

.wake-button {
  padding: .75rem 1.25rem .75rem 2.5rem;
  border: 2px solid var(--orange);
  color: #fff3e4;
  background: rgba(15, 10, 8, .72);
  box-shadow: inset 0 0 1rem rgba(255, 100, 31, .13), .35rem .38rem 0 rgba(0, 0, 0, .44);
  backdrop-filter: blur(8px);
}

.wake-button__pulse {
  position: absolute;
  left: 1rem;
  top: 50%;
  width: .72rem;
  height: .72rem;
  border-radius: 50%;
  background: #f43b2f;
  box-shadow: 0 0 1rem #ff3a2f;
  transform: translateY(-50%);
}

.wake-button:hover, .wake-button:focus-visible { transform: translateY(-3px) rotate(-1deg); background: rgba(84, 19, 9, .83); }

.character-zone {
  position: absolute;
  z-index: 5;
  right: clamp(10rem, 17vw, 23rem);
  bottom: 3.8%;
  width: min(38vw, 700px);
  height: 84%;
  pointer-events: none;
  transform: translate3d(calc(var(--px) * .85rem), calc(var(--py) * .5rem), 0);
  will-change: transform;
}

.character {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 0;
  width: min(100%, 650px);
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  transform: translateX(-50%);
  transform-origin: 50% 92%;
  animation: doll-idle 4.2s ease-in-out infinite;
}

.character img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(1.1rem 1.5rem 1rem rgba(0, 0, 0, .78)) saturate(.93) contrast(1.03);
  transition: filter .25s ease;
  user-select: none;
}

.character__glow {
  position: absolute;
  z-index: 0;
  left: 17%;
  right: 17%;
  top: 5%;
  bottom: 8%;
  border-radius: 50%;
  background: radial-gradient(circle at 44% 28%, rgba(255, 114, 27, .3), transparent 44%);
  filter: blur(25px);
  animation: glow-breathe 3s ease-in-out infinite;
}

.character-shadow {
  position: absolute;
  z-index: 0;
  left: 15%;
  right: 10%;
  bottom: -.5%;
  height: 8%;
  border-radius: 50%;
  background: rgba(0, 0, 0, .9);
  filter: blur(15px);
  animation: shadow-breathe 4.2s ease-in-out infinite;
}

.eye {
  position: absolute;
  z-index: 4;
  top: 22.1%;
  width: 1.25%;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  background: #ff271d;
  box-shadow: 0 0 .5rem .15rem #ff271d, 0 0 1.6rem .45rem rgba(255, 35, 20, .8);
  transition: opacity .14s;
}
.eye--left { left: 46.4%; }
.eye--right { left: 57.8%; }

.knife-flash {
  position: absolute;
  z-index: 5;
  left: 43%;
  top: 49%;
  width: 35%;
  height: 2px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  filter: drop-shadow(0 0 .35rem #fff);
  transform: rotate(39deg);
}

.speech {
  position: absolute;
  z-index: 8;
  top: 17%;
  right: -7%;
  min-width: 10rem;
  padding: .9rem 1rem;
  border: 3px solid #1b1610;
  color: #1b1610;
  background: var(--paper);
  box-shadow: .38rem .42rem 0 rgba(0, 0, 0, .6);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(.9rem, 1.05vw, 1.25rem);
  line-height: 1;
  letter-spacing: .05em;
  text-align: center;
  transform: rotate(5deg) scale(.88);
  opacity: 0;
  transition: opacity .18s, transform .28s cubic-bezier(.2, 1.6, .4, 1);
}

.speech::after {
  content: "";
  position: absolute;
  left: 9%;
  bottom: -1.25rem;
  border: .75rem solid transparent;
  border-top-color: var(--paper);
  transform: rotate(22deg);
}

.warning-tag {
  position: absolute;
  z-index: 8;
  left: 10%;
  bottom: 10%;
  padding: .5rem .8rem;
  border: 2px solid #21140a;
  color: #251207;
  background: #ffb11f;
  box-shadow: .25rem .3rem 0 rgba(0, 0, 0, .5);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(.7rem, .72vw, .92rem);
  letter-spacing: .12em;
  transform: rotate(-10deg);
  animation: tag-wiggle 2.3s ease-in-out infinite;
}

.character:hover img { filter: drop-shadow(1.1rem 1.5rem 1rem rgba(0, 0, 0, .78)) saturate(1.06) contrast(1.04); }

.is-awake .character { animation: doll-attack .82s cubic-bezier(.2, .75, .3, 1); }
.is-awake .eye { opacity: 1; animation: eye-flicker .82s steps(2); }
.is-awake .knife-flash { animation: blade-flash .65s ease .12s; }
.is-awake .speech { opacity: 1; transform: rotate(2deg) scale(1); }
.is-awake .title { animation: title-shock .55s steps(2); }

.lore-card {
  position: absolute;
  z-index: 10;
  right: clamp(1.5rem, 3.8vw, 4.8rem);
  bottom: 13%;
  width: clamp(250px, 18.5vw, 350px);
  padding: 1.25rem 1.3rem 1.15rem;
  border: 1px solid rgba(61, 45, 28, .5);
  color: #211a13;
  background:
    linear-gradient(rgba(239, 231, 209, .94), rgba(218, 203, 171, .96)),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(57, 40, 24, .08) 23px);
  box-shadow: .7rem .9rem 1.5rem rgba(0, 0, 0, .48);
  transform: rotate(1.8deg) translate3d(calc(var(--px) * -.35rem), calc(var(--py) * -.2rem), 0);
}

.lore-card::before {
  content: "";
  position: absolute;
  inset: .38rem;
  border: 1px dashed rgba(62, 40, 21, .38);
  pointer-events: none;
}

.lore-card__pin {
  position: absolute;
  top: -.55rem;
  left: 48%;
  width: 1rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff704d, #7e0b06 68%);
  box-shadow: .2rem .3rem .3rem rgba(0, 0, 0, .5);
}

.lore-card__case { margin: 0 0 .3rem; color: #9a2318; font-size: .7rem; font-weight: 900; letter-spacing: .2em; }
.lore-card h2 { margin: 0 0 .72rem; font-family: Impact, "Arial Black", sans-serif; font-size: clamp(1.4rem, 1.65vw, 2rem); letter-spacing: .04em; }
.lore-card > p:not(.lore-card__case) { margin: .55rem 0; font-family: Georgia, serif; font-size: clamp(.78rem, .76vw, .92rem); line-height: 1.42; }
.lore-card em { color: #8c150f; font-weight: 700; }
.lore-card dl { margin: .9rem 0 0; display: grid; gap: .35rem; }
.lore-card dl div { display: flex; justify-content: space-between; gap: .6rem; border-top: 1px solid rgba(57, 37, 18, .24); padding-top: .35rem; }
.lore-card dt, .lore-card dd { margin: 0; font-size: .68rem; font-weight: 900; letter-spacing: .08em; }
.lore-card dt { color: #8c150f; }

.footer {
  position: absolute;
  z-index: 16;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.5rem;
  overflow: hidden;
  background: rgba(2, 3, 4, .78);
  backdrop-filter: blur(8px);
}

.hazard-tape {
  position: absolute;
  left: -2%;
  bottom: 1.8rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: 104%;
  height: 2rem;
  padding: 0 1.5rem;
  overflow: hidden;
  color: #241200;
  background: var(--orange-hot);
  border-block: 2px solid #180c00;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: .78rem;
  letter-spacing: .13em;
  white-space: nowrap;
  transform: rotate(-.5deg);
}
.hazard-tape span { flex: 1 0 auto; }
.footer p { position: absolute; right: 2rem; bottom: .28rem; margin: 0; color: #8f999d; font-size: .58rem; letter-spacing: .17em; }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 5rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .8rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff;
  background: #111614;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .5);
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .11em;
  transform: translate(-50%, 1rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .25s;
}
.toast svg { width: 1.1rem; fill: none; stroke: var(--acid); stroke-width: 2.5; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes background-breathe {
  from { transform: translate3d(calc(var(--px) * -1.1rem), calc(var(--py) * -.7rem), 0) scale(1.07); }
  to { transform: translate3d(calc(var(--px) * -1.1rem), calc(var(--py) * -.7rem), 0) scale(1.11); }
}
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(3%, -2%); } 50% { transform: translate(-2%, 3%); } 75% { transform: translate(2%, 4%); } 100% { transform: translate(-3%, -1%); } }
@keyframes fog-drift { from { transform: translateX(-4%) scaleY(.9); } to { transform: translateX(9%) scaleY(1.15); } }
@keyframes lightning { 0%, 18%, 28%, 100% { opacity: 0; } 8%, 23% { opacity: .85; } }
@keyframes pulse { 50% { transform: scale(.65); opacity: .7; } }
@keyframes doll-idle { 0%, 100% { transform: translateX(-50%) translateY(0) rotate(-.35deg); } 50% { transform: translateX(-50%) translateY(-1.1%) rotate(.55deg); } }
@keyframes glow-breathe { 50% { opacity: .58; transform: scale(1.04); } }
@keyframes shadow-breathe { 50% { transform: scaleX(.92); opacity: .72; } }
@keyframes tag-wiggle { 50% { transform: rotate(-7deg) translateY(-2px); } }
@keyframes doll-attack { 0% { transform: translateX(-50%) translateY(0) scale(1); } 40% { transform: translateX(-55%) translateY(-4%) scale(1.16) rotate(-3deg); } 70% { transform: translateX(-48%) translateY(-1%) scale(1.04) rotate(2deg); } 100% { transform: translateX(-50%) translateY(0) scale(1); } }
@keyframes eye-flicker { 0%, 25%, 55%, 100% { opacity: 1; } 18%, 48% { opacity: .18; } }
@keyframes blade-flash { 0%, 100% { opacity: 0; transform: rotate(39deg) translateX(-50%); } 45% { opacity: 1; transform: rotate(39deg) translateX(55%); } }
@keyframes title-shock { 0%, 100% { transform: skewY(-3deg) rotate(-1deg) translate(0); } 25% { transform: skewY(-3deg) rotate(-1deg) translate(-5px, 2px); } 65% { transform: skewY(-3deg) rotate(-1deg) translate(5px, -2px); } }

@media (max-width: 1180px) {
  .character-zone { right: 16vw; width: 43vw; }
  .lore-card { width: 250px; right: 1.5rem; }
  .hero__copy { width: 46vw; }
  .title { font-size: clamp(4.6rem, 8.6vw, 7.5rem); }
}

@media (max-width: 840px), (max-height: 660px) {
  body { overflow: auto; }
  .experience { min-height: 100svh; height: auto; overflow: clip; }
  .hero { min-height: 1120px; height: auto; padding-bottom: 6rem; }
  .topbar { position: relative; gap: 1rem; }
  .brand__copy { display: none; }
  .social-link { min-height: 2.7rem; padding: 0 .75rem; }
  .social-link span:last-child { display: none; }
  .hero__copy { top: 7rem; left: 1.25rem; width: calc(100% - 2.5rem); text-align: center; }
  .eyebrow { justify-content: center; }
  .title { margin-inline: auto; font-size: clamp(4.5rem, 20vw, 7.5rem); }
  .tagline { font-size: 1.15rem; }
  .actions { justify-content: center; }
  .character-zone { top: 23rem; right: 5%; bottom: auto; width: 90%; height: 610px; }
  .speech { right: 0; top: 16%; }
  .lore-card { top: 50rem; right: 50%; bottom: auto; width: min(86%, 410px); transform: translateX(50%) rotate(1deg); }
  .footer { position: absolute; }
  .footer p { display: none; }
}

@media (max-width: 520px) {
  .topbar { padding: 1rem; }
  .brand__stamp { width: 2.65rem; }
  .hero__copy { top: 6rem; }
  .title { font-size: clamp(3.9rem, 22vw, 6.5rem); }
  .actions { display: grid; grid-template-columns: 1fr; margin-inline: auto; width: min(100%, 310px); }
  .ca-button, .wake-button { justify-content: center; width: 100%; }
  .character-zone { top: 24.5rem; height: 520px; }
  .lore-card { top: 47.5rem; }
  .hero { min-height: 1080px; }
  .warning-tag { left: 3%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .background, .hero__copy, .character-zone, .lore-card { transform: none; }
  #embers, .fog { display: none; }
}

