/* Hero film.
   First visit: the KALSOM / CINERARIA films (with their own sound) fill the viewport with the collection title.
   Scrolling shrinks the film and fuses it into the outlined MUSHEI letters, where it keeps playing. */
:root {
  --mushei-film-runway: 150vh;
}
/* Mobile: reserve a full screen before the following sections enter the viewport. */
@media (max-width: 640px) {
  :root { --mushei-film-runway: 110svh; }
}
/* The static poster reserves the same opening space until the film mounts. */
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-home-preview], :has(#visite-3d:target)) main[data-page="home"]:not(:has(> .mushei-film-runway))::before {
    content: "";
    display: block;
    height: var(--mushei-film-runway);
    background: #0b0a09 url('/assets/films/intro.jpg') center 38% / cover no-repeat;
  }
}
/* Scroll runway placed before the wordmark; the film stays fixed while the page scrolls past it. */
.mushei-film-runway {
  height: var(--mushei-film-runway);
  pointer-events: none;
}
.mushei-film-stage {
  --cover: 1;   /* 1 = whole rectangle visible, 0 = only the letters */
  --zoom: 1.6;  /* letter mask scale, 1 = letters fit the box */
  --copy: 1;    /* title opacity */
  --copy-y: 0px;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #0b0a09;
  -webkit-mask-image: url('/mushei-hero-mask.svg'), linear-gradient(rgb(0 0 0 / var(--cover)), rgb(0 0 0 / var(--cover)));
  mask-image: url('/mushei-hero-mask.svg'), linear-gradient(rgb(0 0 0 / var(--cover)), rgb(0 0 0 / var(--cover)));
  -webkit-mask-size: calc(100% * var(--zoom)) calc(100% * var(--zoom)), 100% 100%;
  mask-size: calc(100% * var(--zoom)) calc(100% * var(--zoom)), 100% 100%;
  -webkit-mask-position: center, center;
  mask-position: center, center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  will-change: width, height, top, left;
  contain: layout paint style;
}
/* Fused: the film sits inside the wordmark box and scrolls with the page. */
.mushei-film-stage.is-fused {
  --cover: 0;
  --zoom: 1;
  --copy: 0;
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  background: transparent;
  will-change: auto;
}
.mushei-film-stage video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 38%;
  opacity: 0;
  transition: opacity 1200ms cubic-bezier(.22, 1, .36, 1);
}
.mushei-film-stage video.is-visible { opacity: 1; }
.mushei-film-stage .mf-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  width: max-content;
  min-height: 44px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border: 0;
  background: transparent;
  white-space: nowrap;
  color: #ede4dd;
  font: 500 12px/1.5 var(--font-mushei-brand, Arial), sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgb(0 0 0 / .6);
  cursor: pointer;
  pointer-events: auto;
  touch-action: pan-y pinch-zoom;
}
.mushei-film-stage .mf-play[hidden] { display: none; }
.mushei-film-stage .mf-play-disc {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(88px, 9vw, 116px);
  aspect-ratio: 1;
  border: 1px solid rgb(237 228 221 / .65);
  border-radius: 50%;
  background: rgb(18 12 10 / .3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgb(0 0 0 / .16), inset 0 1px 0 rgb(255 255 255 / .1);
  transition: transform 180ms cubic-bezier(.23, 1, .32, 1), background-color 180ms ease, border-color 180ms ease;
}
.mushei-film-stage .mf-play-disc::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid rgb(237 228 221 / .18);
  border-radius: inherit;
}
.mushei-film-stage .mf-play-disc::after {
  content: '';
  position: absolute;
  top: -3px;
  left: calc(50% - 2.5px);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.mushei-film-stage .mf-play-icon { width: 26px; height: 26px; fill: currentColor; }
.mushei-film-stage .mf-play-icon path { transform: none !important; translate: none !important; }
.mushei-film-stage .mf-play-label { font-size: 10px; line-height: 1.5; }
.mushei-film-stage .mf-play:focus-visible { outline: none; }
.mushei-film-stage .mf-play:focus-visible .mf-play-disc { outline: 2px solid currentColor; outline-offset: 5px; }
@media (hover: hover) and (pointer: fine) {
  .mushei-film-stage .mf-play:hover .mf-play-disc {
    transform: scale(1.06);
    border-color: #ede4dd;
    background: rgb(18 12 10 / .48);
  }
}
.mushei-film-stage .mf-play:active .mf-play-disc { transform: scale(.96); }
@media (prefers-reduced-motion: reduce) {
  .mushei-film-stage .mf-play-disc { transition: none; }
  .mushei-film-stage .mf-play:hover .mf-play-disc,
  .mushei-film-stage .mf-play:active .mf-play-disc { transform: none; }
}
@media (max-width: 640px) {
  .mushei-film-stage.is-swipeable {
    pointer-events: auto;
    touch-action: pan-y pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
  }

}
/* Soft vignette so the title stays legible on bright frames. */
.mushei-film-stage::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / .18) 0%, rgb(0 0 0 / 0) 35%, rgb(0 0 0 / 0) 60%, rgb(0 0 0 / .32) 100%);
  opacity: var(--copy);
}
.mushei-film-copy {
  position: absolute; inset: 0;
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(10px, 1.6vw, 22px);
  padding: 0 24px;
  text-align: center;
  color: #ede4dd;
  opacity: var(--copy);
  transform: translate3d(0, var(--copy-y), 0);
  text-shadow: 0 2px 24px rgb(0 0 0 / .25);
}
.mushei-film-copy .mf-eyebrow {
  margin: 0;
  font-size: clamp(11px, 1.05vw, 15px);
  font-weight: 500;
  max-width: 32em;
  letter-spacing: .32em;
  text-transform: uppercase;
  opacity: .9;
}
@media (max-width: 640px) {
  .mushei-film-copy .mf-eyebrow { font-size: 10px; letter-spacing: .22em; line-height: 1.7; max-width: 24em; }
}
.mushei-film-copy .mf-title {
  margin: 0;
  font-size: clamp(64px, 15vw, 230px);
  font-weight: 500;
  line-height: .92;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.mushei-film-copy .mf-eyebrow,
.mushei-film-copy .mf-title {
  transition: opacity 700ms cubic-bezier(.22, 1, .36, 1), transform 700ms cubic-bezier(.22, 1, .36, 1);
}
.mushei-film-copy.is-switching .mf-eyebrow,
.mushei-film-copy.is-switching .mf-title { opacity: 0; transform: translateY(10px); }
.mushei-film-copy .mf-scroll {
  position: absolute; bottom: clamp(24px, 4vh, 40px); left: 50%;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  transform: translateX(-50%);
  min-width: 88px; min-height: 64px; margin: 0; padding: 0;
  border: 0; background: transparent; color: inherit;
  font: inherit; font-size: 11px; line-height: 1; letter-spacing: .28em; text-transform: uppercase;
  text-align: center; opacity: .85; cursor: pointer; pointer-events: auto;
  transition: opacity 200ms ease;
}
.mushei-film-copy .mf-scroll svg {
  display: block; width: 12px; height: 40px;
  stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round;
  animation: mushei-film-scroll 2400ms ease-in-out infinite;
}
.mushei-film-copy .mf-scroll:focus-visible { outline: 1px solid currentColor; outline-offset: 8px; }
@media (hover: hover) and (pointer: fine) {
  .mushei-film-copy .mf-scroll:hover { opacity: 1; }
}
@keyframes mushei-film-scroll {
  0%, 100% { transform: translateY(0); opacity: .55; }
  50% { transform: translateY(5px); opacity: 1; }
}
/* The compiled home reveal targets SVG paths broadly; keep control icons in place. */
.mushei-film-copy .mf-scroll path,
.mushei-film-copy .mf-sound-icon path { transform: none !important; translate: none !important; }
/* Outlines stay above the film; the letters no longer reveal lookbook photos on hover or focus. */
:has(> .mushei-film-stage) > svg[data-mushei-wordmark] { position: relative; z-index: 1; pointer-events: none; }
:has(> .mushei-film-stage) > svg[data-mushei-hover="true"] [data-letter] { fill-opacity: 0 !important; pointer-events: none; }
:has(> .mushei-film-stage) > svg[data-mushei-hover="true"] { cursor: default; }
@media (prefers-reduced-motion: reduce) {
  .mushei-film-stage video,
  .mushei-film-copy .mf-eyebrow,
  .mushei-film-copy .mf-title { transition: none; }
  .mushei-film-copy .mf-scroll svg { animation: none; }
}
/* Recognizable speaker icon, aligned with the scroll label on the opposite side. */
.mushei-film-copy .mf-sound {
  position: absolute; bottom: calc(clamp(24px, 4vh, 40px) + 37px); right: calc(clamp(20px, 3vw, 48px) - 4px);
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 12px 4px;
  border: 0; background: transparent; color: inherit;
  font: 800 11px/1 var(--font-mushei-brand, Arial), sans-serif;
  letter-spacing: .3em; text-transform: uppercase;
  opacity: .8; cursor: pointer; pointer-events: auto;
  transition: opacity 250ms ease;
}
.mushei-film-copy .mf-sound:hover,
.mushei-film-copy .mf-sound[aria-pressed="true"] { opacity: 1; }
.mushei-film-copy .mf-sound[hidden] { display: none; }
.mushei-film-copy .mf-sound:focus-visible { outline: 1px solid currentColor; outline-offset: 6px; }
.mushei-film-stage.is-fused .mf-sound { visibility: hidden; }
.mushei-film-copy .mf-sound-icon {
  display: block; flex: none; width: 22px; height: 22px;
  stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round;
}
.mushei-film-copy .mf-sound-waves,
.mushei-film-copy .mf-sound-muted { transition: opacity 180ms ease; }
.mushei-film-copy .mf-sound-waves { opacity: 0; }
.mushei-film-copy .mf-sound-muted { opacity: .8; }
.mushei-film-copy .mf-sound[aria-pressed="true"] .mf-sound-waves { opacity: 1; }
.mushei-film-copy .mf-sound[aria-pressed="true"] .mf-sound-muted { opacity: 0; }
/* Autoplay held back by the browser: a soft breathing invites a click. */
.mushei-film-copy .mf-sound.is-inviting { animation: mushei-film-invite 2.4s ease-in-out infinite; }
@keyframes mushei-film-invite { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .mushei-film-copy .mf-sound.is-inviting { animation: none; }
  .mushei-film-copy .mf-sound-waves,
  .mushei-film-copy .mf-sound-muted { transition: none; }
}

/* Film progress, bottom left, level with the sound control: a ring that fills, then 01 02 03. */
.mushei-film-copy .mf-progress {
  position: absolute; bottom: calc(clamp(24px, 4vh, 40px) + 37px); left: clamp(20px, 3vw, 48px);
  display: flex; align-items: center; gap: 4px;
  min-height: 44px; pointer-events: auto;
  font: 500 12px/1 var(--font-mushei-brand, Arial), sans-serif;
  font-variant-numeric: tabular-nums; letter-spacing: .08em;
}
.mushei-film-stage.is-fused .mf-progress, .mushei-film-stage.is-fused .mf-ring { visibility: hidden; }
.mushei-film-copy .mf-ring { width: 26px; height: 26px; margin-right: 8px; overflow: visible; transform: rotate(-90deg); }
.mushei-film-copy .mf-ring circle { fill: none; stroke: currentColor; stroke-width: 1.4; }
.mushei-film-copy .mf-ring-track { opacity: .3; }
.mushei-film-copy .mf-ring-fill { stroke-dasharray: 1; stroke-dashoffset: 1; stroke-linecap: round; }
.mushei-film-copy .mf-ring .mf-ring-dot { fill: currentColor; stroke: none; }
.mushei-film-copy .mf-step {
  min-width: 32px; min-height: 32px; padding: 0 6px; margin: 0;
  border: 1px solid transparent; border-radius: 3px; background: transparent; color: inherit;
  font: inherit; letter-spacing: inherit; opacity: .45; cursor: pointer;
  transition: opacity 250ms ease, border-color 250ms ease;
}
.mushei-film-copy .mf-step:hover { opacity: .85; }
.mushei-film-copy .mf-step.is-active { opacity: 1; border-color: currentColor; }
.mushei-film-copy .mf-step:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }

