/* Motion graphics SVG de Astrion Library: íconos que se dibujan, demo de arrastrar y soltar,
   pasos animados y anillos del cierre. Todo vectorial; se activa al entrar en pantalla (.rv.in)
   y se apaga con prefers-reduced-motion. Se carga solo en /astrion-library/. */

/* ---- íconos de línea que se dibujan al aparecer ---- */
.m-ico { position: absolute; right: 18px; top: 16px; width: 30px; height: 30px; color: var(--accent, var(--gold)); opacity: .9; }
.m-ico .ico { width: 100%; height: 100%; display: block; overflow: visible; }
.ico .dr { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s var(--ease-out-expo) calc(var(--d, 0s) + .25s); }
.rv.in .ico .dr { stroke-dashoffset: 0; }
.spec:hover .m-ico, .qual:hover .m-ico { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent, #d2b48c) 70%, transparent)); }
.m-ico { transition: transform .5s var(--ease-spring), filter .4s; }
.spec:hover .m-ico, .qual:hover .m-ico { transform: scale(1.12) rotate(-4deg); }
.qual { position: relative; }
.qual.lead .m-ico { width: 38px; height: 38px; right: clamp(22px, 3vw, 34px); top: clamp(22px, 3vw, 34px); }
.spec h3 { padding-right: 40px; }

/* ---- ícono del hero de Library: recortado a su forma y con un brillo contenido (antes la luz se escapaba por los costados) ---- */
.p-icon.tight::before { inset: -12%; border-radius: 30%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%); filter: blur(10px); }
.p-icon.tight img { border-radius: 0; box-shadow: none; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent) 30%, transparent)); }
.p-icon.tight img { width: 100%; height: 100%; } /* en celular floating.css lo fija en 96px y el destello quedaba más grande que el ícono */
.p-icon.tight .sweep { border-radius: 23%; isolation: isolate; }

