/* ==========================================================================
   RAHAZO · ostp-fx.css
   Capa de firma visual OSTP · @echoShift
   Referencia factica: OPA AutoTechPro (ostp-echoshift.github.io/opa-autotechpro)
   --------------------------------------------------------------------------
   Traduccion OPA -> RAHAZO (misma firma, paleta de tokens.css):
     OPA #D71513 rojo neon    -> --rojo-rahazo #B41525 / --rojo-senal #EC5560
     OPA #05060A negro        -> --negro-asfalto #111214 / --negro-profundo
     OPA #2D0100 card-bg      -> rgba(36, 40, 45, .62)  (gris carbon translucido)
     OPA #580300 borde        -> --rojo-profundo #860F1B
     OPA #D3D3D3 plata        -> --acero #94989F / --blanco-hueso
     (nuevo)                  -> --amarillo-seguridad #F5B700 (CTA y franja vial)
   --------------------------------------------------------------------------
   Contenido:
     1. Variables de efectos        7. Animaciones (vial, flotar, pulso)
     2. Fondo ambiental             8. Brillo del cursor (spotlight)
     3. Superficies de vidrio       9. Barra de progreso y particulas
     4. Brillo neon                10. Transiciones entre paginas
     5. Lineas de luz              11. Movil y dispositivos tactiles
     6. Hover: elevar y brillar    12. Movimiento reducido
   Se carga DESPUES de pages.css. Modulo JS: assets/js/modules/fx.js
   ========================================================================== */

