:root {
    --bg-color: #050505;
    --text-main: #ffffff;
    --text-muted: #888888;
    --accent-green: #00FF88;
    --accent-purple: #7B2FFF;
    
    --font-heading: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-heading);
    overflow-x: hidden;
    cursor: none; /* Hide default cursor */
    -webkit-font-smoothing: antialiased;
}
body.is-loading {
    overflow: hidden !important;
    height: 100vh !important;
    width: 100vw !important;
    position: fixed;
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    text-transform: uppercase;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: var(--text-main);
    display: inline-block;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-purple);
    transition: width 0.8s ease;
}
.is-inview .section-title::after {
    width: 100%;
}

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

/* Custom Cursor */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    background-color: var(--accent-green);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background-color 0.3s;
    will-change: transform;
}
.cursor.active {
    width: 40px;
    height: 40px;
    background-color: rgba(123, 47, 255, 0.5);
    border: 1px solid var(--accent-green);
}

/* Progress & Indicators */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-green));
    width: 0%;
    z-index: 1000;
}

.section-indicator {
    position: fixed;
    bottom: 40px;
    right: 40px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    z-index: 100;
    color: var(--accent-green);
    mix-blend-mode: difference;
}

/* Background Canvas */
.webgl {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none; /* prevent blocking scroll */
}

/* Layout */
.section {
    position: relative;
    padding: 100px 5vw;
    min-height: 100vh;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ---- 01. HERO ---- */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-title {
    font-size: clamp(4rem, 10vw, 10rem);
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 1rem;
    overflow: hidden;
}

.hero-title .char {
    display: inline-block;
    transform: translateY(110%);
    opacity: 0;
}

.hero-subtitle {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 3rem;
    height: 1.5rem; /* prevent layout shift */
}

.btn-ripple {
    display: inline-block;
    padding: 1rem 3rem;
    background: transparent;
    color: var(--accent-green);
    font-family: var(--font-mono);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 2px;
    border: 1px solid var(--accent-green);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: none; /* custom cursor */
}

.btn-ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 255, 136, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:hover::before {
    width: 300px;
    height: 300px;
}
.btn-ripple:hover {
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.scroll-arrow {
    position: absolute;
    bottom: 50px;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--text-muted);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

/* ---- 02. ABOUT ---- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.split-text {
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: #ddd;
}
.split-word {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
}
.split-word span {
    display: inline-block;
    transform: translateY(100%);
}

.skills {
    font-family: var(--font-mono);
    margin-top: 2rem;
}
.skill-item {
    margin-bottom: 1.5rem;
}
.skill-item span {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--accent-green);
}
.skill-bar-wrap {
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.1);
    position: relative;
}
.skill-bar {
    height: 100%;
    background: var(--accent-purple);
    width: 0; /* Animated via JS */
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px var(--accent-purple);
}

.about-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.about-image {
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1555099962-4199c345e5dd?auto=format&fit=crop&q=80&w=800');
    background-size: cover;
    background-position: center;
    filter: grayscale(100%) contrast(1.2);
    transition: var(--transition);
}

.about-image-wrapper:hover .about-image {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Glitch minimal effect on hover */
.glitch:hover {
    animation: glitch-anim 0.3s infinite;
}
@keyframes glitch-anim {
    0% { transform: translate(0) }
    20% { transform: translate(-2px, 2px) }
    40% { transform: translate(-2px, -2px) }
    60% { transform: translate(2px, 2px) }
    80% { transform: translate(2px, -2px) }
    100% { transform: translate(0) }
}

/* ---- 03. WORKS ---- */
.works {
    overflow: hidden;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px; /* Reduced vertical gap for better alignment */
    margin-top: 4rem;
}

.project-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem; /* Increased padding for more premium feel */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    height: 100%; /* Ensure all cards in a row have same height */
}

/* Stagger removed for perfect alignment as requested */

.project-card:hover {
    border-color: var(--accent-green);
    background: rgba(0, 255, 136, 0.05);
    transform: translateY(-10px);
}

.project-image-wrap {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-image {
    transform: scale(1.1);
}

.project-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-purple);
    color: #fff;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-content {
    position: relative;
}

