/* ======================= */
/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Caudex:wght@400;700&display=swap');

/* ======================= */
/* Base */
body {
    margin: 0;
    padding: 2em;
    font-family: 'Caudex', serif;
    background: linear-gradient(135deg, #f5f0e6, #d9bfa8, #b76e6b, #d18a88);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite alternate;
    color: #4a2c2a;
    transition: color 0.5s ease, background 0.5s ease;
    text-align: center;
}

/* Fondo animado */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 100%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 0%; }
    100% { background-position: 0% 50%; }
}

/* ======================= */
/* Encabezados */
h1, h2, h3 {
    text-align: center;
    color: #6b2d2a;
    margin-bottom: 1em;
}

/* ======================= */
/* Barra de navegación */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(245, 240, 230, 0.95);
    backdrop-filter: blur(6px);
    z-index: 1000;
    padding: 1em 0;
    border-bottom: 2px solid #6b2d2a;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2em;
    margin: 0;
    padding: 0;
}

nav ul li a {
    text-decoration: none;
    color: #6b2d2a;
    font-weight: 700;
    transition: color 0.3s ease;
    font-size: 1.05em;
}

nav ul li a:hover {
    color: #a53e3b;
}

/* ======================= */
/* Encabezado principal */
header {
    padding-top: 6em;
    margin-bottom: 2em;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header h1 {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 0.5em;
}

header button {
    font-family: 'Caudex', serif;
    font-size: 1em;
    padding: 12px 35px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    background-color: #6b2d2a;
    color: #f5f0e6;
    transition: all 0.4s ease;
}

header button:hover {
    background-color: #a53e3b;
    transform: scale(1.05);
}

/* ======================= */
/* Contenedor principal */
#container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3em;
    text-align: center;
}

/* Introducción */
.intro {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1em;
    padding: 2em 1em;
}

.intro p {
    text-align: center;
    line-height: 1.7;
    margin-bottom: 1em;
    color: #4a2c2a;
    font-size: 1.05em;
}

/* ======================= */
/* Galería de proyectos */
.proyectos {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.galeria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5em;
    width: 100%;
    max-width: 1100px;
}

/* ======================= */
/* Tarjetas cuadradas refinadas */
.tarjeta {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* proporción 1:1 */
    border-radius: 12px;
    cursor: pointer;
    background: #f5f0e6cc;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tarjeta a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.tarjeta img {
    width: 100%;
    height: 70%;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
    transition: transform 0.5s ease;
}

.tarjeta h3 {
    height: 30%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 1em;
    background: linear-gradient(135deg, #d9bfa8, #a53e3b);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.tarjeta:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.tarjeta:hover img {
    transform: scale(1.05);
}

/* ======================= */
/* Footer */
footer {
    margin-top: 4em;
    padding: 2em;
    text-align: center;
    background-color: #f5f0e6;
    border-top: 2px solid #6b2d2a;
    border-radius: 15px 15px 0 0;
    color: #4a2c2a;
}

footer h2 {
    margin-bottom: 1em;
}

footer p {
    margin: 0.5em 0;
}

/* ======================= */
/* Responsive */
@media (max-width: 900px) {
    #container {
        gap: 2em;
    }

    h1 {
        font-size: 1.8em;
    }

    header button {
        padding: 10px 25px;
        font-size: 0.95em;
    }

    .intro p {
        font-size: 1em;
    }
}
