@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* --- Design Tokens --- */
:root {
    --bg-color: #020617;
    --surface: #0f172a;
    --primary: #8b5cf6;
    --secondary: #ec4899;
    --accent: #3b82f6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-blur: blur(12px);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Fluid Typography & Spacing */
    --h1-size: clamp(2.5rem, 8vw, 4.5rem);
    --h2-size: clamp(2rem, 6vw, 3.5rem);
    --h3-size: clamp(1.5rem, 4vw, 2.2rem);
    --body-size: clamp(1rem, 1.2vw, 1.15rem);
    --section-padding: clamp(60px, 12vh, 120px);
    --container-padding: clamp(1.5rem, 5vw, 3rem);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: var(--body-size);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; line-height: 1.1; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* --- Background Mesh --- */
.bg-mesh {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
}

/* --- MOBILE-FIRST STYLES (Default) --- */

/* Navigation */
nav {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    padding: 1rem 0; transition: var(--transition);
}

nav.scrolled {
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
}

nav .container { display: flex; justify-content: space-between; align-items: center; }

.logo { font-size: 1.5rem; font-weight: 800; color: var(--text-main); text-decoration: none; }
.logo span { color: var(--primary); }

.nav-links {
    position: fixed; top: 0; right: -100%;
    width: 100%; height: 100vh;
    background: rgba(2, 6, 23, 0.98);
    backdrop-filter: blur(20px);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    gap: 2.5rem; list-style: none;
    transition: var(--transition);
}

.nav-links.active { right: 0; }
.nav-links a { text-decoration: none; color: var(--text-main); font-size: 1.5rem; font-weight: 600; }

.menu-toggle { display: flex; flex-direction: column; gap: 6px; cursor: pointer; z-index: 1001; }
.bar { width: 28px; height: 2px; background-color: var(--text-main); transition: var(--transition); }

.menu-toggle.active .bar:nth-child(1) { transform: rotate(-45deg) translate(-8px, 8px); }
.menu-toggle.active .bar:nth-child(2) { opacity: 0; }
.menu-toggle.active .bar:nth-child(3) { transform: rotate(45deg) translate(-8px, -8px); }

/* Hero */
.hero { min-height: 100vh; display: flex; align-items: center; text-align: center; padding-top: 100px; }
.hero-grid { display: flex; flex-direction: column; gap: 3rem; }

.hero-text h1 { font-size: var(--h1-size); margin-bottom: 1.5rem; }
.hero-text h1 span { background: linear-gradient(to right, #fff, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.hero-text h2 { font-size: var(--h3-size); color: var(--text-muted); margin-bottom: 2rem; }
.hero-text p { color: var(--text-muted); margin-bottom: 3rem; max-width: 600px; margin-inline: auto; }

.hero-btns { display: flex; flex-direction: column; gap: 1rem; }

.profile-wrapper { position: relative; margin-inline: auto; }
.image-container { 
    width: min(100%, 350px); aspect-ratio: 1; border-radius: 40px; 
    overflow: hidden; border: 1px solid var(--border-color);
}
.image-container img { width: 100%; height: 100%; object-fit: cover; }

/* Sections General */
section { padding: var(--section-padding) 0; }

.section-header { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 3rem; text-align: center; }
.section-num { color: var(--primary); font-weight: 700; font-size: 0.9rem; letter-spacing: 2px; }
.section-title { font-size: var(--h2-size); }

/* About */
.about-card {
    background: var(--glass-bg); padding: 2.5rem; border-radius: 32px;
    border: 1px solid var(--border-color);
}
.about-card p { margin-bottom: 1.5rem; color: var(--text-muted); }

/* Projects */
.projects-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.project-card {
    background: var(--surface); padding: 2.5rem; border-radius: 32px;
    border: 1px solid var(--border-color); display: flex; flex-direction: column;
}

/* Skills */
.skills-grid { display: flex; flex-direction: column; gap: 2rem; }
.skill-category { background: var(--surface); padding: 2rem; border-radius: 24px; border: 1px solid var(--border-color); }
.skill-list { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.skill-item { background: var(--bg-color); border: 1px solid var(--border-color); padding: 0.6rem 1.2rem; border-radius: 12px; font-size: 0.9rem; }

/* Contact */
.contact-grid { display: flex; flex-direction: column; gap: 3rem; }
.contact-form { display: flex; flex-direction: column; gap: 1.2rem; }
.contact-form input, .contact-form textarea {
    width: 100%; background: var(--surface); border: 1px solid var(--border-color);
    padding: 1.2rem; border-radius: 16px; color: white; font-family: inherit; font-size: 1rem;
}

/* Buttons */
.btn { 
    width: 100%; padding: 1.2rem 2rem; border-radius: 16px; font-weight: 700;
    text-decoration: none; text-align: center; transition: var(--transition); border: none; cursor: pointer;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: white; }

/* --- TABLET SCALING (640px+) --- */
@media (min-width: 640px) {
    .hero-btns { flex-direction: row; justify-content: center; }
    .btn { width: auto; min-width: 200px; }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
}

/* --- DESKTOP SCALING (1024px+) --- */
@media (min-width: 1024px) {
    /* Navbar */
    .menu-toggle { display: none; }
    .nav-links {
        position: static; width: auto; height: auto; background: transparent;
        flex-direction: row; gap: 3rem; backdrop-filter: none;
    }
    .nav-links a { font-size: 0.95rem; color: var(--text-muted); position: relative; }
    .nav-links a::after {
        content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px;
        background: var(--primary); transition: var(--transition);
    }
    .nav-links a:hover { color: var(--text-main); }
    .nav-links a:hover::after { width: 100%; }

    /* Hero */
    .hero { text-align: left; }
    .hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 4rem; align-items: center; }
    .hero-text p { margin-inline: 0; }
    .hero-btns { justify-content: flex-start; }
    .profile-wrapper { margin-inline: 0; }

    /* Layouts */
    .projects-grid { grid-template-columns: repeat(3, 1fr); }
    .skills-grid { grid-template-columns: repeat(3, 1fr); }
    .contact-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 5rem; }
    .section-header { text-align: left; }

    /* Desktop Animations */
    .project-card:hover { transform: translateY(-10px); border-color: var(--secondary); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
    .skill-item:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.05); }
    
    .image-container { animation: floating 6s ease-in-out infinite; }
    @keyframes floating {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-20px); }
    }
}

/* --- Scroll Reveal --- */
.reveal { opacity: 0; transform: translateY(30px); transition: var(--transition); }
.reveal.active { opacity: 1; transform: translateY(0); }
