@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #0c0c0e;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --accent-glow: rgba(99, 102, 241, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    width: 100vw;
}

/* Optimized Background Animation */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 50vw;
    /* Reduced size slightly */
    height: 50vw;
    border-radius: 50%;
    z-index: -1;
    filter: blur(80px);
    /* Reduced blur radius */
    opacity: 0.5;
    animation: drift 20s infinite alternate ease-in-out;
    will-change: transform;
    /* Hint for performance */
    transform: translateZ(0);
    /* Force hardware acceleration */
}

body::before {
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

body::after {
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes drift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        transform: translate3d(30px, 50px, 0) scale(1.05);
    }
}

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

/* Typography */
h1,
h2,
h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-bottom: 0.2em;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

h3 {
    font-size: 1.5rem;
    color: #fff;
}

p {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* Usage of translateZ for glass cards to promote to own layer */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    /* Reduced blur */
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1), box-shadow 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    will-change: transform;
}

/* Simplified Shine Effect */
.glass-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    /* Smaller shine width */
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.03),
            transparent);
    transform: skewX(-25deg);
    transition: left 0.5s ease;
    pointer-events: none;
    /* Perf */
}

.glass-card:hover {
    transform: translateY(-5px) translateZ(0);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.glass-card:hover::before {
    left: 150%;
    transition: left 0.7s ease;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 6rem 0;
    position: relative;
}

.hero-subtitle {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #a855f7;
    text-transform: uppercase;
    letter-spacing: 3px;
    padding: 0.5rem 1rem;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 50px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.hero-slogan {
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

.cta-button {
    display: inline-block;
    padding: 1rem 3rem;
    background: var(--primary-gradient);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.5);
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 4rem 0;
}

.service-item ul {
    list-style: none;
    margin-top: 1rem;
}

.service-item li {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-left: 1.75rem;
    position: relative;
}

.service-item li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #818cf8;
    font-weight: bold;
}

/* Tech Stack */
.tech-stack-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 3rem 0;
}

.tech-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #cbd5e1;
    transition: all 0.3s ease;
    cursor: default;
    /* remove backdrop filter on small elements for perf */
}

.tech-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    border-color: #818cf8;
    color: white;
    box-shadow: 0 5px 15px rgba(129, 140, 248, 0.2);
}

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

.project-card {
    padding: 0;
}

.project-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid var(--card-border);
    transition: transform 0.5s ease;
}

/* Removed image zoom mainly for perf, kept card lift */
/* .project-card:hover .project-image {
    transform: scale(1.03); 
} */

.project-content {
    padding: 1.5rem;
    text-align: center;
}

.project-link {
    display: inline-block;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #6366f1, #a855f7);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background-position 0.3s ease;
}

.project-link:hover {
    background-position: 100% 0;
}

/* Scroll Reveal Animation Classes - Optimized */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    /* Reduced distance */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    /* Reduced duration */
    will-change: opacity, transform;
}

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

/* Stagger delays for children if needed */
.delay-100 {
    transition-delay: 0.05s;
}

.delay-200 {
    transition-delay: 0.1s;
}

.delay-300 {
    transition-delay: 0.15s;
}

/* Footer */
footer {
    padding: 6rem 0 4rem;
    text-align: center;
    border-top: 1px solid var(--card-border);
    margin-top: 4rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.75rem;
    }

    .hero {
        padding: 4rem 0;
    }

    .container {
        padding: 0 20px;
    }
}