/* ===========================
   A4 Estudio — Preloader V1
   Isotipo stroke draw + fade out
   =========================== */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-gray-900);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Fade out reveal */
.preloader.reveal {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s ease, visibility 1.2s ease;
}

.preloader-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader-svg {
  height: 112px;
  width: auto;
}

/* Stroke draw animation only on Isotipo */
.preloader-iso path {
  fill: transparent;
  stroke: white;
  stroke-width: 2;
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: strokeDraw 1.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* Stagger the dot (second path in preloader-iso) */
.preloader-iso path:nth-child(2) {
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation-delay: 0.6s;
  animation-duration: 0.8s;
}

/* Fill in after draw */
.preloader-icon.filled .preloader-iso path {
  fill: white;
  stroke: white;
  transition: fill 0.4s ease;
}

/* Text reveal with fade in */
.preloader-text {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.preloader-icon.filled .preloader-text {
  opacity: 1;
}

@keyframes strokeDraw {
  to {
    stroke-dashoffset: 0;
  }
}

/* Pulse before fade out */
.preloader-logo.pulse {
  animation: logoPulse 0.6s ease;
}

@keyframes logoPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}
