/* phones draw a blue flash on every tap; the site's own hover and focus styles replace it */
a, button, [role="button"] { -webkit-tap-highlight-color: transparent; }

/* Homepage new sections + motion for 04, 05, 07 (owner: partner agent)
   Static states here are the JS-off / reduced-motion look. JS adds motion only. */

/* ============================================================
   THE NIGHT — Season One on film (reel-shaped frame)
   ============================================================ */
.the-night {
  position: relative;
  padding: 6rem 3rem;
  overflow: hidden;
}

/* faint gold halo behind the frame */
.the-night::before {
  content: '';
  position: absolute;
  left: 8%;
  top: 50%;
  width: min(60vw, 720px);
  aspect-ratio: 1;
  transform: translate(-10%, -50%);
  background: radial-gradient(circle, rgba(240, 215, 140, 0.12), transparent 62%);
  pointer-events: none;
}

.the-night-inner {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(3rem, 7vw, 7rem);
  max-width: 1200px;
  margin: 0 auto;
}

.the-night-film {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* 9:16 frame, never larger than the video's native 1280px height */
.the-night-frame {
  position: relative;
  height: min(78vh, 680px);
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  overflow: hidden;
  background: #0a0a0a;
  border: 1px solid rgba(240, 215, 140, 0.35);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 6px rgba(240, 215, 140, 0.05);
  will-change: transform;
}

.the-night-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* thin inner rule, like a viewfinder */
.the-night-frame::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(244, 239, 228, 0.12);
  border-radius: 12px;
  pointer-events: none;
}

.the-night-toggle {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(240, 215, 140, 0.6);
  background: rgba(0, 0, 0, 0.55);
  color: var(--gold);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.3s ease, color 0.3s ease;
}

.the-night-toggle[hidden] { display: none; }

.the-night-toggle:hover,
.the-night-toggle:focus-visible {
  background: var(--gold);
  color: #000;
}

.the-night-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* pause bars by default, play triangle when paused */
.the-night-toggle::before {
  content: '';
  width: 10px;
  height: 12px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
  box-sizing: border-box;
}

.the-night-toggle.is-paused::before {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent currentColor;
}

.the-night-film figcaption {
  font: 500 0.7rem/1 'Oswald', sans-serif;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(240, 215, 140, 0.75);
}

.the-night-kicker {
  font: 500 0.75rem/1 'Oswald', sans-serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.5rem;
}

.the-night-text h2 {
  font-family: 'Oswald', sans-serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 5.4vw, 5rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0;
}

.the-night-lead {
  max-width: 26rem;
  margin: 1.75rem 0 0;
  padding-left: 1.25rem;
  border-left: 1px solid var(--gold);
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 900px) {
  .the-night { padding: 3.5rem 1.5rem; }
  .the-night::before { left: 50%; top: 62%; width: 110vw; transform: translate(-50%, -50%); }
  .the-night-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .the-night-text { order: 1; }
  .the-night-film { order: 2; }
  .the-night-frame { height: auto; width: min(72vw, 320px); }
  .the-night-text h2 { font-size: clamp(2rem, 9vw, 2.8rem); }
  .the-night-lead { font-size: 0.95rem; margin-top: 1.25rem; }
}

/* ============================================================
   04 COUNTRIES — labels, tile shade, desktop pinned track
   ============================================================ */
/* wrapper is invisible to layout unless the track is active */
.section-4-stage { display: contents; }

.country-name {
  position: absolute;
  left: 1rem;
  bottom: 0.9rem;
  z-index: 1;
  font: 500 0.95rem/1 'Oswald', sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ivory);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
  pointer-events: none;
}

.country-item { position: relative; }

