/* =========================================================
   HIDDEN KEY APPLE MOTION 1.1.0
   Apple hardware is a first-class target, not a fallback.
   Content is readable by default; motion progressively enhances it.
   ========================================================= */

html.hk-platform-apple {
  --hkam-ease: cubic-bezier(.22,.78,.22,1);
}

/* 1.2.1: Apple-owned homepage reveals now use the same Core reveal contract
   as finalized inner pages. The JS controller adds .is-visible through the same
   IntersectionObserver thresholds and includes bounded WebKit fail-open passes. */
html.hk-platform-apple.hk-apple-homepage-ready #hk-homepage .hk-reveal.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate3d(0,0,0) scale(1) !important;
  filter: none !important;
}

html.hk-platform-apple.hk-entry-handoff:not(.hk-entry-hero-in) #hk-homepage :is(.hk-hero-copy,.hk-reservation-card,.hk-hero-benefits,.hk-trust-strip),
html.hk-platform-apple.hk-entry-handoff:not(.hk-entry-hero-in) #hk-site-header {
  opacity: 0 !important;
  pointer-events: none !important;
}
html.hk-platform-apple.hk-entry-hero-in #hk-homepage :is(.hk-hero-copy,.hk-reservation-card,.hk-hero-benefits,.hk-trust-strip),
html.hk-platform-apple.hk-entry-hero-in #hk-site-header {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  pointer-events: auto !important;
}

html.hk-platform-apple.hk-apple-page-painted body > *:not(.hk-entry) {
  visibility: visible !important;
}
html.hk-platform-apple.hk-apple-page-painted #hk-site-header,
html.hk-platform-apple.hk-entry-complete #hk-site-header {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}


/* Asset hydration must never leave a painted Apple page visually blank. Core's
   design system intentionally fades these images in after .is-loaded; after the
   entrance prepaint has run, allow the image to paint as soon as the browser has
   bytes, even if an optimizer delayed Core's load-class callback. */
html.hk-platform-apple.hk-apple-homepage-ready.hk-apple-page-painted #hk-homepage :is(.hk-media-card__image,.hk-image-cover),
html.hk-platform-apple.hk-apple-homepage-ready.hk-entry-complete #hk-homepage :is(.hk-media-card__image,.hk-image-cover) {
  opacity: 1 !important;
}

