/* menu */
.menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100svh;
    clip-path: circle(0% at 50% 50%);
    background-color: var(--base-500);
    overflow: hidden;
    padding: 1rem;
    z-index: 100;
    pointer-events: none;
}

.menu-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    border-radius: 2rem;
}

@media (max-width: 1000px) {
    .menu-wrapper {
        background-color: #1F1D1D;
    }

    /* Ensure the desktop background slider images don't push down mobile layout */
    .hover-slider-image-wrap {
        display: none;
    }
}

.col {
    position: relative;
    height: 100%;
    display: flex;
}

.col-1 {
    flex: 3;
    padding: 1rem 2rem;
}

.col-2 {
    flex: 2;
    align-items: flex-end;
    padding: 0 2rem 1rem 2rem;
}

.link {
    position: relative;
    pointer-events: auto;
}

.link a h2 {
    text-decoration: none;
    color: var(--base-300);
    font-size: 3.5rem;
    /* Reduced from 4rem */
    line-height: 1.1;
    pointer-events: auto;
    transition: color 0.3s ease-out;
}

.link a h2:hover {
    color: var(--base-100);
}

/* ==================== STAGGERED TEXT ANIMATION STRUCT ==================== */
/* These classes are applied by JS to split text for both mobile (entering) and desktop (hovering) */
.word-stagger-hover {
    position: relative;
    display: inline-block;
    transform-origin: bottom;
    overflow: hidden;
    vertical-align: top;
    cursor: pointer;
}

.char-wrap {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

/* Primary text character (starts visible, moves up on hover/enter) */
.char-inner {
    display: inline-block;
    opacity: 0.5;
    /* Matches opacity-20/50 in React */
    transform: translateY(0%);
    will-change: transform;
}

/* Secondary text character (starts hidden below, moves up on hover/enter) */
.char-inner-absolute {
    position: absolute;
    left: 0;
    top: 0;
    display: inline-block;
    opacity: 1;
    /* Match opacity-100 in React */
    transform: translateY(110%);
    will-change: transform;
    color: var(--base-100);
}

/* ==================== DESKTOP HOVER ANIMATIONS ==================== */
@media (min-width: 1001px) {

    /* Background Image Slider Wrap */
    .hover-slider-image-wrap {
        position: absolute;
        top: 2rem;
        bottom: 2rem;
        right: 2rem;
        width: calc(40% - 2rem);
        /* Matches the relative width of the right column (flex: 2) */
        border-radius: 1rem;
        overflow: hidden;
        z-index: 0;
        pointer-events: none;
        display: grid;
    }

    .hover-slider-image-wrap::after {
        content: '';
        position: absolute;
        inset: 0;
        /* Custom gradient: #1F1D1D solid on the left, fading transparent towards the right */
        background: linear-gradient(to right, #1F1D1D 0%, rgba(31, 29, 29, 0.4) 50%, rgba(31, 29, 29, 0) 100%);
        z-index: 1;
    }

    .hover-slider-img {
        grid-area: 1 / 1 / 2 / 2;
        width: 100%;
        height: 100%;
        object-fit: cover;
        /* Initial state hidden (matching hidden clipPathVariants) */
        clip-path: polygon(0% 0%, 100% 0%, 100% 0%, 0% 0px);
        transform: scale(1.05);
        /* Slight zoom for smoothness */
        z-index: 0;
    }

    .hover-slider-img.active {
        /* Active state visible (matching visible clipPathVariants) */
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
        transform: scale(1);
    }

    /* Bring wrapper content above the absolute images */
    .menu-wrapper {
        background-color: transparent;
        z-index: 2;
    }
}


.socials {
    width: 50%;
    display: flex;
    gap: 2em;
}

.socials .sub-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1.5rem;
    /* Reduced from 2rem */
}

.menu-meta {
    color: var(--base-100);
}

.socials .sub-col p {
    position: relative;
    margin-bottom: 0.25rem;
}

.menu-meta>p:first-child {
    color: var(--base-400);
    margin-bottom: 1rem;
}

.socials-horizontal {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Mobile specific overrides for contact buttons */
@media (max-width: 1000px) {
    .socials-horizontal .btn {
        width: 3.2rem;
        height: 3.2rem;
        padding: 0;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        background: #BDB6AE;
        /* match menu-btn backdrop */
        /* Quitar backdrop-filter que interfiere con el fondo sólido */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .socials-horizontal .btn .circle {
        transform: scale(1) translate(-50%, -50%) !important;
        translate: none !important;
        width: 2.7rem !important;
        /* inner dark circle size matching menu-btn */
        height: 2.7rem !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        margin: 0 !important;
        border-radius: 50% !important;
        background-color: #1F1D1D !important;
        /* Dark center circle */
        transition: width 0.3s ease, height 0.3s ease;
    }

    .socials-horizontal .btn:hover .circle,
    .socials-horizontal .btn:active .circle {
        width: 2.7rem !important;
        /* maintain shape on hover/touch */
        border-radius: 50% !important;
    }

    .socials-horizontal .btn .icon {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        translate: none !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 2 !important;
        color: #ffffff !important;
        width: 1.4rem !important;
        /* icon scale matching menu-btn */
        height: 1.4rem !important;
    }

    .socials-horizontal .btn .icon svg {
        width: 100%;
        height: 100%;
    }

    .socials-horizontal .btn:hover .icon,
    .socials-horizontal .btn.hover .icon {
        transform: translate(-50%, -50%);
        /* Prevent hover offset */
    }

    .socials-horizontal .btn .button-text {
        display: none;
        /* Hide text on mobile */
    }

    /* Icon Animations */
    .socials-horizontal .btn:first-child .icon {
        /* PBX Button Vibration */
        animation: pbxVibrate 2s cubic-bezier(.36, .07, .19, .97) infinite !important;
        transform-origin: center center !important;
    }

    .socials-horizontal .btn:nth-child(2) .icon {
        /* Correo Button Levitate */
        animation: correoLevitate 3s ease-in-out infinite !important;
    }
}

@keyframes pbxVibrate {

    0%,
    20%,
    40%,
    60%,
    80%,
    100% {
        transform: translate(-50%, -50%) rotate(0deg) !important;
    }

    2%,
    6%,
    10%,
    14%,
    18% {
        transform: translate(-50%, -50%) rotate(-10deg) scale(1.1) !important;
    }

    4%,
    8%,
    12%,
    16% {
        transform: translate(-50%, -50%) rotate(10deg) scale(1.1) !important;
    }
}

@keyframes correoLevitate {

    0%,
    100% {
        transform: translate(-50%, -50%) !important;
    }

    50% {
        transform: translate(-50%, calc(-50% - 4px)) !important;
    }
}


/* SplitText mask styles */
.split-line {
    overflow: hidden;
    will-change: transform;
    pointer-events: auto;
}

@media (max-width: 1000px) {
    .link a h2 {
        font-size: 2.25rem;
        line-height: 1.2;
    }

    .col-2 {
        flex-direction: column;
        align-items: flex-start;
    }

    .socials {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 10rem;
    }

    .socials .sub-col {
        flex: 1;
    }

    .menu-commissions {
        display: none;
    }
}
