/* ─────────────────────────────────────────
   ELYSIAN TRAVEL GROUP — home.css
   Styles specific to the homepage only.
   Requires: style.css
───────────────────────────────────────── */

/* ── INTRO LOADER ──────────────────────── */
html.is-loading { overflow: hidden; }
.intro-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--warm-white);
  transition: transform 1.1s cubic-bezier(0.76, 0, 0.24, 1);
  /* If the script never runs, get out of the way on our own */
  animation: introFailsafe 0s linear 6s forwards;
}
.intro-loader-inner {
  display: block;
  transition: opacity 0.5s ease, transform 1.1s cubic-bezier(0.76, 0, 0.24, 1);
}
.intro-loader-mark {
  display: block;
  height: 104px;
  width: auto;
  opacity: 0;
  transform: translateY(10px) scale(0.94);
  animation: introMark 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}
.intro-loader.is-done { transform: translateY(-100%); }
.intro-loader.is-done .intro-loader-inner { opacity: 0; transform: translateY(-40px); }
@keyframes introMark { to { opacity: 1; transform: none; } }
@keyframes introFailsafe { to { visibility: hidden; } }

/* The film logo makes its entrance as the loader lifts */
.film-copy {
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.35s, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.35s;
}
html.is-loading .film-copy { opacity: 0; transform: translateY(24px); }
/* ...then holds for 2.5s after the loader lifts and fades away, leaving the film alone.
   The animation starts when html drops .is-loading, so the clock runs from the reveal. */
html:not(.is-loading) .film-logo { animation: filmLogoOut 1.6s cubic-bezier(0.4, 0, 0.2, 1) 2.5s forwards; }
@keyframes filmLogoOut { to { opacity: 0; visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .intro-loader { transition: opacity 0.3s ease; }
  .intro-loader.is-done { transform: none; opacity: 0; }
  .intro-loader-mark { animation: none; opacity: 1; transform: none; }
  .film-copy { transition: none; }
}

/* ── OPENING FILM ──────────────────────── */
.film {
  position: relative;
  width: 85vw;
  margin: 108px auto 0; /* clears the fixed nav, which then reads as ink on cream */
  aspect-ratio: 1920 / 816;
  overflow: hidden;
  background: var(--ink);
}
/* No poster: the ink ground of .film holds the frame until the video's first frame paints.
   The file is already cropped to the 2.35:1 picture (1920x816), so .film matches it. */
.film-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.film-scrim {
  position: absolute;
  inset: 0;
  background: rgba(43,28,26,0.34);
}
.film-copy {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.film-logo { margin: 0; line-height: 0; }
.film-logo img {
  display: block;
  width: clamp(140px, 14vw, 230px);
  height: auto;
}

/* Sound button: the film loops silently, like a hotel hero, and sound is one click away.
   Browsers block autoplay with sound, so it can't start by itself. */
.film-sound {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 2;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 50%;
  background: rgba(43,28,26,0.18);
  color: #fff;
  cursor: pointer;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.9s, background-color 0.3s ease, border-color 0.3s ease;
}
html.is-loading .film-sound { opacity: 0; }
.film-sound:hover,
.film-sound:focus-visible { background: rgba(43,28,26,0.5); border-color: #fff; }
.film-sound:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }
.film-sound svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.film-sound .icon-off { display: none; }
.film.is-muted .film-sound .icon-on { display: none; }
.film.is-muted .film-sound .icon-off { display: block; }
@media (prefers-reduced-motion: reduce) {
  .film-sound { transition: none; }
}

/* ── STATEMENT (photo left, motto right) ── */
.statement {
  max-width: 1560px;
  margin: 0 auto;
  padding: var(--space-section) var(--space-inline);
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: clamp(40px, 6vw, 104px);
}
.statement-img {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--sand);
}
.statement-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.statement-motto {
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
  text-align: center;
}
/* Paragraph and link share one narrow measure, centred under the motto */
.statement-text {
  max-width: 430px;
  margin: clamp(36px, 4vw, 60px) auto 0;
  font-size: 14px;
  line-height: 1.95;
  color: var(--muted);
  text-align: center;
}
.statement-link {
  display: block;
  max-width: 430px;
  margin: 40px auto 0;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.3s;
}
.statement-link:hover { border-color: var(--ink); }

/* ── EXPERIENCES DECK ──────────────────── */
.deck-section { padding-bottom: var(--space-section); }
.deck-header {
  max-width: 1560px;
  margin: 0 auto 48px;
  padding: 0 var(--space-inline);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.deck-header .section-title { margin-top: 0; }

.hero-deck {
  --peek: clamp(64px, 9vw, 160px);
  --gap: 56px;
  --slide-h: clamp(440px, 70vh, 720px);
  position: relative;
}
.hero-track {
  display: flex;
  gap: var(--gap);
  padding: 40px var(--peek);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--peek);
  scrollbar-width: none;
  cursor: grab;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-track.dragging { cursor: grabbing; }
/* Snapping fights the scripted slide animation and manual drag */
.hero-track.dragging,
.hero-track.is-animating { scroll-snap-type: none; }
.hero-track img {
  -webkit-user-drag: none;
  user-select: none;
}

/* Mobile first: photo, then the card under it. The desktop composition
   (two equal photos on a diagonal, card centred over both) is below. */
.hero-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 24px;
}
.hero-slide-main {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--sand);
}
.hero-slide-main img,
.hero-slide-detail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-slide-main img {
  transform: scale(1.05);
  transition: transform 2.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-slide.is-active .hero-slide-main img { transform: scale(1); }

.hero-slide-detail {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--sand);
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s, transform 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}
/* Text card: title, one short line, Discover, centred. The landmark sits
   behind the text and takes no room of its own. */
