/**
 * Home Next — Opening curtain + section title reveal
 * Home Next のみ（.nw-next-draft3）
 */

/* ——— Opening curtain ——— */
.nw-opening {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080808;
  color: #fff;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  pointer-events: auto;
}

.nw-opening__brand {
  margin: 0;
  font-family: var(--font-en, "Unbounded", system-ui, sans-serif);
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: none;
  color: rgba(255, 255, 255, 0.35);
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 0.5s ease,
    color 0.5s ease,
    letter-spacing 0.5s ease;
}

.nw-opening.is-brand-in .nw-opening__brand {
  opacity: 1;
  color: #fff;
  letter-spacing: 0.12em;
}

.nw-opening.is-brand-out .nw-opening__brand {
  opacity: 0.35;
}

.nw-opening.is-exit {
  transform: translate3d(0, -100%, 0);
  transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
  pointer-events: none;
}

.nw-opening.is-done {
  visibility: hidden;
  pointer-events: none;
  display: none;
}

html.is-opening,
html.is-opening body {
  overflow: hidden;
}

html.is-opening body {
  padding-right: var(--nw-scrollbar-comp, 0px);
}

/* Pause FV story animations while curtain is up */
html.is-opening .nw-showreel__scene.is-active,
html.is-opening .nw-showreel__scene.is-active *,
html.is-opening .nw-showreel__scene.is-active *::before,
html.is-opening .nw-showreel__scene.is-active *::after {
  animation-play-state: paused !important;
}

/* ——— Section title reveal ——— */
html.nw-js .nw-reveal-title {
  overflow: hidden;
}

html.nw-js .nw-reveal-title .nw-reveal-title__line {
  display: block;
  will-change: transform, opacity, clip-path;
  transition:
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    clip-path 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

html.nw-js .nw-reveal-title:not(.is-revealed) .nw-reveal-title__line {
  opacity: 0;
  transform: translate3d(0, 48px, 0);
  clip-path: inset(0 0 100% 0);
}

html.nw-js .nw-reveal-title.is-revealed .nw-reveal-title__line {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  clip-path: inset(0 0 0 0);
}

html.nw-js .nw-reveal-title .nw-reveal-title__line--delay {
  transition-delay: 0.12s;
}

/* Contact title has inner spans — keep block flow */
html.nw-js .nw-reveal-title .nw-next-contact__title.nw-reveal-title__line {
  display: block;
}

@media (max-width: 980px) {
  html.nw-js .nw-reveal-title:not(.is-revealed) .nw-reveal-title__line {
    transform: translate3d(0, 40px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nw-opening,
  .nw-opening.is-exit {
    transition: none !important;
    transform: none !important;
    display: none !important;
  }

  html.is-opening,
  html.is-opening body {
    overflow: visible !important;
    padding-right: 0 !important;
  }

  html.is-opening .nw-showreel__scene.is-active,
  html.is-opening .nw-showreel__scene.is-active *,
  html.is-opening .nw-showreel__scene.is-active *::before,
  html.is-opening .nw-showreel__scene.is-active *::after {
    animation-play-state: running !important;
  }

  html.nw-js .nw-reveal-title .nw-reveal-title__line,
  html.nw-js .nw-reveal-title:not(.is-revealed) .nw-reveal-title__line,
  html.nw-js .nw-reveal-title.is-revealed .nw-reveal-title__line {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }
}
