/* ==========================================
   RESET & BASE
   ========================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; /* GSAP handles smooth scroll */ }
body { 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale; 
    background-color: #0A0A0A;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}
::selection { background: #DC2626; color: #fff; }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: #0A0A0A; }
::-webkit-scrollbar-thumb { background: #222; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #DC2626; }

/* ==========================================
   1. PRELOADER
   ========================================== */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #0A0A0A;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader-inner {
    text-align: center;
}

.preloader-name {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    display: block;
    margin-bottom: 30px;
}

.preloader-bar {
    width: 200px;
    height: 2px;
    background: rgba(255,255,255,0.08);
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
}

.preloader-fill {
    width: 0%;
    height: 100%;
    background: #DC2626;
    border-radius: 10px;
}



/* ==========================================
   MOUSE GLOW
   ========================================== */
#mouse-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    top: 0; left: 0;
}

/* ==========================================
   SCROLL PROGRESS BAR (top)
   ========================================== */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: #DC2626;
    z-index: 9999;
    transition: none;
}

/* ==========================================
   3. TEXT SPLIT LINE REVEAL
   ========================================== */
.line-mask {
    overflow: hidden;
    display: block;
}

.line-inner {
    display: block;
    transform: translateY(105%);
}

/* ==========================================
   TYPEWRITER
   ========================================== */
.typewriter-cursor {
    font-weight: 300;
    font-size: 1.3rem;
    animation: blink 0.8s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================
   BUTTONS (with magnetic support)
   ========================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 15px 32px;
    background: #fff;
    color: #0A0A0A;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.5s cubic-bezier(0.16,1,0.3,1), transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.btn-primary::before {
    content: '';
    position: absolute; inset: 0;
    background: #DC2626;
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.btn-primary:hover { color: #fff; }
.btn-primary:hover::before { transform: scaleX(1); transform-origin: left; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 15px 32px;
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.4s, background 0.4s, transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.04); }

/* ==========================================
   ABOUT STATS (Glassmorphism Cards)
   ========================================== */
.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem 1.5rem;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(220, 38, 38, 0.4);
    transform: translateY(-5px);
}
.stat-number-wrapper {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.stat-number {
    font-family: 'Syne', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.04em;
}
.stat-suffix {
    font-family: 'Syne', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: #DC2626;
}
@media (max-width: 768px) {
    .stat-number { font-size: 2.2rem; }
    .stat-suffix { font-size: 1.5rem; }
    .stat-card { padding: 1.5rem 1rem; }
}
.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #888;
    margin-top: 12px;
    font-weight: 600;
}

.tech-item {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: #888;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), color 0.3s;
    cursor: default;
}
.tech-item:hover {
    color: #fff;
    transform: translateX(8px);
}

/* ==========================================
   4. HORIZONTAL SCROLL GALLERY
   ========================================== */
.projects-pin {
    display: flex;
    flex-direction: column;
}

.projects-track {
    display: flex;
    gap: 40px;
    padding: 0 calc(50vw - 260px) 60px calc(50vw - 260px);
    flex-shrink: 0;
    align-items: center;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    perspective: 2000px;
}
.projects-track::-webkit-scrollbar {
    display: none;
}

.project-card {
    flex: 0 0 520px;
    height: 520px;
    background: #111;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.5s;
    transform-style: preserve-3d;
    will-change: transform, filter, opacity;
}

@media (max-width: 768px) {
    .projects-track {
        gap: 20px;
        padding: 0 7.5vw 60px 7.5vw;
    }
    .project-card {
        flex: 0 0 85vw;
        height: 420px;
    }
}

.project-card:hover {
    border-color: rgba(220,38,38,0.3);
    filter: blur(0px) !important;
    opacity: 1 !important;
}

.card-preview {
    width: 100%;
    height: 260px;
    background: #0D0D0D;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 1.2s cubic-bezier(0.16,1,0.3,1), opacity 0.5s;
}

.project-card:hover .card-preview img {
    transform: scale(1.06);
}

.card-preview img[src=""] { opacity: 0; }

.card-body {
    padding: 28px 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #555;
    margin-bottom: 10px;
}

.card-body h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.card-body p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    margin-top: auto;
    padding-top: 16px;
    transition: gap 0.4s cubic-bezier(0.16,1,0.3,1);
}
.card-link i { font-size: 0.7rem; transition: transform 0.4s cubic-bezier(0.16,1,0.3,1); }
.project-card:hover .card-link { gap: 16px; }
.project-card:hover .card-link i { transform: translateX(4px); }

/* ==========================================
   FOOTER
   ========================================== */
.footer-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    position: relative;
    padding-bottom: 2px;
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.footer-link::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0%; height: 1px;
    background: #DC2626;
    transition: width 0.5s cubic-bezier(0.16,1,0.3,1);
}
.footer-link:hover::after { width: 100%; }

/* ==========================================
   GSAP INITIAL HIDDEN STATES
   ========================================== */
.hero-reveal { opacity: 0; transform: translateY(40px); }
.hero-img { opacity: 0; transform: translateY(60px) scale(0.97); }
.about-reveal { opacity: 0; transform: translateY(30px); }
.foot-reveal { opacity: 0; transform: translateY(25px); }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
    #hero h1 .line-inner { font-size: 13vw; }
    .project-card { flex: 0 0 340px; height: 460px; }
    .card-preview { height: 200px; }
    .projects-track {
        padding: 0 calc(50vw - 170px) 60px calc(50vw - 170px);
        gap: 25px;
    }
}

@media (max-width: 640px) {
    .project-card { flex: 0 0 280px; height: 420px; }
    .card-preview { height: 180px; }
    .projects-track {
        padding: 0 calc(50vw - 140px) 60px calc(50vw - 140px);
        gap: 20px;
    }
    #mouse-glow { display: none; }
}
