* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0b0f19;
    color: #f8fafc;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 32px 7%;
    background:
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.18), transparent 35%),
        radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.15), transparent 35%),
        #0b0f19;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.nav-links {
    display: flex;
    gap: 28px;
    color: #94a3b8;
}

.nav-links a {
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #ffffff;
}

.hero-content {
    max-width: 850px;
    padding: 100px 0;
}

.eyebrow {
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

h1 {
    font-size: clamp(4rem, 12vw, 9rem);
    line-height: 0.9;
    letter-spacing: -0.06em;
    margin-bottom: 28px;
}

.hero-text {
    max-width: 650px;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: #cbd5e1;
}

.hero-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 38px;
}

.button {
    padding: 13px 22px;
    border: 1px solid #334155;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.button:hover {
    background: #ffffff;
    color: #0b0f19;
    border-color: #ffffff;
}

section {
    padding: 110px 7%;
}

.section-header {
    max-width: 750px;
    margin-bottom: 55px;
}

.section-label {
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

h2 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.hobbies {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.hobby {
    min-height: 360px;
    padding: 42px;
    border: 1px solid #1e293b;
    border-radius: 28px;
    background: #111827;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.hobby:hover {
    transform: translateY(-6px);
    border-color: #475569;
}

.hobby-icon {
    font-size: 3rem;
    margin-bottom: auto;
}

.hobby h3 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.hobby p {
    color: #94a3b8;
}

footer {
    padding: 40px 7%;
    border-top: 1px solid #1e293b;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

@media (max-width: 800px) {
    .hero {
        padding: 24px;
    }

    .nav-links {
        display: none;
    }

    section {
        padding: 80px 24px;
    }

    .hobbies {
        grid-template-columns: 1fr;
    }

    .hobby {
        min-height: 300px;
        padding: 30px;
    }

    footer {
        padding: 30px 24px;
    }
}

/* Galería de fotografía */

.photo-card {
    overflow: hidden;
}

.photo-card img {
    display: block;
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 18px;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.photo-card:hover img {
    transform: scale(1.04);
    filter: brightness(1.08);
}

@media (max-width: 800px) {
    .photo-card img {
        height: 220px;
    }
}

/* Galería fotográfica */

#photo-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

#photo-gallery .photo-card {
    min-height: auto;
    padding: 0;
    overflow: hidden;
}

#photo-gallery .photo-card img {
    width: 100%;
    height: 420px;
    display: block;
    object-fit: cover;
    border-radius: 24px;
}

#photo-gallery .photo-card h3 {
    padding: 20px 20px 24px;
    font-size: 1.3rem;
}

@media (max-width: 800px) {

    #photo-gallery {
        grid-template-columns: 1fr;
    }

    #photo-gallery .photo-card img {
        height: 300px;
    }

}

/* Visor de fotografías */

.photo-viewer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: zoom-out;
}

.photo-viewer img {
    max-width: 94vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
}

.viewer-close {
    position: absolute;
    top: 24px;
    right: 28px;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.viewer-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

@media (max-width: 800px) {

    .photo-viewer {
        padding: 15px;
    }

    .photo-viewer img {
        max-width: 96vw;
        max-height: 86vh;
    }

    .viewer-close {
        top: 15px;
        right: 15px;
    }

}

/* Filtros de fotografía */

.photo-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 36px;
}

.filter-button {
    padding: 11px 20px;
    border: 1px solid #334155;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    font: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-button:hover {
    color: #ffffff;
    border-color: #64748b;
}

.filter-button.active {
    background: #ffffff;
    color: #0b0f19;
    border-color: #ffffff;
}

@media (max-width: 800px) {

    .photo-filters {
        gap: 8px;
        margin-bottom: 28px;
    }

    .filter-button {
        padding: 10px 16px;
    }

}

/* Filtros de fotografía - tamaño grande */

.filter-button {
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 500;
    min-height: 48px;
}

@media (max-width: 800px) {

    .filter-button {
        padding: 14px 22px;
        font-size: 1rem;
        min-height: 50px;
    }

}

/* Ajuste para móviles pequeños */

@media (max-width: 500px) {

    .filter-button {
        padding: 11px 16px;
        min-height: 44px;
        font-size: 0.92rem;
    }

}