@media (min-width: 901px) {
  /* same rgba(0,0,0,.6) shade as before, moved from the section onto each tile
     so the country names can sit above it; the photos look exactly as they did */
  .section-4::before { content: none; }

  .country-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
  }

  .country-name { left: 1.25rem; bottom: 1.25rem; font-size: 0.8rem; letter-spacing: 0.22em; }

  /* --- pinned horizontal track (class added by JS: desktop + motion allowed) --- */
  .section-4.is-track {
    display: block;
    padding: 0;
    min-height: 0;
  }

  .section-4.is-track .section-4-stage {
    display: block;
    position: relative;
    height: 100vh;
    overflow: hidden;
  }

  .section-4.is-track .country-row {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: max-content;
    align-items: center;
    gap: clamp(1rem, 2vw, 2rem);
    padding: 0 6vw 0 38%;
    will-change: transform;
  }

  /* square tiles = the square artwork shown whole, never cropped */
  .section-4.is-track .country-item {
    flex: 0 0 auto;
    width: min(72vh, 620px);
    height: min(72vh, 620px);
    background-size: cover;
    border-radius: 4px;
    overflow: hidden;
  }

  .section-4.is-track .country-name {
    left: 1.75rem;
    bottom: 1.5rem;
    font-size: clamp(2.6rem, 5.2vw, 5rem);
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 0.95;
    white-space: normal;
    max-width: calc(100% - 3.5rem);
  }

  .section-4.is-track .country-name::before {
    content: attr(data-index);
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--gold);
  }

  /* text panel holds still while the tiles slide in beneath its black fade */
  .section-4.is-track .section-4-text {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 38%;
    justify-content: center;
    padding: 0 3vw 0 3rem;
    background: linear-gradient(90deg, #000 0%, #000 80%, rgba(0, 0, 0, 0) 100%);
  }
}

/* ============================================================
   07 SEASON ONE — stacks fan with scroll (--fan, from JS) + hover bump
   Static default --fan: .55 reproduces the original resting fan;
   hover adds .45 (= the original hover fan). JS scrubs --fan 0 -> 1.
   ============================================================ */
@media (min-width: 901px) {
  .season-tile {
    --fan: 0.55;
    --fan-hover: 0;
  }

  .season-tile:hover { --fan-hover: 0.45; }

  .season-one-grid .season-tile .photo-stack-item {
    --f: min(calc(var(--fan) + var(--fan-hover)), 1.2);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
  }

  .season-one-grid .season-tile .photo-stack-item:nth-child(1) {
    transform: rotate(calc(-4deg - 22deg * var(--f))) translate(calc(-4% - 28% * var(--f)), calc(2% + 14% * var(--f)));
  }

  .season-one-grid .season-tile .photo-stack-item:nth-child(2) {
    transform: rotate(calc(3deg + 19deg * var(--f))) translate(calc(4% + 22% * var(--f)), calc(-2% - 12% * var(--f)));
  }

  .season-one-grid .season-tile .photo-stack-item.photo-stack-main {
    transform: rotate(0deg) scale(calc(1.04 + 0.1 * var(--f)));
  }
}

/* ============================================================
   Background decoration — The Night + Season One in numbers
   (decorative only, aria-hidden; drift added in js/home-motion.js)
   ============================================================ */
.hm-decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* huge outlined word sitting behind the content */
.hm-word {
  position: absolute;
  white-space: nowrap;
  font: 500 clamp(7rem, 19vw, 18rem)/0.85 'Oswald', sans-serif;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1px rgba(240, 215, 140, 0.11);
  will-change: transform;
}

/* --- The Night: camera flashes on both sides + red carpet under the film --- */
.hm-decor--night .hm-word { right: -2vw; bottom: -0.12em; }

/* the old left-side halo is replaced by the flashes */
.the-night::before { content: none; }

.the-night-film { position: relative; isolation: isolate; }

/* Press-line camera flashes, same look as the Media page hero (.md-hero__flash):
   soft halo (span) + anamorphic streak (::before) + hot core and glint (::after).
   Positions/sizes/timing come from inline custom props: --x --y --s --t --o --r */
.hm-flashes {
  --hm-fs: clamp(5rem, 9vw, 10rem);
  position: absolute;
  top: 4%;
  bottom: 4%;
  width: 18%;
  pointer-events: none;
}
.hm-flashes--l { left: 0; }
.hm-flashes--r { right: 0; }