/* Guaranteed animated media fallback. If Safari refuses/stalls the MP4 we still
   show a deliberate door opening instead of jumping directly to the page. */
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-apple-css-door {
  position: fixed;
  inset: 0;
  z-index: 34;
  pointer-events: none;
  perspective: 1500px;
  overflow: hidden;
  background: transparent;
}
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-apple-css-door__panel {
  position: absolute;
  top: 0;
  width: 50.1%;
  height: var(--hk-entry-vh, 100dvh);
  overflow: hidden;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity;
  transition: transform 1.12s cubic-bezier(.2,.72,.18,1), opacity .98s ease;
  background: #070505;
}
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-apple-css-door__panel--left {
  left: 0;
  transform-origin: 0 50%;
}
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-apple-css-door__panel--right {
  right: 0;
  transform-origin: 100% 50%;
}
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-apple-css-door__panel img {
  position: absolute;
  top: 0;
  width: 200%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-apple-css-door__panel--left img { left: 0; }
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-apple-css-door__panel--right img { right: 0; }
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-apple-css-door.is-opening .hk-apple-css-door__panel--left {
  transform: rotateY(-82deg) translateZ(1px);
  opacity: .08;
}
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-apple-css-door.is-opening .hk-apple-css-door__panel--right {
  transform: rotateY(82deg) translateZ(1px);
  opacity: .08;
}
@media (prefers-reduced-motion: reduce) {
  html.hk-platform-apple .hk-entry.hk-apple-entry .hk-apple-css-door__panel {
    transition-duration: .16s !important;
  }
}

/* Apple entrance: simple compositing only. No clip-path, blur, filter morphs,
   or smooth-scroll dependency during the handoff. */
html.hk-platform-apple .hk-entry.hk-apple-entry {
  contain: layout paint;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  transition: opacity .76s cubic-bezier(.3,0,.3,1) !important;
}
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-entry-stage,
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-entry-poster,
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-entry-video,
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-entry-reveal-img {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-entry-video {
  opacity: 1;
  visibility: visible;
  background: #070505;
  transition: opacity .12s linear !important;
}
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-entry-poster {
  opacity: 1;
  transition: opacity .12s linear !important;
}
html.hk-platform-apple .hk-entry.hk-apple-entry.is-access-locked .hk-entry-video,
html.hk-platform-apple .hk-entry.hk-apple-entry:not(.is-video-verified) .hk-entry-video {
  opacity: 0 !important;
}
html.hk-platform-apple .hk-entry.hk-apple-entry.is-video-verified .hk-entry-video {
  opacity: 1 !important;
}
html.hk-platform-apple .hk-entry.hk-apple-entry.is-video-verified .hk-entry-poster {
  opacity: 0 !important;
  pointer-events: none;
}
html.hk-platform-apple .hk-entry.hk-apple-entry.is-apple-reveal .hk-entry-reveal-img {
  opacity: 1 !important;
  transform: translateZ(0) scale(1) !important;
  transition: opacity .2s ease, transform .72s var(--hkam-ease) !important;
}
html.hk-platform-apple .hk-entry.hk-apple-entry.is-apple-reveal .hk-entry-video,
html.hk-platform-apple .hk-entry.hk-apple-entry.is-apple-fallback .hk-entry-video {
  opacity: 0 !important;
}
html.hk-platform-apple .hk-entry.hk-apple-entry.is-apple-page-crossfade .hk-entry-reveal-img {
  opacity: 1 !important;
  transform: translateZ(0) scale(1) !important;
}
html.hk-platform-apple .hk-entry.hk-apple-entry.is-apple-page-crossfade .hk-entry-scrim {
  opacity: 0 !important;
  transition: opacity .25s ease !important;
}

html.hk-platform-apple .hk-entry.hk-apple-entry.is-apple-morphing {
  background: transparent !important;
}
html.hk-platform-apple .hk-entry.hk-apple-entry.is-apple-morphing .hk-entry-stage,
html.hk-platform-apple .hk-entry.hk-apple-entry.is-apple-morphing .hk-entry-side,
html.hk-platform-apple .hk-entry.hk-apple-entry.is-apple-morphing .hk-entry-buffer {
  opacity: 0 !important;
  pointer-events: none !important;
}
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-apple-morph-frame {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 20;
  width: 100vw;
  height: var(--hk-entry-vh, 100dvh);
  overflow: hidden;
  border-radius: 0;
  opacity: 1;
  pointer-events: none;
  background: #070505;
  box-shadow: 0 22px 70px rgba(0,0,0,.38);
  transition:
    left .72s var(--hkam-ease),
    top .72s var(--hkam-ease),
    width .72s var(--hkam-ease),
    height .72s var(--hkam-ease),
    border-radius .72s var(--hkam-ease),
    opacity .2s ease;
  will-change: left, top, width, height, border-radius, opacity;
}
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-apple-morph-frame > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-apple-morph-frame.is-settled {
  opacity: 0;
}
html.hk-platform-apple.hk-entry-handoff #hk-homepage .hk-hero-visual img.is-loaded {
  opacity: 1 !important;
  animation: none !important;
  transform: scale(1.035) !important;
}
html.hk-platform-apple .hk-entry.hk-apple-entry.is-apple-exiting {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Keep the form responsive while the movie preloads. The page itself never
   receives a fixed-body scroll snapshot, avoiding the WebKit restoration lag. */
html.hk-platform-apple .hk-entry.hk-apple-entry .hk-entry-panel__scroll {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
html.hk-platform-apple .hk-entry.hk-apple-entry.is-form-gone .hk-entry-side {
  pointer-events: none;
}
html.hk-platform-apple .hk-entry.hk-apple-entry.is-form-gone .hk-entry-panel {
  opacity: 0 !important;
  transform: translate3d(0,24px,0) !important;
}

/* iPhone/iPad: native visual viewport + native scrolling. */
html.hk-apple-ios .hk-entry.hk-apple-entry {
  height: var(--hk-entry-vh, 100dvh);
  min-height: var(--hk-entry-vh, 100dvh);
  top: var(--hk-entry-vv-top, 0px);
}
html.hk-apple-ios .hk-entry.hk-apple-entry .hk-entry-stage {
  height: var(--hk-entry-vh, 100dvh);
}
html.hk-apple-ios .hk-entry.hk-apple-entry .hk-entry-panel__scroll {
  scrollbar-width: none;
}
html.hk-apple-ios .hk-entry.hk-apple-entry .hk-entry-panel__scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Progressive homepage motion. These hiding rules are activated ONLY after
   the observer has been installed. A hard failsafe in JS removes them again. */
html.hk-platform-apple.hk-apple-enhanced #hk-homepage .hk-apple-observe {
  opacity: .001 !important;
  transform: translate3d(0,18px,0) !important;
  transition: opacity .68s var(--hkam-ease), transform .68s var(--hkam-ease) !important;
}
html.hk-platform-apple.hk-apple-enhanced #hk-homepage .hk-apple-observe.is-hk-apple-inview {
  opacity: 1 !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html.hk-platform-apple .hk-entry.hk-apple-entry,
  html.hk-platform-apple .hk-entry.hk-apple-entry *,
  html.hk-platform-apple.hk-apple-enhanced #hk-homepage .hk-apple-observe {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ---------------------------------------------------------
   iPhone/iPad paint budget
   ---------------------------------------------------------
   The standard homepage stylesheet still provides layout and visual design on
   Apple. These selectors disable only continuous decorative loops on iOS so
   WebKit can prioritize image decode, form interaction and scrolling. Mac keeps
   the richer CSS ambience; no content visibility depends on these animations.
*/
html.hk-apple-ios #hk-homepage::after,
html.hk-apple-ios #hk-homepage .hk-hero-visual img,
html.hk-apple-ios #hk-homepage .hk-hero-light,
html.hk-apple-ios #hk-homepage .hk-process-card:not(:last-child)::after,
html.hk-apple-ios #hk-homepage .hk-reservation-card,
html.hk-apple-ios #hk-homepage .hk-reservation-card::after,
html.hk-apple-ios #hk-homepage .hk-field,
html.hk-apple-ios #hk-homepage .hk-amenities-orbit__ring,
html.hk-apple-ios #hk-homepage .hk-amenities-orbit__key,
html.hk-apple-ios #hk-homepage .hk-amenities-orbit__spark,
html.hk-apple-ios #hk-homepage .hk-amenities-scene .hk-amenity-tile::after,
html.hk-apple-ios #hk-homepage .hk-privacy-banner__aside::after,
html.hk-apple-ios #hk-homepage .hk-section .hk-icon,
html.hk-apple-ios #hk-homepage .hk-section .hk-media-card__line,
html.hk-apple-ios #hk-homepage .hk-section .hk-eyebrow,
html.hk-apple-ios #hk-homepage .hk-ornament span,
html.hk-apple-ios #hk-homepage .hk-button::after,
html.hk-apple-ios #hk-homepage .hk-ambient-float,
html.hk-apple-ios #hk-homepage .hk-amenity-tile[data-hk-amenity="06"].is-missing-asset::after {
  animation: none !important;
}

/* Avoid retaining compositor layers across the whole page on iOS. */
html.hk-apple-ios.hk-entry-complete #hk-homepage .hk-hero-visual img,
html.hk-apple-ios.hk-entry-complete #hk-homepage .hk-reservation-card,
html.hk-apple-ios.hk-entry-complete #hk-homepage .hk-reveal {
  will-change: auto !important;
}
