/* Halloway: The Call title page -- the house itself.
 *
 * Shell-only (not part of the hunt-engine layer). The root cover is a portrait SVG
 * house scene from house-scene.js with the painted keyhole profile art worked
 * into the doorway: one front door to the Landing, tappable moon/window/lamp
 * details, and the keyed wordmark below. Mobile-first; calm under reduced
 * motion. */

body.title-body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(88% 56% at 50% 0%, rgba(37, 27, 55, 0.62), transparent 70%),
    linear-gradient(180deg, rgba(10, 9, 19, 0.98) 0%, rgba(5, 5, 11, 1) 58%, #030308 100%),
    #05050b;
  color: #f0ecff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.title-root {
  min-height: 100svh;
}

.title-stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding:
    calc(env(safe-area-inset-top, 0px) + 1rem)
    1rem
    calc(env(safe-area-inset-bottom, 0px) + 1.35rem);
}

.title-stage::before,
.title-stage::after,
.title-rake,
.title-haze {
  content: "";
  position: absolute;
  pointer-events: none;
}

.title-stage::before {
  inset: 0;
  background:
    radial-gradient(54% 34% at calc(var(--rake-x, 48) * 1%) calc(var(--rake-y, 42) * 1%), rgba(237, 226, 255, 0.12), transparent 66%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.76), transparent 46%, rgba(0, 0, 0, 0.86));
}

.title-stage::after {
  inset: auto 0 0;
  height: 54%;
  background:
    linear-gradient(180deg, transparent, rgba(18, 12, 29, 0.36) 48%, rgba(55, 28, 31, 0.18)),
    radial-gradient(74% 36% at 50% 76%, rgba(178, 126, 132, 0.13), transparent 72%);
}

.title-rake {
  inset: 0;
  z-index: 1;
  mix-blend-mode: screen;
  background:
    radial-gradient(
      38% 32% at calc(var(--rake-x, 48) * 1%) calc(var(--rake-y, 42) * 1%),
      rgba(238, 229, 255, 0.14),
      rgba(238, 229, 255, 0.035) 42%,
      transparent 70%
    );
}

.title-paintwash {
  position: absolute;
  inset: -10% -28% 14%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.16;
  filter: saturate(0.92) sepia(0.14) hue-rotate(312deg) contrast(1.04) brightness(0.74) blur(1.2px);
  mix-blend-mode: screen;
  transform: translate3d(calc(var(--approach-x, 0) * -0.28px), calc(var(--approach-y, 0) * -0.16px), 0);
  -webkit-mask-image: radial-gradient(ellipse at 50% 48%, #000 0 16%, rgba(0, 0, 0, 0.58) 38%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 48%, #000 0 16%, rgba(0, 0, 0, 0.58) 38%, transparent 70%);
}

.title-paintwash-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  transform: scale(1.08);
}

.title-haze {
  z-index: 1;
  height: 42%;
  width: 70%;
  bottom: 6%;
  opacity: 0.34;
  filter: blur(18px);
  background:
    linear-gradient(90deg, transparent, rgba(100, 64, 103, 0.18), transparent),
    linear-gradient(180deg, transparent, rgba(178, 126, 132, 0.08), transparent);
  transform: translate3d(calc(var(--approach-x, 0) * -0.5px), 0, 0);
}

.title-haze--left {
  left: -18%;
}

.title-haze--right {
  right: -22%;
  bottom: 20%;
  opacity: 0.28;
  transform: translate3d(calc(var(--approach-x, 0) * 0.4px), 0, 0);
}

.title-composition {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 0.68rem;
  width: min(100%, 34rem);
}

.title-house-wrap {
  position: relative;
  width: min(100%, 21.5rem);
  min-width: min(100%, 17.25rem);
  transform:
    translate3d(calc(var(--house-x, 0) * 1px), calc(var(--house-y, 0) * 1px), 0)
    rotate(calc(var(--hall-x, 0) * 0.28deg));
  transform-origin: 50% 72%;
  transition: transform 180ms ease;
}

.title-house-scene {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  filter:
    drop-shadow(0 28px 50px rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 34px rgba(114, 75, 150, 0.12));
}

