/* =========================================
   1. DESIGN TOKENS — TIPOGRAFÍA, COLOR, LAYOUT
   ========================================= */
:root {
  --primary: #0C2340;
  --secondary: #3AA7DF;
  --white: #FFFFFF;
  --ink-soft: #4a5568;
  --bg-soft: #F4F7FA;
  --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  /* Ancho máximo estándar del sitio (pantallas grandes) */
  --page-max: 1920px;

  /* Escala tipográfica única — usar SIEMPRE estas variables, no tamaños sueltos */
  --fs-eyebrow: clamp(0.75rem, 0.9vw, 0.85rem);
  --fs-h1: clamp(0.85rem, 1.4vw, 1.05rem);   /* h1 de hero funciona como "kicker", el peso visual lo lleva .main-title */
  --fs-display: clamp(2.2rem, 5.2vw, 4.8rem); /* titulares hero / grandes declaraciones */
  --fs-h2: clamp(2rem, 4vw, 3.2rem);
  --fs-h3: clamp(1.15rem, 1.6vw, 1.45rem);
  --fs-h4: clamp(1rem, 1.2vw, 1.15rem);
  --fs-body-lg: clamp(1.05rem, 1.3vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;

  --lh-tight: 1.05;
  --lh-heading: 1.2;
  --lh-body: 1.65;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; }

/* NORMALIZACIÓN TIPOGRÁFICA — una sola fuente de verdad para toda la web */
h1, h2, h3, h4 {
    line-height: var(--lh-heading);
    margin-bottom: 0.4em;
    text-transform: none;
    font-weight: 800;
}
h1 { font-size: var(--fs-h1); font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
h2 { font-size: var(--fs-h2); font-weight: 900; letter-spacing: -1px; line-height: var(--lh-tight); }
h3 { font-size: var(--fs-h3); font-weight: 800; }
h4 { font-size: var(--fs-h4); font-weight: 700; }
p  { font-size: var(--fs-body); line-height: var(--lh-body); }

/* Etiqueta pequeña tipo "eyebrow" — para introducir secciones editorialmente */
.eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: 3px;
    text-transform: uppercase; color: var(--secondary); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--secondary); display: inline-block; }

body { font-family: 'Poppins', sans-serif; background: var(--white); color: var(--primary); }

/* Contenedor raíz: nunca más ancho que 1920px, centrado en monitores grandes */
.page-wrap { max-width: var(--page-max); margin: 0 auto; position: relative; background: var(--white); }

/* OPTIMIZACIÓN DE RENDIMIENTO GPU */
.hero, .hero-content, .card, .section, .reveal, .service-card, .portfolio-item {
    transform: translateZ(0); 
}

