/* DS by David Sosa — capa de movimiento y efectos (v2). Va después de ds.css. */

/* Encabezado fijo que se vuelve sólido al bajar */
.site-head { position: fixed; inset: 0 0 auto; z-index: 50; background: transparent; transition: background-color .3s, box-shadow .3s; }
.site-head.scrolled { background: rgba(14,15,19,.8); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 1px 0 rgba(244,242,238,.08); }
.site-head .top { padding-block: 1rem; }
main > section:first-child { padding-top: calc(clamp(2.5rem, 8vw, 6rem) + 4.5rem); }

/* Portada con lienzo animado */
.hero { position: relative; isolation: isolate; min-height: min(100svh, 60rem); display: flex; align-items: center; }
.hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; z-index: -1; background: linear-gradient(to bottom, transparent, var(--ink)); pointer-events: none; }
.hero-in { width: 100%; }
.estado { display: inline-flex; align-items: center; gap: .6rem; font: 500 .9rem/1.3 var(--head); color: var(--gray-d); border: 1px solid rgba(244,242,238,.16); border-radius: 999px; padding: .45rem .9rem; margin-bottom: 2rem; background: rgba(14,15,19,.6); }
.pulso { width: .55rem; height: .55rem; border-radius: 50%; flex: none; background: var(--blue); box-shadow: 0 0 0 0 rgba(31,107,255,.7); animation: pulso 2s infinite; }
@keyframes pulso { 70% { box-shadow: 0 0 0 .6rem rgba(31,107,255,0); } 100% { box-shadow: 0 0 0 0 rgba(31,107,255,0); } }

