/* 
    GATEWAY STYLES (Split Screen)
    Dual-Track Portfolio
*/

.gateway-container {
    display: flex;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    position: relative;
    background: #000;
}

.side-canvas {
    position: absolute;
    top: 0;
    width: 50vw;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
    transition: opacity 0.5s;
}

@media (max-width: 1024px) {
    .side-canvas {
        width: 100% !important;
        height: 50% !important;
        opacity: 0.9 !important; /* Maximum clarity on mobile */
    }
    #ml-canvas { top: 50%; right: 0; }
}

#fs-canvas { left: 0; }
#ml-canvas { right: 0; }

.side:hover ~ .side-canvas {
    opacity: 0.8;
}

.side {
    position: relative;
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: flex 0.8s var(--ease-out-expo), filter 0.5s;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
}

/* Side Backgrounds / Overlays */
.side::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.3;
    transition: opacity 0.5s;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

/* Full Stack Side */
.side-fullstack {
    border-right: 1px solid var(--border-glass);
}
.side-fullstack::before {
    background: radial-gradient(circle at 30% 50%, rgba(var(--fs-accent-rgb), 0.2), transparent 70%),
                linear-gradient(45deg, #050505 0%, #001a1d 100%);
}

/* Machine Learning Side */
.side-ml::before {
    background: radial-gradient(circle at 70% 50%, rgba(var(--ml-accent-rgb), 0.2), transparent 70%),
                linear-gradient(-45deg, #050505 0%, #1a001d 100%);
}

/* Hover Interaction: Desktop */
@media (min-width: 1025px) {
    .gateway-container:hover .side {
        flex: 0.4;
        filter: grayscale(0.8) blur(2px);
    }

    .side:hover {
        flex: 0.6 !important;
        filter: grayscale(0) blur(0) !important;
    }

    .side:hover::before {
        opacity: 0.6;
    }
}

/* Central UI & Divider */
.glow-divider {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 80vh;
    background: white;
    z-index: 10;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    transition: all 0.5s var(--ease-out-expo);
}

.central-ui {
    position: absolute;
    left: 50%;
    top: 5dvh;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
    text-align: center;
    width: auto;
    animation: headerAppear 1.2s var(--ease-out-expo) forwards;
}

@keyframes headerAppear {
    from { opacity: 0; transform: translate(-50%, -20px) blur(10px); }
    to { opacity: 1; transform: translate(-50%, 0) blur(0); }
}

.welcome-message {
    padding: 10px 30px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.typewriter-line {
    overflow: hidden;
    white-space: normal; /* Allow wrapping on mobile */
    margin: 0 auto;
    letter-spacing: 4px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    width: 100%;
}

.t-1 {
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    color: var(--white);
    border-right: 3px solid var(--fs-accent);
    width: 0;
    animation: 
        typing 2s steps(11, end) forwards,
        blink-fs .75s step-end infinite;
    text-shadow: 0 0 10px rgba(var(--fs-accent-rgb), 0.5);
}

.t-2 {
    font-size: clamp(0.8rem, 2vw, 1.4rem);
    color: var(--text-dim);
    border-right: 3px solid var(--ml-accent);
    width: 0;
    margin-top: 5px;
    opacity: 0;
    animation: 
        typing 2s steps(11, end) 2.5s forwards,
        blink-ml .75s step-end infinite,
        fadeIn 1s forwards 2.5s;
    text-shadow: 0 0 10px rgba(var(--ml-accent-rgb), 0.5);
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-fs {
    from, to { border-color: transparent }
    50% { border-color: var(--fs-accent) }
}

@keyframes blink-ml {
    from, to { border-color: transparent }
    50% { border-color: var(--ml-accent) }
}

/* Floating Socials */
.floating-socials {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 25px;
    border-radius: 40px;
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-glass);
    transition: var(--transition-smooth);
}

.floating-socials a {
    color: var(--text-dim);
    font-size: 1.3rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-socials a:hover {
    color: var(--white);
    transform: translateY(-3px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Stats Overlay */
.side-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s 0.2s var(--ease-out-expo);
}

.side:hover .side-stats {
    opacity: 1;
    transform: translateY(0);
}

.stat-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-dim);
    border-left: 2px solid;
    padding-left: 10px;
}

.fs-stats .stat-item { border-color: var(--fs-accent); }
.ml-stats .stat-item { border-color: var(--ml-accent); }

/* Floating Socials */
.floating-socials {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
}

.floating-socials a {
    color: var(--text-dim);
    font-size: 1.2rem;
    transition: color 0.3s;
}

.floating-socials a:hover {
    color: var(--white);
}

/* Side Content adjustments */
.side-content {
    position: relative;
    z-index: 5;
    text-align: center;
    pointer-events: none;
    transform: translateY(0);
    transition: transform 0.6s var(--ease-out-expo);
}

.side:hover .side-content {
    transform: translateY(-20px);
}

.side-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    text-transform: uppercase;
    letter-spacing: -2px;
    margin-bottom: 1rem;
    color: var(--white);
    line-height: 0.9;
}

.side-fullstack .side-title {
    text-shadow: 0 0 20px rgba(var(--fs-accent-rgb), 0.5);
}

.side-ml .side-title {
    text-shadow: 0 0 20px rgba(var(--ml-accent-rgb), 0.5);
}

.side-desc {
    font-weight: 500;
    color: var(--text-dim);
    font-size: 1.1rem;
    max-width: 300px;
    margin: 0 auto;
}

.side-cta {
    margin-top: 30px;
    padding: 12px 30px;
    border: 1px solid var(--white);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s var(--ease-out-expo);
}

.side:hover .side-cta {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile: Premium Immersive Cards */
@media (max-width: 1024px) {
    .gateway-container {
        flex-direction: column;
    }

    .glow-divider {
        width: 80vw;
        height: 1px;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .central-ui {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100vw;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .side {
        flex: 1;
        width: 100%;
        border-right: none;
        padding: 60px 20px;
    }

    .side-fullstack {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .side-content {
        transform: translateY(0) !important;
        background: rgba(0, 0, 0, 0.6); /* Deeper Contrast */
        padding: 35px 25px;
        border-radius: 20px;
        backdrop-filter: blur(15px); /* Stronger blur for clarity */
        border: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
        max-width: 340px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }

    .side-title {
        font-size: clamp(2.2rem, 10vw, 3rem);
        margin-bottom: 0.8rem;
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }

    .side-desc {
        font-size: 0.9rem;
    }

    .side-stats {
        opacity: 1;
        transform: translateY(0);
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        margin-top: 15px;
    }

    .stat-item {
        font-size: 0.65rem;
        padding-left: 8px;
        border-left-width: 1px;
    }

    .side-cta {
        opacity: 1;
        transform: translateY(0);
        margin-top: 25px;
        padding: 10px 25px;
        font-size: 0.8rem;
        background: rgba(255, 255, 255, 0.05);
    }

    .floating-socials {
        bottom: 20px;
        padding: 8px 20px;
        scale: 0.9;
    }

    /* Small phones adjustment */
    @media (max-height: 700px) {
        .side-title { font-size: 1.8rem; }
        .side-stats { display: none; }
        .side-content { padding: 20px; }
        .side-cta { margin-top: 15px; }
    }
}
