/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.5s, color 0.5s;
}

h1,
h2,
h3,
h4,
h5,
h6,
.hero .title,
.logo-text__brand {
    font-family: var(--font-title);
}

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
    --color-orange: #ED8A2E;
    --color-blue: #3E86A6;
    --color-red: #E0522E;

    --bg-primary: #030712;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --border-color: rgba(255, 255, 255, 0.05);

    --font-title: 'Ubuntu', sans-serif;
    --font-body: 'Montserrat', sans-serif;

    --header-height: 72px;

    /* Colores para el efecto de división */
    --left-color: #030712;   /* azul oscuro */
    --right-color: #ED8A2E;  /* naranja */
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: var(--header-height);
    transition: background-color 0.5s, border-color 0.5s;
    background-color: transparent;
}

.header.scrolled {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* ----- LOGO "B" ----- */
.header__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.header__logo:hover {
    transform: scale(1.02);
}

.logo-img {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    object-fit: contain;
    transition: opacity 0.5s, transform 0.3s;
}

.logo-img.switching {
    opacity: 0.5;
    transform: scale(0.9);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-text__brand {
    font-family: var(--font-title);
    font-weight: 900;
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-text__dev {
    font-family: var(--font-title);
    font-weight: 900;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.header__logo:hover .logo-text__dev {
    color: var(--color-blue);
}

/* ----- NAVEGACIÓN ----- */
.header__nav {
    display: none;
}

@media (min-width: 768px) {
    .header__nav {
        display: block;
    }
}

.header__nav-list {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    list-style: none;
}

.nav-link {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.3s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-blue);
    transition: width 0.3s;
}

.nav-link:hover {
    color: var(--color-blue);
}

.nav-link:hover::after {
    width: 100%;
}

/* ----- CONTROLES ----- */
.header__controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    display: none;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    font-size: 1rem;
}

@media (min-width: 768px) {
    .theme-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
}

/* ============================================================
   MENÚ MÓVIL
   ============================================================ */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

.mobile-menu.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

.mobile-menu__list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.mobile-nav-link {
    font-family: var(--font-title);
    font-weight: 900;
    font-size: 2.5rem;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.3s;
}

.mobile-nav-link:hover {
    color: var(--color-blue);
}

.mobile-theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    background: transparent;
    color: var(--color-blue);
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    cursor: pointer;
}

.mobile-theme-toggle:hover {
    background: rgba(62, 134, 166, 0.1);
}

/* ============================================================
   HERO (efecto de división)
   ============================================================ */
.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-primary); /* Fondo de respaldo */
}

.side {
    display: grid;
    place-items: center;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    transition: width 0.08s ease-out; /* Suaviza el movimiento */
}

.side .title {
    font-size: clamp(2.5rem, 7vw, 7rem);
    font-weight: 800;
    margin: 0 10vw;
    width: 80vw;
    text-align: center;
    line-height: 1.2;
    pointer-events: none;    /* Permite que el mouse pase a través del texto */
    user-select: none;       /* Evita selección */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.05em;
    flex-wrap: wrap;
}

.title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.title-logo {
    width: clamp(2.5rem, 6vw, 5rem);
    height: auto;
    flex-shrink: 0;
    display: block;
}

.title-text {
    display: inline-block;
}

.side .fancy {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.6em;
    line-height: 0.8;
    display: inline-block;
}

/* Lado izquierdo */
#left-side {
    background-color: var(--left-color);
    width: 60%;             /* Valor inicial */
    z-index: 2;

    
}

#left-side .title {
    color: #ffffff;
}

#left-side .fancy {
    color: var(--right-color);
}

/* Lado derecho (siempre visible debajo) */
#right-side {
    background-color: var(--right-color);
    z-index: 1;
    
}

#right-side .title {
    color: var(--left-color);
}

#right-side .fancy {
    color: #ffffff;
}

/* Ajustes responsivos para el hero */
@media (max-width: 768px) {
    .side .title {
        font-size: clamp(2rem, 12vw, 4rem);
        margin: 0 5vw;
        width: 90vw;
    }
    .side .fancy {
        font-size: 1.4em;
    }
    .title-logo {
        width: clamp(1.6rem, 8vw, 2.8rem);
    }
}