.hm-flash {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(var(--s, 1) * var(--hm-fs));
  aspect-ratio: 1;
  translate: -50% -50%;
  rotate: var(--r, 0deg);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 234 184 / 0.34), rgb(240 215 140 / 0.1) 40%, transparent);
  opacity: 0.16; /* static "ghost" glints when motion is reduced */
  transform: scale(0.6);
}
.hm-flash::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -45%;
  right: -45%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(255 234 184 / 0.85) 50%, transparent);
}
.hm-flash::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, rgb(255 255 255) 0 2.5%, rgb(255 234 184 / 0.9) 5%, transparent 15%),
    linear-gradient(transparent, rgb(255 234 184 / 0.7), transparent) 50% 50% / 1px 56% no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  .hm-flash {
    opacity: 0;
    animation: hm-flash var(--t, 7s) ease-out var(--o, 0s) infinite;
    will-change: opacity, transform;
  }
  .hm-flash--burst { animation-name: hm-flash-burst; }
}
/* a flash: near-instant pop, ~half-second decay, then dark for the rest of the period */
@keyframes hm-flash {
  0% { opacity: 0; transform: scale(0.5); }
  1% { opacity: 1; transform: scale(1); }
  18%, 100% { opacity: 0; transform: scale(1.08); }
}
/* a double tap, like a photographer firing twice */
@keyframes hm-flash-burst {
  0% { opacity: 0; transform: scale(0.5); }
  1% { opacity: 1; transform: scale(1); }
  8% { opacity: 0.08; transform: scale(0.92); }
  10% { opacity: 0.9; transform: scale(1); }
  23%, 100% { opacity: 0; transform: scale(1.08); }
}

/* phones: narrower side lanes, smaller flashes, fewer of them */
@media (max-width: 700px) {
  .hm-flashes { --hm-fs: 4.5rem; width: 22%; }
  .hm-flash:nth-child(2),
  .hm-flash:nth-child(4) { display: none; }
}

/* red carpet running from under the frame down to the section's bottom edge */
.hm-carpet {
  position: absolute;
  z-index: -2;
  left: 50%;
  top: 55%;
  bottom: -6rem;         /* reaches the section's bottom edge (section padding) */
  width: 150%;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg, transparent 0 3%, rgba(240, 215, 140, 0.35) 3% 3.6%, transparent 3.6% 96.4%, rgba(240, 215, 140, 0.35) 96.4% 97%, transparent 97%),
    linear-gradient(180deg, #5e0d16 0%, #8a1420 55%, #6b0f19 100%);
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 75%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 75%, transparent 100%);
  opacity: 0.75;
  pointer-events: none;
}

/* 35mm film strip: dark band with gold sprocket holes */
.hm-strip {
  position: absolute;
  top: -5%;
  bottom: -5%;
  width: 46px;
  border-left: 1px solid rgba(240, 215, 140, 0.14);
  border-right: 1px solid rgba(240, 215, 140, 0.14);
  background:
    repeating-linear-gradient(180deg, transparent 0 10px, rgba(240, 215, 140, 0.16) 10px 24px, transparent 24px 34px) 7px 0 / 8px 100% no-repeat,
    repeating-linear-gradient(180deg, transparent 0 10px, rgba(240, 215, 140, 0.16) 10px 24px, transparent 24px 34px) calc(100% - 7px) 0 / 8px 100% no-repeat,
    rgba(240, 215, 140, 0.02);
  will-change: transform;
}
.hm-strip--l { left: 2.5vw; }
.hm-strip--r { right: 2.5vw; }

.the-night-inner { z-index: 1; }

@media (max-width: 900px) {
  .hm-strip { width: 30px; }
  .hm-strip--l { left: 0.5rem; }
  .hm-strip--r { right: 0.5rem; }
}

/* ============================================================
   The Night — big play button over the poster until the film is started
   ============================================================ */
.the-night-toggle.is-paused {
  right: 50%;
  bottom: 50%;
  width: 76px;
  height: 76px;
  transform: translate(50%, 50%);
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 0 0 10px rgba(240, 215, 140, 0.08);
}
.the-night-toggle.is-paused::before {
  margin-left: 5px;
  border-width: 12px 0 12px 19px;
}

/* ============================================================
   04 Countries — tiles 20% smaller (desktop track + mobile strip)
   ============================================================ */
@media (min-width: 901px) {
  .section-4.is-track .country-item {
    width: min(57.6vh, 496px);
    height: min(57.6vh, 496px);
  }
  .section-4.is-track .country-name { font-size: clamp(2.1rem, 4.2vw, 4rem); }
}
@media (max-width: 900px) {
  .country-item { flex-basis: 50%; }
}
@media (max-width: 420px) {
  .country-item { flex-basis: 59%; }
}

