/* =========================
   RESET / BASE
   ========================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    border: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-size: 1em;
    line-height: 1.6;
    font-family: "Inter", "Helvetica", Arial, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    color: #fff; /* color por defecto, JS lo sobreescribirá según fondo */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Transiciones globales para textos que cambian color */
section,footer,h1,h2,h3,p,small,header nav a,.static-text,.dynamic-text {
    transition: color 0.3s ease;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1em 0; /* 24px aprox */
    z-index: 1000;
    transition: background 0.3s ease, color 0.3s ease;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Menú centrado */
nav ul {
    display: flex;
    justify-content: center;
    gap: 2.25em; /* espacio entre items */
    list-style: none;
}

nav a {
    text-decoration: none;
    color: inherit;      /* heredado del body/JS */
    font-size: 0.75em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s ease, opacity 0.3s ease;
}

nav a:hover {
    opacity: 0.75;
}

.panel {
    min-height: 100vh;
    padding: 9.375em 3.75em 3.75em; /* 150px 60px 60px -> en em (150/16=9.375) */
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25em;
}

h1 {
    font-size: 2.8em;   /* 2.8 * 16px = 44.8px */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

/* H2 — titulares de sección + typewriter */
h2 {
    font-size: 2em;     /* 32px */
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.6em;
    display: flex;
    flex-wrap: wrap;
}

h3 {
    font-size: 1.6em;   /* 25.6px */
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

/* Párrafos dentro de panel */
p {
    max-width: 50em;
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 1em;
}

small {
    font-size: 0.85em;
}

/* =========================
   TIPOS DINÁMICOS (static / dynamic)
   ========================= */
.static-text,
.dynamic-text {
    transition: color 0.6s ease;
}

/* =========================
   MOSAICO 3x3 – PORTFOLIO
   ========================= */
.grid-mosaico {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2em;
    width: 100%;
    margin-top: 2em;
}

/* Cada ítem */
.mosaico-item {
    display: flex;
    flex-direction: column;
    gap: 0.6em;
    transition: transform 0.3s ease;
}

.mosaico-item:hover {
    transform: translateY(-4px);
}

/* Contenedor para mantener proporción 16:9 */
.mosaico-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 8px;
}

/* Imágenes */
.mosaico-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease, filter 0.35s ease;
}

/* Efecto hover suave */
.mosaico-media:hover img {
    transform: scale(1.06);
    filter: brightness(0.9);
}

/* Títulos */
.mosaico-item h3 {
    font-size: 1.1em;
    margin: 0;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .grid-mosaico {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .grid-mosaico {
        grid-template-columns: 1fr;
    }
}


/* =========================
   FOOTER
   ========================= */
footer {
    background: #000;
    color: #fff;
    padding: 2.5em;      /* 40px */
    text-align: center;
    font-size: 1em;
}

/* =========================
   RESPONSIVE: ajustar tipografía en pantallas pequeñas
   ========================= */
@media (max-width: 1024px) {
    .panel {
        padding: 8em 2.5em 2.5em;
    }
    .panel h1 { font-size: 2.4em; }
    .panel h2 { font-size: 1.8em; }
    h3 { font-size: 1.4em; }
}

@media (max-width: 600px) {
    nav ul { gap: 1.2em; }
    nav a { font-size: 0.85em; }
    .panel { padding: 6.5em 1.5em 2em; }
    .panel h1 { font-size: 2em; }
    .panel h2 { font-size: 1.4em; }
    h3 { font-size: 1.15em; }
    .panel p { font-size: 0.98em; }
}
