/* Christmas 2026 homepage hero (Cavell, Dec 2026). Goes with js/christmas-2026.js, which adds the layers and the
   xmc26-on class to #home. Every rule is scoped to .hero.xmc26-on, so this file does nothing while the switch is off.
   Layer order under the real hero content (z-index 2 in index.html):
     z0: London (world), scrim, far snow      z1: Kevin's sleigh, near snow, mist      z3: Pause button */
.hero.xmc26-on {
  --xmc26-after: #eef5fc; /* the hero ends in pale snow; the trust bar floats in it (Cavell, 1 Dec; was navy) */
  --xmc26-gutter: max(0px, calc((100% - 1400px) / 2));
  /* Sleigh width on desktop: fits between the left edge of the text and the booking card (~610px at 1440). */
  --xmc26-sw: clamp(360px, calc((min(100vw, 1400px) - 760px) * 0.95), 640px);
  /* Full width on wide screens; the grid inside stays 1400px. padding-top is left alone (the traffic strip sets it). */
  max-width: none;
  padding-left: var(--xmc26-gutter);
  padding-right: var(--xmc26-gutter);
  isolation: isolate;
}
.hero.xmc26-on::before { display: none; } /* the drifting grid would sit hidden under the picture */

.hero.xmc26-on .xmc26-world,
.hero.xmc26-on .xmc26-scrim,
.hero.xmc26-on .xmc26-snow,
.hero.xmc26-on .xmc26-haze,
.hero.xmc26-on .xmc26-vehicle { pointer-events: none; user-select: none; }

.hero.xmc26-on .xmc26-world,
.hero.xmc26-on .xmc26-scrim,
.hero.xmc26-on .xmc26-snow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero.xmc26-on .xmc26-world picture { display: block; width: 100%; height: 100%; }
.hero.xmc26-on .xmc26-world img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 57%;
}
/* Keeps the white and teal headline readable over the busy sky. */
.hero.xmc26-on .xmc26-scrim {
  background: linear-gradient(90deg,
    rgba(5, 20, 42, 0.88) 0%,
    rgba(5, 20, 42, 0.73) 29%,
    rgba(5, 20, 42, 0.35) 53%,
    rgba(5, 20, 42, 0.08) 83%,
    rgba(5, 20, 42, 0.18) 100%);
}
.hero.xmc26-on .xmc26-snow { display: block; }
.hero.xmc26-on .xmc26-world--sky { display: none; } /* phones/tablets only */
.hero.xmc26-on .xmc26-snow--front { z-index: 1; }

/* Kevin's classic sleigh (Cavell, 1 Dec): the whole image, never cropped. Desktop: low down under the stats, its runners
   by the snow at the bottom of the hero. The JS puts it over .xmc26-slot (a spacer it adds after the stats) via --xmc26-top.
   The sleigh's front curl lines up with the text. */
.hero.xmc26-on .xmc26-vehicle {
  position: absolute;
  z-index: 1;
  left: calc(var(--xmc26-gutter) + 52px);
  top: var(--xmc26-top, auto);
  width: var(--xmc26-sw);
  transform-origin: 52% 72%;
}
.hero.xmc26-on .xmc26-vehicle picture { display: block; position: relative; z-index: 1; } /* above the smoke trail */
.hero.xmc26-on .xmc26-vehicle img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-user-drag: none;
}
/* Room for the sleigh under the stats, down by the snow; the stats keep a soft dark shadow over the bright city. */
.hero.xmc26-on .xmc26-slot { flex-shrink: 0; height: calc(var(--xmc26-sw) * 0.38); pointer-events: none; }
.hero.xmc26-on .hero-stats {
  text-shadow: 0 1px 12px rgba(5, 20, 42, 1), 0 0 4px rgba(5, 20, 42, 0.95), 0 0 2px rgba(5, 20, 42, 0.9);
  /* closest-side: the glow fades to nothing before the box edges, so no visible rectangle over the smoke */
  background: radial-gradient(closest-side, rgba(5, 20, 42, 0.5), rgba(5, 20, 42, 0.25) 55%, rgba(5, 20, 42, 0) 100%);
}
.hero.xmc26-on .hero-stat-label { color: rgba(240, 246, 255, 0.92); }
/* The hero is now taller: keep the booking card exactly where it is without Christmas (not re-centred lower). */
@media (min-width: 1025px) {
  .hero.xmc26-on .hero-booking-col { align-self: start; }
}

/* Entrance (Cavell, 1 Dec): out from behind the booking panel (which sits above the sleigh), swooping down and left to
   its place under the stats, then braking: a small overshoot, the nose rocks back, and the runners kick up snow.
   Plays once. Waiting = hidden until in view. */
