@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-color: #030303;
    --card-bg: #080808;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent-red: #ff3b3b;
    --accent-gradient: linear-gradient(135deg, #ff3b3b 0%, #ff0000 100%);
    --border-color: rgba(255, 255, 255, 0.08);
    --nav-height: 80px;
    --card-glow: 0 0 40px rgba(255, 59, 59, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Particles */
#particles-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 59, 59, 0.15) 0%, rgba(255, 59, 59, 0.05) 50%, transparent 100%);
    filter: blur(40px);
    animation: float infinite ease-in-out;
    opacity: 0.6;
    transition: background 0.5s ease;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-20px, -100px) scale(0.9);
    }
    75% {
        transform: translate(-40px, -50px) scale(1.05);
    }
}

/* Ensure content is above particles */
header, section, footer {
    position: relative;
    z-index: 1;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 8rem 0;
    border-bottom: 1px solid var(--border-color);
}

/* Header */
header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(3, 3, 3, 0.8);
    backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.btn-nav {
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-primary) !important;
    transition: background 0.2s;
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Hero Section */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: var(--nav-height);
    background: radial-gradient(circle at 50% 30%, rgba(255, 59, 59, 0.08) 0%, transparent 60%);
}

.hero h1 {
    font-size: 5rem;
    margin-bottom: 1.5rem;
}

#name-text {
    transition: opacity 0.3s ease;
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* Name Toggle */
#name-toggle {
    transition: transform 0.2s ease, color 0.3s ease;
    display: inline-block;
}

#name-toggle:hover {
    color: var(--accent-red);
}

#name-dot {
    transition: color 0.3s ease;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-secondary);
    font-size: 2rem;
    animation: bounce 2s infinite;
    cursor: pointer;
    transition: color 0.3s;
    text-decoration: none;
}

.scroll-indicator:hover {
    color: var(--accent-red);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--accent-red);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 59, 59, 0.3);
}

.btn-secondary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: transparent;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    margin-right: 1rem;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Features / Expertise */
.section-header {
    margin-bottom: 4rem;
}

.section-label {
    color: var(--accent-red);
    font-weight: 600;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.feature-card {
    padding: 2rem;
    border-left: 1px solid var(--border-color);
    transition: border-color 0.3s;
}

.feature-card:hover {
    border-left-color: var(--accent-red);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Tech Stack */
.tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: center;
    justify-content: center;
}

.tech-item {
    font-size: 2.5rem;
    opacity: 0.3;
    transition: opacity 0.3s, transform 0.3s, filter 0.3s;
}

.tech-item:hover {
    opacity: 1;
    transform: scale(1.15);
    filter: drop-shadow(0 0 25px currentColor) brightness(1.2);
}

/* Projects */
.project-card {
    background: #0a0a0a;
    border: 1px solid rgba(255, 59, 59, 0.15);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 59, 59, 0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 59, 59, 0.3);
    box-shadow: 0 8px 30px rgba(255, 59, 59, 0.15);
}

.project-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 59, 59, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--accent-red);
}

.project-link {
    color: var(--accent-red);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.2s;
}

.project-link:hover {
    gap: 0.75rem;
}

/* Footer */
#contact .container {
    text-align: center;
}

.btn-discord {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: #5865F2;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 4rem;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-discord:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.4);
    background: #4752C4;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 59, 59, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--accent-red);
    transition: background 0.3s, color 0.3s;
}

.view-project-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.2s;
}

/* Tablet and below (768px) */
@media (max-width: 768px) {
    :root {
        --nav-height: 60px;
    }

    .container {
        padding: 0 1.5rem;
    }

    section {
        padding: 4rem 0;
    }

    /* Header */
    header {
        height: var(--nav-height);
    }

    .logo {
        font-size: 1.25rem;
    }

    .nav-links {
        gap: 1rem !important;
    }

    .nav-icon svg, .nav-icon i {
        width: 20px;
        height: 20px;
    }

    /* Hero Section */
    .hero h1 {
        font-size: 3.5rem !important;
    }

    .hero p {
        font-size: 1rem;
    }

    .btn-primary, .btn-secondary {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .btn-secondary {
        margin-left: 0.5rem;
    }

    /* Scroll Indicator */
    .scroll-indicator {
        font-size: 1.5rem;
        bottom: 1rem;
    }

    /* Section Headers */
    .section-header h2 {
        font-size: 1.75rem !important;
    }

    /* Feature Cards */
    .grid-3 {
        grid-template-columns: 1fr !important;
    }

    .feature-card {
        padding: 1.5rem;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }

    /* Tech Stack */
    .tech-grid {
        gap: 2rem;
    }

    .tech-item {
        font-size: 2rem;
    }

    /* Project Cards */
    .project-card {
        padding: 1.5rem;
        min-height: auto;
    }

    /* Footer */
    .btn-discord {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    section {
        padding: 3rem 0;
    }

    /* Hero Section */
    .hero {
        min-height: 100vh;
    }

    .hero h1 {
        font-size: 2.5rem !important;
        margin-bottom: 1rem;
    }

    .hero p {
        font-size: 0.95rem;
        margin-bottom: 2rem !important;
    }

    .btn-primary, .btn-secondary {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
        text-align: center;
    }

    /* Navigation */
    .nav-links {
        gap: 0.75rem !important;
    }

    /* Section Headers */
    .section-header {
        margin-bottom: 2rem;
    }

    .section-header h2 {
        font-size: 1.5rem !important;
    }

    .section-label {
        font-size: 0.75rem;
    }

    /* Feature Cards */
    .feature-card {
        padding: 1rem;
    }

    .feature-card h3 {
        font-size: 1.1rem;
    }

    /* Tech Stack */
    /* Footer */
    .btn-discord {
        width: 100%;
    .tech-grid {
        gap: 1.5rem;
    }

    .tech-item {
        font-size: 1.5rem;
    }

    /* Reduce particles for performance */
    .particle:nth-child(n+6) {
        display: none;
    }
}

/* Particle Animation - Optimized for 60 FPS */
.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 59, 59, 0.15) 0%, rgba(255, 59, 59, 0.05) 50%, transparent 100%);
    animation: particleFloat 20s infinite ease-in-out;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    33% {
        transform: translate3d(30px, -30px, 0) rotate(120deg);
    }
    66% {
        transform: translate3d(-20px, 20px, 0) rotate(240deg);
    }
}

/* Smooth transitions with GPU acceleration */
.tech-item,
.feature-card,
.project-card,
.btn-primary,
.btn-secondary {
    will-change: transform;
    backface-visibility: hidden;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
