/* The featured dish occupies the original mouth-to-book animation containers. */
body.santa-home .home-book.santa-special {
  --santa-special-ink: #100f0b;
  --santa-special-gold: #ffc814;
  --santa-special-green: #a6be36;
  --santa-special-cream: #faf3e8;
  padding: 0;
  background: #100f0b;
}

body.santa-home .home-book.santa-special.is-ride { background: transparent; }

/* A hidden overflow container can scroll when its descendants receive focus.
   Clipping keeps the mouth mask aligned without introducing an inner viewport. */
body.santa-home .home-portal { overflow: clip; }

body.santa-home .santa-special .home-book-inner.brxe-container {
  width: 100%;
  max-width: none;
  height: 100%;
  padding: 0 2vw 0 0;
  grid-template-columns: 56.8vw minmax(0, 1fr);
  column-gap: 1.8vw;
  row-gap: 0;
  align-items: center;
  justify-items: center;
  align-content: center;
}

body.santa-home .santa-special .home-book-stage.brxe-block {
  --book-os: 1;
  --book-w: 100%;
  --book-h: 100%;
  --book-d: 0px;
  --book-spin: 9s;
  position: relative;
  width: 100%;
  height: auto;
  min-width: 0;
  aspect-ratio: 900 / 760;
  top: 16px;
  padding: 0;
  perspective: 1800px;
  overflow: visible;
  align-self: center !important;
}

/* translate and scale on the stage remain exclusively owned by the portal rig. */
body.santa-home .santa-special .home-book-3d.brxe-block {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  scale: 1;
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  transform: rotateZ(0deg);
  animation: home-book-spin var(--book-spin, 9s) ease-in-out infinite;
}

body.santa-home .santa-special .santa-special-plate {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: visible;
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
  filter: none;
  pointer-events: none;
  user-select: none;
}

body.santa-home .santa-special .santa-special-plate--front {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(.5px);
}

body.santa-home .santa-special .santa-special-plate--back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg) translateZ(.5px);
}

/* Keep the existing animation name: the book helper also inspects its phase. */
@keyframes home-book-spin {
  0%, 100% { transform: rotateZ(-1deg) scale(.996); }
  25% { transform: rotateZ(.6deg) scale(1); }
  50% { transform: rotateZ(1deg) scale(1.006); }
  75% { transform: rotateZ(-.4deg) scale(1); }
}

body.santa-home .santa-special .home-book-copy.brxe-block {
  position: relative;
  top: max(-18px, -1.1vw);
  width: 100%;
  min-width: 0;
  max-width: none;
  align-items: center;
  row-gap: 0;
  text-align: center;
}

body.santa-home .santa-special.is-ride:not(.is-landed) .home-book-copy {
  visibility: hidden;
  pointer-events: none;
}

body.santa-home .santa-special .santa-special-arrival-decor {
  opacity: 0;
  transition: opacity 200ms ease;
}

body.santa-home .santa-special.is-landed .santa-special-arrival-decor,
body.santa-home .santa-special:not(.is-ride) .santa-special-arrival-decor {
  opacity: 1;
}

body.santa-home .santa-special .santa-special-label {
  position: relative;
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  width: min(470px, 29.65vw);
  color: var(--santa-special-green);
  font-family: "The Whoopsies Handwriting", cursive;
  font-size: clamp(36px, 4.17vw, 72px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: .005em;
  white-space: nowrap;
  -webkit-text-stroke: 0;
}

body.santa-home .santa-special .santa-special-label::after {
  content: none;
  position: absolute;
  left: 18%;
  right: 9%;
  bottom: 2px;
  height: 8px;
  background: var(--santa-special-green);
  clip-path: polygon(0 58%, 18% 24%, 44% 5%, 69% 12%, 87% 40%, 100% 80%, 100% 100%, 81% 73%, 57% 60%, 33% 69%, 12% 93%, 0 100%);
  rotate: -5deg;
  transform-origin: 50% 50%;
}

body.santa-home .santa-special .home-book-title.home-book-title.home-book-title {
  width: 100%;
  margin: 0 0 min(8px, .5vw);
  color: var(--santa-special-gold);
  font-family: "The Whoopsies", sans-serif;
  font-size: clamp(94px, 11vw, 190px);
  font-weight: 500;
  line-height: .78;
  letter-spacing: -.015em;
  text-wrap: initial;
  -webkit-text-stroke: 0;
  paint-order: normal;
}

body.santa-home .santa-special .santa-special-title-line {
  display: block;
  white-space: nowrap;
  scale: 1.1 1;
  transform-origin: 50% 50%;
}

body.santa-home .santa-special .home-book-text.brxe-text-basic {
  width: max-content;
  max-width: 100%;
  margin: 0 0 clamp(20px, 2.52vw, 40px);
  color: var(--santa-special-cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 2.78vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.025em;
  -webkit-text-stroke: 0;
}

body.santa-home .santa-special #brxe-hkbtn1.button-drawn {
  width: min(420px, 26.5vw);
  height: clamp(54px, 5.42vw, 86px);
  min-height: clamp(54px, 5.42vw, 86px);
  padding: 0 15px 7px;
  color: #100f0b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 2.8vw, 46px);
  font-weight: 700;
  line-height: 1;
  --btn-label-offset: -1%;
}

body.santa-home .santa-special #brxe-hkbtn1 .button-drawn-label {
  font-family: inherit;
  font-weight: inherit;
  letter-spacing: -.025em;
  white-space: nowrap;
}