@media (max-width: 640px) {
  .mushei-film-stage:not(.is-fused) { height: 100dvh; }
  .mushei-film-copy .mf-progress {
    top: calc(16px + env(safe-area-inset-top, 0px));
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    gap: 0;
    max-width: calc(100% - 112px);
    overflow-x: auto;
    scrollbar-width: none;
  }
  /* Phones: a small dot for each film, with the existing accessible buttons. */
  .mushei-film-copy .mf-progress::-webkit-scrollbar { display: none; }
  .mushei-film-copy .mf-step {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    min-width: 28px;
    min-height: 44px;
    padding: 0;
    border: 0;
    font-size: 0;
    letter-spacing: 0;
  }
  .mushei-film-copy .mf-step::after {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    transform: scale(1);
    transition: transform 160ms ease-out;
  }
  .mushei-film-copy .mf-step.is-active::after { transform: scale(1.5); }
  .mushei-film-copy > .mf-ring {
    display: block;
    position: absolute;
    left: 20px;
    bottom: calc(clamp(24px, 4svh, 40px) + 46px + env(safe-area-inset-bottom, 0px));
    margin: 0;
    pointer-events: none;
  }
  @media (prefers-reduced-motion: reduce) { .mushei-film-copy .mf-step::after { transition: none; } }
  .mushei-film-copy .mf-scroll {
    bottom: calc(clamp(24px, 4svh, 40px) + env(safe-area-inset-bottom, 0px));
  }
  .mushei-film-copy .mf-sound {
    bottom: calc(clamp(24px, 4svh, 40px) + 37px + env(safe-area-inset-bottom, 0px));
  }
}
