/* Imagen de fondo de cada portada. Se dibuja como máscara sobre el color de acento, así sigue el tema claro/oscuro.
   Inicio = puntos · Optimizer = circuito · Monitor = línea de pulso (se desliza sola). */
.hero { position: relative; overflow: hidden; }
.hero > .wrap { position: relative; z-index: 1; }
/* inset negativo: sobra una baldosa de cada lado, así el fondo se mueve con transform (compositor) y no repinta la máscara en cada cuadro */
.backdrop { position: absolute; inset: -240px; background: var(--op); opacity: .2; pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(transparent 40%, var(--bg)); }

body.inicio .backdrop {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='2' cy='2' r='1.3'/%3E%3C/svg%3E");
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='2' cy='2' r='1.3'/%3E%3C/svg%3E");
  animation: deriva-puntos 30s linear infinite;
}
body.p-op .backdrop {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M0 30h40l10 10h30M80 40v30l10 10h30M0 90h30l10-10h20M60 120v-20l10-10'/%3E%3Ccircle cx='80' cy='40' r='3' fill='black'/%3E%3Ccircle cx='40' cy='80' r='3' fill='black'/%3E%3Ccircle cx='120' cy='80' r='3' fill='black'/%3E%3C/svg%3E");
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M0 30h40l10 10h30M80 40v30l10 10h30M0 90h30l10-10h20M60 120v-20l10-10'/%3E%3Ccircle cx='80' cy='40' r='3' fill='black'/%3E%3Ccircle cx='40' cy='80' r='3' fill='black'/%3E%3Ccircle cx='120' cy='80' r='3' fill='black'/%3E%3C/svg%3E");
  animation: deriva-circuito 40s linear infinite;
}
body.p-mon .backdrop {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='120' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M0 60H60l8-8 8 8h16l10-34 14 68 12-44 8 10h104'/%3E%3C/svg%3E");
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='120' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M0 60H60l8-8 8 8h16l10-34 14 68 12-44 8 10h104'/%3E%3C/svg%3E");
  animation: deriva-pulso 10s linear infinite;
}
body.p-hib .backdrop {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='110' fill='black'%3E%3Cpath d='M30 18a12 12 0 1 0 10 18 9 9 0 0 1-10-18z'/%3E%3Ccircle cx='82' cy='30' r='1.6'/%3E%3Ccircle cx='70' cy='86' r='1.3'/%3E%3Ccircle cx='14' cy='72' r='1.3'/%3E%3Cpath d='M88 74h10l-10 10h10' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110' height='110' fill='black'%3E%3Cpath d='M30 18a12 12 0 1 0 10 18 9 9 0 0 1-10-18z'/%3E%3Ccircle cx='82' cy='30' r='1.6'/%3E%3Ccircle cx='70' cy='86' r='1.3'/%3E%3Ccircle cx='14' cy='72' r='1.3'/%3E%3Cpath d='M88 74h10l-10 10h10' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
  animation: deriva-luna 50s linear infinite;
}
/* En celu animar la máscara repinta toda la portada en cada cuadro: queda quieta */
@media (hover: none) { body .backdrop { animation: none; } }
@keyframes deriva-puntos { to { transform: translate(28px, 28px); } }
@keyframes deriva-circuito { to { transform: translate(120px, 120px); } }
@keyframes deriva-pulso { to { transform: translateX(-240px); } }
@keyframes deriva-luna { to { transform: translate(110px, 110px); } }
