@import url('https://fonts.googleapis.com/css2?family=Monsieur+La+Doulaise&family=Quicksand:wght@300..700&family=Raleway:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --dark-plum: #331E36;
    --indigo: #41337A;
    --steel-blue: #6ea4bf;
    --pale-aqua: #78d5ce;
    --light-cream: #ECFEE8;
    --mint-cream: #F5FFFA;
    --jet: #333333;
}

/* Tipografías */
.raleway-font {
    font-family: "Raleway", sans-serif;
}
.monsieur-la-doulaise-regular {
    font-family: "Monsieur La Doulaise", cursive;
}
.quicksand-font {
    font-family: "Quicksand", sans-serif;
}

/* Reset y base */
html {
    box-sizing: border-box;
    background-color: var(--mint-cream);
    scroll-behavior: smooth;
}
*, *::before, *::after {
    box-sizing: inherit;
}
body {
    margin: 0;
    font-family: "Quicksand", sans-serif;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

body.loaded {
    opacity: 1;
}
header {
    /* Ajuste para móvil */
    height: 30rem; 
    padding-top: 5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}
    
.top {
    position: fixed;
    top: 0;
    width: 100%;
    height: 5rem;    
    display: flex;
    justify-content: space-between;
    align-items: center;    
    padding: 0 1rem;    
    z-index: 10;
    transition: background-color 0.3s ease;
}

.menu-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: block; /* Visible en móvil por defecto */
    z-index: 11; /* Asegura que esté por encima del nav cuando se abre */
}

nav {
    
    display: none; 
}


header.menu-open nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(245, 255, 250, 0.95); /* var(--mint-cream) con transparencia */
    z-index: 9;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

header.menu-open nav a {
    font-size: 1.8rem;
    color: var(--dark-plum);
}

/* Títulos */
.h1 a {
    text-decoration: none;
    color: var(--dark-plum);
}
h1 {
    padding: 0;
    margin: 0;    
    font-size: 1.5rem;
}
.logo-Span {
    color: var(--pale-aqua);
    display: inline-block;
}

/* Banner Text */
.banner-text {
    display: flex;
    flex-direction: column;
    /* Ajuste para móvil: toma todo el ancho */
    width: 90%; 
    align-items: center;
    justify-content: center;
    
    /* Centrado en móvil */
    margin-top: 3rem; 
    margin-left: 0;
    
    color: var(--jet);
    text-align: center;
}

.banner-text-h2 {
    /* Reducir tamaño en móvil */
    font-size: 1.8rem; 
    margin-bottom: 0.5rem;
}

.h3-banner {
    color: var(--jet);
    /* Reducir tamaño en móvil */
    font-size: 1rem; 
    font-weight: 500;
}

a.bts1,
a.bts2 {
    text-decoration: underline;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

a.bts1:hover,
a.bts2:hover {
    color: var(--steel-blue);
    cursor: pointer;
}


#services {
    padding: 2rem 1rem;
}

.h2 {
    text-align: center;
    color: var(--jet);
    font-size: 2rem;
}
.h3 {
    font-size: 1.5rem;
    text-align: center;
}

/* Contenedor de tarjetas en grid (Mobile-First: 1 Columna) */
.services {
    display: grid;
    grid-template-columns: repeat(1, 1fr); /* 1 columna en móvil */
    gap: 1.5rem;
    justify-items: center;
    max-width: 75rem;    
    margin: 0 auto;        
    padding: 2rem 1rem;
}


.child-div-flip {
    /* Toman 100% del contenedor (menos padding) */
    width: 100%; 
    max-width: 30rem; /* Límite para que no sean demasiado anchas en tablets */
    height: 14rem; /* Altura ajustada */
    perspective: 1000px;
    margin: 0 auto;
    position: relative;
}

.child-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.999s;
}

.child-div-flip.flipped .child-inner {
    transform: rotateY(180deg);
}

.child-front,
.child-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    top: 0;
    left: 0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.child-front {
    background-color: var(--pale-aqua);
    color: #fff;
    font-size: 1rem;
    transform: rotateY(0deg);
}

.child-back {
    background-color: var(--steel-blue);
    color: #fff;
    font-size: 1rem;
    transform: rotateY(180deg);
}

.icon {
    max-width: 3rem; /* Iconos más pequeños en móvil */
    margin: 0 auto;
    filter: invert();
}
.content-p {
    font-size: 0.9rem;
    text-align: center;
    font-weight: bold;
}