body.santa-home .santa-special #brxe-hkbtn1 .button-drawn-face path,
body.santa-home .santa-special #brxe-hkbtn1 .button-drawn-shelf path {
  fill: var(--santa-special-gold);
  stroke: #100f0b;
}

body.santa-home .santa-special-title-art,
body.santa-home .santa-special-label-art { display: block; width: 100%; height: auto; overflow: hidden; }

body.santa-home .santa-special .product-sky .product-star { opacity: 0 !important; }
body.santa-home .home-portal > .product-sky .product-star { opacity: 0 !important; }

/* A child directly beneath the portal content; it never intercepts controls. */
body.santa-home .home-portal > .santa-special-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #100f0b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

body.santa-home .home-portal:has(.santa-special.is-landed:not(.is-asleep)) > .santa-special-backdrop {
  opacity: 1;
}

/* The portal clone has no product-star class, so its exit zoom stays visible. */
body.santa-home .santa-special.is-out .home-portal-star {
  opacity: 0;
}

body.santa-home .santa-special .santa-special-decor {
  position: absolute;
  width: clamp(24px, 3.4vw, 58px);
  height: auto;
  color: var(--santa-special-green);
  fill: currentColor;
  pointer-events: none;
}

body.santa-home .santa-special .santa-special-decor--upper {
  left: 89%;
  top: -2%;
  rotate: -28deg;
}

body.santa-home .santa-special .santa-special-decor--lower {
  left: 6%;
  bottom: -2%;
  rotate: 14deg;
}

@media (max-width: 1100px) and (min-width: 768px) {
  body.santa-home .santa-special .home-book-copy.brxe-block {
    top: -12px;
  }

  body.santa-home .santa-special .santa-special-label {
    margin-bottom: 18px;
    padding-bottom: 12px;
  }

  body.santa-home .santa-special .home-book-title.home-book-title.home-book-title {
    margin-bottom: 18px;
  }

  body.santa-home .santa-special .home-book-text.brxe-text-basic {
    margin-bottom: 28px;
  }

  body.santa-home .santa-special #brxe-hkbtn1.button-drawn {
    height: 64px;
    min-height: 64px;
    font-size: 26px;
  }
}

@media (max-width: 767px) {
  body.santa-home .santa-special .home-book-inner.brxe-container {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 5vw 24px;
    gap: 15px;
    align-content: center;
  }

  body.santa-home .santa-special .home-book-stage.brxe-block {
    width: min(94vw, 520px);
    top: 0;
  }

  body.santa-home .santa-special .home-book-copy.brxe-block {
    top: 0;
  }

  body.santa-home .santa-special .santa-special-label {
    font-size: clamp(29px, 7.8vw, 43px);
    width: min(300px, 76vw);
    margin-bottom: 0;
    padding-bottom: 0;
  }

  body.santa-home .santa-special .santa-special-label::after {
    height: 5px;
    bottom: 0;
  }

  body.santa-home .santa-special .home-book-title.home-book-title.home-book-title {
    font-size: clamp(64px, 18vw, 116px);
    line-height: .79;
    margin-bottom: 15px;
  }

  body.santa-home .santa-special .santa-special-title-line {
    scale: 1.04 1;
  }

  body.santa-home .santa-special .home-book-text.brxe-text-basic {
    font-size: clamp(20px, 5.3vw, 29px);
    margin-bottom: 22px;
  }

  body.santa-home .santa-special #brxe-hkbtn1.button-drawn {
    width: min(300px, 90%);
    height: 59px;
    min-height: 59px;
    padding-bottom: 4px;
    font-size: 28px;
  }
}

@media (max-width: 767px) and (max-height: 740px) {
  body.santa-home .santa-special .home-book-stage.brxe-block {
    width: 72vw;
  }

  body.santa-home .santa-special .home-book-inner.brxe-container {
    padding-top: 10px;
    padding-bottom: 14px;
    row-gap: 8px;
  }

  body.santa-home .santa-special .home-book-title.home-book-title.home-book-title {
    font-size: 16vw;
  }

  body.santa-home .santa-special .home-book-text.brxe-text-basic {
    margin-bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.santa-home .santa-special .home-book-3d.brxe-block {
    animation: none;
    transform: none;
  }
}
