/* Homepage — navigation et scènes cinématiques pilotées par le scroll. */

.story-page--cinematic #main > section[id] {
  scroll-margin-top: calc(var(--cb-topbar-h, 100px) + 18px);
}

.home-cinema-spacer {
  position: relative;
  z-index: 0;
  height: var(--home-cinema-hold, 280px);
  pointer-events: none;
}

.home-cinema-progress {
  --home-cinema-progress: 0;
  position: fixed;
  z-index: 88;
  top: calc(var(--home-cinema-top, 100px) + 30px);
  right: clamp(16px, 2.1vw, 38px);
  bottom: 30px;
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  gap: 14px;
  width: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s cubic-bezier(.16, 1, .3, 1);
}

.home-cinema--enhanced .home-cinema-progress {
  opacity: .82;
}

.home-cinema-progress__count {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: rgba(203, 215, 235, .54);
  font-family: var(--cb-display-font);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  writing-mode: vertical-rl;
}

.home-cinema-progress__count b {
  color: rgba(220, 231, 248, .92);
  font-size: 12px;
  font-weight: 600;
}

.home-cinema-progress__rail {
  position: relative;
  display: block;
  width: 1px;
  height: min(42vh, 340px);
  overflow: hidden;
  border-radius: 999px;
  background: rgba(184, 205, 235, .14);
}

.home-cinema-progress__fill {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: inherit;
  background: var(--cb-accent-gradient);
  box-shadow: 0 0 18px rgba(86, 126, 255, .52);
  transform: scaleY(var(--home-cinema-progress));
  transform-origin: 50% 0;
}

.story-page--cinematic [data-home-section-nav] a[href^="#"] {
  position: relative;
}

.story-page--cinematic [data-home-section-nav] a[href^="#"]::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 3px;
  left: 12px;
  height: 2px;
  border-radius: 999px;
  background: var(--cb-accent-gradient);
  opacity: 0;
  transform: scaleX(.45);
  transition:
    opacity .25s cubic-bezier(.16, 1, .3, 1),
    transform .3s cubic-bezier(.16, 1, .3, 1);
}

.story-page--cinematic [data-home-section-nav] a[aria-current="location"] {
  color: #fff;
}

.story-page--cinematic [data-home-section-nav] a[aria-current="location"]::after {
  opacity: 1;
  transform: scaleX(1);
}

body.home-cinema--enhanced #main {
  position: relative;
  isolation: isolate;
  overflow: visible;
}

body.home-cinema--enhanced #main > .home-cinema-scene h2 {
  font-weight: var(--cb-display-weight);
  letter-spacing: var(--cb-display-tracking);
  line-height: var(--cb-display-leading);
}

body.home-cinema--enhanced #main > .home-cinema-scene {
  --home-entry-opacity: 1;
  --home-entry-y: 0px;
  --home-entry-scale: 1;
  --home-entry-clip-y: 0%;
  --home-entry-clip-x: 0%;
  --home-entry-radius: 0px;
  --home-exit-brightness: 1;
  --home-exit-blur: 0px;
  position: sticky;
  top: var(--home-cinema-top);
  z-index: calc(12 + var(--home-scene-index, 0));
  display: grid;
  align-items: center;
  align-content: center;
  width: 100%;
  height: var(--home-cinema-stage);
  min-height: var(--home-cinema-stage);
  max-height: var(--home-cinema-stage);
  margin-block: 0;
  overflow: clip;
  opacity: var(--home-entry-opacity);
  clip-path: inset(
    var(--home-entry-clip-y)
    var(--home-entry-clip-x)
    0
    round var(--home-entry-radius)
  );
  filter:
    brightness(var(--home-exit-brightness))
    blur(var(--home-exit-blur));
  transform:
    translate3d(0, var(--home-entry-y), 0)
    scale(var(--home-entry-scale));
  transform-origin: 50% 100%;
  box-shadow: 0 -42px 110px -70px rgba(41, 107, 195, .72);
  will-change: transform, opacity, clip-path, filter;
  backface-visibility: hidden;
}

body.home-cinema--enhanced #main > .home-cinema-scene.story-reveal,
body.home-cinema--enhanced #main > .home-cinema-scene.story-reveal.is-in {
  opacity: var(--home-entry-opacity);
  transform:
    translate3d(0, var(--home-entry-y), 0)
    scale(var(--home-entry-scale));
  transition: none;
}

body.home-cinema--enhanced #main > .home-cinema-scene.is-home-cinema-covered {
  visibility: hidden;
}

body.home-cinema--enhanced #main > .home-cinema-scene:focus-within {
  visibility: visible;
  opacity: 1;
  clip-path: inset(0);
  filter: none;
}

body.home-cinema--enhanced #main > .home-cinema-scene > * {
  position: relative;
  z-index: 2;
}

body.home-cinema--enhanced .site-footer {
  position: relative;
  z-index: 70;
}

@media (max-width: 1120px), (prefers-reduced-motion: reduce) {
  .home-cinema-progress,
  .home-cinema-spacer {
    display: none !important;
  }

  .story-page--cinematic [data-home-section-nav] a[href^="#"]::after {
    bottom: 6px;
  }
}

@media (forced-colors: active) {
  .home-cinema-progress__fill,
  .story-page--cinematic [data-home-section-nav] a[href^="#"]::after {
    background: Highlight;
  }
}