.title-house,
.title-house-fallback {
  display: block;
  width: 100%;
  height: auto;
}

.title-house-fallback {
  aspect-ratio: 2 / 3;
  border-radius: 42% 42% 4% 4%;
  background:
    radial-gradient(40% 22% at 50% 78%, rgba(255, 199, 104, 0.42), transparent 70%),
    linear-gradient(180deg, #1d1530 18%, #100d1a 100%);
}

.title-approach {
  appearance: none;
  position: absolute;
  z-index: 4;
  left: 31.5%;
  bottom: 1.4%;
  width: 37%;
  height: 39%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 48% 48% 10% 10%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.title-approach:focus-visible {
  outline: 2px solid rgba(255, 218, 145, 0.78);
  outline-offset: 5px;
}

.title-door-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.title-painted-door {
  position: absolute;
  z-index: 3;
  left: 27.8%;
  bottom: 1.6%;
  width: 44.4%;
  height: 45.6%;
  overflow: hidden;
  border: 1px solid rgba(222, 167, 174, 0.34);
  border-radius: 48% 48% 4% 4%;
  background: #120c18;
  box-shadow:
    inset 0 0 0 1px rgba(255, 228, 232, 0.12),
    inset 0 -2rem 2.5rem rgba(0, 0, 0, 0.36),
    0 0 1.6rem rgba(178, 126, 132, 0.22),
    0 1rem 1.6rem rgba(0, 0, 0, 0.32);
  transform:
    translate3d(calc(var(--approach-x, 0) * -0.12px), calc(var(--approach-y, 0) * -0.12px), 0)
    scale(0.992);
  opacity: 0.9;
  filter: saturate(0.94) sepia(0.12) hue-rotate(314deg) contrast(1.06) brightness(0.96);
  pointer-events: none;
}

.title-painted-door::before,
.title-painted-door::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.title-painted-door::before {
  background:
    radial-gradient(54% 38% at 50% 40%, transparent 0 44%, rgba(222, 167, 174, 0.12) 66%, rgba(0, 0, 0, 0.2) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), transparent 28% 72%, rgba(0, 0, 0, 0.42));
  mix-blend-mode: multiply;
}

.title-painted-door::after {
  box-shadow:
    inset 0 0 1.1rem rgba(255, 220, 225, 0.17),
    inset 0 -2.4rem 2.8rem rgba(0, 0, 0, 0.34);
}

.title-painted-door-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 43%;
  transform: scale(1.04);
}

.title-house-wrap.is-awake .title-painted-door,
.title-house-wrap.is-opening .title-painted-door {
  opacity: 1;
  filter: saturate(1) sepia(0.12) hue-rotate(314deg) contrast(1.08) brightness(1.04);
  box-shadow:
    inset 0 0 0 1px rgba(255, 228, 232, 0.2),
    inset 0 -2rem 2.5rem rgba(0, 0, 0, 0.28),
    0 0 2rem rgba(178, 126, 132, 0.34),
    0 1rem 1.7rem rgba(0, 0, 0, 0.36);
}

.title-house-body,
.title-procession {
  transform-box: fill-box;
  transform-origin: center;
  transform: translate3d(calc(var(--approach-x, 0) * -0.16px), calc(var(--approach-y, 0) * -0.1px), 0);
  transition: transform 180ms ease;
}

.title-house-wing {
  fill: #120f1d;
  stroke: #312843;
  stroke-width: 2;
}

.title-house-wing--left,
.title-house-wing--right {
  opacity: 0.92;
}