@media (max-width: 480px) {
    .logo-text__brand,
    .logo-text__dev {
        font-size: 0.875rem;
    }
    .logo-img {
        width: 2rem;
        height: 2rem;
    }
    .mobile-nav-link {
        font-size: 2rem;
    }
    .side .title {
        font-size: clamp(1.8rem, 10vw, 2.8rem);
    }
}

/* ============================================================
   SERVICIOS
   ============================================================ */
.services {
    padding: 5rem 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.services__inner {
    width: 100%;
}

.services__title {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: clamp(2rem, 3vw, 3.5rem);
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.services__subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1.1rem;
    text-align: center;
    color: var(--text-secondary);
    opacity: 0.8;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.services__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 640px) {
    .services__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .services__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ----- Tarjeta individual ----- */
.service-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(4px);
}

.service-card:hover {
    transform: translateY(-6px);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.service-card__icon {
    font-size: 2.5rem;
    color: var(--color-blue);
    margin-bottom: 1rem;
    transition: color 0.3s;
}

.service-card:hover .service-card__icon {
    color: var(--color-orange);
}

.service-card__title {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.service-card__description {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Ajuste responsivo para móviles */
@media (max-width: 480px) {
    .service-card {
        padding: 1.5rem 1rem;
    }
    .service-card__icon {
        font-size: 2rem;
    }
    .service-card__title {
        font-size: 1.1rem;
    }
    .service-card__description {
        font-size: 0.875rem;
    }
}

/* ============================================================
   CLIENTES (carrusel automático infinito con CSS)
   ============================================================ */
.clients {
  padding: 5rem 0;
  background-color: #ffffff;
  color: var(--bg-primary);
  overflow: hidden;                /* Oculta lo que sale de la pantalla */
}

.clients__inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.clients__title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: clamp(2rem, 3vw, 3.5rem);
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.clients__subtitle {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.1rem;
  text-align: center;
  color: #4b5563;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Contenedor del carrusel: ancho completo y animación */
.clients__grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 2rem;
  width: max-content;           /* El ancho se ajusta a todo el contenido duplicado */
  animation: scrollLeft 20s linear infinite;  /* Animación continua */
}

/* Pausa la animación al pasar el mouse */
.clients__grid:hover {
  animation-play-state: paused;
}

/* Cada logo: dimensiones y centrado */
.client-card {
  flex: 0 0 auto;
  width: 200px;                 /* Ancho fijo para uniformidad (ajustable) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.client-card:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.client-card__logo {
  display: block;
  width: 90%;
  height: auto;
  max-height: 100px;
  object-fit: contain;
  filter: none;
  transition: filter 0.3s ease;
}

.client-card:hover .client-card__logo {
  filter: brightness(0.9);
}

/* Animación: desplazamiento hacia la izquierda */
@keyframes scrollLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    /* Desplaza exactamente la mitad del ancho (porque duplicamos los logos) */
    transform: translateX(-50%);
  }
}

/* Ajustes para móviles */
@media (max-width: 640px) {
  .clients__grid {
    gap: 1.5rem;
    animation-duration: 15s;    
  }
  .client-card {
    width: 150px;
  }
  .client-card__logo {
    max-height: 80px;
    width: 85%;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
    color: var(--text-primary);
}

.footer__inner {
    width: 100%;
}

.footer__content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer__column {
    display: flex;
    flex-direction: column;
}

.footer__logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer__bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    text-align: center;
}

@media (max-width: 640px) {
    .footer__content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ============================================================
   SEPARADOR HERO → INTRO (montaña #030712, escalable)
   ============================================================ */
.intro {
  position: relative;
}

.intro::before {
  content: '';
  position: absolute;
  top: -8vw;                     /* ~ -120px en desktop 1440px, ~ -30px en móvil 375px */
  left: 0;
  width: 100%;
  height: 9vw;                   /* ~ 130px en desktop, ~ 34px en móvil */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 1600 200'%3E%3Cpolygon fill='%23030712' points='-4,188.586 174,76 292,124 402,60 536,108 752,8 882,66 990,32 1210,116 1380,64 1536,150 1604,115.09 1604,204 -4,204'/%3E%3Cpolygon fill='%230d1117' points='174,76 174,78 -4,198 -4,188.586'/%3E%3Cpolygon fill='%23161b22' points='292,124 302,138 402,64 402,60'/%3E%3Cpolygon fill='%230d1117' points='536,108 544,120 752,12 752,8'/%3E%3Cpolygon fill='%23161b22' points='882,66 890,78 990,36 990,32'/%3E%3Cpolygon fill='%230d1117' points='1210,116 1222,130 1380,68 1380,64'/%3E%3Cpolygon fill='%23161b22' points='1536,150 1546,164 1604,124 1604,115.09'/%3E%3Cpolygon fill='%230a0f14' points='174,76 292,124 282,140 174,78'/%3E%3Cpolygon fill='%230a0f14' points='402,60 536,108 528,120 402,64'/%3E%3Cpolygon fill='%230a0f14' points='752,8 882,66 874,80 752,12'/%3E%3Cpolygon fill='%230a0f14' points='990,32 990,36 1192,130 1210,116'/%3E%3Cpolygon fill='%230a0f14' points='1380,64 1536,150 1526,168 1380,68'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: 2;
  pointer-events: none;
}

/* ============================================================
   SEPARADOR SERVICIOS → CONTACTO (flecha oscura hacia abajo)
   ============================================================ */
.services {
  position: relative;
}

.services::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;                     /* Altura de la flecha (ajustable) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 1600 200'%3E%3Cpolygon fill='%23030712' points='0,0 1600,0 800,200'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  transform: translateY(100%);       /* justo debajo de Servicios */
  z-index: 1;
  pointer-events: none;
}

/* Ajuste responsive */
@media (max-width: 640px) {
  .services::after {
    height: 40px;
  }
}
/* ============================================================
   CONTACTO (centrado también en móvil)
   ============================================================ */
#contacto {
  background: #ffffff;
  padding: 80px 20px;
  text-align: center;
}

.contact__container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;            /* un pequeño margen interno para que respire */
}

#contacto h2 {
  font-family: var(--font-title);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  margin-bottom: 24px;
  color: #030712;
}

#contacto p {
  font-family: var(--font-body);
  font-size: 1.125rem;
  margin-bottom: 40px;
  line-height: 1.6;
  color: #4b5563;
}

