/* ==========================================================================
   Página Principal (index.html) - Estilos Específicos
   ========================================================================== */

/* --- PANTALLA DE BIENVENIDA Y HEADER --- */
#welcome-screen { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    display: flex; justify-content: center; align-items: center; 
    background-color: var(--c-bg-primary); z-index: var(--z-welcome); 
    transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1); cursor: pointer; 
    padding: var(--space-lg); box-sizing: border-box; 
}
.welcome-text { text-align: center; transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1), text-align 1.2s ease; }
.logo {
    width: 35vw; max-width: 450px; height: auto; display: block; margin: 0 auto;
    opacity: 0; animation: fadeIn 1s ease-out 0.2s forwards;
    transition: width 1.2s cubic-bezier(0.19, 1, 0.22, 1), filter 0.3s ease-in, margin 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}
.welcome-tagline {
    font-family: var(--font-secondary); font-weight: 300; font-size: 1vw;
    letter-spacing: 8px; text-transform: uppercase; margin-top: var(--space-md);
    color: var(--c-text-primary); opacity: 0;
    animation: slideUpFadeIn 1s cubic-bezier(0.19, 1, 0.22, 1) 0.7s forwards;
    transition: font-size 1.2s cubic-bezier(0.19, 1, 0.22, 1), letter-spacing 1.2s cubic-bezier(0.19, 1, 0.22, 1), color 0.3s ease-in, margin-top 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

#welcome-screen.is-animating { background-color: var(--c-transparent); }
#welcome-screen.is-animating .welcome-text { mix-blend-mode: difference; }
#welcome-screen.is-animating .logo { filter: invert(1); }
#welcome-screen.is-animating .welcome-tagline { color: var(--c-text-inverse); }

#welcome-screen.is-header-mode { height: auto; background-color: var(--c-transparent); justify-content: flex-start; align-items: flex-start; cursor: default; pointer-events: none; }
#welcome-screen.is-header-mode .welcome-text { pointer-events: auto; text-align: left; }
#welcome-screen.is-header-mode .logo { width: 150px; margin: 0; }
#welcome-screen.is-header-mode .welcome-tagline { opacity: 1; font-size: 10px; letter-spacing: 4px; margin-top: 8px; animation: none; }

/* --- GALERÍA DE FOTOS (HOME) --- */
#photo-gallery { width: 100%; box-sizing: border-box; padding: 0; }
.gallery-grid { column-count: 3; column-gap: 0; transition: opacity 0.3s ease; font-size: 0; line-height: 0; }
.gallery-item {
    opacity: 0;
    break-inside: avoid-column;
    width: 100%;
    display: inline-block;
    vertical-align: top;
    background-color: #000;
    overflow: hidden;
}

.gallery-item img, .gallery-item video { 
    width: 100%; height: auto; object-fit: cover; display: block; 
    margin: 0; padding: 0; outline: none; border: none;
}

.gallery-item video {
    background-color: #000;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ANIMACIONES DE ENTRADA DE LA GALERÍA */
#photo-gallery.is-visible .gallery-item { opacity: 1; transform: none; }
.gallery-item:nth-child(1) { transform: translate(-100vw, 50vh) scale(1.8) rotate(-25deg); transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.5s; }
.gallery-item:nth-child(2) { transform: translateY(150vh) scale(2.5); transition: transform 1.5s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.5s; }
.gallery-item:nth-child(3) { transform: translate(100vw, 20vh) scale(1.5) rotate(20deg); transition: transform 1.3s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.5s; }
.gallery-item:nth-child(3n+4) { transform: translate(-50vw, 20vh) rotate(-15deg); transition: transform 1.5s cubic-bezier(0.19, 1, 0.22, 1) 0.5s, opacity 1s 0.5s; }
.gallery-item:nth-child(3n+5) { transform: translateY(50vh) scale(1.5); transition: transform 1.5s cubic-bezier(0.19, 1, 0.22, 1) 0.6s, opacity 1s 0.6s; }
.gallery-item:nth-child(3n+6) { transform: translate(50vw, 25vh) rotate(15deg); transition: transform 1.5s cubic-bezier(0.19, 1, 0.22, 1) 0.7s, opacity 1s 0.7s; }

/* --- FILTROS (HOME) --- */
#filter-container { position: fixed; bottom: 30px; left: 30px; z-index: var(--z-controls); display: flex; align-items: center; color: var(--c-text-inverse); opacity: 0; transition: opacity 1s ease 0.5s; }
#filter-container.is-visible { opacity: 1; }

/* --- BOTONES FIJOS (HOME) --- */
#menu-fixed { top: 40px; right: 40px; }
#contact-fixed { bottom: 200px; right: 40px; }

#filter-button { 
    font-family: var(--font-secondary); font-weight: 300; font-size: 200px; 
    line-height: 1; user-select: none; cursor: pointer; text-decoration: none; 
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), letter-spacing 0.3s ease; 
    transform-origin: center; position: relative; z-index: 103; 
    display: flex; align-items: center; justify-content: center; 
    width: 120px; height: 120px; mix-blend-mode: difference; opacity: 0.5; 
    transform: rotate(0deg); 
}
#filter-button:hover { transform: rotate(180deg); }
#filter-button.is-active { transform: rotate(135deg); }