.title-roof-tiles,
.title-house-tracery {
  fill: none;
  stroke: rgba(121, 105, 154, 0.22);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.title-vines {
  fill: rgba(117, 142, 106, 0.42);
  stroke: rgba(117, 142, 106, 0.34);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.title-stars .title-star {
  opacity: var(--star-op, 0.4);
  animation: title-star-twinkle 5s ease-in-out infinite;
}

@keyframes title-star-twinkle {
  0%, 100% { opacity: calc(var(--star-op, 0.4) * 0.38); transform: scale(0.82); }
  50% { opacity: var(--star-op, 0.4); transform: scale(1.08); }
}

.title-moon {
  --title-moon-extra-x: 0px;
  --title-moon-extra-y: 0px;
  --title-moon-scale: 1;
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transform:
    translate(
      calc(var(--moon-x, 0) * 1px + var(--title-moon-extra-x)),
      calc(var(--moon-y, 0) * 1px + var(--title-moon-extra-y))
    )
    scale(var(--title-moon-scale));
  transition: transform 220ms ease;
}

.title-moon-disc {
  filter: drop-shadow(0 0 14px rgba(236, 226, 255, 0.28));
}

.title-moon.is-touched .title-moon-halo {
  animation: title-moon-answer 1.6s ease;
}

@keyframes title-moon-answer {
  0%, 100% { opacity: 0.08; transform: scale(1); }
  38% { opacity: 0.2; transform: scale(1.16); }
}

.title-smoke-puff {
  opacity: 0;
  animation: title-smoke-rise 5.4s ease-in-out infinite;
  animation-delay: var(--puff-delay);
  transform-origin: center;
}

@keyframes title-smoke-rise {
  0% { opacity: 0; transform: translate(0, 0) scale(0.72); }
  18% { opacity: 0.18; }
  70% { opacity: 0.02; transform: translate(-22px, -62px) scale(1.9); }
  100% { opacity: 0; transform: translate(-30px, -82px) scale(2.2); }
}

.title-win,
.title-gable,
.title-lamp {
  cursor: pointer;
}

.title-win-glow,
.title-gable-glow,
.title-lamp-glow {
  transition: opacity 180ms ease, filter 180ms ease;
}

.title-win-glow {
  animation: title-window-breathe 6.5s ease-in-out infinite;
}

.title-win:nth-of-type(2n) .title-win-glow {
  animation-delay: -2s;
}

@keyframes title-window-breathe {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.24; }
}

.title-win:hover .title-win-glow,
.title-win:focus-visible .title-win-glow,
.title-win.is-lit .title-win-glow {
  opacity: 0.58;
  filter: drop-shadow(0 0 12px rgba(232, 179, 76, 0.56));
}

.title-win.is-touched .title-win-frame,
.title-gable.is-touched .title-gable-glow,
.title-lamp.is-touched .title-lamp-glow {
  animation: title-prop-wake 1.25s ease;
}

@keyframes title-prop-wake {
  0%, 100% { opacity: 0.16; }
  36% { opacity: 0.72; }
}

.title-gable:hover .title-gable-glow,
.title-gable:focus-visible .title-gable-glow {
  opacity: 0.42;
  filter: drop-shadow(0 0 12px rgba(232, 179, 76, 0.42));
}

.title-lamp-glow,
.title-lantern-glow {
  animation: title-lamp-flicker 3.8s ease-in-out infinite;
}

.title-lamp:hover .title-lamp-glow,
.title-lamp:focus-visible .title-lamp-glow,
.title-lamp.is-touched .title-lamp-glow {
  opacity: 0.34;
  filter: drop-shadow(0 0 18px rgba(232, 179, 76, 0.72));
}

@keyframes title-lamp-flicker {
  0%, 100% { opacity: 0.1; }
  40% { opacity: 0.18; }
  47% { opacity: 0.12; }
  58% { opacity: 0.22; }
}

.title-door-light {
  opacity: calc(var(--door-glow, 0.46) * 0.42);
  transition: opacity 220ms ease;
}

.title-door-rim {
  transition: opacity 220ms ease;
}

.title-door-leaf {
  fill: #0a0710;
  stroke: #5a4565;
  stroke-width: 1.4;
  transform-box: fill-box;
  transform-origin: center bottom;
  transition: transform 520ms cubic-bezier(0.2, 0.9, 0.18, 1), opacity 420ms ease, filter 220ms ease;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.48));
}

.title-door-seam {
  fill: none;
  stroke: rgba(224, 177, 184, 0.38);
  stroke-width: 1.2;
  opacity: 0.55;
  transition: opacity 220ms ease;
}