/* Contenedor de los enlaces */
.contact__links {
  display: flex;
  flex-direction: column;     /* uno abajo del otro */
  align-items: center;        /* centrados horizontalmente */
  gap: 20px;
  font-size: 1.25rem;
}

/* Botón de WhatsApp */
.contact__button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25D366;
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.125rem;
  padding: 16px 32px;
  border-radius: 50px;
  text-decoration: none;
  transition: background 0.3s, transform 0.3s;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.contact__button:hover {
  background: #1ebe5b;
  transform: translateY(-3px);
}

.contact__button i {
  font-size: 1.4rem;
}

/* Enlace de email */
.contact__link {
  color: var(--color-blue);
  text-decoration: none;
  transition: color 0.3s;
}

.contact__link:hover {
  color: var(--color-orange);
}

/* ============================================================
   FOOTER (solo el logo alineado a la izquierda)
   ============================================================ */
.footer {
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
    color: var(--text-primary);
}

.footer__inner {
    width: 100%;
}

.footer__content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: start;               /* Alinea el inicio de ambas columnas */
}

.footer__column {
    display: flex;
    flex-direction: column;
}

/* Branding (alineado a la izquierda) */
.footer__brand {
    align-items: flex-start;          /* Solo esta columna se alinea a la izquierda */
}



.footer__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.footer__logo-img {
    width: 40px;
    height: 40px;
}

.footer__brand-name {
    font-family: var(--font-title);
    font-weight: 900;
    font-size: 1.25rem;
}

.footer__description {
    font-family: var(--font-body);
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Contacto */
.footer__heading {
    font-family: var(--font-title);
    font-weight: 700;
    margin-bottom: 15px;
}

.footer__contact-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer__contact-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.footer__contact-list i {
    width: 20px;
    color: var(--color-blue);
}

.footer__contact-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer__contact-list a:hover {
    color: var(--color-blue);
}

/* Copyright */
.footer__bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 640px) {
    .footer__content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Utility: solo visible para lectores de pantalla y buscadores */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* H1 fijo debajo del efecto split */
.hero__keyword {
    position: absolute;
    bottom: 25%;                  /* Ajusta la distancia desde abajo */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;                  /* Por encima de los lados */
    font-family: var(--font-title);
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    pointer-events: none;         /* Para no interferir con el movimiento del mouse */
}