#filter-menu { 
    position: fixed; top: 0; left: 0; height: 100vh; width: auto; 
    list-style: none; padding: 0 60px; margin: 0; 
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start; 
    opacity: 0; transform: translateX(-100%); pointer-events: none; 
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.19, 1, 0.22, 1); 
    z-index: var(--z-nav); background-color: var(--c-bg-overlay); 
}
#filter-menu.is-open { opacity: 1; transform: translateX(0); pointer-events: auto; }
#filter-menu li a { 
    position: relative;
    display: inline-block;
    font-family: var(--font-display); font-size: 64px; text-transform: uppercase; 
    letter-spacing: 2px; text-decoration: none; color: var(--c-text-inverse); 
    transition: letter-spacing 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), color 0.35s ease; line-height: 0.9; 
}
#filter-menu li a:hover {
    letter-spacing: 3.5px;
    transform: translateX(8px);
}

/* --- MENÚ OVERLAY ESPECÍFICO (HOME) --- */
.menu-wrapper {
    width: 100%;
    min-height: calc(100vh - 10vw);
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1.08fr);
    grid-template-rows: minmax(220px, 0.88fr) auto;
    column-gap: clamp(56px, 8vw, 160px);
    row-gap: clamp(24px, 4vw, 56px);
    align-items: stretch;
}

.menu-info {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    justify-self: start;
    max-width: 460px;
    padding-left: clamp(8px, 2vw, 28px);
    padding-bottom: clamp(24px, 4vh, 52px);
    box-sizing: border-box;
    position: relative;
}

.menu-brand-title {
    font-size: clamp(66px, 5.9vw, 118px);
    font-weight: 700;
    margin: 0;
    line-height: 0.94;
    letter-spacing: -0.035em;
    color: var(--c-text-inverse);
}

.menu-bio-link {
    display: inline-block;
    margin-top: 14px;
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: clamp(22px, 1.85vw, 36px);
    line-height: 1.05;
    letter-spacing: -0.01em;
    text-decoration: none;
    text-transform: none;
    color: rgba(255, 255, 255, 0.78);
    transition: color 0.35s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), letter-spacing 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu-bio-link:hover {
    color: var(--c-text-inverse);
    letter-spacing: 0;
    transform: translateX(8px);
}

.menu-author-photo {
  position: fixed;
  bottom: 30px;
  right: 40px;
  z-index: var(--z-overlay-content);
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 10%;
  display: block;
  filter: grayscale(100%) contrast(1.1);
  border: 2px solid rgba(255,255,255,0.15);
}

.social-links { margin-top: var(--space-xl); }
.social-links a {
    display: inline-block;
    font-size: 0.8rem; font-weight: 400; color: var(--c-text-secondary);
    text-decoration: none; text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: var(--space-sm); transition: color 0.35s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), letter-spacing 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.social-links a:hover { color: var(--c-text-inverse); letter-spacing: 2.6px; transform: translateX(5px); }

.menu-nav {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    width: min(100%, 760px);
    padding-top: clamp(28px, 6vh, 96px);
    padding-right: clamp(8px, 1.8vw, 22px);
}

.menu-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: clamp(10px, 1.4vw, 22px);
}

.menu-nav-item {
    overflow: visible;
    padding-right: 18px;
}

.menu-nav li a {
    position: relative;
    display: inline-block;
    font-size: clamp(54px, 4.6vw, 96px);
    font-weight: 700;
    line-height: 0.9;
    text-decoration: none;
    text-align: right;
    letter-spacing: -0.035em;
    color: var(--c-text-inverse);
    transition: color 0.35s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), letter-spacing 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: pointer;
    will-change: transform, opacity;
}

.menu-nav a:hover {
    color: var(--c-text-hover);
    letter-spacing: -0.015em;
    transform: translateX(10px);
}