.title-door-keyhole {
  fill: #dea7ae;
  opacity: 0.72;
  filter: drop-shadow(0 0 12px rgba(178, 126, 132, 0.58));
  transition: opacity 220ms ease, transform 220ms ease;
  transform-box: fill-box;
  transform-origin: center;
}

.title-doorspill {
  opacity: calc(var(--door-glow, 0.46) * 0.5);
  animation: title-doorspill-breathe 5.2s ease-in-out infinite;
}

@keyframes title-doorspill-breathe {
  0%, 100% { opacity: calc(var(--door-glow, 0.46) * 0.35); transform: scaleX(0.96); }
  50% { opacity: calc(var(--door-glow, 0.46) * 0.72); transform: scaleX(1.03); }
}

.title-house-wrap.is-awake .title-door-light,
.title-house-wrap.is-opening .title-door-light {
  opacity: 0.88;
}

.title-house-wrap.is-awake .title-door-rim,
.title-house-wrap.is-opening .title-door-rim {
  opacity: 0.82;
}

.title-house-wrap.is-awake .title-door-keyhole,
.title-house-wrap.is-opening .title-door-keyhole {
  opacity: 1;
  transform: scale(1.05);
}

.title-house-wrap.is-opening .title-door-leaf--left {
  transform: translateX(-30px) skewY(2deg) scaleX(0.82);
  opacity: 0.72;
}

.title-house-wrap.is-opening .title-door-leaf--right {
  transform: translateX(30px) skewY(-2deg) scaleX(0.82);
  opacity: 0.72;
}

.title-house-wrap.is-opening .title-door-seam,
.title-house-wrap.is-opening .title-door-keyhole {
  opacity: 0;
}

.title-procession {
  animation: title-procession-drift 7s ease-in-out infinite;
}

@keyframes title-procession-drift {
  0%, 100% { transform: translate3d(calc(var(--approach-x, 0) * -0.16px), calc(var(--approach-y, 0) * -0.1px), 0); }
  50% { transform: translate3d(calc(var(--approach-x, 0) * -0.16px + 4px), calc(var(--approach-y, 0) * -0.1px - 2px), 0); }
}

.title-mist-band {
  animation: title-mist-drift 8s ease-in-out infinite;
  animation-delay: var(--mist-delay);
}

@keyframes title-mist-drift {
  0%, 100% { transform: translateX(-18px); opacity: 0.04; }
  50% { transform: translateX(20px); opacity: 0.08; }
}

.title-path-stones {
  fill: rgba(154, 128, 105, 0.18);
}

.title-resume-slot {
  width: min(100%, 31rem);
  min-height: 0;
}

.title-banner {
  display: grid;
  justify-items: center;
  gap: 0.58rem;
  max-width: 31rem;
  padding: 0 0.35rem;
  text-align: center;
  pointer-events: none;
}

body.title-body .title-wordmark {
  margin: 0;
  display: inline-block;
  font-size: 2.22rem;
  color: #f4f0ff;
  text-shadow:
    calc(var(--hall-x, 0) * 1px) calc(var(--hall-y, 0) * 1px) 1px rgba(255, 255, 255, 0.18),
    0 0 1.2rem rgba(187, 160, 255, 0.16),
    0 0.18rem 0.45rem rgba(0, 0, 0, 0.64);
}

.title-poem {
  display: grid;
  gap: 0.25rem;
  color: #d8d0ec;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.96rem;
  line-height: 1.45;
}

.title-poem p,
.title-cue {
  margin: 0;
}

.title-cue {
  color: #dea7ae;
  font-size: 0.82rem;
  font-weight: 650;
  text-transform: lowercase;
}

.title-store-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.68rem;
  margin-top: 0.16rem;
}