/* --- 1. VARIABLES DE EFECTOS ------------------------------------------ */
:root {
  --fx-glass: rgba(36, 40, 45, 0.62);
  --fx-glass-strong: rgba(17, 18, 20, 0.82);
  --fx-glass-deep: rgba(11, 12, 13, 0.55);
  --fx-glass-border: rgba(148, 152, 159, 0.16);
  --fx-glass-border-hot: rgba(236, 85, 96, 0.55);
  --fx-blur: 12px;
  --fx-radius: 18px;
  --fx-radius-lg: 26px;

  --fx-glow-red: 0 0 28px rgba(180, 21, 37, 0.45);
  --fx-glow-red-soft: 0 12px 34px rgba(180, 21, 37, 0.22);
  --fx-glow-cta: 0 0 26px rgba(245, 183, 0, 0.38);
  --fx-glow-text: 0 0 18px rgba(236, 85, 96, 0.55);
  --fx-glow-white: 0 0 22px rgba(245, 243, 239, 0.35);

  --fx-line: linear-gradient(90deg, transparent, var(--rojo-senal), transparent);
  --fx-line-cta: linear-gradient(90deg, transparent, var(--amarillo-seguridad), transparent);
  --fx-brand-gradient: linear-gradient(135deg, var(--rojo-rahazo) 0%, var(--rojo-profundo) 100%);

  --fx-lift: -10px;
  --fx-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- 2. FONDO AMBIENTAL ------------------------------------------------ */
/* Capa fija detras del contenido: brillo rojo arriba a la derecha, azul
   carretera abajo a la izquierda (equivalente al overlay de 135° de OPA) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 100% 0%, rgba(180, 21, 37, 0.2), transparent 62%),
    radial-gradient(900px 640px at 0% 100%, rgba(23, 58, 106, 0.28), transparent 60%),
    linear-gradient(135deg, #0b0c0d 0%, #111214 55%, #170a0d 100%);
}

/* Reticula tenue tipo HUD / asfalto */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(148, 152, 159, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 152, 159, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}

/* Las secciones dejan ver el fondo ambiental */
.section--deep,
.clients {
  background: var(--fx-glass-deep);
}

.page-hero {
  background: transparent;
}

.page-hero::before {
  background:
    radial-gradient(circle at 25% 40%, rgba(180, 21, 37, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(11, 12, 13, 0.2), rgba(11, 12, 13, 0.65));
}

.topbar {
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* --- 3. SUPERFICIES DE VIDRIO ------------------------------------------ */
.card,
.equip-card,
.corridor,
.contact-box,
.form__section,
.testimonial,
.purpose__item,
.values__item,
.steps__item,
.route-map,
.empty-state,
.article__foot,
.tracking,
.owner,
.carriers__panel {
  background: var(--fx-glass);
  -webkit-backdrop-filter: blur(var(--fx-blur)) saturate(120%);
  backdrop-filter: blur(var(--fx-blur)) saturate(120%);
  border-color: var(--fx-glass-border);
}

.card,
.equip-card,
.corridor,
.contact-box,
.form__section,
.testimonial,
.purpose__item,
.values__item,
.route-map,
.article__foot,
.tracking {
  border-radius: var(--fx-radius);
}

.glance {
  background: rgba(36, 40, 45, 0.55);
  -webkit-backdrop-filter: blur(var(--fx-blur));
  backdrop-filter: blur(var(--fx-blur));
  border-bottom-color: var(--fx-glass-border);
}

.quote-card {
  background: rgba(24, 26, 30, 0.78);
  border-radius: var(--fx-radius);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(245, 183, 0, 0.12);
}

.choice-card {
  background: rgba(17, 18, 20, 0.6);
  border-radius: 14px;
}

.field__control {
  background: rgba(11, 12, 13, 0.7);
}

.site-footer {
  background: rgba(11, 12, 13, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* El borde de vidrio no debe borrar los bordes de acento */
.purpose__item { border-top-color: var(--brand); }
.purpose__item:nth-child(2) { border-top-color: var(--azul-senal); }
.tracking { border-top-color: var(--warning); }
.article__foot { border-top-color: var(--cta); }
.owner { border-left-color: var(--brand); }

/* --- 4. BRILLO NEON ---------------------------------------------------- */
.hero__title span,
.page-hero__title span,
.section__title span {
  text-shadow: var(--fx-glow-text);
}

.capacity .stat__value {
  text-shadow: var(--fx-glow-white);
}

.brand__logo {
  filter: drop-shadow(0 0 10px rgba(180, 21, 37, 0.35));
  transition: filter var(--dur) ease, height var(--dur) var(--fx-ease);
}

.brand:hover .brand__logo {
  filter: drop-shadow(0 0 16px rgba(236, 85, 96, 0.6));
}

.footer__logo {
  filter: drop-shadow(0 0 12px rgba(180, 21, 37, 0.4));
}

.equip-card__count {
  box-shadow: var(--fx-glow-cta);
}

.equip-card--support .equip-card__count {
  box-shadow: 0 0 18px rgba(91, 155, 234, 0.35);
}

.badge {
  box-shadow: 0 0 18px rgba(180, 21, 37, 0.25);
}

/* Botones: degradado de marca (como .map-btn de OPA) */
.btn--primary {
  --btn-bg: var(--rojo-rahazo);
  background-image: var(--fx-brand-gradient);
}

.btn--primary:hover {
  box-shadow: var(--fx-glow-red);
}

.btn--cta:hover {
  box-shadow: var(--fx-glow-cta);
}

.btn--outline:hover {
  box-shadow: var(--fx-glow-white);
}

/* --- 5. LINEAS DE LUZ -------------------------------------------------- */
/* Subrayado luminoso bajo los titulos de seccion (OPA .section-title::after) */
.section__head .section__title::after {
  content: '';
  display: block;
  width: 96px;
  height: 3px;
  margin-top: var(--sp-4);
  background: var(--fx-line);
  border-radius: 3px;
}

.section__head--center .section__title::after {
  margin-inline: auto;
}

.cta-final__title::after {
  content: '';
  display: block;
  width: 120px;
  height: 3px;
  margin: var(--sp-5) auto 0;
  background: var(--fx-line-cta);
}

/* Borde superior luminoso de las tarjetas (OPA .valor-card::before) */
.card::before {
  height: 2px;
  background: var(--fx-line);
  transform: scaleX(0.35);
  opacity: 0.6;
  transition: transform var(--dur-slow) var(--fx-ease), opacity var(--dur) ease;
}

.card--interactive:hover::before,
.card--interactive:focus-within::before {
  transform: scaleX(1);
  opacity: 1;
}

.equip-card,
.corridor,
.contact-box {
  position: relative;
  overflow: hidden;
}

.equip-card::before,
.contact-box::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--fx-line-cta);
  opacity: 0;
  transition: opacity var(--dur) ease;
}

.equip-card:hover::before,
.contact-box:hover::before {
  opacity: 1;
}

.site-header.is-scrolled {
  border-bottom-color: transparent;
  box-shadow: var(--shadow), inset 0 -1px 0 rgba(180, 21, 37, 0.55);
}

.site-footer {
  border-top: 0;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--fx-line);
}

/* --- 6. HOVER: ELEVAR Y BRILLAR ---------------------------------------- */
@media (hover: hover) {
  .card--interactive,
  .equip-card,
  .values__item,
  .purpose__item,
  .steps__item,
  .testimonial {
    transition:
      transform var(--dur-slow) var(--fx-ease),
      border-color var(--dur) ease,
      box-shadow var(--dur-slow) var(--fx-ease);
  }

  .card--interactive:hover,
  .card--interactive:focus-within {
    transform: translateY(var(--fx-lift));
    border-color: var(--fx-glass-border-hot);
    box-shadow: var(--fx-glow-red-soft);
  }

  .equip-card:hover,
  .values__item:hover,
  .purpose__item:hover,
  .testimonial:hover {
    transform: translateY(-6px);
    border-color: rgba(245, 183, 0, 0.45);
    box-shadow: 0 12px 30px rgba(245, 183, 0, 0.12);
  }

  .steps__item:hover {
    transform: translateY(-4px);
    border-color: var(--fx-glass-border-hot);
  }

  .card__icon,
  .equip-card__icon {
    transition: transform var(--dur-slow) var(--fx-ease), filter var(--dur) ease, color var(--dur) ease;
  }

  .card--interactive:hover .card__icon {
    transform: scale(1.08) rotate(-3deg);
    filter: drop-shadow(0 0 10px rgba(236, 85, 96, 0.55));
  }

  .equip-card:hover .equip-card__icon {
    transform: translateX(6px);
    filter: drop-shadow(0 0 8px rgba(245, 183, 0, 0.45));
  }

  .footer__links a,
  .related a {
    transition: color var(--dur-fast) ease, padding-left var(--dur) var(--fx-ease);
  }

  .footer__links a:hover {
    padding-left: 5px;
  }

  .footer__social a:hover {
    transform: translateY(-4px);
    box-shadow: var(--fx-glow-red);
  }
}

/* --- 7. ANIMACIONES ---------------------------------------------------- */
/* Franja de seguridad en movimiento: "carretera" */
.hazard-stripe {
  background-size: 40px 40px;
  animation: fx-road 1.6s linear infinite;
}

@keyframes fx-road {
  to { background-position: 40px 0; }
}

/* Lineas del esquema de corredores fluyendo hacia el destino */
.route-map__line {
  animation: fx-route 1.4s linear infinite;
}

.route-map__route.is-active .route-map__line,
.route-map__route:hover .route-map__line {
  stroke-dasharray: 14 8;
  animation-duration: 0.8s;
  filter: drop-shadow(0 0 4px rgba(236, 85, 96, 0.7));
}

@keyframes fx-route {
  to { stroke-dashoffset: -18; }
}

/* Flotar (OPA .header-badge) */
.history__seal,
.page-hero .badge {
  animation: fx-float 3.2s ease-in-out infinite;
}

@keyframes fx-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Pulso del contador del flotante y de los puntos activos */
.carousel__dot[aria-current='true'] {
  box-shadow: 0 0 10px rgba(236, 85, 96, 0.7);
}

/* WhatsApp: anillo de pulso + tooltip (OPA .whatsapp-float) */
.wa-float {
  animation: fx-wa-pulse 2.2s infinite;
}

.wa-float::after {
  content: attr(aria-label);
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  padding: 6px 14px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  white-space: nowrap;
  color: #0B2A16;
  background: var(--whatsapp);
  border-radius: var(--radius-pill);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur) ease, transform var(--dur) var(--fx-ease);
  pointer-events: none;
}

@media (hover: hover) {
  .wa-float:hover::after {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fx-wa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.65); }
  70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Entrada escalonada mas marcada que la base */
.js .reveal {
  transform: translateY(40px) scale(0.985);
  filter: blur(4px);
  transition:
    opacity var(--dur-slow) var(--fx-ease),
    transform var(--dur-slow) var(--fx-ease),
    filter var(--dur-slow) var(--fx-ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal.is-visible {
  filter: none;
}

/* --- 8. BRILLO DEL CURSOR (spotlight, lo activa fx.js) ------------------ */
.fx-spot {
  isolation: isolate;
}

.fx-spot::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(236, 85, 96, 0.13), transparent 45%);
  opacity: 0;
  transition: opacity var(--dur) ease;
}

.fx-spot:hover::after {
  opacity: 1;
}

/* --- 9. BARRA DE PROGRESO Y PARTICULAS --------------------------------- */
.fx-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: calc(var(--z-header) + 1);
  height: 3px;
  background: linear-gradient(90deg, var(--rojo-rahazo), var(--rojo-senal) 60%, var(--amarillo-seguridad));
  box-shadow: 0 0 10px rgba(236, 85, 96, 0.6);
  transform: scaleX(var(--fx-progress, 0));
  transform-origin: left;
  pointer-events: none;
}

