/* Estilos propios de Sepia: van junto con Tailwind por CDN; los colores viven también en :root por si los reutilizas */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Paleta: negro de fondo, menta y turquesa como acentos */
:root {
  --sepia-bg: #000000;
  --sepia-mint: #4ADE80;
  --sepia-turquoise: #2DD4BF;
  --sepia-text: #FFFFFF;
  --sepia-text-muted: #A1A1AA;
  --sepia-border: rgba(74, 222, 128, 0.2);
  --sepia-glow: rgba(74, 222, 128, 0.4);
  --sepia-glow-turquoise: rgba(45, 212, 191, 0.4);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--sepia-bg);
  color: var(--sepia-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Tarjetas de galería / servicios: borde suave y brillo al pasar el mouse */
.sepia-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid rgba(74, 222, 128, 0.15);
  background: rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.sepia-card:hover {
  border-color: rgba(74, 222, 128, 0.4);
  box-shadow: 0 0 30px var(--sepia-glow), 0 0 60px rgba(45, 212, 191, 0.2);
}

/* Degradado menta–turquesa para botones y acentos */
.sepia-gradient {
  background: linear-gradient(135deg, var(--sepia-mint) 0%, var(--sepia-turquoise) 100%);
}

.sepia-gradient-text {
  background: linear-gradient(135deg, var(--sepia-mint) 0%, var(--sepia-turquoise) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Barra superior semitransparente con desenfoque; .scrolled la oscurece un poco al bajar */
.navbar-blur {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(0, 0, 0, 0.6);
}

.navbar-blur.scrolled {
  background: rgba(0, 0, 0, 0.85);
}

/* Botón “Cotizar” y CTAs */
.btn-sepia {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, var(--sepia-mint) 0%, var(--sepia-turquoise) 100%);
  color: #000000;
}

.btn-sepia:hover {
  box-shadow: 0 0 20px var(--sepia-glow), 0 0 40px var(--sepia-glow-turquoise);
  transform: translateY(-2px);
}

/* Animación junto al logo; pura decoración */
.equalizer-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 40px;
}

.equalizer-bar {
  width: 4px;
  background: linear-gradient(to top, var(--sepia-mint), var(--sepia-turquoise));
  border-radius: 2px;
  animation: equalizer-pulse 1.2s ease-in-out infinite;
}

.equalizer-bar:nth-child(1) { height: 20%; animation-delay: 0s; }
.equalizer-bar:nth-child(2) { height: 60%; animation-delay: 0.1s; }
.equalizer-bar:nth-child(3) { height: 100%; animation-delay: 0.2s; }
.equalizer-bar:nth-child(4) { height: 60%; animation-delay: 0.3s; }
.equalizer-bar:nth-child(5) { height: 20%; animation-delay: 0.4s; }

@keyframes equalizer-pulse {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}

/* Por si quieres usar .animate-fade-in-up en algún bloque */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

/* El JS le agrega .open para desplegar el menú hamburguesa */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.mobile-menu.open {
  max-height: 500px;
}

/* Dos copias idénticas + translate -50% = carrusel continuo sin salto.
   El margen derecho de cada copia = separación entre logos, para que el
   empalme entre la copia 1 y la 2 sea perfecto (loop infinito real). */
.marquee-container {
  width: 100%;
  padding: 1rem 0; /* aire para que el logo al crecer no se recorte */
  /* Banda con viñeta: gris tenue al centro que se difumina a negro hacia los
     lados, para que los logos negros se vean y entren/salgan sin corte duro. */
  background:
    radial-gradient(ellipse 60% 120% at 50% 50%, rgba(255, 255, 255, 0.05), transparent 70%),
    linear-gradient(to right, #000 0%, #2e2e2e 18%, #3a3a3a 50%, #2e2e2e 82%, #000 100%);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 35s linear infinite;
  will-change: transform;
}

.marquee-content {
  flex-shrink: 0;
  margin-right: 3rem; /* = gap-12 interno */
}

/* Interacción: al pasar el mouse por la cinta, se pausa toda la animación */
.marquee-container:hover .marquee-track {
  animation-play-state: paused;
}

/* ...y el logo señalado crece y se ilumina */
.marquee-content img {
  transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

.marquee-content img:hover {
  transform: scale(1.25);
  opacity: 1;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Sustituir por <img> de cada marca cuando las tengas */
.brand-logo-placeholder {
  width: 140px;
  height: 70px;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(74, 222, 128, 0.3);
  border-radius: 8px;
  color: rgba(74, 222, 128, 0.5);
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.3);
  transition: border-color 0.3s, color 0.3s;
}

.brand-logo-placeholder:hover {
  border-color: rgba(74, 222, 128, 0.5);
  color: rgba(74, 222, 128, 0.8);
}

/* ===== Video de fondo del hero (con opacidad + viñeta a negro) ===== */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;           /* video más visible */
  z-index: 0;
  pointer-events: none;
  /* Difuminado arriba y abajo: el video se funde con el negro de la página
     (sin línea de corte) al hacerse transparente en sus bordes. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 15%, #000 82%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 15%, #000 82%, transparent 100%);
}

/* Oscurecido con viñeta (más suave): centro despejado, bordes atenuados */
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 65% 65% at center, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.32) 48%, rgba(0, 0, 0, 0.72) 82%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.05) 42%, rgba(0, 0, 0, 0.4) 100%);
}

