﻿/* ============================================================
   INFINITY WRITER - INTRODUCTION
   ============================================================ */


/* ============================================================
   INTRO - STRUCTURE
   ============================================================ */

.intro-page {
  overflow: hidden;
}

.intro {
  position: relative;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #000;
}


/* ============================================================
   INTRO - VIDEO
   ============================================================ */

.intro__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.002);
  transition:
    transform 1.4s var(--ease-cinematic),
    filter 1.15s ease;
}


/* ============================================================
   INTRO - VOILE CINEMATIQUE
   ============================================================ */

.intro__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at center, transparent 42%, rgba(0, 0, 0, .38) 100%),
    linear-gradient(to top, rgba(0,0,0,.48), transparent 40%);
  transition: background-color 1.15s ease, opacity 1.15s ease;
  pointer-events: none;
}


/* ============================================================
   INTRO - CHARGEMENT
   ============================================================ */

.intro__loading {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 5.5vh;
  display: grid;
  gap: 10px;
  width: min(260px, 70vw);
  color: rgba(255,255,255,.6);
  font-size: 10px;
  letter-spacing: .2em;
  text-align: center;
  text-transform: uppercase;
  transform: translateX(-50%);
  transition: opacity .5s ease;
}

.intro__loading-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
  transform-origin: left;
  animation: loading-line 1.6s ease-in-out infinite;
}

@keyframes loading-line {
  0% {
    transform: scaleX(0);
    opacity: .2;
  }

  50% {
    transform: scaleX(1);
    opacity: 1;
  }

  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}


/* ============================================================
   INTRO - BOUTON ENTRER
   ============================================================ */

.enter-button {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 7vh;
  min-width: 178px;
  padding: 13px 30px;
  border: 1px solid rgba(199,130,250,.62);
  background: rgba(4,3,7,.32);
  color: var(--white);
  font: 500 11px/1 var(--sans);
  letter-spacing: .34em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  backdrop-filter: blur(12px);
  box-shadow:
    inset 0 0 24px rgba(109,49,251,.08),
    0 0 26px rgba(109,49,251,.08);
  transition:
    opacity .8s ease,
    transform .8s var(--ease-cinematic),
    background-color .3s ease,
    box-shadow .3s ease;
}

.enter-button::before,
.enter-button::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 22px;
  height: 1px;
  background: rgba(199,130,250,.7);
  transition: width .3s ease;
}

.enter-button::before {
  right: calc(100% + 12px);
}

.enter-button::after {
  left: calc(100% + 12px);
}

.enter-button:hover {
  background: rgba(109,49,251,.15);
  box-shadow:
    inset 0 0 30px rgba(109,49,251,.14),
    0 0 32px rgba(109,49,251,.16);
}

.enter-button:hover::before,
.enter-button:hover::after {
  width: 34px;
}


/* ============================================================
   INTRO - ETATS
   ============================================================ */

.intro.is-ready .enter-button {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.intro.is-ready .intro__loading {
  opacity: 0;
  pointer-events: none;
}

.intro.is-leaving {
  pointer-events: none;
}

.intro.is-leaving .intro__video {
  transform: scale(1.065);
  filter: brightness(.38);
}

.intro.is-leaving .intro__veil {
  background-color: #000;
  opacity: 1;
}

.intro.is-leaving .enter-button {
  opacity: 0;
  transform: translate(-50%, -8px);
}

.intro__fallback {
  position: absolute;
  z-index: 4;
  bottom: 3vh;
  left: 50%;
  transform: translateX(-50%);
}