/* Cursor Seguidor */
.cursor-follower {
  position: fixed;
  width: 20px; height: 20px;
  border: 2px solid var(--secondary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000002;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, border-color 0.3s ease, background-color 0.3s ease; 
}

.cursor-follower.celeste { border-color: #3AA7DF !important; background: rgba(58, 167, 223, 0.1) !important; }
.cursor-follower.oscuro { border-color: #0C2340 !important; background: rgba(12, 35, 64, 0.1) !important; }

@media (max-width: 1024px) { .cursor-follower { display: none; } }

/* =========================================
   2. HEADER & MENU ESCRITORIO
   ========================================= */
header {
  position: fixed; top: 0; left: 0; width: 100%; padding: 25px 8%;
  display: flex; justify-content: space-between; align-items: center; z-index: 5000;
  background: linear-gradient(to bottom, rgba(12, 35, 64, 0.85), transparent);
  backdrop-filter: blur(10px);
}

header .logo img { display: block; transition: transform 0.3s ease; }
header .logo a:hover img { transform: scale(1.05); }

header .menu { display: flex; gap: 35px; margin-left: auto; }
header .menu a {
    position: relative; padding: 5px 0; text-decoration: none;
    color: #fff !important; font-weight: 600;
}

header .menu a::after {
    content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 0;
    background-color: var(--secondary); transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
header .menu a:hover::after { width: 100%; }

.menu-btn { display: none; color: #fff !important; font-size: 2.2rem; cursor: pointer; z-index: 5001; }

/* =========================================
   3. MENÚ MÓVIL
   ========================================= */
.mobile {
  position: fixed; top: 0; right: -100%; width: 100%; height: 100%;
  background: var(--primary); z-index: 6000; transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column; justify-content: center; padding: 10% 12%;
}
.mobile.active { right: 0; }

.close-menu {
  position: absolute; top: 30px; right: 8%; 
  font-size: 2.5rem; color: #fff !important; cursor: pointer;
  transition: 0.3s;
}
.close-menu:hover { transform: rotate(90deg); color: var(--secondary) !important; }

.mobile nav { display: flex; flex-direction: column; gap: 30px; align-items: flex-start; }

.mobile a {
  color: #fff; font-size: clamp(1.8rem, 8vw, 2.5rem); font-weight: 700;
  text-decoration: none; position: relative; opacity: 0.6; transition: 0.4s;
  padding: 5px 0;
}

.mobile a::after {
    content: ''; position: absolute; width: 0; height: 3px; bottom: -2px; left: 0;
    background-color: var(--secondary); transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile a:hover::after, .mobile a:active::after { width: 100%; }
.mobile a:hover, .mobile a:active { opacity: 1; color: #fff; }

/* =========================================
   4. HERO ESTILIZADO Y BOTÓN DESLIZAR
   ========================================= */
.hero {
    /* Ya NO es sticky -- el video de fondo ahora vive aparte, fijo a
    nivel de toda la página (ver .video-bg-global más abajo). Esta
    sección es contenido normal: sube y se va con el scroll nativo,
    sin ninguna animación de JS empujándola. background-color de
    respaldo por si el video tarda en cargar o falla. */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: transparent;
    position: relative;
    z-index: 1;
}

/* Video de fondo GLOBAL -- fijo al viewport, vive a nivel de <body>
   (ver header.php), por detrás de absolutamente todo el contenido. No
   depende de ninguna sección ni de su orden. */
.video-bg-global {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 0; overflow: hidden; pointer-events: none;
}
.video-bg-global iframe { position: absolute; top: 50%; left: 50%; width: 100vw; height: 56.25vw; min-height: 100vh; min-width: 177.77vh; transform: translate(-50%, -50%); pointer-events: none; }
.overlay-dark-global { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(12, 35, 64, 0.65); z-index: 0; pointer-events: none; }

.hero-content { position: relative; z-index: 5; color: #fff; max-width: 1200px; padding: 0 5%; }

.hero-content h1 { 
    font-size: clamp(0.9rem, 2vw, 1.2rem); 
    text-transform: uppercase; 
    letter-spacing: 3px; 
    margin-bottom: 20px; 
    font-weight: 500; 
    color: #ffffff;
}
.hero-content .main-title { 
    font-size: clamp(2rem, 6vw, 5rem); 
    font-weight: 900; 
    line-height: 1.05; 
    margin-bottom: 25px; 
    color: #ffffff;
}
.hero-content .sub-title { 
    font-size: clamp(1.2rem, 2.5vw, 1.5rem); 
    font-weight: 400; 
    color: rgba(255, 255, 255, 0.9);
}
.hero-content .btn-container { margin-top: 40px; }

/* Botón Deslizar Animado */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    z-index: 10;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    cursor: pointer;
}
.scroll-indicator:hover { opacity: 1; }
.scroll-indicator i {
    color: var(--secondary); 
    font-size: 2.5rem;
    margin-bottom: 5px;
    animation: bounce 2s infinite;
}
.scroll-indicator span {
    font-size: 0.85rem;
    letter-spacing: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.hero::after {
    content: ""; position: absolute; top: 0; left: 50%; width: 100vw; margin-left: -50vw; height: 100%;
    background-image: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.04; z-index: 3; pointer-events: none;
}

/* =========================================
   5. SECCIONES FLOTANTES
   ========================================= */
.section { padding: 100px 8%; }

/* Tarjetas Flotantes (Glassmorphism) */
.floating-card-top {
    position: relative;
    z-index: 10;
    margin: 100px 5% 0; /* separación arriba a propósito -- antes pegaba directo con la sección de diagnóstico */
    border-radius: 40px 40px 0 0;
    background: rgba(244, 247, 250, 0.85) !important; 
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-bottom: none;
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.1);
}

.floating-card-bottom {
    position: relative;
    z-index: 10;
    margin: 0 5% 60px;
    border-radius: 0 0 40px 40px;
    background: rgba(12, 35, 64, 0.40) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.container-narrow { max-width: 1100px; margin: 0 auto; text-align: center; }

.floating-card-top h2 { color: var(--primary) !important; }
.floating-card-bottom .services-title { color: #ffffff !important; }
/* "Nuestros Servicios" en particular -- redondea también arriba, no
solo abajo como el resto de secciones que usan .floating-card-bottom
(esta va después de "Cómo trabajamos", con espacio de por medio, así
que necesita verse como tarjeta completa, no solo con el borde inferior). */
#servicios { border-radius: 40px; }
@media (max-width: 1024px) { #servicios { border-radius: 30px; } }
@media (max-width: 768px) { #servicios { border-radius: 20px; } }

.services-sub { font-size: 1.15rem; color: rgba(255,255,255,0.8); margin-top: 10px; }
.floating-card-top p { font-size: 1.15rem; line-height: 1.6; color: #444; }

/* TARJETAS DE SERVICIOS — grid fijo, nunca deja una tarjeta huérfana */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin-top: 40px; }

/* =========================================
   PROCESO / METODOLOGÍA -- grid de 3 pasos reutilizado en todas las
   páginas de servicio (Branding, Fotografía, Web, 3D, Video). Nombre
   propio a propósito: NO usar .service-card/.services-grid, esas ya
   las usa "Impacto Digital" en el home para un componente distinto
   (interactivo, altura fija 460px) -- reusar esos nombres aquí rompía
   el diseño por choque de estilos.
   ========================================= */
.proceso-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin-top: 20px; }
@media (max-width: 900px) { .proceso-grid { grid-template-columns: 1fr; gap: 20px; } }
.proceso-card {
    background: #fff; border-radius: 16px; padding: 32px 28px;
    box-shadow: 0 10px 30px -10px rgba(12,35,64,0.08); border: 1px solid rgba(12,35,64,0.06);
}
.proceso-card .proceso-icon {
    width: 52px; height: 52px; border-radius: 50%; background: var(--secondary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 18px;
}
.proceso-card h3 { font-size: 1.1rem; color: var(--primary); margin-bottom: 10px; font-weight: 800; }
.proceso-card p { color: #64748b; font-size: 0.92rem; line-height: 1.6; }
.card { 
    padding: 50px 40px; background: rgba(255,255,255,0.03); 
    border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; transition: var(--transition); 
    text-align: left; transform: scale(1); will-change: transform;
}
.card h3 { color: var(--secondary); margin-bottom: 15px; font-size: var(--fs-h4); }
.card p { color: #fff; }
.card:hover { background: var(--secondary); }
.card:hover h3, .card:hover p { color: var(--primary); }
/* Zoom al pasar mouse/dedo — respaldo CSS por si GSAP no alcanza a disparar en touch */
.card:hover, .card:focus-within, .card.touch-active { transform: scale(1.045); box-shadow: 0 20px 45px rgba(0,0,0,0.25); }

/* =========================================
   6. PORTAFOLIO HORIZONTAL PREMIUM (GSAP PIN)
   ========================================= */
.portfolio-horizontal-container {
    position: relative;
    left: 50%; width: 100vw; margin-left: -50vw; /* ancho completo real, sin límite de 1920px */
    height: 100vh; /* Altura completa de la pantalla para el anclaje */
    background: rgba(12, 35, 64, 0.5); /* 50% translúcido a propósito -- el hero (video) se
    queda fijo detrás siempre (ver main.js, ya no se empuja fuera de pantalla), así que el
    portafolio necesita dejarlo entrever en vez de taparlo por completo. */
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* El Mega Heading Fantasma (Texto lleno, marca de agua ajustada) */
.portfolio-big-text {
    position: absolute;
    bottom: 6%; /* Despegado ligeramente del fondo */
    left: 2%;
    font-size: 14vw; /* Reducido de 22vw a 14vw para que se lea la palabra completa */
    font-weight: 900;
    color: rgba(255, 255, 255, 0.05); /* Texto sólido, elegante marca de agua */
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
    line-height: 1;
}

.portfolio-wrapper {
    display: flex;
    padding: 0 5vw;
    gap: 60px; /* Mucho "aire" entre proyectos */
    will-change: transform;
    z-index: 2;
    position: relative;
    align-items: center;
}

.portfolio-item {
    flex: 0 0 500px; /* Ancho fijo de cada proyecto en desktop */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.portfolio-item .img-container {
    width: 100%;
    aspect-ratio: 4/5; /* Proporción premium vertical */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.portfolio-item img, .portfolio-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-item:hover img, .portfolio-item:hover video { transform: scale(1.05); }
.portfolio-item-link { display: contents; color: inherit; text-decoration: none; cursor: pointer; }

.portfolio-info { padding-top: 10px; }
.portfolio-info h3 { color: #ffffff; margin-bottom: 8px; font-weight: 800; }
.portfolio-info p { color: rgba(255,255,255,0.6); font-size: 1rem; line-height: 1.5; }

.cta-portfolio {
    flex: 0 0 500px;
    display: flex;
    align-items: flex-start; /* Se alinea arriba, al mismo nivel que las fotos */
}
.cta-portfolio .cta-content {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    width: 100%;
    aspect-ratio: 4/5; /* ESTA ES LA CLAVE: Obliga a que la caja mida exactamente lo mismo que las fotos */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.marquee-container {
    position: relative;
    left: 50%; width: 100vw; margin-left: -50vw; /* ancho completo real, igual que hero/portafolio/diagnóstico */
    z-index: 11; 
    overflow: hidden; background: transparent; padding: 60px 0; /* sin fondo -- deja ver el video de fondo directo, sin filtro de color encima */
    white-space: nowrap; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.marquee-content {
    display: inline-block; font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 900; color: rgba(255, 255, 255, 0.12); /* claro y tenue -- antes era oscuro sobre blanco, ahora el fondo es oscuro translúcido */
    text-transform: uppercase; line-height: 1;
}

/* =========================================
   6C. DIAGNÓSTICO DE MARCA — sección oscura a ancho completo (igual que portafolio)
   El embed (diagnostico_embed.php) trae su propio layout de 2 columnas
   (texto + formulario) prefijado con "ilm-", así que este wrapper solo
   pone el fondo oscuro de borde a borde — sin grid propio, sin duplicar texto.
   ========================================= */
.diagnostico-dark-bleed {
    position: relative;
    left: 50%; width: 100vw; margin-left: -50vw; /* ancho completo real */
    margin-top: -2px; /* elimina la línea/hairline entre este bloque y el portafolio de arriba */
    background: #0C2340;
    padding: 90px 8%;
}
@media (max-width: 767px) {
    .diagnostico-dark-bleed { padding: 60px 6%; }
}

/* =========================================
   7. IMPACTO DIGITAL INTEGRADO — tarjetas interactivas expandibles
   ========================================= */
.impacto-digital {
    background-color: var(--bg-soft);
    padding: 100px 5%;
    text-align: center;
    color: var(--primary);
}

.impacto-digital .container { max-width: 1300px; margin: 0 auto; }
.impacto-digital .main-title { color: var(--primary); margin-bottom: 30px; }

.impacto-digital .intro-text {
    font-size: 1.15rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 60px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* Contenedor: 3 tarjetas iguales, la que tiene hover/foco/click se expande y
   "apaga" visualmente a la más lejana — deja de ser una grilla de íconos
   genérica y se vuelve una pieza interactiva real. */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    text-align: left;
}

@media (min-width: 1024px) {
    .cards-container { flex-direction: row; align-items: stretch; }
}

.service-card {
    position: relative;
    background-color: var(--white);
    border-radius: 24px;
    border: 1px solid rgba(12, 35, 64, 0.08);
    box-shadow: 0 10px 30px -10px rgba(12, 35, 64, 0.06);
    overflow: hidden;
    cursor: pointer;
    flex: 1 1 33.333%;
    min-width: 0;
    height: 460px;
    transition: flex 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s ease, opacity 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 36px 32px 28px;
}

@media (min-width: 1024px) {
    .cards-container.has-active .service-card.active {
        flex: 2 1 66.666%;
        opacity: 1;
        box-shadow: 0 25px 50px -12px rgba(12, 35, 64, 0.3);
    }
    .cards-container.has-active .service-card.sibling-visible {
        flex: 1 1 33.333%;
        opacity: 0.9;
    }
    .cards-container.has-active .service-card.sibling-hidden {
        flex: 0 0 0%; width: 0; padding-left: 0; padding-right: 0; margin: 0;
        opacity: 0; border: none; pointer-events: none; overflow: hidden;
    }
}

/* Baño de color de marca (navy → celeste) que "inunda" la tarjeta activa */
.color-wash-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2;
    background: linear-gradient(135deg, var(--primary) 0%, #143a63 55%, var(--secondary) 100%);
    clip-path: circle(0px at calc(100% - 50px) 50px);
    transition: clip-path 0.7s cubic-bezier(0.25, 1, 0.3, 1);
    pointer-events: none;
}
.service-card.active .color-wash-bg { clip-path: circle(180% at calc(100% - 50px) 50px); }

/* Marca de agua tipográfica en movimiento, visible solo cuando la tarjeta está activa */
.bg-marquee-container {
    position: absolute; bottom: 16px; left: 0; width: 100%; height: 260px; z-index: 2;
    display: flex; align-items: center; overflow: hidden; pointer-events: none;
    user-select: none; opacity: 0; transition: opacity 0.5s ease;
}
.service-card.active .bg-marquee-container { opacity: 1; }
.bg-marquee-track {
    display: flex; white-space: nowrap; gap: 3rem; width: max-content;
    animation: impactoMarquee 26s linear infinite;
    font-weight: 900; text-transform: uppercase; line-height: 0.85; letter-spacing: -2px;
    font-size: clamp(4rem, 9vw, 9.5rem); color: rgba(255,255,255,0.12);
}
@keyframes impactoMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.card-content { position: relative; z-index: 4; height: 100%; display: flex; flex-direction: column; justify-content: space-between; transition: color 0.4s ease; }

.circle-icon-btn {
    position: absolute; top: 24px; right: 24px; width: 52px; height: 52px; border-radius: 50%;
    background-color: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
    z-index: 10; font-size: 1.2rem; transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 14px rgba(12, 35, 64, 0.2);
}
.service-card.active .circle-icon-btn { background-color: #fff; color: var(--primary); transform: scale(1.1); box-shadow: 0 0 25px rgba(255,255,255,0.5); }

.badge-wrapper { padding-right: 4rem; margin-bottom: 20px; }
.service-badge {
    display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700;
    padding: 6px 14px; border-radius: 50px; background: rgba(58, 167, 223, 0.15);
    color: #1c6ea3; border: 1px solid rgba(58, 167, 223, 0.3);
}
.service-card.active .service-badge { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.3); }

.service-card .card-title { color: var(--primary); font-size: 1.4rem; margin-bottom: 12px; transition: color 0.4s ease; }
.service-card.active .card-title { color: #fff; }

.service-card .card-description { color: #64748b; font-size: 0.92rem; line-height: 1.6; transition: color 0.4s ease; }
.service-card.active .card-description { color: #dce8f2; text-shadow: 0 1px 3px rgba(0,0,0,0.25); }

.card-footer { padding-top: 18px; margin-top: 18px; border-top: 1px solid rgba(12,35,64,0.08); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.service-card.active .card-footer { border-top-color: rgba(255,255,255,0.15); }

.card-cta-wa {
    background: #25D366; color: #fff; text-decoration: none; font-size: 0.78rem; font-weight: 700;
    padding: 10px 18px; border-radius: 50px; display: inline-flex; align-items: center; gap: 6px; transition: 0.3s;
}
.card-cta-wa:hover { background: #1fb457; transform: translateY(-1px); }

.saber-mas-link { color: #64748b; text-decoration: none; font-size: 0.8rem; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; transition: color 0.3s; }
.service-card.active .saber-mas-link { color: #e2e8f0; }
.saber-mas-link:hover { color: var(--secondary); }
.service-card.active .saber-mas-link:hover { color: #fff; }

.impacto-digital .footer-text { font-size: 1.05rem; line-height: 1.7; color: #555; max-width: 900px; margin: 50px auto 0; font-style: italic; }

@media (max-width: 1023px) {
    .service-card { height: auto; min-height: 380px; }
    .bg-marquee-container { display: none; } /* en columna apilada, la marca de agua sobra */
}



/* =========================================
   8. CLIENT ROSTER (marquee continuo, referencia instrument.com)
   ========================================= */
.clientes-section-wrapper {
    position: relative;
    left: 50%; width: 100vw; margin-left: -50vw; /* ancho completo real */
    background: var(--bg-soft);
    padding: 90px 0;
    text-align: center;
    overflow: hidden;
}

.clientes-header { max-width: 700px; margin: 0 auto 55px; padding: 0 8%; }
.clientes-header .eyebrow { justify-content: center; }
.clientes-header h2 { color: var(--primary); }

.roster-track { display: flex; flex-direction: column; gap: 30px; }

/* Las 3 filas se superponen levemente para que visualmente "se crucen" */
.roster-row { display: flex; width: max-content; gap: 60px; will-change: transform; padding: 20px 0; }
.roster-row.dir-left  { animation: rosterLeft 40s linear infinite; }
.roster-row.dir-right { animation: rosterRight 46s linear infinite; }
.roster-row.dir-left.slow { animation-duration: 52s; }
.roster-track:hover .roster-row { animation-play-state: paused; }

.roster-logo {
    height: 40px; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; opacity: 0.55; filter: grayscale(1); transition: var(--transition);
}
.roster-logo:hover { opacity: 1; filter: grayscale(0); transform: translateY(-2px); }
.roster-logo img { height: 100%; width: auto; max-width: 150px; object-fit: contain; }

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

@media (max-width: 768px) {
    .clientes-section-wrapper { padding: 60px 0; }
    .roster-logo { height: 30px; }
    .roster-row { gap: 44px; }
}

.cta-final {
    background-color: var(--secondary); 
    padding: 100px 5%;
    text-align: center;
    color: var(--white);
    position: relative;
    z-index: 11;
}

.cta-final h2 {
    color: var(--white) !important;
    margin-bottom: 20px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.cta-final p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
}

/* =========================================
   9. BOTONES, LOADERS Y AEO
   ========================================= */
.whatsapp-cta { background: #55CD6C !important; color: #fff !important; padding: 18px 45px !important; border-radius: 50px !important; font-weight: 800 !important; font-size: 1.1rem; box-shadow: 0 10px 25px rgba(85, 205, 108, 0.4) !important;}
.social-btn { background: #fff; padding: 12px 25px; border-radius: 50px; text-decoration: none; color: var(--primary); font-weight: 700; display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.social-btn:hover { background: var(--primary); color: #fff; }
.social-btn-outline { background: transparent; padding: 12px 25px; border-radius: 50px; text-decoration: none; font-weight: 700; border: 1px solid rgba(255,255,255,0.3); color: #fff !important; display: inline-flex; align-items: center; gap: 8px; }
.social-btn-outline:hover { background: #fff; color: var(--primary) !important; }
.nav-arrow { background: transparent; color: var(--secondary); border: none; width: 45px; height: 45px; font-size: 1.5rem; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: transform 0.3s ease-out; outline: none; }
.nav-arrow:hover { transform: scale(1.2); }

.loader { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: var(--primary); display: flex; justify-content: center; align-items: center; z-index: 1000001; pointer-events: none; }
.loader-logo { width: 250px; filter: brightness(0) invert(1); animation: pulseLogo 2s infinite ease-in-out; }
@keyframes pulseLogo { 0%, 100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
.transition-overlay { position: fixed; top: 100%; left: 0; width: 100%; height: 100%; background: var(--secondary); z-index: 1000000; display: flex; justify-content: center; align-items: center; pointer-events: none; will-change: transform; }
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; will-change: transform, opacity; }
.reveal.active { opacity: 1 !important; transform: translateY(0) !important; }

/* Footer: enlaces e íconos sociales (antes onmouseover inline) */
.footer-link { color: #fff; text-decoration: none; opacity: 0.7; line-height: 2; display: inline-block; transition: 0.3s; }
.footer-link:hover { opacity: 1; }
.footer-link i { color: var(--secondary); margin-right: 8px; }
.footer-social-icon {
    width: 35px; height: 35px; border-radius: 50%; background: rgba(255,255,255,0.08);
    color: #fff; display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: 0.3s; font-size: 0.9rem;
}
.footer-social-icon:hover { background: var(--secondary); }

/* Acordeones y Secciones SEO/AEO */
details summary { list-style: none; outline: none; }
details summary::-webkit-details-marker { display: none; }
details p { animation: fadeInAccordion 0.4s ease-out forwards; }
@keyframes fadeInAccordion { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
details[open] summary i { transform: rotate(180deg); }
details summary i { transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

/* =========================================
   8B. CTA FINAL — "¿Listo para encender tu marca?"
   ========================================= */
.cta-final-section {
    position: relative;
    left: 50%; width: 100vw; margin-left: -50vw; /* ancho completo real */
    text-align: center; background-color: var(--secondary); padding: 100px 8%;
}
.cta-final-section h2 { color: #fff; }
.cta-final-sub { margin-bottom: 40px; color: #fff; opacity: 0.9; font-size: var(--fs-body-lg); }
.cta-final-section .social-container { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.cta-final-section .whatsapp-cta { margin-bottom: 50px; }

/* =========================================
   9B. FLECHAS DE GALERÍA (componente reutilizable)
   Se activa en cualquier .gallery-swipe — pensado para las
   galerías de portafolio por cliente (fase siguiente del proyecto).
   Flechas DENTRO de la imagen, casi invisibles en reposo,
   visibles y agrandadas en hover/touch.
   ========================================= */
.gallery-swipe { position: relative; }
.gallery-swipe .g-arrow {
    position: absolute; top: 50%; transform: translateY(-50%) scale(0.9);
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(12, 35, 64, 0.35); backdrop-filter: blur(6px);
    color: #fff; border: none; display: flex; align-items: center; justify-content: center;
    opacity: 0.4; cursor: pointer; z-index: 20; transition: var(--transition);
}
.gallery-swipe .g-arrow.prev { left: 20px; }
.gallery-swipe .g-arrow.next { right: 20px; }
.gallery-swipe:hover .g-arrow,
.gallery-swipe .g-arrow:focus-visible { opacity: 0.85; }
.gallery-swipe .g-arrow:hover { opacity: 1 !important; transform: translateY(-50%) scale(1.12); background: rgba(58, 167, 223, 0.9); }

.gallery-lightbox-overlay {
    position: fixed; inset: 0; background: rgba(12, 35, 64, 0.94);
    z-index: 99998; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.gallery-lightbox-overlay.active { opacity: 1; pointer-events: auto; }

/* =========================================
   9C. FAQ — BENTO GRID CON MODAL FLIP (reemplaza el <details> plano)
   ========================================= */
.faq-bento-wrap {
    background-color: rgba(12, 35, 64, 0.5); /* translúcido -- se ve el video detrás, como portafolio. Ya no blanco sólido. */
    padding: 110px 0 140px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.faq-bento-wrap .eyebrow{ color: var(--secondary); }
.faq-bento-wrap #faq-title{ color: #fff; }
.faq-bento-wrap .faq-sub{ color: rgba(255,255,255,0.75) !important; }
.faq-big-text {
    position: absolute;
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14vw;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.06); /* tenue y clara -- fondo ahora oscuro/translúcido, no blanco */
    text-transform: uppercase;
    line-height: 0.85;
    letter-spacing: -0.02em;
    white-space: nowrap;
    pointer-events: none;
    z-index: 0;
}
@media (max-width: 640px) {
    .faq-big-text { font-size: 20vw; } /* la palabra es corta ("Preguntas"), en móvil puede ser más grande sin desbordar */
}
.faq-bento-inner { max-width: 1024px; margin: 0 auto; padding: 0 8%; position: relative; z-index: 1; }
.faq-bento-wrap .eyebrow { justify-content: center; display: flex; }
.faq-bento-wrap .faq-sub { color: #64748b; font-size: 0.95rem; max-width: 480px; margin: 10px auto 40px; }

.faq-bento-grid { display: grid; grid-template-columns: repeat(2, 1fr); align-items: stretch; justify-items: stretch; gap: 10px; text-align: left; }
@media (min-width: 640px) { .faq-bento-grid { gap: 16px; } }

.perspective-1000 { perspective: 1000px; }
.preserve-3d { transform-style: preserve-3d; }

.faq-bento-card { cursor: pointer; display: flex; height: 100%; }
.faq-card-inner {
    position: relative; width: 100%; height: 100%; flex: 1;
    background: var(--bg-soft); border: 2px solid rgba(12,35,64,0.06);
    border-radius: 18px; padding: 16px; display: flex; flex-direction: column;
    justify-content: space-between; gap: 10px; transition: var(--transition);
    min-height: 140px;
}
@media (min-width: 640px) { .faq-card-inner { padding: 26px; min-height: 190px; } }
.faq-bento-card:hover .faq-card-inner { border-color: var(--secondary); box-shadow: 0 10px 30px -10px rgba(58,167,223,0.25); }

.faq-card-top { display: none; align-items: center; justify-content: space-between; }
@media (min-width: 640px) { .faq-card-top { display: flex; } }
.faq-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--secondary); }
.faq-badge {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    color: #64748b; background: rgba(12,35,64,0.05); padding: 3px 10px; border-radius: 50px;
}
.faq-badge.destacado { color: var(--secondary); background: rgba(58,167,223,0.1); border: 1px solid rgba(58,167,223,0.25); }

.faq-card-title {
    font-size: 0.85rem; font-weight: 700; color: var(--primary); line-height: 1.35; transition: color 0.3s;
}
@media (min-width: 640px) { .faq-card-title { font-size: 1.1rem; } }
.faq-bento-card:hover .faq-card-title { color: var(--secondary); }

.faq-card-preview { display: none; color: #64748b; font-size: 0.85rem; margin-top: 6px; line-height: 1.5; }
@media (min-width: 640px) { .faq-card-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } }

/* En móvil (<640px) el badge de arriba y el preview están ocultos --
solo queda visible la pregunta, y justify-content:space-between (pensado
para cuando SÍ hay 3 bloques) la dejaba pegada arriba con puro espacio
vacío debajo. Acá se centra de verdad, vertical y horizontal, como
corresponde cuando es lo único visible en la tarjeta. */
@media (max-width: 639px) {
  .faq-card-inner { justify-content: center; align-items: center; text-align: center; }
  .faq-card-title { text-align: center; }
}

.faq-hidden-answer { display: none; }

/* Modal */
.faq-modal-overlay {
    position: fixed; inset: 0; background: rgba(12,35,64,0.55); backdrop-filter: blur(4px);
    z-index: 99997; display: none; align-items: center; justify-content: center; padding: 16px;
    opacity: 0;
}
.faq-modal-overlay.open { display: flex; }
.faq-modal-card {
    background: #fff; border: 2px solid var(--secondary); border-radius: 24px;
    padding: 30px 24px; width: 100%; max-width: 640px; box-shadow: 0 30px 60px rgba(12,35,64,0.3);
    position: relative;
}
@media (min-width: 640px) { .faq-modal-card { padding: 44px; } }
.faq-modal-close {
    position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%;
    background: var(--bg-soft); border: none; color: var(--primary); font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: 0.3s;
}
.faq-modal-close:hover { background: var(--secondary); color: #fff; }
.faq-modal-badge:empty { display: none; }
.faq-modal-title { font-size: 1.25rem; font-weight: 800; color: var(--primary); padding-right: 30px; margin: 10px 0 16px; }
@media (min-width: 640px) { .faq-modal-title { font-size: 1.7rem; } }
.faq-modal-body { color: #475569; font-size: 1rem; line-height: 1.7; border-top: 1px solid rgba(12,35,64,0.08); padding-top: 16px; }
.faq-modal-body strong { color: var(--primary); }

/* =========================================
   10. MEDIA QUERIES
   ========================================= */
@media (max-width: 1024px) {
  .floating-card-top { margin: 70px 4% 0; border-radius: 30px 30px 0 0; }
  .floating-card-bottom { margin: 0 4% 50px; border-radius: 0 0 30px 30px; }
  .clientes-card { margin: 0 4%; border-radius: 30px 30px 0 0; padding: 60px 5%; }
  header .menu { display: none; }
  .menu-btn { display: block; margin-left: auto; }
  .section { padding: 80px 6%; }
  
  /* Ajustes Portafolio Horizontal Móvil */
  .portfolio-item { flex: 0 0 85vw; } /* Ocupa casi toda la pantalla en móvil */
  .portfolio-wrapper { gap: 30px; }
  .cta-portfolio { flex: 0 0 85vw; }
}

@media (max-width: 768px) {
  .floating-card-top { margin: 50px 3% 0; border-radius: 20px 20px 0 0; }
  .floating-card-bottom { margin: 0 3% 30px; border-radius: 0 0 20px 20px; }

  /* Servicios: 2 columnas x 3 filas en móvil (nunca deja una tarjeta suelta) */
  .services { grid-template-columns: repeat(2, 1fr); gap: 12px; min-width: 0; }
  /* Antes las tarjetas se salían del ancho de la sección en móvil -- padding
  fijo (50px 40px) pensado para desktop era demasiado para una columna angosta.
  Esta sección usa .card / h3 / p (NO .service-card, esa es otra sección
  distinta) -- recortado + texto más pequeño solo acá, en desktop queda igual. */
  .services .card {
    min-width: 0;
    padding: 15px 12px;
  }
  .services .card h3 { font-size: 0.95rem; margin-bottom: 6px; }
  .services .card p {
    font-size: 0.78rem; line-height: 1.45;
    /* "menos texto" en móvil -- recorta visualmente a 3 líneas con "..."
    en vez de mostrar el párrafo completo. El texto real no cambia (sigue
    completo para desktop y para lectores de pantalla), solo se acorta
    la vista en pantallas chicas. */
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }

  /* CTA final: en móvil, texto reducido a solo "Compartir" (sin repetir
  cada red social) + ícono, en grid 2x2 -- antes se apilaban en fila
  ancha con texto largo y se veía forzado. */
  .cta-final-section .social-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    max-width: 320px;
    margin: 0 auto;
  }
  .cta-final-section .social-btn-outline {
    justify-content: center;
    padding: 14px 10px;
  }
}
/* =========================================
   ESTILO ACORDEÓN
   ========================================= */
.faq-container { display: flex; flex-direction: column; gap: 15px; margin-top: 40px; }
.faq-item { background-color: #F8F9FA; border-radius: 12px; border-left: 6px solid var(--secondary); overflow: hidden; transition: all 0.3s ease; }
.faq-item[open] { background-color: #FFFFFF; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.faq-item summary { padding: 25px 30px; font-size: 1.15rem; font-weight: 800; color: var(--primary); cursor: pointer; display: flex; justify-content: space-between; align-items: center; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary i { color: var(--secondary); font-size: 1.2rem; transition: transform 0.3s ease; }
.faq-item[open] summary i { transform: rotate(180deg); }
.faq-item p { padding: 0 30px 25px 30px; margin: 0; color: #555; font-size: 1.05rem; line-height: 1.7; animation: fadeInAccordion 0.4s ease-out forwards; }