/* ============================================================================
 *  Centro Óptico Sicuani — HOME v2 (refinamiento IMPACTANTE) · carga al final
 *  Preloader · hero con foto · botones con efecto · marquees · video Transitions
 *  historia · why-us premium · testimonios en movimiento · sedes con logo+mapa
 * ========================================================================== */

/* ============================ PRELOADER ============================ */
.hp-preloader { position: fixed; inset: 0; z-index: 99999; background: radial-gradient(120% 120% at 50% 30%, #131a34 0%, #0a0f20 60%, #06080f 100%); display: grid; place-items: center; transition: opacity .7s ease, visibility .7s ease; }
.hp-preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.hp-preloader__box { text-align: center; padding: 2rem; }
.hp-preloader__logo { height: 64px; margin: 0 auto 1.4rem; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.4); animation: hpPulse 2.2s ease-in-out infinite; }
.hp-preloader__name { font-family: var(--hp-display); font-weight: 500; font-size: clamp(1.6rem, 4vw, 2.6rem); color: #fff; letter-spacing: .01em; }
.hp-preloader__name em { font-style: italic; color: var(--hp-star); }
.hp-preloader__sub { font-family: var(--hp-ui); font-size: .78rem; letter-spacing: .3em; text-transform: uppercase; color: var(--hp-gold); margin-top: .5rem; }
.hp-preloader__bar { width: min(260px, 70vw); height: 2px; background: rgba(255,255,255,.14); border-radius: 2px; margin: 1.8rem auto 0; overflow: hidden; }
.hp-preloader__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--hp-blue-l), var(--hp-star)); border-radius: 2px; animation: hpLoad 1.9s cubic-bezier(.6,.1,.2,1) forwards; }
@keyframes hpLoad { 0% { width: 0; } 70% { width: 82%; } 100% { width: 100%; } }
@keyframes hpPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.05); opacity: .85; } }

