/* ==========================================================================
   CENATEC - ESTILOS CORPORATIVOS & ULTRA-SMOOTH CANVAS SCROLL ENGINE
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400..700;1,9..40,400..700&family=Space+Grotesk:wght@700;900&family=Orbitron:wght@600;800;900&display=swap');

:root {
  --cenatec-navy: #0f172a;
  --cenatec-navy-dark: #0b132b;
  --cenatec-gold: #f59e0b;
  --cenatec-gold-hover: #d97706;
  --cenatec-red: #e63946;
  --bg-cream: #fbf8ef;
  --bg-light: #f8fafc;
  --font-title: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-brand: 'Orbitron', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-light);
  color: var(--cenatec-navy);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.font-space {
  font-family: var(--font-title);
}

.font-orbitron {
  font-family: var(--font-brand);
}

/* FOCO ACCESIBLE */
:focus-visible {
  outline: 3px solid var(--cenatec-gold);
  outline-offset: 4px;
}

/* ==========================================================================
   CONTENEDOR DE SCROLL EXTENDIDO & CANVAS STICKY (STICKY VIDEO CANVAS)
   ========================================================================== */
.hero-scroll-track {
  position: relative;
  width: 100%;
  height: 280vh;
  background-color: #0b132b;
}

.hero-sticky-stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
}

/* Canvas del Video */
.hero-scroll-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  pointer-events: none;
  background-image: url('../assets/frames/frame_0001.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Overlay Suave para que el video se vea 100% brillante y nítido */
.hero-canvas-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.45) 0%, transparent 25%, transparent 75%, rgba(15, 23, 42, 0.75) 100%);
  pointer-events: none;
}

/* Capas Narrativas Sincronizadas */
.narrative-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  transition: opacity 0.35s ease-out, transform 0.35s ease-out;
  will-change: opacity, transform;
}

/* Título Cinematográfico Principal */
.hero-title-cinematic {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: clamp(32px, 4.6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-align: center;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.9);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Tarjeta Narrativa Fase 2 & 3 (Glassmorphism Translúcido) */
.narrative-card {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2rem;
  padding: 2.25rem 2rem;
  max-width: 620px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
  color: #ffffff;
  margin-left: auto;
  margin-right: auto;
}

/* Barra Pill Búsqueda Flotante */
.search-pill-hero {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 9999px;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  max-width: 680px;
  width: 100%;
}

/* Modo Escena (Despejar Texto) */
.scene-mode .hero-header,
.scene-mode .narrative-layer,
.scene-mode #hero-search-pill-wrapper {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(20px) !important;
}

.btn-return-scene {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  padding: 0 36px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  color: #0f172a;
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 9999px;
  backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.scene-mode .btn-return-scene {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   SECCIONES INFERIORES: TARJETAS FLOTANTES & CATÁLOGO
   ========================================================================== */
.card-floating {
  background: #ffffff;
  border-radius: 1.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.05);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-floating:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.12);
  border-color: #cbd5e1;
}

.filter-pill {
  border-radius: 9999px;
  padding: 0.6rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.25s ease;
  background: #ffffff;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.filter-pill:hover, .filter-pill.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* Modales */
.modal-enter {
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Ajustes Responsive Móviles */
@media (max-width: 768px) {
  .hero-scroll-track {
    height: 220vh;
  }
  .hero-title-cinematic {
    font-size: clamp(34px, 9.5vw, 54px);
  }
  .narrative-card {
    padding: 1.75rem;
    margin: 0 1rem;
  }
}