/* ===== Modal de cotización (Cotizar → Proyectos / Retail → Microsoft Form) ===== */
.cotizar-overlay {
  position: fixed;
  inset: 0;
  z-index: 60; /* sobre el navbar (z-50) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cotizar-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cotizar-dialog {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  background: #0a0a0a;
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 1rem;
  box-shadow: 0 0 40px var(--sepia-glow), 0 0 80px rgba(45, 212, 191, 0.08);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}

.cotizar-overlay.open .cotizar-dialog {
  transform: none;
}

.cotizar-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--sepia-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}
.cotizar-close:hover { color: var(--sepia-mint); }

.cotizar-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.cotizar-sub {
  text-align: center;
  color: var(--sepia-text-muted);
  margin-bottom: 1.5rem;
}

.cotizar-cards {
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) {
  .cotizar-cards { grid-template-columns: 1fr 1fr; }
}

.cotizar-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(74, 222, 128, 0.15);
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.cotizar-card:hover,
.cotizar-card:focus-visible {
  border-color: rgba(74, 222, 128, 0.45);
  box-shadow: 0 0 24px rgba(74, 222, 128, 0.18);
  transform: translateY(-2px);
  outline: none;
}

.cotizar-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--sepia-mint) 0%, var(--sepia-turquoise) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cotizar-card-desc {
  font-size: 0.9rem;
  color: var(--sepia-text-muted);
}

.cotizar-back {
  background: none;
  border: none;
  color: var(--sepia-text-muted);
  cursor: pointer;
  margin-bottom: 1rem;
  transition: color 0.2s;
}
.cotizar-back:hover { color: var(--sepia-mint); }

.cotizar-frame {
  position: relative;
  width: 100%;
  height: 600px;
}
@media (max-width: 640px) {
  .cotizar-frame { height: 70vh; }
}

.cotizar-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0.5rem;
  background: #ffffff;
}

.cotizar-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sepia-text-muted);
  pointer-events: none;
}

/* ===== "Nuestros Servicios": lista interactiva con hover ===== */
.client-item {
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  border-left: 2px solid rgba(74, 222, 128, 0.12);
  color: var(--sepia-text-muted);
  font-weight: 500;
  cursor: default;
  transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.client-item:hover,
.client-item:focus-visible {
  border-left-color: var(--sepia-mint);
  background: rgba(74, 222, 128, 0.06);
  color: #ffffff;
  transform: translateX(6px);
}

/* ===== "Clientes Destacados": sistema orbital 3D estilo solar-system =====
   Estructura: .orbit-system (contenedor, define perspective) > .orbit-plane
   (el "disco" inclinado en 3D vía rotateX) > pistas punteadas + .orbit-center
   (núcleo) + dos .orbit-ring (anillo interior/exterior), cada uno con
   .orbit-item (punto fijo en el círculo, vía --angle/--radius) que contiene
   una .orbit-bubble (la burbuja visible con el nombre).
   Truco de "billboard": como .orbit-plane inclina TODO el disco (incluidos
   los nombres), cada .orbit-bubble aplica la rotación inversa exacta
   (rotateX opuesto al del plano + rotateZ opuesto al de su propio ángulo y
   al giro del anillo) para que el texto siempre se vea de frente y NUNCA
   volteado, sin importar en qué punto de la órbita esté. La rotación del
   anillo (giro constante + "volante" del mouse) y el acercamiento por
   proximidad los controla main.js (initOrbitSystem) escribiendo transform
   inline en .orbit-ring y en cada .orbit-bubble cuadro a cuadro; el ángulo
   fijo de cada item se le pasa a JS vía data-angle. Si el visitante prefiere
   menos movimiento, ese JS no arranca y el CSS de abajo ya deja los textos
   derechos usando solo var(--angle) (sin giro de anillo, que sería 0). */
.orbit-system {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 1 / 1;
  margin: 1.5rem auto 0;
  --r-outer: clamp(190px, 38vw, 310px);
  --r-inner: clamp(105px, 21vw, 165px);
  --orbit-tilt: 58deg; /* debe coincidir con TILT_DEG en main.js */
  perspective: 1400px;
}

.orbit-plane {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--orbit-tilt));
}