/* --- SECCIONES PROYECTOS Y GALERÍA --- */
.projects, .gallery {
    margin-top: 1rem;
    padding: 1rem;
    gap: 1rem;
    max-width: 100%;
    height: auto;
}

.child-container {
    /* Mobile-First: 1 Columna */
    display: grid;
    grid-template-columns: repeat(1, 1fr); 
    gap: 1.5rem; 
    justify-items: center;
    max-width: 75rem; 
    margin: 0 auto;     
    padding: 2rem 1rem;
}

.projects-child {
    display: flex;
    flex-direction: column;
    height: auto; 
    /* Ajuste para móvil */
    width: 100%; 
    max-width: 350px; 
    text-decoration: none; 
    color: inherit; 
    margin: 0;
    background-color: var(--light-cream); 
    border-radius: 0.8rem;
    padding: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

    /* NUEVO: Centrado de contenido en móviles */
    text-align: center;
    align-items: center;
}
.projects-child h4, 
.projects-child p {
    text-decoration: none; 
}
.child-image {
    width: 100%; 
    height: 14rem; /* Altura ajustada */
    margin: 0.5rem 0; 
    background-size: cover; /* Cambiado a cover para que se vea bien en el espacio */
    background-repeat: no-repeat;
    background-position: center; 
    border-radius: 0.5rem;
}
.child-info {
    width: 100%; 
    padding: 0 1rem; 
}

/* Botón de proyectos */
button.btn-project {
    display: flex;
    align-items: center;
    background-color: var(--indigo);
    color: var(--mint-cream);
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    margin: 0 auto;
    width: 8rem;
    height: 3rem;
    text-align: center;
    justify-content: center;
    /* Ajuste para móvil */
    margin-top: 1rem; 
}


/* Footer (Asegurar que sea vertical y centrado en móvil) */
footer{
    background-color: var(--indigo);
    color: var(--mint-cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
    width: 100%;
    height: auto; /* Altura auto para adaptarse al contenido */
    padding: 2rem 1rem;
    text-align: center;
}
#Contact{
    color: var(--mint-cream);
    margin-bottom: 1rem;
}
.footer-contact {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Permitir que los íconos se envuelvan si es necesario */
}
footer img{
    width: 2.5rem; /* Iconos más pequeños en móvil */
    filter: invert();
    margin: 0.5rem 1rem; /* Espaciado ajustado */
}
footer article {
    width: 100%;
    margin-top: 1rem;
    font-size: 0.9rem;
}
.footer-a a{
    text-decoration: none;
    color: var(--mint-cream);
}

@media (min-width: 768px) {
    
    /* Header/Top Bar */
    header {
        height: 50rem;
        padding-top: 7rem;
    }
    
    .top {
        padding: 0 2rem;
    }

    /* Ocultar el botón de menú en escritorio */
    .menu-button {
        display: none;
    }
    
    nav {
        /* Mostrar navegación en escritorio y establecer su layout original */
        display: flex; 
        flex-direction: row;
        position: static;
        height: auto;
        width: auto;
        background-color: transparent;
        z-index: 10;
        align-items: center;
        justify-content: flex-end;
        gap: 2rem;
        margin-right: 1rem;
    }

    nav a {
        font-size: 1.2rem;
        color: var(--jet); /* Vuelve al color original de escritorio */
    }

    /* Banner Text */
    .banner-text {
        width: 38rem;
        margin-top: 7rem; 
        margin-left: 5rem;
        text-align: left;
        align-items: flex-start;
    }
    
    .banner-text-h2 {
        font-size: 2.5rem;
    }
    .h3-banner {
        font-size: 1.2rem;
    }
    
    /* Servicios (Vuelve a 2 columnas) */
    .services {
       display: flex;
       flex-direction: row;
       max-width: 90%;
       align-items: center;
    }
    
    .child-div-flip {
        width: 20rem; /* Ancho ajustado para escritorio */
        height: 16rem;
    }
    
    .icon {
        max-width: 4rem;
    }

    /* Galerías (Vuelve a 2 columnas) */
    .child-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem; 
    }
    
    .projects-child {
        width: 30rem; /* Ancho original en escritorio */
        max-width: none;
        /* REVERTIR CENTRADO: Asegura que el contenido esté a la izquierda en desktop */
        text-align: left; 
        align-items: flex-start;
    }

    /* Estilo del botón de proyecto en escritorio */
    button.btn-project {
        margin-top: 0;
    }
    
    .child-image {
        height: 18rem;
    }
    
    /* Footer */
    footer {
        height: 15rem;
    }
    .footer-contact {
        flex-direction: row;
    }
}
