/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb { background: #9F361F; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #ff4500; }

/* Loader Animations */
@keyframes typing {
    0% { width: 0ch; }
    40% { width: 9ch; }
    60% { width: 9ch; }
    100% { width: 0ch; }
}

@keyframes blinkCursor {
    50% { border-color: transparent; }
}

.typing-animation {
    animation: typing 3s steps(9) infinite alternate, blinkCursor 0.7s steps(1) infinite;
}

/* Loaded State */
body.loaded #loader {
    transform: translateY(-100%);
}

/* --- PROJECTS SECTION FINAL FIX --- */

.projects-horizontal {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden; /* Bahar nikla hua content chupana zaroori hai */
    /* background-color: #050505; */
    padding: 0;
    
    /* Flexbox Layout */
    display: flex; 
    flex-direction: column; 
    justify-content: center;
}

/* Header Styling */
.section-header {
    width: 100%;
    padding: 40px 10% 20px 10%;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
    /* background-color: #050505;  */
}

.section-header h2 { 
    font-family: 'Syncopate', sans-serif; 
    font-size: 3rem; 
    color: #ffffff;
}

/* Wrapper - THE MAIN FIX */
.projects-wrapper {
    display: flex;
    gap: 60px;
    padding-left: 10%;
    padding-right: 10%;
    align-items: center;
    
    /* IMPORTANT: Width ko khula chhod diya taaki GSAP ise pura scroll kar sake */
    width: fit-content; 
    
    flex-grow: 1; /* Bachi hui vertical jagah lega */
    flex-wrap: nowrap; /* Cards ek line me rahenge */
    
    /* Native scroll band, kyunki GSAP handle karega */
    overflow: visible; 
}

/* --- Card Styles (Perfect Dimensions) --- */
.project-card {
    width: 300px;
    height: 450px;
    flex-shrink: 0;
    perspective: 1000px;
    position: relative;
}

@media (min-width: 768px) {
    .project-card {
        width: 400px;
        height: 550px;
    }
}

.card-inner {
    width: 100%;
    height: 100%;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: transform 0.4s ease, border-color 0.4s ease;
}

.project-card:hover .card-inner {
    transform: translateY(-10px);
    border-color: #9F361F;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

/* Image Window (65%) */
.img-window {
    height: 65%;
    width: 100%;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.img-window img {
    width: 100%;
    height: auto !important;
    min-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 3s ease-in-out;
}

.project-card:hover .img-window img {
    /* Smooth Scroll Up */
    transform: translateY(calc(-100% + 360px)); 
}

/* Content Window (35%) */
.card-content {
    height: 35%;
    width: 100%;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(to top, #0a0a0a, #151515);
    z-index: 2;
    flex-shrink: 0;
}

.card-content h3 {
    font-family: 'Syncopate', sans-serif;
    font-size: 1.4rem;
    color: white;
    margin-bottom: 8px;
    transition: color 0.3s;
}

.project-card:hover h3 {
    color: #9F361F;
}

.card-content p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.btn-small { 
    color: #9F361F; 
    text-decoration: none; 
    font-size: 0.85rem; 
    border-bottom: 1px solid #9F361F; 
    display: inline-block; 
    width: fit-content;
    padding-bottom: 2px;
    transition: 0.3s;
}

.btn-small:hover {
    color: white;
    border-color: white;
}

/* Mobile Menu Toggle Animation Classes (Toggled by JS) */
.menu-links.active {
    left: 0 !important;
}

.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background-color: #9F361F;
}
.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background-color: #9F361F;
}

/* Cursor Hover States (Toggled by JS) */
body.hovering .cursor-outline {
    width: 60px;
    height: 60px;
    border-color: #9F361F;
    background-color: rgba(159, 54, 31, 0.1);
    backdrop-filter: blur(2px);
}
body.hovering .cursor-dot {
    opacity: 0;
}