/* Centro Educacional Luis Rutten — Portada animada v1
   Animaciones institucionales, ligeras y accesibles. */

.home-page { overflow-x: hidden; }

/* HERO: movimiento ambiental y profundidad */
.home-page .hero-animated { isolation: isolate; }
.home-page .hero-animated .hero-media img {
  transform: scale(1.025);
  animation: celrHeroKenBurns 13s ease-in-out infinite alternate;
  will-change: transform;
}
.home-page .hero-animated .hero-media::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: 2;
  pointer-events: none;
  opacity: .42;
  background: radial-gradient(circle at 70% 28%, rgba(255,213,122,.18), transparent 30%);
  animation: celrHeroLight 10s ease-in-out infinite alternate;
}

.home-page .hero-ambient {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.home-page .hero-ambient span {
  position: absolute;
  display: block;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.035);
  box-shadow: inset 0 0 30px rgba(255,255,255,.025);
  backdrop-filter: blur(1px);
}
.home-page .hero-ambient span:nth-child(1) {
  width: 190px; height: 190px; right: 8%; top: 15%;
  animation: celrFloatA 11s ease-in-out infinite;
}
.home-page .hero-ambient span:nth-child(2) {
  width: 78px; height: 78px; right: 25%; bottom: 18%;
  animation: celrFloatB 9s ease-in-out infinite;
}
.home-page .hero-ambient span:nth-child(3) {
  width: 120px; height: 120px; left: 48%; top: 8%;
  animation: celrFloatC 13s ease-in-out infinite;
}

/* HERO: entrada escalonada del contenido */
.home-page .hero-animated-content > * { opacity: 0; }
.home-page .hero-animated-content h1 {
  animation: celrHeroTextIn .86s cubic-bezier(.2,.75,.22,1) .12s both;
}
.home-page .hero-animated-content .hero-subtitle {
  animation: celrHeroTextIn .8s cubic-bezier(.2,.75,.22,1) .3s both;
}
.home-page .hero-animated-content .hero-actions {
  animation: celrHeroTextIn .78s cubic-bezier(.2,.75,.22,1) .48s both;
}
.home-page .hero-animated-content .hero-highlights {
  animation: celrHeroTextIn .78s cubic-bezier(.2,.75,.22,1) .66s both;
}
.home-page .hero-animated-content h1 em {
  position: relative;
  display: block;
  width: fit-content;
}
.home-page .hero-animated-content h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: .02em;
  width: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f6d57a, rgba(246,213,122,.12));
  animation: celrAccentLine .7s ease .95s forwards;
}

/* Botones con microinteracción */
.home-page .hero-actions .btn {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}
.home-page .hero-actions .btn::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -80%;
  width: 45%;
  height: 200%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  transition: left .55s ease;
  pointer-events: none;
}
.home-page .hero-actions .btn:hover::after,
.home-page .hero-actions .btn:focus-visible::after { left: 135%; }
.home-page .hero-actions .btn:hover { transform: translateY(-2px); }

.home-page .hero-highlight svg { animation: celrIconBreath 3.8s ease-in-out infinite; }
.home-page .hero-highlight:nth-child(2) svg { animation-delay: .7s; }
.home-page .hero-highlight:nth-child(3) svg { animation-delay: 1.4s; }