.hero.xmc26-on.xmc26-waiting .xmc26-vehicle { opacity: 0; }
.hero.xmc26-on.xmc26-enter .xmc26-vehicle {
  will-change: transform, opacity;
  animation: xmc26-arrive 3000ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
@keyframes xmc26-arrive {
  0%   { opacity: 0; transform: translate3d(var(--xmc26-from-x, 60vw), var(--xmc26-from-y, -40px), 0) scale(0.5) rotate(-5deg); }
  8%   { opacity: 1; }
  68%  { opacity: 1; transform: translate3d(-18px, 4px, 0) scale(1.01) rotate(1.6deg); }
  82%  { transform: translate3d(5px, 0, 0) scale(1) rotate(-1.2deg); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1) rotate(0); }
}
/* Braking: a puff of snow kicked up from the front of the runners. */
.hero.xmc26-on .xmc26-vehicle::after {
  content: '';
  position: absolute;
  left: -4%;
  bottom: -2%;
  width: 46%;
  height: 34%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform-origin: 80% 100%;
  background:
    radial-gradient(ellipse 30% 40% at 72% 80%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse 26% 34% at 45% 72%, rgba(244, 249, 255, 0.85), rgba(244, 249, 255, 0) 70%),
    radial-gradient(ellipse 22% 28% at 22% 62%, rgba(236, 244, 252, 0.7), rgba(236, 244, 252, 0) 70%);
}
.hero.xmc26-on.xmc26-enter .xmc26-vehicle::after { animation: xmc26-spray 3000ms ease-out both; }
@keyframes xmc26-spray {
  0%, 60% { opacity: 0; transform: scale(0.5); }
  72%     { opacity: 1; transform: scale(1); }
  100%    { opacity: 0; transform: translateX(-10%) scale(1.4); }
}
.hero.xmc26-on.xmc26-static .xmc26-vehicle,
.hero.xmc26-on.xmc26-paused .xmc26-vehicle { animation: none; transform: none; opacity: 1; }

/* Mist: the picture's own pale mist, then down into the navy trust bar with no seam. */
.hero.xmc26-on .xmc26-haze {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 1;
  height: clamp(180px, 27vh, 300px); /* a soft mist over the lower hero, thickening into the snow at the bottom */
  opacity: var(--xmc26-haze-opacity, 0.78);
  background:
    radial-gradient(ellipse 45% 55% at 24% 55%, rgba(223, 239, 248, 0.34), transparent 92%),
    radial-gradient(ellipse 50% 60% at 74% 50%, rgba(223, 239, 248, 0.3), transparent 94%),
    linear-gradient(to bottom, rgba(214, 230, 243, 0) 0%, rgba(214, 230, 243, 0.26) 22%, rgba(206, 224, 240, 0.32) 55%,
                    rgba(220, 234, 247, 0.6) 86%, var(--xmc26-after) 100%); /* pale mist thickening into snow at the bottom */
}
/* Painted snowdrifts along the very bottom of the hero (Cavell, 1 Dec): the same picture as the site's other
   dark-into-light joins; its bottom is exactly the pale snow colour the trust bar sits in. */
.hero.xmc26-on::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 1;
  height: clamp(80px, 12vw, 190px);
  background: url('/images/christmas-2026/site/snow-dark-to-light.webp') center bottom / 100% 100% no-repeat;
  pointer-events: none;
}

/* Pause / resume for the moving snow and sleigh (not the traffic strip's Pause). */
.hero.xmc26-on .xmc26-motion-button {
  position: absolute;
  z-index: 3;
  right: calc(var(--xmc26-gutter) + 24px); /* right-hand side: the TOM helper sits fixed at bottom left */
  bottom: 16px;
  border: 1px solid rgba(236, 251, 255, 0.35);
  background: rgba(7, 30, 54, 0.76);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
}
.hero.xmc26-on .xmc26-motion-button[hidden] { display: none; }
.hero.xmc26-on .xmc26-motion-button:hover,
.hero.xmc26-on .xmc26-motion-button:focus-visible { background: rgba(16, 68, 84, 0.92); }
.hero.xmc26-on .xmc26-motion-button:focus-visible { outline: 2px solid #00E0C2; outline-offset: 3px; }

/* Phones and tablets (the stacked hero in index.html): booking panel stays where it is;
   the sleigh sits after the stats, in the flow, rising in when scrolled to. */
@media (max-width: 1024px) {
  .hero.xmc26-on .xmc26-slot { display: none; }
  /* The hero is very tall here (~1550px at 390 wide), so one picture covering all of it was zoomed in ~3.5x.
     Instead the picture is shown at its own shape: the full London scene at the bottom (behind the stats and Kevin),
     and the starry sky from its top behind the headline, each fading out softly. Navy in between, behind the
     booking card. Same file for both, so nothing extra is downloaded. */
  .hero.xmc26-on .xmc26-world { top: auto; bottom: 0; height: auto;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22%);
            mask-image: linear-gradient(to bottom, transparent 0%, #000 22%); }
  .hero.xmc26-on .xmc26-world--sky { display: block; top: 0; bottom: auto;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 58%);
            mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 58%); }
  .hero.xmc26-on .xmc26-world picture,
  .hero.xmc26-on .xmc26-world img { height: auto; }
  .hero.xmc26-on .xmc26-scrim {
    background: linear-gradient(to bottom,
      rgba(4, 17, 34, 0.86) 0%,
      rgba(5, 20, 42, 0.7) 22%,
      rgba(5, 20, 42, 0.62) 62%,
      rgba(5, 20, 42, 0.5) 76%,
      rgba(5, 20, 42, 0.15) 100%); /* stays dark down to the stats, which sit over the bright bridge */
  }
  /* Kevin below the stats on phones (Cavell, 30 Nov): after the stats (order 7), resting by the snow at the bottom. */
  .hero.xmc26-on .xmc26-vehicle {
    position: relative;
    order: 8;
    left: auto;
    top: auto;
    width: min(94vw, 710px);
    margin: 4px auto -6px;
    top: 45px; /* down by the snow at the bottom of the hero, just above the drifts and the Pause button */
  }
  .hero.xmc26-on .hero-stats { margin-bottom: 8px; }
  .hero.xmc26-on .xmc26-haze { height: 140px; }
  .hero.xmc26-on .xmc26-motion-button { right: 16px; bottom: 14px; padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero.xmc26-on .xmc26-vehicle { animation: none !important; opacity: 1 !important; transform: none !important; }
}
