/* ============================================================
   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 (se redimensiona dinámicamente) */
#left-side {
    background-color: var(--left-color);
    width: 60%;             /* Valor inicial (se actualiza con JS) */
    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
   ============================================================ */
.clients {
    padding: 5rem 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: auto;
    display: flex;
    align-items: center;
}

.clients__inner {
    width: 100%;
}

.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: var(--text-secondary);
    opacity: 0.8;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

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

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

/* ----- Tarjeta Cliente ----- */
.client-card {
    background: rgba(255, 255, 255, 0.644);
    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);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.client-card:hover {
    transform: translateY(-6px);
    background: rgba(255, 255, 255, 0.596);
    box-shadow: 0 12px 30px rgba(219, 145, 34, 0.74);
}

.client-card__logo {
    max-width: 120px;
    height: 100px;
    display: block;
    object-fit: contain;
}

/* Ajuste responsivo para móviles */
@media (max-width: 480px) {
    .client-card {
        padding: 1.5rem 1rem;
        min-height: 120px;
    }
    .client-card__logo {
        max-width: 100px;
    }
}

/* ============================================================
   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;
    }
}
