:root {
    --primary-red: #dc2626;
    --dark-red: #991b1b;
    --light-red: #f87171;
    --accent-red: #ff1744;
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --text-light: #f8fafc;
    --text-gray: #94a3b8;
    --border-red: rgba(220, 38, 38, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Three.js Background */
#threejs-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0505 100%);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 0;
    backdrop-filter: blur(20px);
    background: rgba(10, 10, 10, 0.8);
    border-bottom: 1px solid var(--border-red);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 0.5rem 0;
    background: rgba(5, 5, 5, 0.95);
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-red);
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    font-size: 0;
}

.logo span {
    display: inline-block;
    font-size: 1.5rem;
    animation: wave 1.2s infinite;
}

/* Apply a delay to each letter for wave effect */
.logo span:nth-child(1) { animation-delay: 0s; }
.logo span:nth-child(2) { animation-delay: 0.1s; }
.logo span:nth-child(3) { animation-delay: 0.2s; }
.logo span:nth-child(4) { animation-delay: 0.3s; }
.logo span:nth-child(5) { animation-delay: 0.4s; }
.logo span:nth-child(6) { animation-delay: 0.5s; }
.logo span:nth-child(7) { animation-delay: 0.6s; }
.logo span:nth-child(8) { animation-delay: 0.7s; }
.logo span:nth-child(9) { animation-delay: 0.8s; }
.logo span:nth-child(10) { animation-delay: 0.9s; }
.logo span:nth-child(11) { animation-delay: 1s; }
.logo span:nth-child(12) { animation-delay: 1.1s; }

/* Wavy keyframes */
@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2.5px); }
}

.nav-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

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

.nav-link {
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-red);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

.nav-link:hover {
    color: var(--text-light);
    background: rgba(220, 38, 38, 0.1);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid var(--border-red);
    border-radius: 8px;
    padding: 0.3rem;
}

.lang-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    background: transparent;
    color: var(--text-gray);
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.lang-btn:hover {
    color: var(--text-light);
    background: rgba(220, 38, 38, 0.1);
}

.lang-btn.active {
    background: var(--primary-red);
    color: var(--text-light);
}

/* Section Animation */
.section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
    pointer-events: none;
}

.section.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.section.slide-out-left {
    transform: translateX(-50px);
    opacity: 0;
}

.section.slide-in-right {
    transform: translateX(50px);
    opacity: 0;
}

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

.hero-content {
    text-align: center;
    max-width: 900px;
    z-index: 2;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-light) 0%, var(--primary-red) 50%, var(--accent-red) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.3));
    }
    100% {
        filter: drop-shadow(0 0 20px rgba(220, 38, 38, 0.6));
    }
}

.hero-subtitle {
    font-size: 1.8rem;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

.typewriter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    color: var(--primary-red);
    border-right: 3px solid var(--primary-red);
    padding-right: 5px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { border-color: var(--primary-red); }
    51%, 100% { border-color: transparent; }
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin: 2.5rem 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cta-buttons {
    margin-top: 3rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

.btn {
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
}

.btn-secondary:hover {
    background: var(--primary-red);
    color: var(--text-light);
    transform: translateY(-3px);
}

/* Skills Section */
.skills-section {
    padding: 6rem 2rem;
    background: rgba(5, 5, 5, 0.5);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
}

.skills-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding-top: 80px;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 3rem;
    color: var(--text-light);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid var(--border-red);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    transform: translateY(30px);
    opacity: 0;
}

.skill-card.animate {
    transform: translateY(0);
    opacity: 1;
}

.skill-card:nth-child(1) { transition-delay: 0.1s; }
.skill-card:nth-child(2) { transition-delay: 0.2s; }
.skill-card:nth-child(3) { transition-delay: 0.3s; }

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(220, 38, 38, 0.2);
    border-color: var(--primary-red);
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.1), transparent);
    transition: left 0.5s;
}

.skill-card:hover::before {
    left: 100%;
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-red);
}

.skill-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
    font-weight: 600;
}

.skill-description {
    color: var(--text-gray);
    line-height: 1.6;
}

/* Contact Section */
.contact-section {
    padding: 6rem 2rem;
    background: rgba(10, 10, 10, 0.8);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
}

.contact-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding-top: 80px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.contact-card {
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid var(--border-red);
    border-radius: 15px;
    padding: 2rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-light);
    transform: translateY(30px);
    opacity: 0;
}

.contact-card.animate {
    transform: translateY(0);
    opacity: 1;
}

.contact-card:nth-child(1) { transition-delay: 0.1s; }
.contact-card:nth-child(2) { transition-delay: 0.2s; }
.contact-card:nth-child(3) { transition-delay: 0.3s; }

.contact-card:hover {
    transform: translateY(-5px);
    background: rgba(220, 38, 38, 0.1);
    border-color: var(--primary-red);
}

.contact-icon {
    font-size: 2.5rem;
    color: var(--primary-red);
    margin-bottom: 1rem;
}

.contact-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.contact-info {
    color: var(--text-gray);
}

.contact-info a {
    color: var(--primary-red);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--accent-red);
}

.copyable-text {
    cursor: pointer;
    color: var(--primary-red);
    transition: color 0.3s ease;
    user-select: all;
}

.copyable-text:hover {
    color: var(--accent-red);
}

/* Floating elements */
.floating-element {
    position: absolute;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(220, 38, 38, 0.05));
    border: 1px solid var(--border-red);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    padding: 1rem;
    animation: float 6s ease-in-out infinite;
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary-red);
}

.floating-element:nth-child(1) {
    top: 15%;
    left: 8%;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    top: 50%;
    right: 8%;
    animation-delay: 2s;
}

.floating-element:nth-child(3) {
    bottom: 20%;
    left: 12%;
    animation-delay: 1.5s;
}

.floating-element:nth-child(4) {
    top: 30%;
    right: 20%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(1deg); }
    66% { transform: translateY(10px) rotate(-1deg); }
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    transition: 0.3s;
    border-radius: 2px;
}

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

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

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-content {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(5, 5, 5, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        border-top: 1px solid var(--border-red);
        gap: 2rem;
    }

    .nav-content.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .language-switcher {
        justify-self: center;
    }

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

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .floating-element {
        display: none;
    }

    .hero {
        padding: 0 1rem;
    }

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

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-red);
}
