:root {
    --bg-color: #020205; /* Deep dark blue/black fallback */
    --text-color: #ffffff;
    --primary-color: #00ffff; /* Cyan */
    --secondary-color: #0055ff; /* Deep Blue */
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.08);
    --blur: 40px;
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-color); /* Fallback */
    background: transparent; /* Let canvas show through */
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
    cursor: none;
}

@media (max-width: 768px) {
    body {
        cursor: auto;
    }
}

h1, h2, h3, .logo {
    font-family: 'Space Grotesk', sans-serif; /* Switch to cleaner font */
    letter-spacing: -0.02em; /* Tighter tracking for modern feel */
}

h1 {
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Loading Overlay */
.loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loader-rings {
    position: relative;
    width: 4rem;
    height: 4rem;
}

.ring-outer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border-top: 2px solid #8b5cf6; /* Violet */
    animation: spin 1s linear infinite;
}

.ring-inner {
    position: absolute;
    inset: 0.5rem;
    border-radius: 50%;
    border-right: 2px solid #6366f1; /* Indigo */
    animation: spin 1.5s linear infinite reverse;
}

.loader-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: #a78bfa; /* Violet-400 */
    font-weight: 500;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* WebGL Canvas */
#webgl-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    outline: none;
    pointer-events: none;
}

/* Glassmorphism Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.5s ease,
                box-shadow 0.5s ease;
}

.glass-panel:hover {
    border-color: rgba(0, 255, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -20px rgba(0, 255, 255, 0.15);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    /* Transparent nav for premium feel, blur handled by backdrop */
    background: rgba(2, 2, 5, 0.6);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo a {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}

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

.nav-links a {
    font-size: 1rem;
    font-weight: 400;
    position: relative;
    opacity: 0.8;
}

.nav-links a:hover {
    opacity: 1;
}

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

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 5%;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hero-content h1 {
    font-size: clamp(3.5rem, 9vw, 9rem);
    line-height: 1.05;
    font-weight: 600;
    margin-bottom: 2rem;
    letter-spacing: -0.04em;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.description {
    font-size: 1.25rem;
    max-width: 600px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 3.5rem;
    font-weight: 300;
    line-height: 1.7;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.btn {
    padding: 1.2rem 3rem;
    border-radius: 100px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--text-color);
    color: #000;
    border: 1px solid var(--text-color);
}

.btn-primary:hover {
    background: transparent;
    color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

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

.btn-secondary:hover {
    border-color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

/* Stats Bar - Redesigned */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 4rem 5%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin: 2rem 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.stat-item {
    text-align: center;
    position: relative;
}

.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.stat-number {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

/* Bento Grid Layout */
.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 3rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    padding: 4rem 5%;
    max-width: 1600px;
    margin: 0 auto;
}

.project-card {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

.project-header {
    margin-bottom: 1.5rem;
}

.project-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.project-year {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
    opacity: 0.8;
}

.project-desc {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2.5rem;
}

.tech-tag {
    font-size: 0.8rem;
    padding: 0.5rem 1.2rem;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.project-link {
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    width: fit-content;
}

.project-link:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Skills Section */
.skills-section {
    padding: 8rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.skills-category {
    margin-bottom: 5rem;
}

.skills-category h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    opacity: 0.9;
    font-weight: 500;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.skill-tag {
    font-size: 1.1rem;
    padding: 1rem 2.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(5px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    color: rgba(255, 255, 255, 0.8);
}

.skill-tag:hover {
    border-color: var(--primary-color);
    background: rgba(0, 255, 255, 0.05);
    color: #fff;
    transform: translateY(-2px);
}

/* Contact */
.contact-section {
    padding: 10rem 5%;
    text-align: center;
    position: relative;
}

.contact-title {
    font-size: clamp(3rem, 8vw, 6rem);
    margin-bottom: 3rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

/* Footer */
footer {
    padding: 4rem 5%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.2);
}

/* Mobile Nav */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 102;
}

.mobile-menu-btn span {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(2, 2, 5, 0.98);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 101;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-nav.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-nav ul {
    list-style: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.mobile-nav a {
    font-size: 2.5rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    color: var(--text-color);
}

/* 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;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.cursor-outline {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .stats-bar {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .stat-item:not(:last-child)::after {
        display: none;
    }

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

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