/* CSS Design System and Modern Styles */
html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    scroll-behavior: smooth;
}

:root {
    /* Colors */
    --bg-dark: #0b0e14;
    --bg-card: rgba(255, 255, 255, 0.03);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #a855f7;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #22d3ee;

    /* Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --radius-lg: 20px;
    --radius-md: 12px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

h1,
h2,
h3,
h4,
.logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.gradient-text {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(11, 14, 20, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 70px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--header-height);
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 4rem;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero .description {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Visuals */
.blob-container {
    position: relative;
}

.blob {
    position: absolute;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: -1;
    animation: pulse 10s infinite alternate;
}

.profile-img {
    width: 100%;
    max-width: 450px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tech Stack Bar */
.tech-stack-container {
    padding: 3rem 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tech-stack {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
    opacity: 0.8;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.tech-item i {
    font-size: 1.5rem;
    color: var(--primary);
}

.tech-item:hover {
    color: var(--text-main);
    transform: translateY(-2px);
    opacity: 1;
}

/* Sections */
section {
    padding: 100px 0;
}

.section-title {
    margin-bottom: 3rem;
}

.subtitle {
    display: block;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: clamp(2rem, 5vw, 3rem);
}

.center {
    text-align: center;
}

.mt-4 {
    margin-top: 4rem;
}

/* Bento / Cards */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all 0.3s ease;
}

.glass:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-5px);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-img {
    height: 200px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.project-info h3 {
    margin-bottom: 1rem;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tags span {
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--accent);
}

.project-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.skill-category h4 {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.skill-category h4 i {
    color: var(--primary);
}

.skill-category p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    margin-bottom: 2rem;
}

.timeline-item .date {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Contact */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding: 4rem !important;
}

.contact-list {
    list-style: none;
    margin-top: 2rem;
}

.contact-list li {
    margin-bottom: 1.5rem;
}

.contact-list a {
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.contact-list a:hover {
    color: var(--primary);
}

/* Footer */
footer {
    padding: 3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

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

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links i {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: color 0.3s;
}

.social-links i:hover {
    color: var(--primary);
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }

    100% {
        transform: scale(1.1);
        opacity: 0.6;
    }
}

.animate-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.animate-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Robust Responsiveness */
@media (max-width: 968px) {
    :root {
        --header-height: 80px;
    }

    body.menu-open {
        overflow: hidden;
    }

    .container {
        padding: 0 1.5rem;
    }

    header {
        height: var(--header-height);
        background: rgba(11, 14, 20, 0.95);
        backdrop-filter: blur(10px);
    }

    nav {
        padding: 0;
        justify-content: space-between;
        height: 100%;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: #0b0e14 !important;
        /* Force solid background */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3rem;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2000;
        margin: 0;
        padding: 0;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .nav-links a {
        font-size: 1.8rem;
        color: var(--text-main);
        font-family: 'Outfit', sans-serif;
        text-transform: uppercase;
        letter-spacing: 2px;
    }

    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 45px;
        height: 45px;
        font-size: 2rem;
        color: var(--text-main);
        z-index: 2001;
        /* Must be above the menu */
        cursor: pointer;
    }

    .grid-2,
    .hero-content,
    .contact-wrapper {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 3rem;
    }

    .hero {
        height: auto;
        min-height: 100vh;
        padding-top: 140px;
        padding-bottom: 60px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-visual {
        order: -1;
        margin-bottom: 2rem;
        display: flex;
        justify-content: center;
    }

    .profile-img {
        width: 220px;
        height: 220px;
        object-fit: cover;
    }

    .blob-container {
        width: 240px;
        height: 240px;
    }

    .hero-text h1 {
        font-size: clamp(2.4rem, 12vw, 3.5rem);
        line-height: 1.1;
    }

    .hero-text p {
        font-size: 1.1rem;
        margin: 2rem auto;
        max-width: 90%;
    }

    .hero-btns {
        justify-content: center;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .hero-btns .btn {
        width: 100%;
        text-align: center;
    }

    .blob {
        width: 250px;
        height: 250px;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .tech-stack-container {
        margin-top: 5rem;
        padding: 3rem 0;
    }

    .tech-stack {
        gap: 1.5rem;
        justify-content: center;
        padding: 0 1rem;
    }

    .tech-item {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 50px;
    }

    .projects-grid {
        grid-template-columns: 1fr !important;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-wrapper {
        padding: 4rem 1.5rem !important;
    }
}

@media (max-width: 480px) {
    .section-title h2 {
        font-size: 2.2rem;
    }

    .tech-item {
        width: 100%;
        /* Full width for long labels on very small screens */
        justify-content: center;
        max-width: 320px;
        margin: 0 auto;
    }

    .hero-text h1 {
        font-size: 2.4rem;
    }
}

/* Click Ripple Effect */
.click-ripple {
    position: fixed;
    width: 20px;
    height: 20px;
    background: rgba(99, 102, 241, 0.4);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple-animation 0.6s ease-out;
    z-index: 9999;
}

@keyframes ripple-animation {
    to {
        transform: translate(-50%, -50%) scale(6);
        opacity: 0;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}