/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    /* Paleta de colores */
    --color-bg: #F5F5F5;
    --color-surface-light: #F9EBED;
    --color-surface-accent: #F2DAC4;
    --color-primary: #D9818F;
    --color-primary-dark: #7E2633;
    --color-text-main: #5A1B24;
    --color-text-hover: #E9A6AF;
    --color-white: #FFFFFF;

    /* Tipografías */
    --font-heading: "DM Serif Display", serif;
    --font-body: "Montserrat", sans-serif;
    --font-system: Arial, sans-serif;

    /* Tipografía fluida */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-xl: clamp(1.75rem, 1.4rem + 1.25vw, 2.25rem);
    --text-2xl: clamp(2.5rem, 1.8rem + 2.5vw, 3.5rem);
    --text-hero: clamp(3rem, 1.5rem + 5vw, 5.5rem);

    /* Espaciados fluidos */
    --space-xs: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
    --space-sm: clamp(0.75rem, 0.6rem + 0.75vw, 1.25rem);
    --space-md: clamp(1.25rem, 1rem + 1.25vw, 2rem);
    --space-lg: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);

    /* Bordes y Transiciones */
    --radius-sm: 15px;
    --radius-md: 30px;
    --radius-lg: 40px;
    --radius-full: 50px;
    --transition-fast: 0.3s ease;
}

/* ==========================================================================
   RESET & ESTILOS BASE
   ========================================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-height: 100vh;
    scroll-behavior: smooth;
}

body {
    padding: var(--space-sm);
    font-family: var(--font-body), var(--font-system);
    font-size: var(--text-base);
    color: var(--color-text-main);
    background-color: var(--color-bg);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-wrap: break-word;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==========================================================================
   BARRA SUPERIOR / HEADER & NAVEGACIÓN
   ========================================================================== */
.header {
    background-color: var(--color-primary-dark);
    border-radius: var(--radius-full);
    padding: var(--space-sm) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 100;
}

.header h2 {
    color: var(--color-white);
    font-size: var(--text-xl);
    font-family: var(--font-heading);
    font-weight: 400;
}

.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    display: block;
    background: var(--color-white);
    height: 3px;
    width: 2rem;
    border-radius: 2px;
    position: relative;
    transition: background 0.2s ease-out, transform 0.2s ease-out;
}

.nav-toggle-label span::before,
.nav-toggle-label span::after {
    content: '';
    position: absolute;
}

.nav-toggle-label span::before {
    top: -8px;
}

.nav-toggle-label span::after {
    top: 8px;
}

.nav ul {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    list-style: none;
}