.title-store-link {
  display: inline-block;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.title-store-link.is-pending {
  cursor: default;
  opacity: 0.76;
}

.title-store-link:focus-visible {
  outline: 2px solid rgba(222, 167, 174, 0.82);
  outline-offset: 5px;
  border-radius: 0.45rem;
}

.title-store-badge {
  display: block;
  width: auto;
  height: clamp(2.32rem, 8.2vw, 2.72rem);
  max-width: 44vw;
}

.title-store-badge.store-badge {
  display: block;
  width: 8.8rem;
  min-width: 8.8rem;
  height: 2.7rem;
  padding: 0.38rem 0.78rem 0.42rem;
  border: 1px solid rgba(222, 167, 174, 0.58);
  border-radius: 0.58rem;
  background: rgba(7, 6, 12, 0.7);
  color: #f4e9eb;
  line-height: 1.08;
  text-align: left;
}

.store-badge-eyebrow {
  display: block;
  color: #c7a0a6;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.store-badge-name {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.83rem;
}

.title-house-links {
  margin-top: 0.1rem;
  pointer-events: auto;
}

.title-house-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.32rem 0.54rem;
  border: 1px solid rgba(222, 167, 174, 0.2);
  border-radius: 0.55rem;
  background: rgba(7, 6, 12, 0.32);
  color: #c7a0a6;
  font-size: 0.72rem;
  text-decoration: none;
}

.title-house-links a:hover,
.title-house-links a:focus-visible {
  border-color: rgba(222, 167, 174, 0.48);
  color: #f4e9eb;
}

.title-house-links svg {
  width: 1rem;
  height: 1rem;
}

html.halloway-native .title-store-links {
  display: none;
}

.title-noscript {
  position: relative;
  z-index: 4;
  max-width: 32rem;
  margin: 4rem auto;
  padding: 0 1.5rem;
  text-align: center;
  color: #c8d0e7;
}

@media (min-width: 520px) {
  .title-house-wrap {
    width: min(100%, 24rem);
  }

  body.title-body .title-wordmark {
    font-size: 3.1rem;
  }

  .title-poem {
    font-size: 1.06rem;
  }
}

@media (min-width: 900px) and (min-height: 640px) {
  .title-composition {
    width: min(100%, 42rem);
  }

  .title-house-wrap {
    width: min(100%, 27rem);
  }

  body.title-body .title-wordmark {
    font-size: 3.6rem;
  }
}

@media (min-width: 900px) and (max-height: 920px) {
  .title-house-wrap {
    width: min(100%, 25.5rem);
  }
}

@media (max-width: 360px) {
  .title-house-wrap {
    min-width: min(100%, 15.6rem);
  }

  body.title-body .title-wordmark {
    font-size: 1.72rem;
  }

  .title-poem {
    font-size: 0.9rem;
  }

  .title-store-links {
    gap: 0.48rem;
  }

  .title-store-badge {
    height: 2.2rem;
    max-width: 46vw;
  }
}

@media (max-height: 740px) {
  .title-house-wrap {
    width: min(100%, 18.75rem);
  }

  .title-stage {
    padding-top: calc(env(safe-area-inset-top, 0px) + 0.72rem);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
  }
}

@media (max-height: 640px) {
  .title-house-wrap {
    width: min(100%, 16.5rem);
    min-width: min(100%, 16.5rem);
  }
}

@media (min-width: 640px) and (max-width: 900px) and (orientation: portrait) {
  .title-moon {
    --title-moon-extra-x: 3.8rem;
    --title-moon-extra-y: 4.1rem;
    --title-moon-scale: 0.86;
  }
}

@media (prefers-reduced-motion: reduce) {
  .title-house-wrap,
  .title-house-body,
  .title-procession,
  .title-moon,
  .title-haze,
  .title-paintwash,
  body.title-body .title-wordmark,
  .title-painted-door {
    transform: none !important;
    transition: none !important;
  }

  .title-stars .title-star,
  .title-smoke-puff,
  .title-win-glow,
  .title-lamp-glow,
  .title-lantern-glow,
  .title-doorspill,
  .title-procession,
  .title-mist-band,
  .title-moon.is-touched .title-moon-halo,
  .title-win.is-touched .title-win-frame,
  .title-gable.is-touched .title-gable-glow,
  .title-lamp.is-touched .title-lamp-glow {
    animation: none !important;
  }

  .title-door-leaf {
    transition: none !important;
  }
}