/* Titular: el azul entra barriendo, como en la intro de video */
html.intro { --start: 1.25s; }
@media (prefers-reduced-motion: no-preference) {
  .cut { animation-delay: var(--start, 0s); }
  .cut + .cut { animation-delay: calc(var(--start, 0s) + .12s); }
  .cut::after { animation: barrido 1s cubic-bezier(.7,0,.2,1) both; animation-delay: calc(var(--start, 0s) + .35s); }
  .cut + .cut::after { animation-delay: calc(var(--start, 0s) + .5s); }
  @keyframes barrido { from { clip-path: inset(57% 100% 0 0); } to { clip-path: inset(57% 0 0 0); } }
  .estado, .hero-foot { animation: subir .8s cubic-bezier(.2,.7,.2,1) both; }
  .estado { animation-delay: var(--start, 0s); }
  .hero-foot { animation-delay: calc(var(--start, 0s) + .55s); }
}
@keyframes subir { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Intro de marca (primera visita de la sesión) */
#intro { display: none; }
html.intro #intro { display: grid; place-items: center; position: fixed; inset: 0; z-index: 100; background: var(--ink); animation: salir .45s ease-in 1.1s forwards; }
.intro-mark { width: min(28vw, 9rem); overflow: visible; }
.intro-mark .top { animation: entraIzq .6s cubic-bezier(.2,.8,.2,1) both; }
.intro-mark .bot { animation: entraDer .6s cubic-bezier(.2,.8,.2,1) .12s both; }
.intro-bar { position: absolute; left: 50%; bottom: 18%; width: 8rem; height: 2px; margin-left: -4rem; background: rgba(244,242,238,.12); overflow: hidden; }
.intro-bar::after { content: ""; position: absolute; inset: 0; background: var(--blue); transform-origin: left; animation: carga 1.05s cubic-bezier(.6,0,.2,1) both; }
@keyframes entraIzq { from { transform: translateX(-90px); opacity: 0; } }
@keyframes entraDer { from { transform: translateX(90px); opacity: 0; } }
@keyframes carga { from { transform: scaleX(0); } }
@keyframes salir { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { html.intro #intro { display: none; } html.intro { --start: 0s; } }

/* Cinta de servicios en movimiento */
.cinta { background: var(--blue); color: #fff; overflow: hidden; transform: skewY(-2deg); margin-block: -1.6rem; position: relative; z-index: 2; padding-block: 1.1rem; }
.cinta-track { display: flex; width: max-content; animation: cinta 40s linear infinite; }
.cinta span { font: 700 clamp(1.4rem, 3vw, 2.2rem)/1 var(--head); letter-spacing: -0.02em; white-space: nowrap; display: inline-flex; align-items: center; transform: skewX(-12deg); }
.cinta span::after { content: ""; width: 2.2rem; height: .9rem; margin-inline: 1.6rem; background: linear-gradient(to bottom, var(--ink) 0 55%, transparent 55% 75%, var(--ink) 75% 100%); }
@keyframes cinta { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .cinta-track { animation: none; } }

/* Aparición al hacer scroll (solo con JavaScript) */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal]:not([data-reveal="stagger"]), .js [data-reveal="stagger"] > * { opacity: 0; transform: translateY(32px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0ms); }
  .js [data-reveal].in:not([data-reveal="stagger"]), .js [data-reveal="stagger"].in > * { opacity: 1; transform: none; }
}

/* Servicios */
.frente { position: relative; border-top-color: rgba(14,15,19,.15); }
.frente::before { content: ""; position: absolute; left: 0; top: -3px; height: 3px; width: 0; background: var(--blue); transition: width .7s cubic-bezier(.2,.7,.2,1) .2s; }
.frente:hover::before, .in > .frente::before, .frentes:not([data-reveal]) .frente::before { width: 100%; }
.in > .frente:nth-child(2)::before { transition-delay: .35s; }
.in > .frente:nth-child(3)::before { transition-delay: .5s; }
.frente > h3 { display: flex; align-items: center; gap: .75rem; }
.ico { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 8px; background: var(--ink); transition: transform .3s, background-color .3s; }
.ico svg { width: 1.35rem; fill: none; stroke: var(--paper); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.frente:hover .ico { transform: rotate(-8deg) scale(1.06); background: var(--blue); }

/* Casos: fondo de rejilla, celular y ventana */
.casos-sec { background-image: linear-gradient(rgba(244,242,238,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(244,242,238,.035) 1px, transparent 1px); background-size: 48px 48px; padding-top: clamp(6rem, 12vw, 9rem); }
.phone { position: relative; width: min(100%, 17.5rem); margin-inline: auto; border-radius: 2.4rem; padding: .6rem; background: #1A1C23; box-shadow: 0 0 0 1px rgba(244,242,238,.12), 0 40px 80px -20px rgba(31,107,255,.45), 0 30px 60px -30px #000; transform: rotate(-3deg); transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.caso:hover .phone { transform: rotate(0) translateY(-6px); }
.phone::before { content: ""; position: absolute; top: 1.1rem; left: 50%; width: 4.5rem; height: 1.1rem; margin-left: -2.25rem; border-radius: 999px; background: #000; z-index: 1; }
.phone video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 1.9rem; background: var(--ink); }
.ventana { border-radius: 10px; overflow: hidden; background: #1A1C23; box-shadow: 0 0 0 1px rgba(244,242,238,.12), 0 40px 80px -24px rgba(31,107,255,.4); transform: perspective(1200px) rotateY(6deg) rotateX(2deg); transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.caso:hover .ventana { transform: none; }
.ventana-bar { display: flex; align-items: center; gap: .4rem; padding: .6rem .8rem; font: 500 .75rem/1 var(--head); color: var(--gray-d); }
.ventana-bar i { width: .6rem; height: .6rem; border-radius: 50%; background: rgba(244,242,238,.2); }
.ventana-bar span { margin-left: .6rem; }
.slides { position: relative; aspect-ratio: 1280 / 681; }
.caso-media .slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .7s; border-radius: 0; }
.caso-media .slides img.on { opacity: 1; }
.dots { display: flex; justify-content: center; gap: .5rem; margin-top: 1rem; }
.dots button { width: 1.6rem; height: .3rem; border: 0; border-radius: 999px; background: rgba(244,242,238,.25); cursor: pointer; padding: 0; transition: background-color .3s, width .3s; }
.dots button[aria-pressed="true"] { background: var(--blue); width: 2.6rem; }
@media (max-width: 860px) { .ventana { transform: none; } }

/* Proceso: línea que se llena + garantías */
.pasos { position: relative; padding-top: 2rem; }
.pasos::before, .pasos::after { content: ""; position: absolute; top: 0; left: 0; height: 3px; border-radius: 3px; }
.pasos::before { right: 0; background: var(--line); }
.pasos::after { width: calc(var(--p, 1) * 100%); background: var(--blue); }
.garantias { list-style: none; padding: 0; margin: clamp(3rem, 7vw, 5rem) 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.garantias li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1.4rem 1.3rem; display: grid; gap: .4rem; align-content: start; }
.garantias strong { font: 600 1.1rem/1.2 var(--head); display: flex; align-items: center; gap: .55rem; }
.garantias strong::before { content: ""; width: 1.25rem; height: 1.25rem; flex: none; border-radius: 50%; background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat; }
.garantias span { color: var(--gray); font-size: .95rem; }
@media (max-width: 900px) { .garantias { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .garantias { grid-template-columns: 1fr; } }

/* Planes: luz que sigue el mouse y borde que gira en el destacado */
.plan { position: relative; transition: transform .25s ease-out, box-shadow .3s; }
.plan::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(22rem circle at var(--mx, 50%) var(--my, 0%), rgba(31,107,255,.16), transparent 60%); }
.plan:hover::before { opacity: 1; }
.plan:hover { box-shadow: 0 30px 60px -30px rgba(14,15,19,.35); }
.plan.destacado { box-shadow: 0 30px 70px -30px rgba(31,107,255,.6); }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.plan.destacado::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 2px; pointer-events: none; background: conic-gradient(from var(--ang), var(--blue), transparent 25%, transparent 50%, var(--blue) 75%, transparent); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@media (prefers-reduced-motion: no-preference) { .plan.destacado::after { animation: giro 5s linear infinite; } }
@keyframes giro { to { --ang: 360deg; } }

/* Quién soy */
.yo-foto { position: relative; max-width: 24rem; }
.yo-foto::before { content: ""; position: absolute; inset: 1.2rem -1.2rem -1.2rem 1.2rem; border: 2px solid var(--blue); border-radius: 8px; }
.yo-foto img { position: relative; transition: filter .6s; }
.yo-foto:hover img { filter: grayscale(0) contrast(1); }
@media (max-width: 760px) { .yo-foto { max-width: 16rem; } }

/* Preguntas frecuentes */
.faq { display: grid; gap: .75rem; max-width: 52rem; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 10px; transition: border-color .3s; }
.faq details[open] { border-color: var(--blue); }
.faq summary { list-style: none; cursor: pointer; padding: 1.2rem 1.4rem; font: 600 1.12rem/1.35 var(--head); display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 5v10M5 10h10' stroke='%23F4F2EE' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 70% no-repeat; transition: transform .3s, background-color .3s; }
.faq details[open] summary::after { transform: rotate(45deg); background-color: var(--blue); }
.faq details p { padding: 0 1.4rem 1.3rem; margin: 0; color: var(--gray); max-width: 44rem; }
@media (prefers-reduced-motion: no-preference) { .faq details[open] p { animation: subir .4s ease-out; } }

/* Contacto con cortes en movimiento */
.contacto { position: relative; overflow: hidden; isolation: isolate; }
.contacto::before { content: ""; position: absolute; inset: -20%; z-index: -1; opacity: .16; transform: skewY(-8deg);
  background: repeating-linear-gradient(to bottom, transparent 0 46px, var(--ink) 46px 53px, transparent 53px 64px, var(--ink) 64px 68px, transparent 68px 140px); }
@media (prefers-reduced-motion: no-preference) { .contacto::before { animation: bajar 8s linear infinite; } }
@keyframes bajar { to { background-position: 0 140px; } }

/* Botón flotante y botones magnéticos */
.fab { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; width: 3.6rem; height: 3.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; box-shadow: 0 12px 30px -8px rgba(31,107,255,.8); transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s; }
.fab svg { width: 1.6rem; height: 1.6rem; }
.js .fab:not(.show) { transform: scale(0); opacity: 0; pointer-events: none; }
.fab:hover { transform: scale(1.08); }
.magnetic { transition: transform .25s cubic-bezier(.2,.8,.2,1), background-color .15s, color .15s; }
.yo img.avatar, .yo-foto:hover img.avatar { filter: none; }