/* ============================ HERO con foto ============================ */
.hp-hero__photo { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hp-hero__photo img { width: 100%; height: 100%; object-fit: cover; opacity: .28; transform: scale(1.05); filter: saturate(.9); animation: hpKen 22s ease-in-out infinite alternate; }
.hp-hero__photo::after { content: ''; position: absolute; inset: 0; background: radial-gradient(110% 90% at 50% 40%, rgba(10,15,32,.45) 0%, rgba(10,15,32,.78) 60%, var(--hp-night) 100%); }
@keyframes hpKen { from { transform: scale(1.05); } to { transform: scale(1.14); } }
.hp-hero .hp-constellation { z-index: 1; }
.hp-hero__veil { z-index: 1; }
.hp-hero__inner { z-index: 3; }
.hp-hero__scroll { z-index: 3; }

/* ============================ BOTONES con efecto ============================ */
.hp-btn { position: relative; overflow: hidden; isolation: isolate; }
.hp-btn::after { content: ''; position: absolute; top: 0; left: -130%; width: 55%; height: 100%; z-index: 1; background: linear-gradient(120deg, transparent, rgba(255,255,255,.38), transparent); transform: skewX(-20deg); transition: left .6s ease; pointer-events: none; }
.hp-btn:hover::after { left: 150%; }
.hp-btn > * { position: relative; z-index: 2; }
/* ghost (sobre hero): vidrio esmerilado */
.hp-btn--ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; }
.hp-btn--ghost:hover { background: #fff; color: var(--hp-night); border-color: #fff; }
/* dark → azul-noche premium con borde sutil (no negro plano) */
.hp-btn--dark { background: linear-gradient(135deg, #1f2a5e 0%, #0e1530 100%); color: #fff; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 10px 28px rgba(10,15,40,.35); }
.hp-btn--dark:hover { box-shadow: 0 14px 36px rgba(37,57,196,.35); border-color: rgba(107,140,255,.5); }
.hp-btn--primary { box-shadow: 0 10px 30px rgba(37,57,196,.4); }

/* ============================ MARQUEE (cintas) ============================ */
.hp-marquee { overflow: hidden; white-space: nowrap; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.hp-marquee__track { display: inline-flex; align-items: center; gap: 2.6rem; padding-left: 2.6rem; animation: hpMarquee 28s linear infinite; }
.hp-marquee:hover .hp-marquee__track { animation-play-state: paused; }
@keyframes hpMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* tira de confianza como cinta */
.hp-trust .hp-marquee__track { gap: 3rem; padding-left: 3rem; }
.hp-trust .hp-marquee__track span { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--hp-ui); font-size: .9rem; color: rgba(255,255,255,.92); }
.hp-trust .hp-marquee__track b { color: var(--hp-gold); }
/* cinta de marcas */
.hp-brands { background: #fff; border-top: 1px solid var(--hp-line); border-bottom: 1px solid var(--hp-line); padding: 1.3rem 0; }
.hp-brands .hp-marquee__track { gap: 3.4rem; padding-left: 3.4rem; animation-duration: 34s; }
.hp-brands__item { font-family: var(--hp-display); font-weight: 500; font-size: 1.35rem; letter-spacing: .04em; color: #8a8f9e; transition: color .3s; }
.hp-brands__item:hover { color: var(--hp-blue); }

/* ============================ COLECCIONES con foto ============================ */
.hp-cat { z-index: 0; }
.hp-cat__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; transition: transform .7s ease; }
.hp-cat:hover .hp-cat__img { transform: scale(1.08); }
.hp-cat::before { z-index: -1; }       /* degradado de respaldo si falla la imagen */
.hp-cat::after { z-index: 1; background: linear-gradient(180deg, rgba(8,12,28,.05) 30%, rgba(8,12,28,.85) 100%); }
.hp-cat > :not(.hp-cat__img) { position: relative; z-index: 2; }
.hp-cat__name { color: #fff; text-shadow: 0 2px 16px rgba(0,0,0,.6); }
.hp-cat__sub { color: rgba(255,255,255,.85); }

/* ============================ TECNOLOGÍA + VIDEO ============================ */
.hp-tech__split { position: relative; z-index: 2; max-width: 1280px; margin: 0 auto clamp(2rem,4vw,3.4rem); display: grid; grid-template-columns: 1fr 1fr; gap: 2.4rem; align-items: center; }
.hp-tech__copy .hp-eyebrow { color: var(--hp-gold); }
.hp-tech__videoframe { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 16/11; box-shadow: 0 30px 70px rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.12); background: #000; }
.hp-tech__videoframe video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hp-tech__videoframe::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 80px rgba(0,0,0,.4); pointer-events: none; }
.hp-tech__badge { position: absolute; top: 14px; left: 14px; z-index: 2; font-family: var(--hp-ui); font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #fff; background: rgba(37,57,196,.85); padding: .35rem .7rem; border-radius: 999px; backdrop-filter: blur(6px); }
.hp-tech__videocap { font-family: var(--hp-body); font-size: .82rem; color: rgba(255,255,255,.55); margin-top: .8rem; text-align: center; }

/* ============================ HISTORIA ============================ */
.hp-history { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; background: var(--hp-night); color: #fff; position: relative; overflow: hidden; }
.hp-history__media { position: relative; min-height: 460px; overflow: hidden; }
.hp-history__media img { width: 100%; height: 100%; object-fit: cover; }
.hp-history__media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 60%, var(--hp-night) 100%); }
.hp-history__body { padding: clamp(2.6rem,6vw,6rem); display: flex; flex-direction: column; justify-content: center; }
.hp-history__body h2 { font-family: var(--hp-display); font-weight: 500; font-size: clamp(2rem,4.4vw,3.2rem); line-height: 1.08; margin-bottom: 1.1rem; }
.hp-history__body h2 em { font-style: italic; color: var(--hp-star); }
.hp-history__body p { font-family: var(--hp-body); color: rgba(255,255,255,.74); line-height: 1.8; margin-bottom: 1rem; }
.hp-history__stats { display: flex; gap: 2.4rem; margin-top: 1rem; flex-wrap: wrap; }
.hp-history__stat b { font-family: var(--hp-display); font-size: 2.4rem; color: var(--hp-gold); display: block; line-height: 1; }
.hp-history__stat span { font-family: var(--hp-ui); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.6); }

/* ============================ WHY-US premium ============================ */
.hp-why__grid { gap: 1.2rem; }
.hp-pillar { background: #fff; border: 1px solid var(--hp-line); border-radius: 18px; padding: 1.8rem 1.6rem; box-shadow: 0 10px 30px rgba(20,22,29,.05); transition: transform .35s ease, box-shadow .35s ease; }
.hp-pillar:hover { transform: translateY(-5px); box-shadow: 0 22px 48px rgba(20,22,29,.12); }
.hp-pillar__ic { background: linear-gradient(140deg, #eef1ff, #fff); }

/* ============================ TESTIMONIOS en movimiento ============================ */
.hp-testi__marquee { position: relative; z-index: 2; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.hp-testi__track { display: flex; gap: 1.4rem; width: max-content; padding-left: 1.4rem; animation: hpMarquee 46s linear infinite; }
.hp-testi__marquee:hover .hp-testi__track { animation-play-state: paused; }
.hp-testi__track .hp-quote { width: 420px; flex: 0 0 auto; white-space: normal; }

/* ============================ SEDES con logo + mapa ============================ */
.hp-sede__head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.hp-sede__logo { height: 42px; width: auto; border-radius: 8px; }
.hp-sede__map { margin: 1rem 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--hp-line); line-height: 0; }
.hp-sede__map iframe { width: 100%; height: 210px; border: 0; filter: grayscale(.2) contrast(1.02); }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 880px) {
  .hp-tech__split { grid-template-columns: 1fr; gap: 1.6rem; }
  .hp-history { grid-template-columns: 1fr; }
  .hp-history__media { min-height: 260px; }
  .hp-history__media::after { background: linear-gradient(180deg, transparent 50%, var(--hp-night) 100%); }
}
@media (max-width: 520px) {
  .hp-testi__track .hp-quote { width: 84vw; }
}
@media (prefers-reduced-motion: reduce) {
  .hp-preloader__bar i { animation: none; width: 100%; }
  .hp-preloader__logo { animation: none; }
  .hp-hero__photo img { animation: none; }
  .hp-marquee__track, .hp-brands .hp-marquee__track, .hp-testi__track { animation: none; }
  .hp-btn::after { display: none; }
}
