/* =========================================
           NAVEGACIÓN / HEADER
           ========================================= */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem var(--spacing-container);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    color: var(--color-text-light);
    transition: background-color 0.3s ease, padding 0.3s ease;
}

header.scrolled {
    background-color: #2c2e305c;
    backdrop-filter: blur(10px);
    padding: 1rem var(--spacing-container);
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    z-index: 1001;
}


/* --- Hamburger Toggle --- */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    touch-action: manipulation;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 1.5px;
    background-color: var(--color-text-light);
    transition: all 0.35s ease;
    transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Fullscreen Overlay Menu --- */
.menu-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(44, 46, 48, 0.97);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
    overflow-y: auto;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.menu-overlay-inner {
    width: 100%;
    max-width: 900px;
    padding: 6rem var(--spacing-container) 3rem;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* Nav links in 2 columns */
.menu-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 6rem;
}

.menu-nav a {
    font-family: var(--font-sans);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--color-text-light);
    text-decoration: none;
    padding: 1rem 0;
    display: block;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

.menu-overlay.active .menu-nav a {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for each link */
.menu-nav a:nth-child(1) {
    transition-delay: 0.08s;
}

.menu-nav a:nth-child(2) {
    transition-delay: 0.14s;
}

.menu-nav a:nth-child(3) {
    transition-delay: 0.20s;
}

.menu-nav a:nth-child(4) {
    transition-delay: 0.26s;
}

.menu-nav a:nth-child(5) {
    transition-delay: 0.32s;
}

.menu-nav a:nth-child(6) {
    transition-delay: 0.38s;
}

.menu-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

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

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

/* Menu credit editorial */
.menu-credit {
    font-family: var(--font-sans);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.8px;
}

.menu-credit a {
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    transition: color 0.3s ease;
}

.menu-credit a:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Misterfront Menu animations */
.menu-overlay .mf-char,
.menu-overlay .mf-logo-full {
    opacity: 0;
}
.menu-overlay.active .mf-char:nth-child(1) { animation: mfRevealGroup 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.60s forwards; }
.menu-overlay.active .mf-char:nth-child(2) { animation: mfRevealGroup 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.65s forwards; }
.menu-overlay.active .mf-char:nth-child(3) { animation: mfRevealGroup 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.70s forwards; }
.menu-overlay.active .mf-char:nth-child(4) { animation: mfRevealGroup 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.75s forwards; }
.menu-overlay.active .mf-char:nth-child(5) { animation: mfRevealGroup 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.80s forwards; }
.menu-overlay.active .mf-char:nth-child(6) { animation: mfRevealGroup 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.85s forwards; }
.menu-overlay.active .mf-char:nth-child(7) { animation: mfRevealGroup 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.90s forwards; }
.menu-overlay.active .mf-char:nth-child(8) { animation: mfRevealGroup 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.95s forwards; }
.menu-overlay.active .mf-char:nth-child(9) { animation: mfRevealGroup 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 1.00s forwards; }
.menu-overlay.active .mf-char:nth-child(10) { animation: mfRevealGroup 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 1.05s forwards; }
.menu-overlay.active .mf-char:nth-child(11) { animation: mfRevealGroup 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 1.10s forwards; }
.menu-overlay.active .mf-logo-full { animation: mfRevealGroup 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 1.20s forwards; }

/* Menu footer area */
.menu-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2.5rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease 0.4s, transform 0.4s ease 0.4s;
}

.menu-overlay.active .menu-footer {
    opacity: 1;
    transform: translateY(0);
}

.menu-office {
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.8;
}

.menu-office strong {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    display: block;
    margin-bottom: 0.3rem;
}

.menu-bottom-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.menu-credit {
    margin-right: auto;
}

/* Language toggle */
.menu-lang {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
}

.menu-lang a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.3s ease;
}

.menu-lang a:hover,
.menu-lang a.active {
    color: var(--color-text-light);
}

/* Instagram icon */
.menu-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.3s ease;
}

.menu-social a:hover {
    border-color: var(--color-text-light);
    color: var(--color-text-light);
}

.menu-social svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

@media (max-width: 600px) {
    .menu-nav {
        grid-template-columns: 1fr !important;
        gap: 0;
    }

    .menu-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .menu-nav a {
        padding: 0.5rem 0;
        display: inline-block;
    }
}