.project-number {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 4rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.03);
    line-height: 1;
    pointer-events: none;
}

.project-title {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 0.8rem;
}

.project-description {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-family: var(--font-heading);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-tags span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 136, 0.2);
    padding: 3px 10px;
    border-radius: 4px;
}

@media (max-width: 992px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    .project-card:nth-child(even) {
        margin-top: 0;
    }
}


/* ---- 04. TECH STACK ---- */
.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
    perspective: 800px;
}

.tech-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 1rem;
    backdrop-filter: blur(5px);
    transition: var(--transition);
    opacity: 0; /* Start hidden for GSAP bounce */
    transform: translateY(50px);
}

.tech-item:hover {
    border-color: var(--accent-purple);
    background: rgba(123, 47, 255, 0.1);
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.tech-item .emoji {
    font-size: 1.5rem;
}


/* ---- 05. CONTACT ---- */
.contact {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.contact-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.contact-desc {
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.contact-form {
    text-align: left;
    margin-bottom: 4rem;
}

.input-group {
    position: relative;
    margin-bottom: 2rem;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 10px 0;
    font-size: 1rem;
    color: #fff;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    outline: none;
    background: transparent;
    font-family: var(--font-mono);
    transition: var(--transition);
}

.input-group label {
    position: absolute;
    top: 10px;
    left: 0;
    pointer-events: none;
    color: rgba(255,255,255,0.5);
    font-family: var(--font-mono);
    transition: 0.3s ease all;
}

.input-group input:focus ~ label,
.input-group input:valid ~ label,
.input-group textarea:focus ~ label,
.input-group textarea:valid ~ label {
    top: -20px;
    font-size: 0.8rem;
    color: var(--accent-green);
}

.input-group input:focus,
.input-group textarea:focus {
    border-bottom-color: var(--accent-green);
}

.contact-form button {
    width: 100%;
    padding: 1.2rem;
    background: transparent;
    border: 1px solid var(--accent-purple);
    color: var(--accent-purple);
}
.contact-form button:hover {
    box-shadow: 0 0 20px rgba(123, 47, 255, 0.4);
    background: rgba(123, 47, 255, 0.1);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

.social-links a {
    color: #fff;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    position: relative;
}

.hover-draw::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-green);
    transition: width 0.3s ease;
}
.hover-draw:hover::after {
    width: 100%;
}

footer {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .about-grid {
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }
    .about-grid {
        grid-template-columns: 1fr;
    }
    .about-image-wrapper {
        aspect-ratio: 1/1;
    }
    .work-card {
        width: 80vw;
        min-width: 300px;
        height: 50vh;
    }
    .section {
        padding: 80px 5vw;
    }
    .cursor {
        display: none; /* Disable custom cursor on mobile */
    }
}

/* ---- PRELOADER ---- */
.preloader {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
    touch-action: none; /* Block touch gestures */
}

.preloader-content {
    text-align: center;
    z-index: 10;
}

.preloader-logo {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--text-main);
    margin-bottom: 2rem;
    position: relative;
    font-family: var(--font-heading);
}

.glitch-dot {
    color: var(--accent-green);
    animation: blink 0.5s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.preloader-status {
    width: 300px;
    margin: 0 auto;
}

.status-text {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-green);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.preloader-bar-wrap {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 0.5rem;
    position: relative;
}

.preloader-bar {
    width: 0%;
    height: 100%;
    background: var(--accent-green);
    box-shadow: 0 0 15px var(--accent-green);
}

.preloader-perc {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: right;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(0, 255, 136, 0.05), transparent);
    opacity: 0.5;
    pointer-events: none;
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* ---- PRELOADER LOGS ---- */
.preloader-logs {
    text-align: left;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(0, 255, 136, 0.7);
    line-height: 1.5;
    height: 60px;
    overflow: hidden;
}

.log-item {
    opacity: 0;
    transform: translateX(-10px);
    animation: log-entry 0.3s forwards;
}

@keyframes log-entry {
    to { opacity: 1; transform: translateX(0); }
}

.preloader-bar {
    transition: width 0.1s linear;
}