.orbit-track {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.orbit-track.outer { width: calc(var(--r-outer) * 2); height: calc(var(--r-outer) * 2); }
.orbit-track.inner { width: calc(var(--r-inner) * 2); height: calc(var(--r-inner) * 2); }

.orbit-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(120px, 24vw, 190px);
  height: clamp(120px, 24vw, 190px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10%;
  background: radial-gradient(circle at 35% 30%, rgba(74, 222, 128, 0.22), rgba(0, 0, 0, 0.92) 70%);
  border: 1px solid rgba(74, 222, 128, 0.35);
  box-shadow: 0 0 50px rgba(74, 222, 128, 0.22), inset 0 0 24px rgba(45, 212, 191, 0.12);
  z-index: 5;
  transform-style: preserve-3d;
}

/* Contrarresta la inclinación del plano para que el texto del núcleo también se vea de frente */
.orbit-center-inner {
  transform: rotateX(calc(-1 * var(--orbit-tilt)));
}

.orbit-center-label {
  display: block;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: clamp(0.7rem, 1.8vw, 0.95rem);
  line-height: 1.25;
  background: linear-gradient(135deg, var(--sepia-mint), var(--sepia-turquoise));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.orbit-center-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.orbit-ring {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.orbit-item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: rotate(var(--angle)) translateX(var(--radius));
  transform-style: preserve-3d;
}

.orbit-bubble {
  position: absolute;
  top: 0;
  left: 0;
  /* Base sin JS (prefers-reduced-motion): cancela el ángulo propio del item
     y la inclinación del plano para que el texto quede derecho y de frente. */
  transform: translate(-50%, -50%) rotate(calc(-1 * var(--angle))) rotateX(calc(-1 * var(--orbit-tilt)));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.2);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  font: inherit;
  font-size: clamp(0.55rem, 1.5vw, 0.72rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  cursor: default;
  will-change: transform;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.orbit-bubble.featured {
  padding: 0.7rem 1.1rem;
  font-size: clamp(0.65rem, 1.8vw, 0.85rem);
  border-color: rgba(74, 222, 128, 0.3);
}

.orbit-bubble.muted {
  border-style: dashed;
  border-color: rgba(161, 161, 170, 0.3);
  color: rgba(161, 161, 170, 0.7);
  font-style: italic;
}

.orbit-bubble:hover,
.orbit-bubble:focus-visible,
.orbit-bubble.is-near {
  border-color: var(--sepia-mint);
  color: #ffffff;
  background: rgba(74, 222, 128, 0.14);
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.35);
}

.orbit-bubble:focus-visible {
  outline: 2px solid var(--sepia-mint);
  outline-offset: 4px;
}

/* Ficha con las filiales de la UNAM: solo aparece al pasar el cursor o enfocar esa burbuja */
.orbit-detail {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 210px;
  white-space: normal;
  font-size: 0.62rem;
  font-weight: 400;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(0, 0, 0, 0.94);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 0.6rem;
  padding: 0.55rem 0.75rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}
.orbit-bubble:hover .orbit-detail,
.orbit-bubble:focus-visible .orbit-detail {
  opacity: 1;
}

/* Se revela con una animación suave cuando entra al viewport (IntersectionObserver en main.js) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Respeta la preferencia de accesibilidad del sistema: quita animaciones automáticas
   (el video del hero se pausa por JS en main.js; aquí solo lo que controla CSS). */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .equalizer-bar {
    animation: none;
    transform: scaleY(0.75);
  }

  .marquee-track {
    animation: none;
  }

  .animate-fade-in-up {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .orbit-bubble {
    transition: none;
  }
}