.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* --- 10. TRANSICIONES ENTRE PAGINAS: ahora las hace ostp-feedback.css (cortina de marca) --- */

/* --- 11. MOVIL Y DISPOSITIVOS TACTILES --------------------------------- */
@media (max-width: 1099px) {
  :root {
    --fx-blur: 8px;
    --fx-radius: 16px;
  }
}

@media (max-width: 599px) {
  :root {
    --fx-blur: 6px;
    --fx-radius: 14px;
  }

  body::after {
    background-size: 40px 40px;
  }

  .section__head .section__title::after {
    width: 72px;
  }

  .wa-float {
    right: max(var(--sp-4), env(safe-area-inset-right));
    bottom: max(var(--sp-4), env(safe-area-inset-bottom));
  }
}

/* En tactiles no hay hover: sin spotlight ni elevacion */
@media (hover: none) {
  .fx-spot::after {
    display: none;
  }
}

/* Sin soporte de backdrop-filter: superficies mas opacas */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  :root {
    --fx-glass: rgba(36, 40, 45, 0.94);
    --fx-glass-deep: rgba(11, 12, 13, 0.92);
  }
}

/* --- 12. MOVIMIENTO REDUCIDO ------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hazard-stripe,
  .route-map__line,
  .history__seal,
  .page-hero .badge,
  .wa-float {
    animation: none !important;
  }

  .js .reveal {
    filter: none;
    transform: none;
  }

  .fx-canvas,
  .fx-progress {
    display: none;
  }

}
