/* Animations d'entrée de la page d'accueil (aucun to{} : chaque élément revient à son style existant) */

@keyframes ac-logo { from { opacity: 0; filter: blur(14px); } }
@keyframes ac-drop { from { opacity: 0; transform: translateY(-16px); } }
@keyframes ac-rise { from { opacity: 0; transform: translateY(24px); } }

.hero > img { animation: ac-logo 1.6s ease-out backwards; }
.hero .top { animation: ac-drop .8s cubic-bezier(.2, .7, .2, 1) .15s backwards; }
.hero .intro .eye { animation: ac-rise .8s cubic-bezier(.2, .7, .2, 1) .45s backwards; }
.hero .intro h1 { animation: ac-rise .9s cubic-bezier(.2, .7, .2, 1) .6s backwards; }
.hero .intro .lead { animation: ac-rise .8s cubic-bezier(.2, .7, .2, 1) .85s backwards; }
.hero .hero-cta .btn { animation: ac-rise .8s cubic-bezier(.2, .7, .2, 1) 1.05s backwards; }
.hero .hero-cta .hero-sec { animation: ac-rise .8s cubic-bezier(.2, .7, .2, 1) 1.2s backwards; }

@media (prefers-reduced-motion: reduce) {
  .hero > img, .hero .top, .hero .intro .eye, .hero .intro h1, .hero .intro .lead, .hero .hero-cta .btn, .hero .hero-cta .hero-sec { animation: none !important; }
}

/* ===== Portail : animation au clic sur « Ouvrir le dashboard » ===== */
@view-transition { navigation: auto; }

html.portal-on { overflow: hidden; }

#portal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  clip-path: circle(0px at var(--x, 50%) var(--y, 50%));
  animation: pt-open .95s cubic-bezier(.65, 0, .2, 1) forwards;
}
@keyframes pt-open { to { clip-path: circle(var(--r, 150vmax) at var(--x, 50%) var(--y, 50%)); } }

#portal .pt-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(760px 520px at 50% 46%, rgba(212, 175, 55, .2), transparent 70%),
    radial-gradient(1200px 700px at 50% 120%, rgba(212, 175, 55, .08), transparent 70%),
    #050506;
}

#portal .pt-core {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(190px, 40vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}
#portal .pt-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 28% 52%;
  box-shadow: 0 0 0 1px rgba(240, 217, 122, .45), 0 0 70px rgba(212, 175, 55, .45);
  animation: pt-logo 1s cubic-bezier(.2, .8, .2, 1) .45s backwards;
}
@keyframes pt-logo { from { opacity: 0; transform: scale(.55); filter: blur(12px); } }

#portal .pt-ring {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(190px, 40vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(240, 217, 122, .55);
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
  animation: pt-ring 1.5s cubic-bezier(.2, .6, .3, 1) .5s forwards;
}
#portal .pt-ring.r2 { animation-delay: .7s; }
#portal .pt-ring.r3 { animation-delay: .9s; }
@keyframes pt-ring {
  0% { opacity: .8; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(3.4); }
}

#portal .pt-name {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(46% + min(190px, 40vw) / 2 + 34px);
  text-align: center;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: clamp(18px, 3.4vw, 26px);
  letter-spacing: .24em;
  color: #f2f2f4;
  text-indent: .24em;
  animation: pt-name 1s cubic-bezier(.2, .8, .2, 1) .75s backwards;
}
@keyframes pt-name { from { opacity: 0; letter-spacing: .6em; transform: translateY(10px); } }

#portal .pt-line {
  position: absolute;
  left: 50%;
  top: calc(46% + min(190px, 40vw) / 2 + 84px);
  width: min(220px, 56vw);
  height: 2px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
#portal .pt-line i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #d4af37, #f0d97a);
  box-shadow: 0 0 14px rgba(240, 217, 122, .8);
  transform-origin: left;
  animation: pt-fill .75s cubic-bezier(.5, 0, .2, 1) .8s backwards;
}
@keyframes pt-fill { from { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  #portal { display: none; }
}