/* Navegación del visor */

.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.viewer-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.viewer-prev {
    left: 28px;
}

.viewer-next {
    right: 28px;
}

@media (max-width: 800px) {

    .viewer-nav {
        width: 48px;
        height: 48px;
        font-size: 2.5rem;
    }

    .viewer-prev {
        left: 12px;
    }

    .viewer-next {
        right: 12px;
    }

}

/* Asegurar que las flechas quedan por encima de la fotografía */

.viewer-nav {
    z-index: 10001;
}

.viewer-close {
    z-index: 10002;
}


.viewer-nav {
    position: fixed !important;
    top: 50% !important;
    z-index: 99999 !important;
    width: 70px !important;
    height: 70px !important;
    background: white !important;
    color: black !important;
    border: 2px solid white !important;
    border-radius: 50% !important;
    font-size: 48px !important;
    line-height: 70px !important;
    text-align: center !important;
    padding: 0 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.viewer-prev {
    left: 25px !important;
}

.viewer-next {
    right: 25px !important;
}


/* Estilo definitivo de las flechas del visor */

.viewer-nav {
    width: 56px !important;
    height: 56px !important;
    background: rgba(255, 255, 255, 0.14) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    font-size: 42px !important;
    line-height: 56px !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s ease, transform 0.2s ease;
}

.viewer-nav:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    transform: translateY(-50%) scale(1.06);
}

.viewer-prev {
    left: 24px !important;
}

.viewer-next {
    right: 24px !important;
}

@media (max-width: 800px) {

    .viewer-nav {
        width: 50px !important;
        height: 50px !important;
        font-size: 36px !important;
        line-height: 50px !important;
    }

    .viewer-prev {
        left: 12px !important;
    }

    .viewer-next {
        right: 12px !important;
    }

}

/* Ajuste final de tamaño y posición de las flechas */

.viewer-nav {
    width: 45px !important;
    height: 45px !important;
    font-size: 32px !important;
    line-height: 45px !important;
}

.viewer-prev {
    left: 30px !important;
}

.viewer-next {
    right: 30px !important;
}

@media (max-width: 800px) {

    .viewer-nav {
        width: 40px !important;
        height: 40px !important;
        font-size: 29px !important;
        line-height: 40px !important;
    }

    .viewer-prev {
        left: 18px !important;
    }

    .viewer-next {
        right: 18px !important;
    }

}

/* Gestos táctiles del visor */

.photo-viewer {
    touch-action: none;
    overscroll-behavior: contain;
}


/* Título de la fotografía en el visor */

.viewer-caption {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 10001;
    max-width: 80%;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    font-size: 1rem;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 800px) {

    .viewer-caption {
        bottom: 20px;
        max-width: 75%;
        font-size: 0.9rem;
        padding: 7px 15px;
    }

}

/* Mejora del título en el visor */

.viewer-caption {
    bottom: 30px;
    max-width: 85%;
    padding: 10px 22px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

@media (max-width: 800px) {
    .viewer-caption {
        bottom: 22px;
        max-width: 82%;
        padding: 9px 17px;
        font-size: 1.05rem;
    }
}


.photo-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination-button {
    min-width: 46px;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: transparent;
    color: #94a3b8;
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-button:hover {
    color: #ffffff;
    border-color: #64748b;
    background: rgba(255, 255, 255, 0.06);
}

.pagination-button.active {
    background: #ffffff;
    color: #0b0f19;
    border-color: #ffffff;
}

@media (max-width: 500px) {
    .photo-pagination {
        margin-top: 30px;
        gap: 8px;
    }

    .pagination-button {
        min-width: 42px;
        height: 42px;
    }
}

body:has(#galeria) .hero {
    min-height: auto;
}

body:has(#galeria) .hero-content {
    padding: 70px 0 50px;
}

/* Cabecera compacta de la galería fotográfica */

body:has(#galeria) .hero {
    padding-top: 24px;
    padding-bottom: 24px;
}

body:has(#galeria) .hero-content {
    padding: 35px 0 30px;
}

body:has(#galeria) .hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    margin-bottom: 18px;
}

body:has(#galeria) .hero-content .hero-text {
    font-size: 1.1rem;
}

body:has(#galeria) section {
    padding-top: 40px;
}
