:root {
    --bg-dark: #020617;
    /* Deeper darker blue/black */
    --bg-card: rgba(30, 41, 59, 0.4);
    --bg-card-hover: rgba(51, 65, 85, 0.5);

    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);

    --accent: #8b5cf6;
    /* Violet accent */
    --accent-glow: rgba(139, 92, 246, 0.5);

    --discord: #5865F2;
    --discord-hover: #4752C4;

    --text-main: #f1f5f9;
    --text-dim: #94a3b8;
    --text-accent: #e2e8f0;

    --border: rgba(255, 255, 255, 0.08);

    --glass: blur(20px) saturate(180%);
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Animated Grid Background */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -3;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    pointer-events: none;
}

/* Static Ambient Background Glow */
body::after {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vh;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05), transparent 70%);
    z-index: -2;
    pointer-events: none;
    filter: blur(80px);
}

/* Mouse Follower Glow */
#mouse-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.5s ease;
    /* JS sets background */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: var(--glass);
    background: rgba(2, 6, 23, 0.6);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    transition: padding 0.3s ease;
}

nav.scrolled {
    padding: 0.8rem 0;
    background: rgba(2, 6, 23, 0.85);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: #fff;
    letter-spacing: -0.05em;
    position: relative;
    z-index: 1;
}

.logo span {
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.3s;
    position: relative;
}

.nav-links a:not(.nav-github)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--primary-glow);
}

.nav-links a:not(.nav-github):hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: #fff;
}

.nav-github {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    border: 1px solid var(--border);
    color: #fff !important;
    transition: var(--transition);
}

.nav-github:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 6rem;
    position: relative;
}

.badge-container {
    perspective: 1000px;
}

.badge {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    color: var(--primary);
    padding: 0.5rem 1.2rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: inline-block;
    margin-bottom: 2rem;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

h1 {
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    background: linear-gradient(to bottom, #fff 40%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.blue-text {
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 5s linear infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

.hero-subtext {
    max-width: 600px;
    margin: 0 auto 3rem;
    color: var(--text-dim);
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.7;
}

.hero-subtext strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    position: relative;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 10px 30px -5px var(--primary-glow);
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 14px;
    z-index: -1;
}

.btn-primary:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px -10px var(--accent-glow);
}

.btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    transform: skewX(-25deg);
    transition: 0.5s;
    filter: blur(5px);
}

.btn-primary:hover .btn-shimmer {
    left: 200%;
    transition: 0.7s ease-in-out;
}

.btn-secondary {
    padding: 1rem 2.5rem;
    border-radius: 14px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-dim);
    transform: translateY(-2px);
}

.btn-discord {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--discord);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 10px 30px -5px rgba(88, 101, 242, 0.4);
}

.btn-discord:hover {
    background: var(--discord-hover);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -5px rgba(88, 101, 242, 0.6);
}

.btn-discord svg {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-discord:hover svg {
    transform: rotate(15deg) scale(1.2);
}

/* Metrics Section */
.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 4rem 0 10rem;
    position: relative;
    z-index: 2;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2.5rem 1.5rem;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

/* Shine effect on hover */
.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
}

.metric-val {
    display: block;
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(to bottom right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
}

.metric-label {
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

/* Stack Section */
.stack-section {
    padding: 6rem 0;
    text-align: center;
}

.section-label {
    font-size: 1rem;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 4px;
    margin-bottom: 5rem;
    font-weight: 800;
    position: relative;
    display: inline-block;
}

.section-label::after {
    content: '';
    display: block;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 10px auto 0;
}

.stack-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4rem;
}

.stack-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
    padding: 2rem;
    border-radius: 20px;
    background: transparent;
}

.stack-item:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-10px);
}

.stack-item img {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 0 0 transparent);
    transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stack-item:hover img {
    filter: drop-shadow(0 0 20px var(--primary-glow));
    transform: scale(1.2) rotate(5deg);
}

.stack-item span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: var(--text-dim);
    font-weight: 500;
    transition: 0.3s;
}

.stack-item:hover span {
    color: #fff;
}

/* Projects Section */
.work-section {
    padding: 10rem 0;
}

.section-header {
    margin-bottom: 6rem;
    text-align: left;
    /* Align left for variety */
}

.title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #fff;
}

.section-header p {
    color: var(--text-dim);
    font-size: 1.1rem;
    max-width: 600px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}

.project-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    /* For JS tilt */
}

/* Glowing border effect via ::after */
.project-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.project-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-15px) scale(1.02);
    /* Fallback */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.card-num {
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    font-weight: 800;
    opacity: 0.5;
}

.status-tag {
    float: right;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #10b981;
    /* Success Green */
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.project-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #fff;
    clear: both;
}

.project-card p {
    color: var(--text-dim);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.card-tags span {
    font-size: 0.75rem;
    background: rgba(30, 41, 59, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--text-accent);
    font-weight: 600;
    border: 1px solid var(--border);
    transition: 0.3s;
}

.project-card:hover .card-tags span {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

/* CTA Section */
.cta-box {
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.8), rgba(2, 6, 23, 0.95));
    border: 1px solid var(--border);
    padding: 6rem 2rem;
    border-radius: 40px;
    text-align: center;
    margin: 6rem 0;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    z-index: 0;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.cta-box>* {
    position: relative;
    z-index: 1;
}

.cta-box h2 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-box p {
    margin-bottom: 3.5rem;
    color: var(--text-dim);
    font-size: 1.25rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
footer {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
    background: #020617;
    position: relative;
    z-index: 10;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    margin-left: 2rem;
    transition: 0.3s;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero {
        text-align: center;
        padding-top: 8rem;
    }

    .button-group {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-discord {
        width: 100%;
        justify-content: center;
    }

    .metrics {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .stack-grid {
        gap: 2rem;
    }

    .stack-item {
        width: 45%;
    }

    .title {
        text-align: center;
    }

    .section-header p {
        text-align: center;
        margin: 0 auto;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .footer-links a {
        margin: 0 1rem;
    }
}