/* ==========================================================
   LISORA — intro.css : animation d'arrivée (page d'accueil)
   ========================================================== */
@property --r {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.intro {
  --r: 0px;
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: var(--color-bg);
  color: var(--white-cream);
  overflow: hidden;
  /* Le « trou » qui s'agrandit depuis la balise du hero (--r animé à l'ouverture) */
  -webkit-mask-image: radial-gradient(
    circle at var(--ox, 50%) var(--oy, 50%),
    transparent var(--r),
    #000 calc(var(--r) + 1px)
  );
  mask-image: radial-gradient(
    circle at var(--ox, 50%) var(--oy, 50%),
    transparent var(--r),
    #000 calc(var(--r) + 1px)
  );
  animation: introGone 0s 7s forwards; /* sécurité si le JS ne répond pas */
}
.no-intro .intro,
.no-intro .intro-ring {
  display: none;
}
.intro.is-open {
  --r: var(--rmax);
  transition: --r 1s cubic-bezier(0.65, 0, 0.25, 1);
  pointer-events: none;
}
.intro--fade {
  -webkit-mask-image: none;
  mask-image: none;
}
.intro--fade.is-open {
  opacity: 0;
  transition: opacity 0.8s ease;
}
.intro--fade ~ .intro-ring {
  display: none;
}
@keyframes introGone {
  to {
    visibility: hidden;
    opacity: 0;
  }
}

/* Anneau lumineux qui accompagne le bord de l'ouverture */
.intro-ring {
  position: fixed;
  z-index: 301;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  left: var(--ox, 50%);
  top: var(--oy, 50%);
  width: calc(var(--rmax, 1000px) * 2);
  height: calc(var(--rmax, 1000px) * 2);
  margin: calc(var(--rmax, 1000px) * -1) 0 0 calc(var(--rmax, 1000px) * -1);
  border: 1px solid rgba(197, 243, 250, 0.75);
  box-shadow:
    0 0 40px rgba(197, 243, 250, 0.35),
    inset 0 0 40px rgba(197, 243, 250, 0.15);
}
.intro-ring.is-open {
  animation: ringOut 1s cubic-bezier(0.65, 0, 0.25, 1) forwards;
}
@keyframes ringOut {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* Mise en scène */
.intro__stage {
  display: grid;
  justify-items: center;
  gap: clamp(28px, 5vw, 44px);
  transition:
    opacity 0.35s ease,
    transform 0.9s var(--ease);
}
.intro.is-open .intro__stage {
  opacity: 0;
  transform: scale(1.06);
}

.intro__mark {
  position: relative;
  width: clamp(180px, 26vw, 240px);
  aspect-ratio: 1;
}
.intro__mark svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.intro__mark .ring {
  fill: none;
  stroke: rgba(243, 240, 233, 0.32);
  stroke-width: 0.7;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.is-play .ring {
  animation: ringDraw 0.9s var(--ease) var(--d, 0s) forwards;
}
@keyframes ringDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.intro__dot {
  fill: url(#introGrad);
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
}
.is-play .intro__dot {
  animation: dotIn 0.5s var(--ease) 0.05s forwards;
}
@keyframes dotIn {
  to {
    transform: scale(1);
  }
}
.intro__halo {
  fill: none;
  stroke: var(--blue-light);
  stroke-opacity: 0.7;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}
.is-play .intro__halo {
  animation: haloOut 1.1s ease-out 0.25s infinite;
}
@keyframes haloOut {
  from {
    transform: scale(1);
    opacity: 0.9;
  }
  to {
    transform: scale(7);
    opacity: 0;
  }
}

/* Faisceau : un tour complet avec traîne */
.intro__beam {
  position: absolute;
  inset: 2.5%;
  border-radius: 50%;
  opacity: 0;
  background: conic-gradient(
    from 0deg,
    transparent 0 290deg,
    rgba(197, 243, 250, 0.1) 325deg,
    rgba(197, 243, 250, 0.55) 359deg,
    transparent 360deg
  );
  -webkit-mask: radial-gradient(circle, transparent 0 5%, #000 6%);
  mask: radial-gradient(circle, transparent 0 5%, #000 6%);
}
.is-play .intro__beam {
  animation: beam 1.2s cubic-bezier(0.45, 0.05, 0.25, 1) 0.3s forwards;
}
@keyframes beam {
  0% {
    opacity: 0;
    transform: rotate(-60deg);
  }
  15% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(360deg);
  }
}

/* Nom : le désordre se met en ordre */
.intro__word {
  display: flex;
  gap: 0.45em;
  margin: 0;
  padding-left: 0.45em;
  font: 500 clamp(1.3rem, 4.2vw, 2rem)/1 var(--font-title);
}
.intro__word span {
  display: block;
  opacity: 0;
}
.is-play .intro__word span {
  animation: letter 0.75s var(--ease) calc(0.5s + var(--i) * 0.09s) forwards;
}
@keyframes letter {
  from {
    opacity: 0;
    transform: translate(var(--jx), var(--jy));
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}
.intro__tag,
.intro__coords {
  margin: 0;
  font: 400 0.58rem var(--font-title);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
}
.is-play .intro__tag {
  animation: fadeUp 0.7s var(--ease) 1s forwards;
}
.intro__coords {
  position: absolute;
  left: var(--pad);
  bottom: 28px;
}
.is-play .intro__coords {
  animation: fadeUp 0.7s var(--ease) 0.8s forwards;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Le header attend la fin de l'intro, puis apparaît en fondu */
.site-header {
  transition: opacity 0.9s ease 0.5s;
}
.intro-pending .site-header {
  opacity: 0;
  pointer-events: none;
  animation: introShow 0s 7s forwards;
}
@keyframes introShow {
  to {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 640px) {
  .intro__tag {
    letter-spacing: 0.12em;
    text-align: center;
  }
}