.hero-slide-text {
  position: relative;
  z-index: 1;
  width: 270px;
  padding: 26px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #FCFAF6;
  border: 1px solid var(--sand);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.4s, transform 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}

@media (min-width: 769px) {
  /* cqw below is the track's content width, i.e. one slide */
  .hero-track { container-type: inline-size; }
  .hero-slide {
    --h: min(var(--slide-h), 56cqw);
    --photo-w: min(calc(var(--h) * 0.99), 56cqw);
    display: block;
    position: relative;
    height: var(--h);
  }
  /* Two photos the same size: one top left, one bottom right, overlapping
     a little in the middle where the card sits over both. */
  .hero-slide-main,
  .hero-slide-detail {
    position: absolute;
    width: var(--photo-w);
  }
  .hero-slide-main { top: 0; left: 0; }
  .hero-slide-detail { bottom: 0; right: 0; }
  .hero-slide-text {
    position: absolute;
    inset: 0;
    margin: auto;
    height: fit-content;
    z-index: 2;
  }
}

.hero-slide.is-active .hero-slide-detail,
.hero-slide.is-active .hero-slide-text {
  opacity: 1;
  transform: none;
}
.hero-slide-title {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--ink);
  margin-bottom: 8px;
}
.hero-slide-desc {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-slide-link {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(43,28,26,0.35);
  padding-bottom: 3px;
  transition: border-color 0.3s;
}
.hero-slide-link:hover { border-color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .hero-slide-main img,
  .hero-slide-detail,
  .hero-slide-text { transition: none; transform: none; opacity: 1; }
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 1024px) {
  .statement {
    padding: var(--space-section-tablet) var(--space-inline-tablet);
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .statement-img { aspect-ratio: 16 / 10; }
  .deck-section { padding-bottom: var(--space-section-tablet); }
  .deck-header { padding: 0 var(--space-inline-tablet); margin-bottom: 36px; }
  .hero-deck { --peek: 72px; --gap: 40px; --slide-h: clamp(440px, 60vh, 560px); }
}

@media (max-width: 768px) {
  /* Full width, height follows the film's own 16:9 frame, sitting just under the fixed nav (--nav-h from nav.js) */
  .film { width: 100%; margin: var(--nav-h, 68px) 0 0; height: auto; aspect-ratio: 16 / 9; }
  .statement {
    padding: var(--space-section-mobile) var(--space-inline-mobile);
    gap: 32px;
  }
  .statement-text { font-size: 13.5px; }
  .deck-section { padding-bottom: var(--space-section-mobile); }
  .deck-header {
    padding: 0 var(--space-inline-mobile);
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 28px;
  }
  .hero-track { padding-block: 24px; }
  .hero-deck { --peek: var(--space-inline-mobile); --gap: 24px; --slide-h: auto; }
  /* Phones keep the desktop diagonal in a narrow frame: two portrait photos
     side by side, the right one dropped lower, the card centred over both. */
  .hero-slide { grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 0; align-items: start; }
  .hero-slide-main,
  .hero-slide-detail { aspect-ratio: 4 / 5; }
  .hero-slide-main { grid-column: 1; grid-row: 1; }
  .hero-slide-detail { grid-column: 2; grid-row: 1; margin-top: 40px; }
  .hero-slide-text { grid-column: 1 / -1; grid-row: 2; justify-self: center; width: min(270px, 86%); margin-top: -80px; }
  .hero-deck { display: flex; flex-direction: column; }
  .hero-deck-nav { order: 2; display: flex; justify-content: flex-end; gap: 10px; padding: 24px var(--space-inline-mobile) 0; }

}

@media (max-width: 480px) {
}
