/* =========================================
   Variables
   ========================================= */
:root {
    --bg-color: #080808; /* Un poco más oscuro */
    --text-color: #f8f8f8;
    --text-muted: #999999;
    --accent-color: #ffffff;
    --border-color: #222222;
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-slow: 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =========================================
   Reset & Base
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none; /* Ocultar cursor por defecto en computadoras */
}

/* Fallback para mostrar ratón en pantallas táctiles o donde falla el custom cursor */
@media (pointer: coarse) {
    body {
        cursor: auto;
    }
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-color);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* =========================================
   Preloader
   ========================================= */
.preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg-color);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.preloader-text {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--text-color);
    letter-spacing: 5px;
    animation: pulse 1.5s infinite;
}
.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* =========================================
   Custom Cursor
   ========================================= */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none; /* Para no bloquear clicks */
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background-color 0.3s, border-color 0.3s;
    mix-blend-mode: difference;
}

.custom-cursor.hovered {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 1);
    border-color: transparent;
    mix-blend-mode: difference;
}

/* Eliminar cursor custom en móviles */
@media (max-width: 768px) {
    .custom-cursor {
        display: none;
    }
    body { cursor: auto; }
}

/* =========================================
   Typography
   ========================================= */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 400;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 4rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    font-weight: 300;
}

/* =========================================
   Navigation
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    z-index: 100;
    background: transparent;
    transition: background var(--transition), padding var(--transition);
}

.navbar.scrolled {
    background: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 5%;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links li a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-color);
    transition: width var(--transition);
}

.nav-links li a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger .bar {
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    transition: 0.3s;
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: linear-gradient(rgba(8, 8, 8, 0.4), rgba(8, 8, 8, 0.9)),
                url('assets/gallery/photo_11.jpg') center/cover no-repeat;
    z-index: -1;
    /* El parallax se maneja por JS, pero en caso de que no, background-attachment sirve de fallback */
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 4px;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-muted);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator a {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}

/* =========================================
   Gallery (Masonry) Section
   ========================================= */
.gallery-section {
    padding: 5rem 5%;
}

/* Gallery Filters */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 4rem;
}
.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    padding-bottom: 5px;
    transition: color var(--transition);
}
.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 0; height: 1px;
    background: var(--text-color);
    transition: width var(--transition);
}
.filter-btn:hover, .filter-btn.active {
    color: var(--text-color);
}
.filter-btn.active::after {
    width: 100%;
}

.masonry-grid {
    column-count: 3;
    column-gap: 1.5rem;
}

.grid-item {
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    width: 100%;
    overflow: hidden;
    cursor: pointer;
    break-inside: avoid;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.grid-item.hidden {
    display: none;
}

/* Efecto hover premium en imagen */
.gallery-img {
    width: 100%;
    transform: scale(1);
    filter: grayscale(80%);
    transition: transform 1.2s cubic-bezier(0.165, 0.840, 0.440, 1.000), filter 1s ease;
}

.grid-item:hover .gallery-img {
    transform: scale(1.08); /* Zoom lento */
    filter: grayscale(0%); /* Vuelve el color */
}

.overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Gradiente suave inverso */
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 2rem;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.overlay-text {
    color: var(--text-color);
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.5rem;
    letter-spacing: 2px;
    transform: translateY(15px);
    transition: transform var(--transition-slow);
}

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

.grid-item:hover .overlay-text {
    transform: translateY(0);
}


/* =========================================
   Contact Section
   ========================================= */
.contact-section {
    padding: 8rem 5%;
    text-align: center;
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
}

.contact-subtitle {
    margin-bottom: 3rem;
    color: var(--text-muted);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    border-bottom-color: var(--accent-color);
}

.form-group textarea {
    resize: vertical;
}

.submit-btn {
    align-self: flex-start;
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 1rem 3rem;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 1rem;
}

.submit-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.form-status {
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* =========================================
   Footer
   ========================================= */
footer {
    padding: 3rem 5%;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.social-links a {
    margin-left: 1.5rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.social-links a:hover {
    color: var(--text-color);
}

/* =========================================
   Lightbox Modal
   ========================================= */
.lightbox {
    position: fixed;
    z-index: 1000;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 1rem;
    user-select: none;
    transition: color var(--transition);
    z-index: 1001;
}
.lightbox-arrow:hover { color: #fff; }
.prev-arrow { left: 2%; }
.next-arrow { right: 2%; }

.lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    transform: scale(0.9);
    transition: transform 0.4s ease;
}

.lightbox.active .lightbox-img {
    transform: scale(1);
}

.close-lightbox {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    user-select: none;
    z-index: 1001;
}

.lightbox-info {
    text-align: center;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
}

.lightbox.active .lightbox-info {
    opacity: 1;
    transform: translateY(0);
}

.lightbox-caption {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.lightbox-exif {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: #999;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.lightbox-counter {
    font-family: var(--font-body);
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: #555;
}

/* =========================================
   Scroll Reveal Animations
   ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal.delay-1 { transition-delay: 0.2s; }
.reveal.delay-2 { transition-delay: 0.4s; }
.reveal.delay-3 { transition-delay: 0.6s; }


/* =========================================
   Animations & Responsive
   ========================================= */

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}

@media (max-width: 900px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .masonry-grid {
        column-count: 1;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(13, 13, 13, 0.95);
        padding: 2rem 0;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(2) {
        transform: translateY(-7px) rotate(-45deg);
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .social-links a {
        margin: 0 0.8rem;
    }
}
