/* FDM · capa de movimiento y efectos (se desactiva con prefers-reduced-motion) */

/* Barra de progreso de lectura */
.progreso { position: fixed; top: 0; left: 0; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--naranja), #ffd0a8); box-shadow: 0 0 12px var(--naranja); z-index: 60; }

/* Portada: chispas, rejilla y láser */
#chispas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.portada .contenedor { position: relative; z-index: 1; }
.rejilla { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 10%, transparent 70%);
  animation: rejilla 18s linear infinite; }
@keyframes rejilla { to { background-position: 56px 56px, 56px 56px; } }
.laser { position: absolute; left: 0; right: 0; height: 2px; top: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--naranja) 30%, #ffd9bd 50%, var(--naranja) 70%, transparent);
  box-shadow: 0 0 18px 2px rgba(255,106,19,.55); opacity: .55; animation: laser 7s ease-in-out infinite; }
@keyframes laser { 0% { top: 8%; opacity: 0 } 10% { opacity: .6 } 50% { top: 88%; opacity: .5 } 60% { opacity: 0 } 100% { top: 88%; opacity: 0 } }
.portada-fondo img { transform: scale(1.08); will-change: transform; }

/* Brillo metálico que recorre los titulares */
.metal { background-size: 220% 100%; animation: brillo 6s ease-in-out infinite; }
@keyframes brillo { 0%, 100% { background-position: 0% 50% } 50% { background-position: 100% 50% } }

/* Titular que entra línea a línea */
.linea-titular { display: block; overflow: hidden; }
.linea-titular > span { display: inline-block; transform: translateY(105%); animation: subir .9s cubic-bezier(.2,.8,.2,1) forwards; }
.linea-titular:nth-child(2) > span { animation-delay: .12s; }
.linea-titular:nth-child(3) > span { animation-delay: .24s; }
@keyframes subir { to { transform: none; } }

/* Indicador de «sistema en marcha» */
.estado-sistema { display: inline-flex; align-items: center; gap: 10px; font: 400 .78rem/1 "Share Tech Mono", Consolas, monospace;
  letter-spacing: .18em; text-transform: uppercase; color: var(--texto-2); margin-left: 6px; }
.estado-sistema i { width: 8px; height: 8px; border-radius: 50%; background: #2ee66b; box-shadow: 0 0 10px #2ee66b;
  animation: latido 1.6s ease-in-out infinite; }
@keyframes latido { 50% { opacity: .35; } }

/* Banda en movimiento */
.banda { position: relative; overflow: hidden; background: var(--naranja); color: #140800; transform: rotate(-1.2deg);
  margin: -8px 0; z-index: 2; box-shadow: 0 10px 40px rgba(255,106,19,.25); }
.banda-pista { display: flex; width: max-content; animation: banda 32s linear infinite; }
.banda span { font: 400 .92rem/1 "Michroma", "Eurostile", "Segoe UI", sans-serif; text-transform: uppercase; letter-spacing: .1em;
  padding: 16px 22px; white-space: nowrap; display: inline-flex; align-items: center; gap: 22px; }
.banda span::after { content: ""; width: 10px; height: 10px; background: #140800; transform: rotate(45deg); }
@keyframes banda { to { transform: translateX(-50%); } }

.estacion { transition: border-color .4s ease, box-shadow .4s ease, transform .4s ease; }
.estacion .numero { transition: filter .4s ease; }
.estacion.activa { border-color: rgba(255,106,19,.75); transform: translateY(-6px);
  box-shadow: 0 0 0 1px rgba(255,106,19,.4), 0 0 46px rgba(255,106,19,.25), 0 18px 40px rgba(0,0,0,.45); }
.estacion.activa .numero { filter: drop-shadow(0 0 10px rgba(255,106,19,.8)); }
.estacion .luz { position: absolute; top: 14px; right: 30px; width: 7px; height: 7px; border-radius: 50%; background: #3a3f46; transition: .4s; }
.estacion.activa .luz { background: var(--naranja); box-shadow: 0 0 12px var(--naranja); }

/* Placas con inclinación 3D y reflejo */
.inclina { transform-style: preserve-3d; transition: transform .25s ease, box-shadow .25s ease; will-change: transform; }
.inclina .reflejo { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255,140,70,.16), transparent 45%); }
.inclina:hover .reflejo { opacity: 1; }
.inclina::before, .inclina::after { z-index: 1; }
.servicio:hover, .proyecto:hover, .pilar:hover { border-color: rgba(255,106,19,.55); }

/* Borde que se ilumina en el formulario */
form.placa { overflow: hidden; }
form.placa .barrido { position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; padding: 1px;
  background: conic-gradient(from var(--angulo, 0deg), transparent 0 70%, var(--naranja) 85%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; animation: barrer 5s linear infinite; }
@property --angulo { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes barrer { to { --angulo: 360deg; } }

/* Foco de luz que sigue al ratón en las secciones */
.foco { position: relative; }
.foco::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(600px circle at var(--fx, 50%) var(--fy, 50%), rgba(255,106,19,.07), transparent 40%); }
.foco > .contenedor { position: relative; z-index: 1; }

/* Aparición escalonada */
.aparece { transition-delay: var(--retardo, 0s); }

@media (prefers-reduced-motion: reduce) {
  .rejilla, .laser, .metal, .banda-pista, form.placa .barrido, .estado-sistema i { animation: none; }
  .laser { display: none; }
  .linea-titular > span { transform: none; animation: none; }
  .inclina { transform: none !important; }
}