/* ============================================================
   Background decoration — stronger
   ============================================================ */
.hm-word { -webkit-text-stroke: 1.5px rgba(240, 215, 140, 0.26); }

.hm-strip {
  border-color: rgba(240, 215, 140, 0.3);
  background:
    repeating-linear-gradient(180deg, transparent 0 10px, rgba(240, 215, 140, 0.38) 10px 24px, transparent 24px 34px) 7px 0 / 8px 100% no-repeat,
    repeating-linear-gradient(180deg, transparent 0 10px, rgba(240, 215, 140, 0.38) 10px 24px, transparent 24px 34px) calc(100% - 7px) 0 / 8px 100% no-repeat,
    rgba(240, 215, 140, 0.05);
}

.the-night::before { background: radial-gradient(circle, rgba(240, 215, 140, 0.22), transparent 62%); }

/* ============================================================
   Background decoration — always moving (ambient loops)
   Uses the individual translate/rotate/scale properties so these
   loops stack on top of the scroll drift GSAP puts on `transform`.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  /* the film runs: sprocket holes travel down the strip */
  .hm-strip { animation: hmFilm 2.4s linear infinite; }
  .hm-strip--r { animation-direction: reverse; }

  /* a light sweep travels across the outlined words */
  .hm-word {
    background: linear-gradient(100deg, transparent 0 40%, rgba(240, 215, 140, 0.35) 50%, transparent 60% 100%) 0 0 / 300% 100% no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    animation: hmShine 7s ease-in-out infinite;
  }

}

/* drifting gold dust (spans injected by js/home-motion.js) */
.hm-dust {
  position: absolute;
  bottom: -10px;
  width: var(--s, 3px);
  height: var(--s, 3px);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(240, 215, 140, 0.9);
  opacity: 0;
  animation: hmDust var(--d, 14s) linear var(--delay, 0s) infinite;
}

@keyframes hmFilm    { to { background-position: 7px 34px, calc(100% - 7px) 34px, 0 0; } }
@keyframes hmShine   { 0% { background-position: 100% 0; } 60%, 100% { background-position: -50% 0; } }
@keyframes hmSpin    { to { rotate: 360deg; } }
@keyframes hmFloat   { 0%, 100% { translate: 0 -14px; } 50% { translate: 0 14px; } }
@keyframes hmGlow    { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
@keyframes hmDust {
  0%   { opacity: 0; translate: 0 0; }
  10%  { opacity: var(--o, 0.7); }
  85%  { opacity: var(--o, 0.7); }
  100% { opacity: 0; translate: var(--dx, 20px) calc(var(--rise, 600px) * -1); }
}

@media (prefers-reduced-motion: reduce) {
  .hm-dust { display: none; }
}

/* phones / touch: these loops animate background-position, a full repaint every frame */
@media (hover: none), (max-width: 900px) {
  .hm-strip,
  .hm-word { animation: none; }
}

/* sprocket holes as a repeating tile, so the running-film loop is seamless */
.hm-strip {
  background:
    linear-gradient(180deg, transparent 0 10px, rgba(240, 215, 140, 0.38) 10px 24px, transparent 24px) 7px 0 / 8px 34px repeat-y,
    linear-gradient(180deg, transparent 0 10px, rgba(240, 215, 140, 0.38) 10px 24px, transparent 24px) calc(100% - 7px) 0 / 8px 34px repeat-y,
    rgba(240, 215, 140, 0.05);
}

/* ============================================================
   Design pass (desktop review)
   ============================================================ */
@media (min-width: 901px) {
  /* centre the film + text as one composition instead of hugging the left strip */
  .the-night-inner {
    grid-template-columns: auto minmax(0, 34rem);
    justify-content: center;
    gap: clamp(3rem, 6vw, 6rem);
  }
  /* the outlined word sits whole along the bottom, clear of the frame */
  .hm-decor--night .hm-word {
    right: 7vw;
    bottom: 0.04em;
    font-size: clamp(6rem, 13vw, 13rem);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hm-word { background-image: linear-gradient(100deg, transparent 0 42%, rgba(240, 215, 140, 0.2) 50%, transparent 58% 100%); }
}
/* phones: the film strips collide with the text and the scroll rail, so the beams + dust carry it */
@media (max-width: 900px) {
  .hm-strip { display: none; }
}