/* ---- demo de arrastrar y soltar ---- */
.dnd-lede { margin: 0 auto; text-align: center; color: var(--muted); max-width: 62ch; font-size: clamp(1rem, 1.3vw, 1.2rem); }
.dnd-stage { position: relative; margin: clamp(26px, 4vw, 48px) auto 0; width: min(1100px, 100%); isolation: isolate; }
.dnd-glow { position: absolute; inset: -6% -4%; z-index: -1; background: radial-gradient(ellipse at 50% 55%, rgba(177, 126, 255, .16), transparent 66%), radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); filter: blur(30px); }
.dnd-mount { position: relative; width: 100%; aspect-ratio: 1200 / 680; }
.dnd-mount svg { display: block; width: 100%; height: 100%; overflow: visible; }
.dnd-tools { opacity: 1; right: 8px; bottom: -44px; }
.dnd-note { text-align: center; margin: 22px auto 0; }
.dnd-points { margin-top: clamp(20px, 3vw, 36px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
@media (max-width: 640px) {
  .dnd-mount { aspect-ratio: 760 / 1080; max-width: 520px; margin-inline: auto; }
  .dnd-tools { position: static; justify-content: center; margin-top: 12px; }
  .dnd-note { margin-top: 14px; }
  .dnd-points { grid-template-columns: 1fr; }
  .dnd-points .spec { padding: 18px; }
  .dnd-points .spec p { font-size: .9rem; }
}

/* ---- pasos 1-2-3 ---- */
.flow3 { position: relative; z-index: 1; padding-block: clamp(6px, 1vw, 14px); }
.flow3-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); position: relative; }
.flow3-steps li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.flow3 .orb { width: clamp(96px, 11vw, 124px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: var(--accent, var(--gold)); border: 1px solid var(--line-strong); background: radial-gradient(circle, color-mix(in srgb, var(--accent, #d2b48c) 16%, #0d0c0a), #0b0a09 72%); box-shadow: 0 0 0 0 transparent, 0 0 50px color-mix(in srgb, var(--accent, #d2b48c) 14%, transparent); margin-bottom: 8px; transition: box-shadow .5s, transform .5s var(--ease-spring); }
.flow3-steps li:hover .orb { transform: translateY(-4px); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent, #d2b48c) 10%, transparent), 0 0 70px color-mix(in srgb, var(--accent, #d2b48c) 26%, transparent); }
.flow3 .orb svg { width: 56%; height: 56%; overflow: visible; }
.flow3 .n { font-family: var(--font-display); font-size: .7rem; letter-spacing: .3em; color: var(--accent, var(--gold)); }
.flow3 b { font-family: var(--font-display); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: .88rem; color: var(--gold-hi); }
.flow3 .d { color: var(--muted); font-size: .96rem; max-width: 30ch; }
/* línea punteada que une los tres pasos (centrada con los íconos) */
.flow3-line { position: absolute; left: 16.66%; right: 16.66%; top: clamp(54px, 6vw, 68px); width: 66.66%; height: 2px; overflow: visible; z-index: 0; }
.flow3-line line { stroke: var(--accent, var(--gold)); stroke-opacity: .55; stroke-width: 1.4; stroke-dasharray: 6 8; vector-effect: non-scaling-stroke; animation: march 1.6s linear infinite; }
@keyframes march { to { stroke-dashoffset: -28; } }

/* animaciones de cada ícono: solo corren mientras el paso está visible */
.flow3 li .radar-sweep, .flow3 li .blip, .flow3 li .fan, .flow3 li .twinkle, .flow3 li .drag { animation-play-state: paused; }
.flow3 li.in .radar-sweep, .flow3 li.in .blip, .flow3 li.in .fan, .flow3 li.in .twinkle, .flow3 li.in .drag { animation-play-state: running; }
.radar-sweep { transform-origin: 32px 32px; animation: radar 3.6s linear infinite; }
@keyframes radar { to { transform: rotate(360deg); } }
.blip { animation: blip 3.6s ease-in-out infinite; opacity: 0; transform-box: fill-box; transform-origin: center; }
.blip.b1 { animation-delay: .5s; } .blip.b2 { animation-delay: 1.7s; } .blip.b3 { animation-delay: 2.9s; }
@keyframes blip { 0%, 100% { opacity: 0; transform: scale(.4); } 10%, 45% { opacity: 1; transform: scale(1); } 70% { opacity: 0; transform: scale(1.8); } }
.fan { transform-origin: 34px 50px; }
.fan.f1 { animation: fan1 4.2s ease-in-out infinite; } .fan.f2 { animation: fan2 4.2s ease-in-out infinite; }
@keyframes fan1 { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-9deg); } }
@keyframes fan2 { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg); } }
.twinkle { transform-box: fill-box; transform-origin: center; animation: twink 2.4s ease-in-out infinite; }
@keyframes twink { 0%, 100% { transform: scale(.85) rotate(0); } 50% { transform: scale(1.15) rotate(18deg); } }
.drag { animation: dragcard 3.4s var(--ease-out-expo) infinite; }
@keyframes dragcard { 0%, 12% { transform: translate(0, 0) scale(1); opacity: 1; } 62% { transform: translate(26px, 24px) scale(.8); opacity: 1; } 78% { transform: translate(26px, 24px) scale(.55); opacity: 0; } 100% { transform: translate(0, 0) scale(1); opacity: 0; } }

@media (max-width: 760px) {
  .flow3-steps { grid-template-columns: 1fr; gap: 26px; }
  .flow3-steps li { display: grid; grid-template-columns: 96px 1fr; column-gap: 20px; text-align: left; align-items: center; justify-items: start; }
  .flow3 .orb { grid-row: 1 / span 3; width: 96px; margin: 0; }
  .flow3 .d { max-width: none; font-size: .9rem; }
  .flow3-line { display: none; }
  .flow3-steps li:not(:last-child)::after { content: ""; position: absolute; left: 48px; top: 100px; height: calc(100% - 76px); border-left: 1.4px dashed color-mix(in srgb, var(--accent, #d2b48c) 55%, transparent); }
}

/* ---- anillos del cierre ---- */
.final { position: relative; isolation: isolate; }
.final-rings { position: absolute; left: 50%; top: 56%; width: min(900px, 140vw); aspect-ratio: 1; translate: -50% -50%; z-index: -1; color: var(--accent, var(--gold)); pointer-events: none; mask-image: radial-gradient(circle, #000 0 30%, transparent 70%); -webkit-mask-image: radial-gradient(circle, #000 0 30%, transparent 70%); }
.final-rings circle { stroke-width: 1.1; transform-box: fill-box; transform-origin: center; opacity: 0; animation: ring-out 7.2s cubic-bezier(.2, .6, .3, 1) infinite; animation-play-state: paused; }
.final.in-view .final-rings circle { animation-play-state: running; }
.final-rings circle:nth-child(2) { animation-delay: 1.8s; } .final-rings circle:nth-child(3) { animation-delay: 3.6s; } .final-rings circle:nth-child(4) { animation-delay: 5.4s; }
@keyframes ring-out { 0% { transform: scale(.5); opacity: 0; } 12% { opacity: .5; } 100% { transform: scale(5); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ico .dr { stroke-dashoffset: 0; transition: none; }
  .flow3-line line, .radar-sweep, .blip, .fan, .twinkle, .drag, .final-rings circle { animation: none; }
  .blip { opacity: 1; }
  .final-rings circle { opacity: .18; transform: scale(1.6); }
  .final-rings circle:nth-child(n+3) { display: none; }
  .m-ico, .flow3 .orb { transition: none; }
}
