/* Fondos de la maqueta aprobada: capas aisladas del contenido y sus controles. */
.fondos { position: relative; isolation: isolate; overflow: clip; }
.fondos__decor, .fondos__decor * { pointer-events: none; }
.fondos__decor { position: absolute; z-index: -1; }

/* Matrices sobre papel. El patrón mide 120 px para cerrar el ciclo sin saltos. */
.fondos__matrices { inset: 0; width: calc(100% + 120px); height: calc(100% + 120px); }
.fondos__drift { animation: fondos-drift 40s linear infinite; }
@keyframes fondos-drift { to { transform: translate(-120px, -120px); } }

/* La mesa asoma junto al encabezado, sin ocupar espacio en la cuadrícula. */
.fondos__rings { right: -140px; top: 24px; width: 560px; height: 560px; }
.fondos__rings circle { fill: none; stroke: var(--mensa); stroke-opacity: .14; stroke-width: 1.2; }
.fondos__rings .fondos__seat { fill: var(--gold); stroke: none; }
.fondos__spin { transform-origin: 280px 280px; animation: fondos-spin 60s linear infinite; }
@keyframes fondos-spin { to { transform: rotate(360deg); } }

.fondos__canvas { inset: 0; width: 100%; height: 100%; opacity: .5; }
.fondos--stats .stat dd { font-variant-numeric: tabular-nums; }
/* El valor final reserva siempre el mismo ancho; la copia animada es decorativa. */
.fondos__count { display: inline-grid; }
.fondos__count > span { grid-area: 1 / 1; }
.fondos__count.is-counting > .fondos__count-value { opacity: 0; }
.fondos__count > .fondos__count-animation { position: static; z-index: auto; }

/* Azul, dorado y violeta difuminados. El formulario conserva su tarjeta opaca. */
.fondos--mesh { background: var(--ink); }
.fondos__mesh { inset: -20%; filter: blur(60px); opacity: .7; }
.fondos__mesh span { position: absolute; border-radius: 50%; }
.fondos__mesh span:nth-child(1) { width: 50%; height: 60%; left: 5%; top: 10%; background: var(--blue); animation: fondos-float 18s ease-in-out infinite alternate; }
.fondos__mesh span:nth-child(2) { width: 40%; height: 50%; right: 5%; top: 30%; background: var(--gold); opacity: .55; animation: fondos-float 22s ease-in-out infinite alternate-reverse; }
.fondos__mesh span:nth-child(3) { width: 45%; height: 45%; left: 35%; bottom: -5%; background: #5b2b9e; opacity: .55; animation: fondos-float 26s ease-in-out infinite alternate; }
@keyframes fondos-float { to { transform: translate(8%, -6%) scale(1.1); } }
.fondos__grain { inset: 0; opacity: .18; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
/* Un velo limita la luminosidad de la malla incluso en su posición más clara. */
.fondos__mesh::after { content: ""; position: absolute; inset: 0; background: rgba(7, 22, 55, .58); }
.fondos--mesh .reg__grid > :first-child { color: #fff; }
.fondos--mesh .reg__grid > :first-child .h2 { color: #fff; }
.fondos--mesh .reg__grid > :first-child .h2 em,
.fondos--mesh .reg__grid > :first-child .eyebrow { color: var(--gold-2); }
.fondos--mesh .reg__grid > :first-child .lead { color: rgba(255, 255, 255, .86); }

.fondos__sequences { inset: 0; display: grid; align-content: space-around; overflow: hidden; color: var(--mensa); opacity: .06; font: 600 22px/1 var(--serif); white-space: nowrap; }
.fondos__sequences > span { width: max-content; animation: fondos-slide 50s linear infinite; }
.fondos__sequences > span:nth-child(2) { animation-duration: 70s; animation-direction: reverse; }
.fondos__sequences > span:nth-child(3) { animation-duration: 60s; }
@keyframes fondos-slide { to { transform: translateX(-50%); } }

/* El enlace tiene nombre accesible; sus nombres repetidos son solo decoración. */
.fondos-ribbon { position: relative; display: block; height: 54px; overflow: hidden; border-block: 1px solid var(--line); background: var(--card); color: var(--mensa); text-decoration: none; }
.fondos-ribbon > .fondos__decor { inset: 0; z-index: auto; display: flex; align-items: center; }
.fondos-ribbon__track { display: flex; width: max-content; animation: fondos-slide 40s linear infinite; }
.fondos-ribbon__group { display: flex; align-items: center; justify-content: space-around; flex: none; min-width: 100vw; white-space: nowrap; font: 700 13px/1 var(--sans); }
.fondos-ribbon__group i { margin-inline: 18px; color: var(--gold); font-style: normal; }
.fondos-ribbon:hover .fondos-ribbon__track, .fondos-ribbon:focus-visible .fondos-ribbon__track { animation-play-state: paused; }
.fondos-ribbon:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }

@media (max-width: 640px) {
  .fondos__rings { right: -320px; opacity: .55; }
}
@media (prefers-reduced-motion: reduce) {
  .fondos__decor, .fondos__decor *, .fondos__decor::before, .fondos__decor::after {
    animation: none !important;
    transition: none !important;
  }
}
