/* =========================================================
   EFECTOS VISUALES — inspirados en nizagroupmultiservice.com
   Para desactivarlos: quitar efectos.css y efectos.js del index.html
   ========================================================= */

/* ---------- 1. Barra de progreso de lectura ---------- */
.fx-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 200; pointer-events: none;
}
.fx-progress span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--gold), #A8F0E8);
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- 2. Encabezado translúcido al bajar ---------- */
.site-header { transition: background-color .3s ease, box-shadow .3s ease, border-color .3s ease; }
.site-header.is-stuck {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 6px 24px rgba(15, 44, 76, .10);
  border-bottom-color: transparent;
}

/* Subrayado que se dibuja en el menú */
.nav a { position: relative; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--gold); border-radius: 2px;
  transform: scaleX(0); transform-origin: right;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); transform-origin: left; }

/* ---------- 3. Portada (hero) ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%;
  filter: blur(70px); opacity: .55; pointer-events: none;
}
.hero::before {
  width: 520px; height: 520px; left: -140px; top: -180px;
  background: radial-gradient(circle, #2F6BC4 0%, transparent 70%);
  animation: fxDrift 16s ease-in-out infinite alternate;
}
.hero::after {
  width: 460px; height: 460px; right: -120px; bottom: -200px;
  background: radial-gradient(circle, rgba(64,224,208,.55) 0%, transparent 70%);
  animation: fxDrift 19s ease-in-out infinite alternate-reverse;
}
@keyframes fxDrift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, 40px) scale(1.12); }
  100% { transform: translate(-30px, 70px) scale(.95); }
}

/* Foto con anillo luminoso girando */
.fx-photo-wrap {
  position: relative; width: 172px; height: 172px; margin: 0 auto 24px;
  border-radius: 50%; padding: 6px;
}
.fx-photo-wrap::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--gold), transparent 30%, #6FA3E8 55%, transparent 80%, var(--gold));
  animation: fxSpin 7s linear infinite;
}
.fx-photo-wrap .hero-photo { position: relative; margin: 0; width: 160px; height: 160px; }
@keyframes fxSpin { to { transform: rotate(360deg); } }

/* Nombre que aparece desde una máscara */
.kln { display: block; overflow: hidden; padding-bottom: .06em; }
.kln-inner { display: inline-block; }
.fx-ready .kln-inner { transform: translateY(110%); transition: transform 1s cubic-bezier(.2,.8,.2,1); }
.fx-ready .kln.is-in .kln-inner { transform: none; }

/* Subrayado dorado que se dibuja bajo el lema */
.u-underline { position: relative; display: inline-block; }
.hero-tagline { margin-bottom: 30px; }
.u-underline::after {
  content: ""; position: absolute; left: 50%; width: 120px; margin-left: -60px; bottom: -12px; height: 3px;
  background: var(--gold); border-radius: 3px;
  transform: scaleX(0); transform-origin: center;
  transition: transform 1s cubic-bezier(.2,.8,.2,1) .9s;
}
.u-underline.is-on::after { transform: scaleX(1); }

/* Indicador para bajar */
.fx-scroll {
  display: inline-flex; margin-top: 34px; color: rgba(255,255,255,.75);
  animation: fxBob 2s ease-in-out infinite;
}
.fx-scroll:hover { color: #fff; }
@keyframes fxBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---------- 4. Botón principal con destello ---------- */
.btn { position: relative; overflow: hidden; }
.btn-primary { box-shadow: 0 8px 22px rgba(27, 75, 145, .35); }
.btn-primary::before {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-18deg);
  animation: fxShimmer 3.2s ease-in-out infinite;
}
@keyframes fxShimmer { 0% { left: -60%; } 60%,100% { left: 130%; } }

/* ---------- 5. Aparición al hacer scroll ---------- */
.fx-ready .reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1);
  transition-delay: var(--d, 0s);
}
.fx-ready .reveal.is-in { opacity: 1; transform: none; }

/* Títulos de sección con línea dorada que crece */
.section-title { position: relative; padding-bottom: 14px; }
.section-title::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 56px; height: 3px;
  margin-left: -28px; background: var(--gold); border-radius: 3px;
  transform: scaleX(0); transition: transform .8s cubic-bezier(.2,.8,.2,1) .2s;
}
.section-title.is-in::after, .footer-title.is-in::after { transform: scaleX(1); }

/* ---------- 6. Línea de tiempo que se dibuja ---------- */
.timeline { border-left-color: transparent; }
.timeline::before, .timeline::after {
  content: ""; position: absolute; left: -2px; top: 0; width: 2px; height: 100%;
}
.timeline::before { background: var(--border); }
.timeline::after {
  background: linear-gradient(180deg, var(--gold), var(--blue));
  transform-origin: top; transform: scaleY(var(--tl, 0));
}
.timeline-dot { z-index: 1; transition: transform .4s ease, box-shadow .4s ease; }
.timeline-item.is-in .timeline-dot {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 8px rgba(64,224,208,.18);
}

/* ---------- 7. Tarjetas que se elevan ---------- */
.card, .exp-project, .carousel-slide, .volunteer-img {
  transition: opacity .5s ease, transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease, border-color .35s ease;
}
.card.in-view:hover, .exp-project:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(15, 44, 76, .16);
  border-color: color-mix(in srgb, var(--gold) 60%, var(--border));
}
.tag { transition: transform .25s ease, background-color .25s ease; }
.tag:hover { transform: translateY(-3px); }

/* Barras de habilidades con brillo recorriendo */
.bar-fill { position: relative; overflow: hidden; }
.bar-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-100%); animation: fxBar 2.6s ease-in-out 1.2s infinite;
}
@keyframes fxBar { to { transform: translateX(100%); } }

/* ---------- 8. Botón flotante de WhatsApp ---------- */
.fx-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 150;
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #25D366; color: #fff !important;
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
  transform: translateY(140%); opacity: 0;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .45s ease;
}
.fx-fab.is-show { transform: none; opacity: 1; }
.fx-fab::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #25D366; animation: fxPulse 2.2s ease-out infinite;
}
@keyframes fxPulse { from { transform: scale(1); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }

/* ---------- 9. Cursor personalizado (solo con mouse) ---------- */
.fx-cursor-dot, .fx-cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 300; pointer-events: none;
  border-radius: 50%; transform: translate(-50%, -50%);
  opacity: 0; transition: opacity .3s ease, width .25s ease, height .25s ease, background-color .25s ease;
}
.fx-cursor-dot { width: 7px; height: 7px; background: var(--gold); }
.fx-cursor-ring { width: 34px; height: 34px; border: 1.5px solid var(--gold); }
.fx-cursor-on .fx-cursor-dot, .fx-cursor-on .fx-cursor-ring { opacity: 1; }
.fx-cursor-ring.is-hover { width: 56px; height: 56px; background: rgba(64,224,208,.12); }

/* ---------- Accesibilidad: sin movimiento si el usuario lo pide ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fx-ready .reveal, .fx-ready .kln-inner { opacity: 1 !important; transform: none !important; }
  .timeline::after { transform: scaleY(1); }
  .fx-cursor-dot, .fx-cursor-ring { display: none; }
}
