/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
    transition: opacity 0.32s ease;
}

a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover { opacity: 0.6; }

/* === NAV === */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    z-index: 100;
}

/* El fondo va en un pseudo-elemento: si el blur estuviera en el nav,
   el menú mobile (position: fixed) quedaría atrapado adentro del nav */
nav::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s ease;
}

nav.scrolled::before {
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    border-bottom-color: rgba(255,255,255,0.08);
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.nav-links a.active { font-weight: 600; }

.nav-icons {
    display: flex;
    gap: 18px;
    align-items: center;
}

.nav-icons a { font-size: 1rem; }

/* === HERO (home) === */
.hero {
    position: relative;
    height: 100vh;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    filter: grayscale(100%) brightness(0.45);
    opacity: 0;
    transition: opacity 1.5s ease;
}

.hero-slide.active { opacity: 1; }

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    margin-top: 14px;
    opacity: 0.8;
}

/* === FOOTER === */
footer {
    background-color: #0a0a0a;
    padding: 36px 40px;
    text-align: center;
}

.footer-icons {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.footer-icons a { font-size: 1.1rem; }

.footer-copy {
    font-size: 0.72rem;
    font-weight: 300;
    opacity: 0.45;
    letter-spacing: 0.05em;
}

/* === SECCIONES INTERNAS === */
.page-section {
    min-height: 100vh;
    padding: 130px 40px 80px;
    max-width: 860px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    padding-bottom: 16px;
}

.section-text {
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.85;
    opacity: 0.82;
}

/* === TIMELINE (formación) === */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 0;
    width: 1px;
    background-color: rgba(255,255,255,0.18);
}

.timeline-item {
    position: relative;
    margin-bottom: 44px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #fff;
}

.timeline-date {
    font-size: 0.78rem;
    opacity: 0.45;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-sub {
    font-size: 0.9rem;
    opacity: 0.65;
    font-weight: 300;
}

/* === HABILIDADES === */
.skill-group { margin-bottom: 56px; }

.skill-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tags li {
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.03em;
}


/* === PORTFOLIO === */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 8px;
}

.portfolio-card {
    border: 1px solid rgba(255,255,255,0.1);
    padding: 28px 24px;
    border-radius: 3px;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.portfolio-card:hover {
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-4px);
}

.card-tag {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.45;
    margin-bottom: 12px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.card-desc {
    font-size: 0.83rem;
    font-weight: 300;
    line-height: 1.65;
    opacity: 0.68;
}

/* === HERO PEQUEÑO (páginas internas) === */
.hero-small { height: 55vh; }

/* === SOBRE MÍ === */
.sobre-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 64px;
    align-items: start;
}

.sobre-foto {
    position: sticky;
    top: 100px;
}

.sobre-foto img {
    width: 280px;
    height: 380px;
    object-fit: cover;
    object-position: center top;
    filter: grayscale(100%);
    border: 1px solid rgba(255,255,255,0.2);
    display: block;
}

.sobre-datos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
    margin-top: 44px;
}

.dato-item {
    display: flex;
    flex-direction: column;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.dato-label {
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.4;
    margin-bottom: 4px;
}

.dato-valor {
    font-size: 0.92rem;
    font-weight: 300;
}

/* === FORMACIÓN === */
.formacion-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.col-title {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.4;
    margin-bottom: 36px;
}

/* === PORTFOLIO GRID === */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
    display: block;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    filter: grayscale(30%);
    display: block;
}

.portfolio-item:hover img {
    transform: scale(1.04);
    filter: grayscale(0%);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.1) 55%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.portfolio-item:hover .portfolio-overlay { opacity: 1; }

.overlay-tag {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.55;
    margin-bottom: 8px;
}

.overlay-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.overlay-desc {
    font-size: 0.8rem;
    font-weight: 300;
    opacity: 0.8;
    line-height: 1.5;
}

/* === PORTFOLIO DETALLE === */
.detail-hero-img {
    width: 100%;
    height: 65vh;
    object-fit: cover;
    display: block;
    filter: grayscale(100%) brightness(0.4);
}

.detail-section {
    max-width: 760px;
    margin: 0 auto;
    padding: 56px 40px 80px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.45;
    margin-bottom: 48px;
    transition: opacity 0.3s ease;
}

.back-link:hover { opacity: 1; }

.detail-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 28px;
    letter-spacing: -0.02em;
}

.detail-desc {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.85;
    opacity: 0.78;
    margin-bottom: 44px;
}

.detail-meta {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
    padding: 28px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 40px;
}

.meta-item { display: flex; flex-direction: column; gap: 5px; }

.meta-label {
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.38;
}

.meta-value { font-size: 0.9rem; font-weight: 300; }

.detail-link {
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 12px 32px;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.detail-link:hover {
    background: white;
    color: black;
    border-color: white;
    opacity: 1;
}

.detail-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* === TOGGLE TEMA === */
#theme-toggle {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    margin-left: 16px;
    opacity: 0.65;
    transition: opacity 0.3s ease;
    line-height: 1;
}
#theme-toggle:hover { opacity: 1; }

/* === BOTÓN VOLVER ARRIBA === */
#scroll-top {
    position: fixed;
    bottom: 36px;
    right: 36px;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease, color 0.3s ease;
    z-index: 90;
    pointer-events: none;
}

#scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#scroll-top:hover { background: #fff; color: #000; }

body.light-mode #scroll-top { border-color: rgba(0,0,0,0.3); color: #111; }
body.light-mode #scroll-top:hover { background: #111; color: #fff; border-color: #111; }

/* === SELECTOR DE IDIOMA === */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 12px;
}

.lang-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    font-family: 'Outfit', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    padding: 2px 5px;
    transition: color 0.3s ease;
    line-height: 1;
}

