:root {
    /* Colors */
    --bg-color: #030712;
    --surface-color: #111827;
    --surface-hover: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --accent-primary: #38bdf8;
    --accent-secondary: #818cf8;
    --accent-tertiary: #c084fc;

    /* Gradients */
    --gradient-main: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --gradient-glow: linear-gradient(135deg, rgba(56, 189, 248, 0.5), rgba(129, 140, 248, 0.5));
    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* Fonts */
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'Space Grotesk', monospace;

    /* Spacing */
    --container-width: 1200px;
    --header-height: 80px;
    --section-spacing: 120px;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

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

/* Advanced Animated Background */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: -1;
    overflow: hidden;
}

.background-gradient::before,
.background-gradient::after {
    content: '';
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: float-bg 20s infinite ease-in-out;
}

.background-gradient::before {
    background: var(--accent-primary);
    top: -20%;
    left: -10%;
    animation-delay: 0s;
}

.background-gradient::after {
    background: var(--accent-secondary);
    bottom: -20%;
    right: -10%;
    animation-delay: -10s;
}

@keyframes float-bg {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

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

.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient-main);
    color: #fff;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.25);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.35);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
}

.btn-outline {
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

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

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: all 0.3s ease;
}

.header.scrolled {
    padding: 1rem 0;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

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

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo .accent {
    color: var(--accent-primary);
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-main);
    transition: width 0.3s ease;
}

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

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.bar {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: 0.3s;
}

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

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

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2rem;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-weight: 500;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 540px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 1rem;
}

/* Hero Visual */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.visual-card {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.code-block {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.3s ease;
}

.code-block:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
}

.code-header {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red {
    background: #ef4444;
}

.yellow {
    background: #f59e0b;
}

.green {
    background: #22c55e;
}

.code-block pre {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #e5e7eb;
    overflow-x: auto;
}

.keyword {
    color: #c084fc;
}

.class-name {
    color: #fcd34d;
}

.function {
    color: #60a5fa;
}

.string {
    color: #4ade80;
}

.self {
    color: #f87171;
}

.glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, transparent 70%);
    filter: blur(40px);
    z-index: 1;
    animation: glow-pulse 4s infinite alternate;
}

@keyframes glow-pulse {
    0% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.9);
    }

    100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

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

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--accent-primary);
    font-size: 1.1rem;
    font-weight: 500;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 5rem;
    align-items: start;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.about-text strong {
    color: var(--text-primary);
}

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

.stat-card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

.stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.skills-wrapper {
    background: var(--surface-color);
    border-radius: 24px;
    padding: 2.5rem;
    border: 1px solid var(--glass-border);
}

.skills-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.skill-category h4 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

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

.skill-tag {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-tag i {
    color: var(--accent-primary);
}

.skill-tag:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

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

.project-card {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

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

.project-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

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

.visual-1 {
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
}

.visual-2 {
    background: linear-gradient(135deg, #059669, #10b981);
}

.visual-3 {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.btn-icon {
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 1.2rem;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover .btn-icon {
    transform: scale(1);
}

.project-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.github-link {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

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

.project-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

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

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

.project-actions {
    display: flex;
    gap: 1rem;
}

/* Contact Section */
.contact-wrapper {
    background: var(--surface-color);
    border-radius: 30px;
    padding: 4rem;
    border: 1px solid var(--glass-border);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.contact-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.05) 0%, transparent 50%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.contact-content {
    position: relative;
    z-index: 1;
}

.contact-text {
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-methods {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.icon-box {
    width: 40px;
    height: 40px;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.contact-item div {
    text-align: left;
    min-width: 0;
}

.contact-item .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.contact-item .value {
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
    overflow-wrap: anywhere;
}

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

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
    text-decoration: none;
}

.social-link:hover {
    background: var(--accent-primary);
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.3);
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--glass-border);
    font-size: 0.9rem;
    margin-top: 4rem;
}

.footer .accent {
    color: #ef4444;
}

/* Animations */
[data-animate] {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate="fade-up"] {
    transform: translateY(30px);
}

[data-animate="fade-left"] {
    transform: translateX(30px);
}

[data-animate="fade-right"] {
    transform: translateX(-30px);
}

.animate-in {
    opacity: 1;
    transform: translate(0);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-content {
        margin: 0 auto;
    }

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

    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .nav-list {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--surface-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.3s ease;
        z-index: 100;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

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

    .hamburger {
        display: flex;
        z-index: 101;
    }

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

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

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

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

    .contact-methods {
        flex-direction: column;
        align-items: stretch;
    }
}

/* --- Fine-grained optimizations for Small Screens --- */
@media (max-width: 480px) {
    .container {
        padding: 0 1.5rem;
    }

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

    .hero-cta {
        flex-direction: column !important;
        width: 100% !important;
    }

    .hero-cta .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    .section {
        padding: 80px 0; /* Reduced spacing on small mobiles */
    }

    .section-title {
        font-size: 2rem;
    }

    .skills-wrapper {
        padding: 1.5rem;
    }

    .contact-wrapper {
        padding: 2.5rem 1.5rem;
    }

    .stats-grid {
        gap: 1.25rem;
    }
}