:root {
    /* Colors */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #f8fafc;
    --bg-secondary: #ffffff;
    --text-color: #0f172a;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);

    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --text-color: #f8fafc;
    --card-bg: #1e293b;
    --border-color: #334155;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-medium), color var(--transition-medium);
    overflow-x: hidden;
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    display: none;
}

@media (pointer: fine) {

    .cursor-dot,
    .cursor-outline {
        display: block;
    }
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-color);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 8rem 0;
    /* Increased padding for better spacing */
}

.section-title {
    font-family: var(--font-display);
    font-size: 3rem;
    margin: 0 auto 4rem auto;
    /* Centering with margin */
    text-align: center;
    position: relative;
    display: table;
    /* Ensures width fits content for the underline */
    z-index: 10;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--gradient-1);
    border-radius: 10px;
    transform: skewX(-15deg);
    /* Playful skew */
}

/* Header & Nav */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: all var(--transition-medium);
}

[data-theme="dark"] .header {
    background-color: rgba(15, 23, 42, 0.7);
}

/* Header Scrolled State */
.header.scrolled {
    border-bottom-color: var(--border-color);
    padding: 0.5rem 0;
    /* Shrink header slightly */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    transition: height 0.3s ease;
}

.header.scrolled .header-container {
    height: 60px;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
    text-decoration: none;
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    bottom: 5px;
    right: -12px;
    animation: bounce 2s infinite;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

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

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
    position: relative;
    font-size: 1.05rem;
}

.nav-link::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 8px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    /* Bouncy transition */
    z-index: -1;
    border-radius: 4px;
}

.nav-link:hover::before {
    opacity: 0.2;
    transform: translateY(0);
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy */
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

[data-theme="dark"] .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

/* Mobile Menu */
.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-color);
    border-radius: 3px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

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

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.2s;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.4s;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    transition: transform 0.3s ease;
}

.hero-title:hover .gradient-text {
    transform: scale(1.02) rotate(1deg);
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 2.5rem;
    max-width: 550px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.6s;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.8s;
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy */
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.5);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

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

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

.btn-outline:hover {
    border-color: var(--text-color);
    background: var(--bg-secondary);
}

.hero-visual {
    position: relative;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeIn 1s ease forwards 1s;
}

.abstract-shape {
    position: absolute;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    /* Organic blob shape */
    filter: blur(60px);
    opacity: 0.6;
    z-index: -1;
    transition: border-radius 5s ease;
}

.shape-1 {
    width: 350px;
    height: 350px;
    background: #6366f1;
    top: 10%;
    right: 10%;
    animation: float 8s ease-in-out infinite, morph 10s ease-in-out infinite;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: #a855f7;
    bottom: 10%;
    left: 10%;
    animation: float 10s ease-in-out infinite reverse, morph 12s ease-in-out infinite;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.15rem;
    color: var(--text-color);
    opacity: 0.9;
    line-height: 1.8;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1.5rem;
    /* Softer corners */
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-color);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.skill-category {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 1.5rem;
    transition: transform 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
}

.skill-category h3 {
    margin-bottom: 1.5rem;
    font-family: var(--font-display);
    color: var(--primary-color);
    font-size: 1.5rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-tag {
    background: var(--card-bg);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
}

.skill-tag:hover {
    border-color: var(--primary-color);
    color: white;
    background: var(--primary-color);
    transform: translateY(-3px) rotate(2deg);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 3rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    height: 240px;
    overflow: hidden;
    position: relative;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

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

.project-content {
    padding: 2.5rem;
}

.project-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

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

.project-tags {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.project-tags span {
    font-size: 0.85rem;
    background: var(--bg-secondary);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    color: var(--primary-color);
    font-weight: 700;
}

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

.link-with-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.link-with-icon:hover {
    color: var(--primary-color);
    gap: 0.8rem;
    /* Slide icon effect */
}

/* Contact Section */
.contact-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-secondary);
    padding: 4rem;
    border-radius: 2rem;
    position: relative;
    overflow: hidden;
}

.contact-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.contact-text {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    color: var(--text-color);
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.btn-large {
    padding: 1.2rem 3.5rem;
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}

.social-links {
    margin-top: 3.5rem;
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

.social-links a {
    color: var(--text-color);
    opacity: 0.7;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    opacity: 1;
    color: var(--primary-color);
    transform: translateY(-5px) rotate(10deg);
    box-shadow: var(--shadow-md);
}

/* Footer */
.footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 6rem;
    font-size: 1rem;
    opacity: 0.8;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-25px);
    }
}

@keyframes morph {
    0% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    33% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
    }

    66% {
        border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
    }

    100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .section {
        padding: 5rem 0;
    }

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

    .hero-title {
        font-size: 3rem;
    }

    .hero-container,
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-visual {
        display: none;
        /* Keep hidden on mobile for cleaner layout */
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hamburger {
        display: block;
        z-index: 1001;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-list {
        position: fixed;
        left: -100%;
        top: 0;
        gap: 0;
        flex-direction: column;
        background-color: var(--bg-color);
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: 0.3s;
        justify-content: center;
        z-index: 1000;
    }

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

    .nav-item {
        margin: 16px 0;
    }

    .nav-link {
        font-size: 1.5rem;
    }
}