.lang-btn:hover,
.lang-btn.active {
    color: #fff;
}

body.light-mode .lang-btn { color: rgba(0,0,0,0.3); }
body.light-mode .lang-btn:hover,
body.light-mode .lang-btn.active { color: #111; }

/* === MODO CLARO === */
body.light-mode {
    background-color: #f8f8f8;
    color: #111;
}
body.light-mode a { color: #111; }
body.light-mode nav::before {
    background-color: rgba(248,248,248,0.95);
    backdrop-filter: blur(10px);
    border-bottom-color: rgba(0,0,0,0.08);
}
body.light-mode .nav-links a,
body.light-mode .nav-icons a { color: #111; }
body.light-mode .hero-title,
body.light-mode .hero-subtitle { color: #fff; }
body.light-mode footer { background-color: #efefef; }
body.light-mode .footer-copy,
body.light-mode .footer-icons a { color: #111; }
body.light-mode .timeline::before { background-color: rgba(0,0,0,0.12); }
body.light-mode .timeline-item::before { background-color: #111; }
body.light-mode .skill-tags li { border-color: rgba(0,0,0,0.2); }
body.light-mode .dato-item,
body.light-mode .info-item { border-bottom-color: rgba(0,0,0,0.08); }
body.light-mode .section-title { border-bottom-color: rgba(0,0,0,0.1); }
body.light-mode .back-link { color: #111; }
body.light-mode .detail-link {
    border-color: rgba(0,0,0,0.4);
    color: #111;
}
body.light-mode .detail-link:hover {
    background: #111;
    color: #fff;
    border-color: #111;
}
body.light-mode .form-input {
    color: #111;
    border-bottom-color: rgba(0,0,0,0.2);
}
body.light-mode .form-input:focus { border-bottom-color: rgba(0,0,0,0.7); }
body.light-mode .form-btn {
    color: #111;
    border-color: rgba(0,0,0,0.4);
}
body.light-mode .form-btn:hover { background: #111; color: #fff; }

/* === CONTACTO === */
.contacto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}
.form-group { margin-bottom: 28px; }
.form-label {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.4;
    margin-bottom: 10px;
}
.form-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding: 10px 0;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 300;
    outline: none;
    transition: border-color 0.3s ease;
}
.form-input:focus { border-bottom-color: rgba(255,255,255,0.7); }
.form-textarea { resize: none; height: 130px; }
.form-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 12px 32px;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.3s ease, color 0.3s ease;
}
.form-btn:hover { background: #fff; color: #000; }

.form-error {
    font-size: 0.88rem;
    font-weight: 300;
    line-height: 1.5;
    color: #ff8a80;
    margin-bottom: 28px;
}
body.light-mode .form-error { color: #c62828; }
/* Honeypot: fuera de pantalla (con display:none algunos bots lo detectan) */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.info-item {
    display: flex;
    flex-direction: column;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    gap: 4px;
}
.contacto-social {
    display: flex;
    gap: 20px;
    margin-top: 32px;
    font-size: 1.1rem;
}

/* === HAMBURGER === */
#hamburger {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

body.light-mode #hamburger { color: #111; }

/* Con el menú mobile abierto, la página de atrás no scrollea */
body.menu-open { overflow: hidden; }

/* En pantallas táctiles no hay hover: el texto de las cards se ve siempre */
@media (hover: none), (max-width: 768px) {
    .portfolio-overlay { opacity: 1; }
    .portfolio-item img { filter: none; }
}

/* Pantallas medianas: el nav completo no entra, achicamos y sacamos
   las redes (siguen en el footer) */
.nav-links a { white-space: nowrap; }

@media (max-width: 1024px) {
    nav { padding: 24px 28px; }
    .nav-links { gap: 18px; }
    .nav-icons > a { display: none; }
}

/* === RESPONSIVE MOBILE === */
@media (max-width: 768px) {

    /* NAV */
    nav {
        padding: 20px 24px;
    }

    #hamburger { display: block; }

    .nav-links {
        display: none;
        flex-direction: column;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.97);
        justify-content: center;
        align-items: center;
        gap: 36px;
        z-index: 99;
    }

    .nav-links.nav-open { display: flex; }

    .nav-links a {
        font-size: 1.5rem;
        font-weight: 300;
        letter-spacing: 0.08em;
    }

    body.light-mode .nav-links {
        background: rgba(248, 248, 248, 0.98);
    }

    /* HERO */
    .hero-small { height: 45vh; }

    /* SECCIONES */
    .page-section {
        padding: 80px 24px 60px;
    }

    /* SOBRE MÍ */
    .sobre-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .sobre-foto { position: static; }

    .sobre-foto img {
        width: 100%;
        height: 300px;
    }

    .sobre-datos {
        grid-template-columns: 1fr;
    }

    /* FORMACIÓN */
    .formacion-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    /* PORTFOLIO */
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-item {
        aspect-ratio: 16/9;
    }

    /* CONTACTO */
    .contacto-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    /* DETALLE */
    .detail-hero-img { height: 40vh; }

    .detail-section {
        padding: 40px 24px 60px;
    }

    .detail-meta { gap: 24px; }

    /* FOOTER */
    footer { padding: 28px 24px; }

    .lang-btn { font-size: 0.75rem; padding: 10px 6px; }
    #theme-toggle { padding: 10px; margin-left: 4px; font-size: 1.1rem; }

    /* PORTFOLIO: overlay más compacto para que entre en la card */
    .portfolio-overlay { padding: 20px; }
    .overlay-title { font-size: 1.15rem; }

    /* BOTÓN VOLVER ARRIBA */
    #scroll-top { bottom: 20px; right: 20px; }
}