.nav a {
    color: var(--color-white);
    font-size: var(--text-base);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav a:hover {
    color: var(--color-text-hover);
}

/* ==========================================================================
   HERO / PORTADA (.inicio)
   ========================================================================== */
.inicio {
    margin-top: var(--space-sm);
    min-height: 70vh;
    background-color: var(--color-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    position: relative;
    overflow: hidden;
}

.inicio-texto {
    width: 55%;
    max-width: 850px;
    z-index: 2;
}

.saludo {
    font-size: var(--text-base);
    color: var(--color-text-main);
    margin-bottom: var(--space-xs);
}

.inicio h1 {
    font-family: var(--font-heading);
    font-size: var(--text-hero);
    font-weight: 400;
    line-height: 0.95;
    color: var(--color-text-main);
    letter-spacing: 1px;
    margin-bottom: var(--space-sm);
}

.inicio h3 {
    font-size: var(--text-lg);
    font-weight: normal;
    color: var(--color-text-main);
    margin-bottom: var(--space-sm);
}

.descripcion {
    max-width: 780px;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text-main);
    margin-bottom: var(--space-md);
}

.boton {
    display: inline-block;
    background-color: var(--color-text-main);
    color: var(--color-surface-light);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: bold;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.boton:hover {
    background-color: var(--color-surface-accent);
    color: var(--color-text-main);
}

.inicio-imagen {
    width: 40%;
    height: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    z-index: 1;
}

.inicio-imagen img {
    max-height: 500px;
    width: auto;
    object-fit: contain;

    -webkit-mask-image:
        linear-gradient(to right, rgba(0, 0, 0, 1) 90%, rgba(0, 0, 0, 0) 100%),
        linear-gradient(to bottom, rgba(0, 0, 0, 1) 90%, rgba(0, 0, 0, 0) 100%);

    mask-image:
        linear-gradient(to right, rgba(0, 0, 0, 1) 90%, rgba(0, 0, 0, 0) 100%),
        linear-gradient(to bottom, rgba(0, 0, 0, 1) 90%, rgba(0, 0, 0, 0) 100%);

    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}


/* ==========================================================================
   SOBRE MÍ
   ========================================================================== */
.sobre-mi {
    margin-top: var(--space-sm);
    background-color: var(--color-surface-accent);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
}

.sobre-mi-texto {
    width: 55%;
}

.etiqueta {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sobre-mi h2 {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 400;
    color: var(--color-text-main);
    margin: var(--space-xs) 0 var(--space-sm);
}

.sobre-mi-texto p {
    font-size: var(--text-base);
    line-height: 1.8;
    color: var(--color-text-main);
    margin-bottom: var(--space-xs);
}

.sobre-mi-datos {
    width: 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-md);
}

.dato {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.dato span {
    width: 3.5rem;
    height: 3.5rem;
    background-color: var(--color-primary);
    color: var(--color-text-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    flex-shrink: 0;
}

.dato p {
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--color-text-main);
}

/* ==========================================================================
   PROYECTOS
   ========================================================================== */
.proyectos {
    margin-top: var(--space-sm);
    padding: var(--space-lg);
    background-color: var(--color-surface-light);
    border-radius: var(--radius-lg);
}

.proyectos h2 {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 400;
    color: var(--color-text-main);
    text-align: center;
    margin-bottom: var(--space-lg);
}

.bloque-proyectos {
    margin-bottom: var(--space-lg);
}

.bloque-proyectos:last-child {
    margin-bottom: 0;
}

.bloque-proyectos h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: var(--space-sm);
}

.carrete {
    width: 100%;
    background-color: var(--color-primary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    align-items: stretch;
}

.carrete a {
    display: block;
    width: 100%;
}

.carrete img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    background-color: var(--color-surface-accent);
    border: 0.5rem solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: var(--space-xs);
    transition: transform var(--transition-fast);
}

.carrete img:hover {
    transform: scale(1.03);
}

/* PAGINA DETALLE PROYECTO 3 */
.detalle-proyecto {
    padding: var(--space-lg);
    background-color: var(--color-surface-light);
    border-radius: var(--radius-lg);
}

.galeria {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.galeria img {
    width: 100%;
    max-width: 1100px;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   CONTACTO
   ========================================================================== */
.contacto {
    margin-top: var(--space-sm);
    background-color: var(--color-primary-dark);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.contacto-contenido {
    width: 50%;
}

.contacto-etiqueta {
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--color-surface-accent);
    margin-bottom: var(--space-sm);
}

.contacto h2 {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 400;
    line-height: 1.1;
    color: var(--color-white);
    margin-bottom: var(--space-sm);
}

.contacto-texto {
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-surface-accent);
    max-width: 650px;
    margin-bottom: var(--space-md);
}

.contacto-links {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.contacto-links a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background-color: var(--color-surface-accent);
    color: var(--color-text-main);
    font-size: var(--text-sm);
    font-weight: 600;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.contacto-links a:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.contacto-visual {
    width: 45%;
    height: 400px;
    background-color: var(--color-surface-accent);
    border: 0.625rem solid var(--color-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.contacto-imagen {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ==========================================================================
   BOTÓN SUBIR & FOOTER
   ========================================================================== */
.btn-subir {
    position: fixed;
    bottom: var(--space-md);
    right: var(--space-md);
    width: 3.2rem;
    height: 3.2rem;
    background-color: var(--color-primary-dark);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.btn-subir:hover {
    background-color: var(--color-primary);
    transform: translateY(-3px);
}

footer {
    min-height: 4rem;
    background-color: var(--color-surface-accent);
    border-radius: var(--radius-full);
    padding: var(--space-sm) var(--space-lg);
    margin-top: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================================================== */
@media (max-width: 1024px) {
    .carrete {
        grid-template-columns: repeat(2, 1fr);
    }

    .inicio-texto,
    .sobre-mi-texto,
    .contacto-contenido {
        width: 50%;
    }

    .inicio-imagen,
    .sobre-mi-datos,
    .contacto-visual {
        width: 45%;
    }
}

@media (max-width: 768px) {
    .nav-toggle-label {
        display: block;
    }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-primary-dark);
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        padding: var(--space-md);
        display: none;
    }

    .nav ul {
        flex-direction: column;
        gap: var(--space-sm);
    }

    /* Mostrar menú al activar checkbox */
    .nav-toggle:checked~.nav {
        display: block;
    }

    .inicio,
    .sobre-mi,
    .contacto {
        flex-direction: column;
        text-align: center;
    }

    .inicio-texto,
    .inicio-imagen,
    .sobre-mi-texto,
    .sobre-mi-datos,
    .contacto-contenido,
    .contacto-visual {
        width: 100%;
    }

    .inicio-imagen {
        justify-content: center;
    }

    .inicio-imagen img {
        max-height: 350px;
    }

    .sobre-mi-datos {
        align-items: center;
    }

    .dato {
        justify-content: center;
    }

    .contacto-links {
        justify-content: center;
    }

    .contacto-visual {
        height: 300px;
    }

    .inicio-imagen img {
        -webkit-mask-image: none !important;
        mask-image: none !important;

        clip-path: circle(45% at center);

        width: 260px;
        height: 260px;
        object-fit: cover;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    body {
        padding: var(--space-xs);
    }

    .carrete {
        grid-template-columns: 1fr;
    }

    .carrete img {
        height: 250px;
    }

    .contacto-visual {
        height: 220px;
    }

    .boton,
    .contacto-links a {
        width: 100%;
        justify-content: center;
    }
}