/* Módulo de movimiento: química, análisis de Malla 200 y encabezados. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.type-cycle {
  display: flex;
  align-items: center;
  min-height: 1.5rem;
  margin: 0 0 1rem;
  color: #cbbbec;
  font: 600 .72rem "Space Grotesk", sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.type-cycle::before {
  content: ">_";
  margin-right: .6rem;
  color: #f1b885;
}

.type-cycle::after {
  content: "";
  width: 7px;
  height: 1em;
  margin-left: .35rem;
  background: currentColor;
  animation: techCursor .75s steps(1) infinite;
}

.type-cycle-dark {
  margin-top: 1rem;
  color: #8d77be;
}

.tech-glitch {
  position: relative;
  display: inline-block;
  color: #f2b783;
  isolation: isolate;
  text-shadow: 0 0 24px rgba(242, 183, 131, .16);
  animation: textGlow 4.8s ease-in-out infinite;
}

.tech-glitch::before,
.tech-glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
}

.tech-glitch::before {
  color: #bba8e9;
  transform: translateX(2px);
  animation: glitchSliceTop 6.2s steps(1) infinite;
}

.tech-glitch::after {
  color: #f3c79f;
  transform: translateX(-2px);
  animation: glitchSliceBottom 6.2s steps(1) .08s infinite;
}

.tech-glitch-dark {
  color: #8b73bb;
  text-shadow: 0 0 22px rgba(130, 106, 181, .2);
}

.tech-glitch-light {
  color: #f8f5ef;
  text-shadow: 0 0 22px rgba(255, 255, 255, .16);
}

.uses-glow {
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  line-height: .98;
}

.image-tech-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 70% 54%, rgba(165, 141, 218, .24), transparent 19%),
    linear-gradient(112deg, transparent 35%, rgba(255,255,255,.12) 48%, transparent 59%);
  background-size: 100% 100%, 230% 100%;
  mix-blend-mode: screen;
  animation: imageGlowBreath 5.5s ease-in-out infinite, imageLightSweep 8s ease-in-out infinite;
}

.chemistry-field {
  position: absolute;
  inset: 8rem 4vw 2rem 50%;
  z-index: -1;
  pointer-events: none;
}

.chemistry-field span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(207, 191, 243, .48);
  border-radius: 50%;
  background: rgba(10, 16, 15, .3);
  color: #d4c7f3;
  font: 600 .78rem "Space Grotesk", sans-serif;
  backdrop-filter: blur(5px);
  animation: moleculeFloat 6s ease-in-out infinite;
}

.chemistry-field span:nth-child(1) { top: 9%; right: 14%; }
.chemistry-field span:nth-child(2) { top: 46%; right: 4%; animation-delay: -1.5s; }
.chemistry-field span:nth-child(3) { bottom: 7%; left: 19%; animation-delay: -3s; }
.chemistry-field span:nth-child(4) { top: 21%; left: 6%; animation-delay: -4.2s; }

.chemistry-field i {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a998d3;
  box-shadow: 0 0 22px #bbaae7;
  animation: electronDrift 8s linear infinite;
}

.chemistry-field i:nth-of-type(1) { top: 20%; left: 44%; }
.chemistry-field i:nth-of-type(2) { top: 64%; left: 66%; animation-delay: -2.5s; }
.chemistry-field i:nth-of-type(3) { top: 76%; left: 32%; animation-delay: -5s; }

.chemical-title span {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  animation: chemicalTitleIn .9s cubic-bezier(.18, .8, .2, 1) forwards;
}

.chemical-title span:last-child {
  color: #f2b783;
  animation-delay: .16s;
}

.mesh-scanner {
  position: absolute;
  inset: 10% 2% 12% 4%;
  z-index: 1;
  overflow: hidden;
  border: 1px solid rgba(180, 162, 222, .28);
  clip-path: polygon(0 9%, 9% 0, 100% 0, 100% 91%, 91% 100%, 0 100%);
  pointer-events: none;
}

.mesh-grid {
  position: absolute;
  inset: 0;
  opacity: .26;
  background-image:
    linear-gradient(rgba(174, 156, 216, .35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(174, 156, 216, .35) 1px, transparent 1px);
  background-size: 32px 32px;
  transform: perspective(500px) rotateX(58deg) scale(1.4);
}

.mesh-line {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c9b9ef, transparent);
  box-shadow: 0 0 25px #9e87d4;
  animation: meshScan 4s ease-in-out infinite;
}

.mesh-scanner small {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  color: #d2c4f2;
  font: 600 .68rem "Space Grotesk", sans-serif;
  letter-spacing: .12em;
}

.mesh-scanner i {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid #cab9ef;
  border-radius: 50%;
  animation: techPoint 3.5s ease-in-out infinite;
}

.mesh-scanner i:nth-of-type(1) { top: 25%; left: 24%; }
.mesh-scanner i:nth-of-type(2) { top: 52%; right: 18%; animation-delay: -1s; }
.mesh-scanner i:nth-of-type(3) { bottom: 18%; left: 42%; animation-delay: -2s; }

.atom-field {
  position: absolute;
  right: 8vw;
  bottom: 7vh;
  z-index: 1;
  width: 280px;
  height: 280px;
  pointer-events: none;
}

.atom-nucleus {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #aa96d7;
  color: #101514;
  font: 700 .85rem "Space Grotesk", sans-serif;
  box-shadow: 0 0 45px rgba(182, 160, 228, .6);
  transform: translate(-50%, -50%);
  animation: nucleusPulse 3s ease-in-out infinite;
}

.atom-field i {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 260px;
  height: 90px;
  border: 1px solid rgba(208, 192, 240, .55);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: atomSpin 9s linear infinite;
}

.atom-field i:nth-of-type(2) { transform: translate(-50%, -50%) rotate(60deg); animation-delay: -3s; }
.atom-field i:nth-of-type(3) { transform: translate(-50%, -50%) rotate(-60deg); animation-delay: -6s; }
.atom-field b { position: absolute; right: 3%; bottom: 15%; color: #cfc1f0; font-size: .75rem; letter-spacing: .12em; animation: moleculeFloat 4s ease-in-out infinite; }

@keyframes chemicalTitleIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes techCursor {
  50% { opacity: 0; }
}

@keyframes textGlow {
  0%, 100% { filter: brightness(1); text-shadow: 0 0 14px rgba(187,168,233,.08); }
  50% { filter: brightness(1.12); text-shadow: 0 0 30px rgba(187,168,233,.28); }
}

@keyframes glitchSliceTop {
  0%, 91%, 94%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); }
  92% { opacity: .62; clip-path: inset(14% 0 63% 0); transform: translateX(3px); }
  93% { opacity: .25; clip-path: inset(62% 0 17% 0); transform: translateX(-2px); }
}

@keyframes glitchSliceBottom {
  0%, 91%, 94%, 100% { opacity: 0; clip-path: inset(100% 0 0 0); }
  92% { opacity: .5; clip-path: inset(58% 0 19% 0); transform: translateX(-3px); }
  93% { opacity: .2; clip-path: inset(30% 0 48% 0); transform: translateX(2px); }
}

@keyframes imageGlowBreath {
  0%, 100% { opacity: .45; }
  50% { opacity: .85; }
}

@keyframes imageLightSweep {
  0%, 20% { background-position: center, 120% 0; }
  60%, 100% { background-position: center, -120% 0; }
}

@keyframes moleculeFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-1deg); }
  50% { transform: translate3d(0, -13px, 0) rotate(2deg); }
}

@keyframes electronDrift {
  0% { transform: rotate(0) translateX(20px) rotate(0); }
  100% { transform: rotate(360deg) translateX(70px) rotate(-360deg); }
}

@keyframes meshScan {
  0%, 100% { top: 3%; opacity: .2; }
  50% { top: 96%; opacity: 1; }
}

@keyframes techPoint {
  0%, 100% { transform: scale(.7); opacity: .35; }
  50% { transform: scale(1.8); opacity: 1; box-shadow: 0 0 18px #bca8e9; }
}

@keyframes nucleusPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(.92); }
  50% { transform: translate(-50%, -50%) scale(1.06); }
}

@keyframes atomSpin {
  to { rotate: 360deg; }
}

@media (max-width: 860px) {
  .chemistry-field { inset: 10rem 0 2rem 28%; opacity: .65; }
  .atom-field { right: -3rem; bottom: 2rem; transform: scale(.72); opacity: .68; }
}

@media (max-width: 560px) {
  .chemistry-field { opacity: .4; }
  .chemistry-field span { width: 48px; height: 48px; }
  .mesh-scanner { inset: 9% 0 13%; }
  .atom-field { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .chemistry-field *,
  .chemical-title span,
  .mesh-scanner *,
  .atom-field *,
  .type-cycle::after,
  .tech-glitch,
  .tech-glitch::before,
  .tech-glitch::after,
  .image-tech-glow {
    animation: none !important;
  }

  .chemical-title span {
    opacity: 1;
    transform: none;
  }
}