/* Indicador de scroll */
.home-page .hero-scroll-cue {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 21px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 6px;
  color: rgba(255,255,255,.82);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: color .2s ease;
}
.home-page .hero-scroll-cue span {
  width: 25px;
  height: 40px;
  border: 1.5px solid rgba(255,255,255,.62);
  border-radius: 999px;
  position: relative;
}
.home-page .hero-scroll-cue span::after {
  content: "";
  width: 4px;
  height: 7px;
  position: absolute;
  left: 50%;
  top: 7px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #f6d57a;
  animation: celrScrollDot 1.7s ease-in-out infinite;
}
.home-page .hero-scroll-cue:hover { color: #fff; }

/* Accesos rápidos: entrada secuencial */
.home-page .home-quick-animated .quick-card {
  opacity: 0;
  animation: celrQuickIn .62s cubic-bezier(.2,.75,.22,1) both;
}
.home-page .home-quick-animated .quick-card:nth-child(1) { animation-delay: .72s; }
.home-page .home-quick-animated .quick-card:nth-child(2) { animation-delay: .82s; }
.home-page .home-quick-animated .quick-card:nth-child(3) { animation-delay: .92s; }
.home-page .home-quick-animated .quick-card:nth-child(4) { animation-delay: 1.02s; }
.home-page .quick-card .quick-icon { transition: transform .32s ease, box-shadow .32s ease; }
.home-page .quick-card:hover .quick-icon,
.home-page .quick-card:focus-visible .quick-icon { transform: translateY(-3px) rotate(-3deg) scale(1.06); }

/* Aparición de secciones al hacer scroll: más refinada que la base */
.home-page main .reveal {
  opacity: 0;
  transform: translateY(26px) scale(.992);
  filter: blur(3px);
  transition: opacity .72s ease, transform .72s cubic-bezier(.2,.7,.2,1), filter .72s ease;
}
.home-page main .reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: blur(0);
}
.home-page .welcome-grid .reveal:nth-child(2) { transition-delay: .12s; }
.home-page .cards-4 .reveal:nth-child(2),
.home-page .specialty-list .reveal:nth-child(2),
.home-page .community-grid .reveal:nth-child(2) { transition-delay: .08s; }
.home-page .cards-4 .reveal:nth-child(3),
.home-page .specialty-list .reveal:nth-child(3),
.home-page .community-grid .reveal:nth-child(3) { transition-delay: .16s; }
.home-page .cards-4 .reveal:nth-child(4),
.home-page .community-grid .reveal:nth-child(4) { transition-delay: .24s; }

/* Imágenes y tarjetas: vida sutil */
.home-page .welcome-image.is-visible img { animation: celrImageFloat 8s ease-in-out 1s infinite; }
.home-page .info-card,
.home-page .news-card,
.home-page .community-card,
.home-page .specialty {
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.home-page .info-card:hover,
.home-page .news-card:hover,
.home-page .community-card:hover { transform: translateY(-7px); }
.home-page .specialty:hover { transform: translateX(6px); }
.home-page .specialties-band::before { animation: celrBandRing 12s ease-in-out infinite alternate; }

/* Keyframes */
@keyframes celrHeroKenBurns {
  0% { transform: scale(1.025) translate3d(0,0,0); }
  100% { transform: scale(1.075) translate3d(-.7%, -.4%, 0); }
}
@keyframes celrHeroLight {
  0% { transform: translate3d(-2%,0,0) scale(.96); opacity: .28; }
  100% { transform: translate3d(4%,2%,0) scale(1.06); opacity: .52; }
}
@keyframes celrHeroTextIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes celrAccentLine { to { width: 100%; } }
@keyframes celrQuickIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes celrFloatA {
  0%,100% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(-22px,16px,0); }
}
@keyframes celrFloatB {
  0%,100% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(14px,-18px,0); }
}
@keyframes celrFloatC {
  0%,100% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(20px,12px,0); }
}
@keyframes celrIconBreath {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes celrScrollDot {
  0% { opacity: 0; transform: translate(-50%,0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,17px); }
}
@keyframes celrImageFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes celrBandRing {
  0% { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1.08) rotate(8deg); }
}

@media (max-width: 900px) {
  .home-page .hero-ambient span:nth-child(1) { width: 120px; height: 120px; right: -28px; top: 18%; }
  .home-page .hero-ambient span:nth-child(2) { display: none; }
  .home-page .hero-ambient span:nth-child(3) { width: 70px; height: 70px; left: auto; right: 23%; top: 9%; }
  .home-page .hero-scroll-cue { display: none; }
  .home-page .hero-animated-content h1 em::after { height: 3px; }
}

@media (max-width: 600px) {
  .home-page .hero-animated .hero-media img { animation-duration: 16s; }
  .home-page .home-quick-animated .quick-card { animation-delay: .2s !important; }
  .home-page main .reveal { filter: none; transform: translateY(18px); }
  .home-page .welcome-image.is-visible img { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .home-page *,
  .home-page *::before,
  .home-page *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
  .home-page .hero-animated-content > *,
  .home-page .home-quick-animated .quick-card,
  .home-page main .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
}
