/* --- Importación de Fuentes y Estilos Generales --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: #ffffff;
    overflow-x: hidden;
}

/* --- Video de Fondo y Overlay --- */
#video-fondo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* --- Menú de Navegación --- */
#menu-navegacion {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 40px 30px;
    border-radius: 0 0 20px 20px;
    overflow: hidden;
}

#menu-navegacion .menu-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    filter: brightness(1.0);
}

/* CORREGIDO: Regla de escritorio con mayor especificidad */
#menu-navegacion #menu-panel {
    list-style: none;
    display: flex;
    flex-direction: row;
    justify-content: flex-end; /* Alinea a la derecha en escritorio */
    align-items: center;
    margin: 0;
    padding: 0;
}

#menu-navegacion li {
    margin: 0 20px;
}

#menu-navegacion a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 400;
    font-size: 1rem;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.3s;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

#menu-navegacion a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.3s;
    font-family: 'Montserrat', sans-serif;
}

.lang-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* --- Estilos para Menú Móvil (Hamburguesa) --- */
.mobile-logo-container {
    display: none;
}

.hamburger {
    display: none;
    cursor: pointer;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1003;
    width: 30px;
    height: 25px;
}

.hamburger span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: #ffffff;
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}
.hamburger span:nth-child(1) { top: 0px; }
.hamburger span:nth-child(2) { top: 8px; }
.hamburger span:nth-child(3) { top: 16px; }

body.menu-open .hamburger span:nth-child(1) { top: 8px; transform: rotate(135deg); }
body.menu-open .hamburger span:nth-child(2) { opacity: 0; left: -60px; }
body.menu-open .hamburger span:nth-child(3) { top: 8px; transform: rotate(-135deg); }


/* --- Contenido Principal y Secciones --- */
main {
    position: relative;
    z-index: 1;
}

section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    text-align: center;
}

.contenido-seccion {
    max-width: 1000px;
    margin: 0 auto;
}

.contenido-seccion h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.contenido-seccion p {
    font-size: 1.1rem;
    line-height: 1.8;
    font-weight: 300;
}

/* --- Sección de Inicio (Logo) --- */
#logo-container {
    position: relative;
    width: 350px;
    height: 300px;
    margin: 40px auto;
}

#logo-container img {
    position: absolute;
    opacity: 0;
    transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#techo.initial { transform: translateY(-250px); }
#letra-e.initial { transform: translateX(-250px); }
#letras-ooo.initial { transform: translateX(250px); }
#nombre-autor.initial { transform: translateX(-50%) translateY(100px); }

#techo.final { top: 0; left: 50%; transform: translateX(-50%); opacity: 1; }
#letra-e.final { bottom: 0; left: -25px; opacity: 1; }
#letras-ooo.final { bottom: 0; right: -25px; opacity: 1; }
#nombre-autor { bottom: -80px; left: 48%; transform: translateX(-50%); width: 105%; max-width: 500px; }
#nombre-autor.final { transform: translateX(-50%) translateY(0); opacity: 1; }

/* --- Sección "¿Quién es?" --- */
#quien-es {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 50px;
    text-align: left;
}

.profile-text {
    flex: 1;
    max-width: 600px;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 20px;
    scroll-behavior: smooth;
}

.profile-text::-webkit-scrollbar { width: 8px; }
.profile-text::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
.profile-text::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.4); border-radius: 10px; }

.profile-photo-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-photo {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* --- Sección de Servicios (Tarjetas Flip) --- */
#servicios h2 { margin-bottom: 50px; }

.servicios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 100%;
    perspective: 1000px;
}

.service-card {
    background-color: transparent;
    width: 100%;
    height: 450px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.service-card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.card-front {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    flex-direction: column;
}

.card-front img {
    width: 100%;
    height: 60%;
    object-fit: cover;
}

.card-front h3 {
    padding: 20px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-grow: 1;
}

.card-back {
    background-color: rgba(0, 70, 150, 0.8);
    color: white;
    transform: rotateY(180deg);
    padding: 20px;
}

.card-content {
    height: 100%;
    overflow-y: auto;
    padding-right: 10px;
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: left;
}
.card-content::-webkit-scrollbar { width: 6px; }
.card-content::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
.card-content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.5); border-radius: 10px; }


/* --- Sección de Contacto (Formulario e Información) --- */
#formulario-contacto {
    width: 100%;
    max-width: 600px;
    margin-top: 30px;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 400;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    backdrop-filter: blur(5px);
    transition: background-color 0.3s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.2);
}

button[type="submit"] {
    display: block;
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    font-family: 'Montserrat', sans-serif;
}

button[type="submit"]:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
}

/* --- Estilos para el Bloque de Información de Contacto --- */
.contact-info {
    max-width: 600px;
    margin: 0 auto 50px auto;
    text-align: center;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.contact-info p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}
.contact-info p:last-child { margin-bottom: 0; }
.contact-info a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}
.contact-info a:hover {
    color: #007bff;
    text-decoration: underline;
}


/* --- Animaciones al Hacer Scroll --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-in-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* --- Media Query para Dispositivos Móviles --- */
@media (max-width: 768px) {
    #menu-navegacion .menu-bg { display: none; }
    .hamburger { display: block; }
    .mobile-logo-container {
        display: block;
        position: fixed;
        top: 15px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1003;
    }
    .mobile-logo-container img {
        display: block;
        height: 50px;
        width: auto;
    }

    /* CORREGIDO: Regla de móvil con la misma especificidad que la de escritorio */
    #menu-navegacion #menu-panel {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: #000025;
        z-index: 9999;
        display: flex;
        flex-direction: column; /* Alinea en columna en móvil */
        align-items: center;
        padding: 20px 0;
        justify-content: flex-start; /* Alinea los enlaces arriba */
        transition: right 0.4s ease-in-out;
    }
    body.menu-open #menu-navegacion #menu-panel { right: 0; }

    #menu-navegacion #menu-panel li {
        width: 100%;
        text-align: center;
        margin: 10px 0;
    }

    #menu-navegacion #menu-panel a, 
    #menu-navegacion #menu-panel .lang-btn {
        display: block;
        width: 80%;
        padding: 15px;
        color: #ffffff;
        font-size: 1.1rem;
        text-decoration: none;
        border-radius: 8px;
        transition: background-color 0.3s;
    }
    #menu-navegacion #menu-panel a:hover, 
    #menu-navegacion #menu-panel .lang-btn:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    body.menu-open { overflow: hidden; }

    section { padding: 80px 15px; }
    .contenido-seccion h2 { font-size: 2rem; }
    #quien-es {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
    .profile-text {
        max-width: 100%;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
    .servicios-grid {
        grid-template-columns: 1fr;
        perspective: 800px;
    }
    .service-card { height: 400px; }
}



/* --- Pie de Página (Footer) --- */
footer {
    position: relative; /* Lo mantiene fijo en la parte inferior de la ventana */
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Fondo oscuro semitransparente */
    color: #ffffff;
    text-align: center;
    padding: 15px 0;
    font-size: 0.9rem;
    z-index: 10; /* Se asegura de que esté por encima del video pero por debajo del menú */
    font-family: 'Montserrat', sans-serif;
    backdrop-filter: blur(5px); /* Un efecto de cristal esmerilado sutil */
}