.contact-info, .faq-info, .legal-info { flex: 1 1 40%; min-width: 300px; padding-right: 5vw; box-sizing: border-box; }
.contact-info h1, .faq-info h1, .legal-info h1 { font-size: 6vw; font-weight: 700; margin: 0 0 40px 0; line-height: 1.1; text-transform: none; }
.info-block p, .info-block a { color: var(--c-text-secondary); text-decoration: none; margin: 0 0 25px 0; font-size: 1rem; transition: color 0.3s ease; }
.info-block a:hover { color: var(--c-text-inverse); }
.contact-form-wrapper, .faq-content-wrapper, .legal-content-wrapper { flex: 1 1 60%; min-width: 300px; }
#contact-legal-links { margin-top: 50px; }
#contact-legal-links a { font-size: 0.8rem; color: var(--c-text-secondary); text-decoration: none; display: inline-block; margin-bottom: 10px; transition: color 0.35s ease, letter-spacing 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
#contact-legal-links a:hover { color: var(--c-text-inverse); letter-spacing: 0.4px; transform: translateX(4px); }

/* Responsive Index */
@media (max-width: 1024px) { 
    .gallery-grid { column-count: 2; } 
}

@media (max-width: 900px) {
    #menu-overlay .overlay-container {
        align-items: stretch;
        padding: clamp(110px, 14vh, 148px) 24px 110px;
    }
    #menu-close-button {
        top: 22px;
        left: 20px;
        right: auto;
        font-size: 18px;
        transform: none;
        transform-origin: center;
        mix-blend-mode: normal;
    }
    .menu-wrapper {
        min-height: calc(100svh - 220px);
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        row-gap: 42px;
    }
    .menu-nav {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        width: min(100%, 420px);
        padding-top: 0;
        padding-right: 0;
    }
    .menu-nav ul {
        align-items: flex-start;
        gap: 12px;
    }
    .menu-nav-item {
        padding-right: 0;
    }
    .menu-nav li a {
        text-align: left;
        font-size: clamp(40px, 9.8vw, 60px);
        line-height: 0.9;
    }
    .menu-info {
        grid-column: 1;
        grid-row: 2;
        align-self: end;
        justify-self: start;
        max-width: 340px;
        margin-top: auto;
        padding-left: 0;
        padding-bottom: 0;
    }
    .menu-brand-title {
        font-size: clamp(54px, 13.5vw, 88px);
        line-height: 0.94;
    }
    .menu-bio-link {
        margin-top: 8px;
        font-size: clamp(20px, 5.4vw, 30px);
    }
    .menu-author-photo {
        right: 18px;
        bottom: 18px;
        width: 68px;
        height: 68px;
    }
    .social-links { margin-top: 25px; }
    .social-links a { margin-bottom: 10px; }
    .contact-info, .faq-info, .legal-info { padding-right: 0; margin-bottom: 60px; }
    .contact-info h1, .faq-info h1, .legal-info h1 { font-size: 10vw; }
}

@media (max-width: 480px) {
    #menu-overlay .overlay-container {
        padding: 108px 20px 96px;
    }
    #menu-close-button:hover {
        transform: translateY(-2px);
    }
    .menu-wrapper {
        min-height: calc(100svh - 188px);
        row-gap: 34px;
    }
    .menu-nav li a {
        font-size: clamp(34px, 9vw, 46px);
    }
    .menu-info {
        max-width: 300px;
    }
    .menu-brand-title {
        font-size: clamp(48px, 12.5vw, 70px);
    }
    .menu-bio-link {
        font-size: clamp(19px, 5vw, 24px);
    }
}

@media (max-width: 768px) { 
    .gallery-grid { column-count: 2; }
    .welcome-tagline { font-size: 14px; letter-spacing: 4px; }
    #menu-fixed { top: 110px; }
    #contact-fixed { bottom: -25px; }
    #filter-container { left: 15px !important; bottom: 15px !important; }
    #filter-button { width: 75px !important; height: 75px !important; font-size: 75px !important; font-weight: 700 !important; }
}

/* Base button positioning */
#menu-fixed { top: 130px; }
#contact-fixed { bottom: 10px; }
#menu-close-button { top: 130px; }
#contact-close-button, #faq-close-button, #legal-close-button { bottom: 10px; }

@media (max-width: 900px) {
    #menu-close-button {
        top: 22px;
        left: 20px;
        right: auto;
        font-size: 18px;
        transform: none;
        transform-origin: center;
        mix-blend-mode: normal;
    }
}
