* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #111;
    color: #fff;
}

/*-- Splash Screen Animada --*/ 

.splash-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: transparent;
    /* Un sombreado blanco gigante que cubre toda la pantalla inicialmente */
    box-shadow: 0 0 0 200vmax white;
    z-index: 9999;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.splash-screen.animate {
    animation: reveal 0.5s ease-in-out forwards;
}

/* La animación que agranda el círculo transparente */
@keyframes reveal {
    0% {
        width: 0;
        height: 0;
    }
    100% {
        /* Aumentamos el ancho y alto a un tamaño mayor que la pantalla */
        width: 300vmax;
        height: 300vmax;
    }
}

/*-- Header --*/

.header {
    width: 100%;
    height: 5em;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-buttons {
    display: flex;
    gap: 2em;
    align-items: center;
    justify-content: center;
}

.nav-buttons a {
    text-decoration: none;
}

.nav-btn {
    color: #ffffff;
    background: transparent;
    border: 1px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5em 1em;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/*-- Sección Principal (Cuerpo con imagen de fondo y parallax) --*/

.main-section {
    position: relative;
    width: 100%;
    min-height: calc(95vh - 5em);
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #1a1a1a;
}

/* Imagen de fondo a pantalla completa con soporte de Parallax y Blur */
.hero-bg-img {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 125%; /* Altura extra para cubrir el desplazamiento del parallax */
    object-fit: cover;
    object-position: center;
    z-index: 1;
    will-change: transform, filter;
    transform: translate3d(0, 0, 0);
    filter: blur(0px);
}

/* Capa de oscurecimiento con gradiente suave */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.8));
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.1s ease-out;
}

/* Contenedor del contenido situado sobre el fondo */
.hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    display: flex;
    justify-content: flex-end; /* Posiciona el bloque hacia la mitad derecha */
}

.hero-gif {
    position: fixed;
    left: 15em;
    top: 15em;
    width: 20em;
    height: auto;
}

.text-container {
    width: 50%;
    padding-left: 3em;  /* Margen de 3em respecto al centro de la pantalla */
    padding-right: 3em; /* Margen de 3em respecto al borde derecho de la pantalla */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.text-container h2 {
    font-size: 2.5rem;
    margin: 0 0 0.5em 0;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.text-container p {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #e0e0e0;
    margin: 0;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

/*-- Sección de contenido / Galería de Encargos --*/

.content-section {
    position: relative;
    z-index: 4;
    background-color: #f0f0f0;
    color: #000;
    padding: 5em 3em 6em 3em;
    min-height: 60vh;
    border-top: 4px solid #000000;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
}

.content-container h3 {
    font-size: 2.4rem;
    margin: 0 0 0.3em 0;
    color: #000000;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.content-container p {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #333333;
    margin-bottom: 2.5em;
}

/*-- Galería de 3 columnas con orden de izquierda a derecha --*/

.encargos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4em 3.2em;
    margin-top: 2em;
    padding-left: 2.5em;  /* Margen interno para la sombra de 2em hacia la izquierda */
    padding-bottom: 2.5em; /* Margen interno para la sombra de 2em hacia abajo */
}

/* Bloque 4:3 con bordes rectos, borde negro grueso y sombra sólida */
.encargo-card {
    position: relative;
    aspect-ratio: 4 / 3;
    background-color: #ffffff;
    border: 4px solid #000000;
    border-radius: 0px; /* Bordes rectos */
    /* Sombra 100% opacidad: 1em a la izquierda (-1em) y 1em abajo (1em) sin blur */
    box-shadow: -1em 1em 0px #000000;
    text-decoration: none;
    color: #000000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.2, 0, 0.2, 1);
    z-index: 1;
}

/* Efecto hover: se agranda ligeramente sobre la pantalla para ampliar la vista */
.encargo-card:hover {
    box-shadow: -1.5em 1.5em 0px #000000;
    transform: scale(1.08);
    z-index: 20;
}

.encargo-img-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    background-color: #e5e5e5;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.encargo-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
    transition: transform 0.35s ease;
}

.encargo-card:hover .encargo-img-wrapper img {
    transform: scale(1.05);
}

.encargo-badge {
    position: absolute;
    top: 0.8em;
    left: 0.8em;
    background-color: #000000;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.35em 0.8em;
    border-radius: 0; /* Bordes rectos */
    border: 2px solid #000000;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.encargo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    text-align: center;
    padding: 1.5em;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        #f6f6f6,
        #f6f6f6 12px,
        #ebebeb 12px,
        #ebebeb 24px
    );
}

.encargo-placeholder-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #111111;
}

.encargo-placeholder-sub {
    font-size: 0.85rem;
    color: #666666;
    font-weight: 500;
}

.encargo-footer {
    background-color: #ffffff;
    border-top: 3px solid #000000;
    padding: 0.75em 1em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
    z-index: 2;
}

.encargo-title {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.encargo-link-text {
    font-size: 0.85rem;
    font-weight: 800;
    color: #000000;
    white-space: nowrap;
    text-transform: uppercase;
}

/* Responsividad */
@media (max-width: 1024px) {
    .encargos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3.5em 2.5em;
    }
}

@media (max-width: 768px) {
    .main-section {
        min-height: calc(100vh - 5em);
        padding: 3em 0;
    }

    .hero-content {
        justify-content: center;
    }

    .text-container {
        width: 100%;
        padding-left: 1.5em;
        padding-right: 1.5em;
        text-align: center;
    }

    .text-container h2 {
        font-size: 1.8rem;
    }

    .content-section {
        padding: 3.5em 1.5em 5em 1.5em;
    }

    /* Columna única para celulares */
    .encargos-grid {
        grid-template-columns: 1fr;
        gap: 3.5em;
        padding-left: 2em;
        padding-bottom: 2em;
    }

    .encargo-card:hover {
        transform: scale(1.04);
    }

    .nav-buttons {
        gap: 0.8em;
    }
    
    .nav-btn {
        padding: 0.4em 0.6em;
        font-size: 0.9rem;
    }
}
