:root {
    --primary-red: #e31b23;
    --secondary-red: #c41016;
    --accent-red: #ff2a33;
    --black: #121212;
    --dark-gray: #1e1e1e;
    --light-gray: #333333;
    --text-color: #f5f5f5;
    --gradient-dark: linear-gradient(135deg, #121212 0%, #1e1e1e 100%);
    --gradient-red: linear-gradient(135deg, var(--primary-red) 0%, var(--secondary-red) 100%);
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(227, 27, 35, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(227, 27, 35, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(227, 27, 35, 0);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    cursor: none;
}

body {
    background-color: var(--black);
    color: var(--text-color);
    overflow-x: hidden;
}

#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Custom cursor */
.cursor-dot,
.cursor-outline {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.cursor-dot {
    width: 10px;
    height: 10px;
    background-color: var(--primary-red);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-red);
    transition: transform 0.15s ease;
}

.cursor-hover {
    transform: translate(-50%, -50%) scale(1.5);
    background-color: transparent;
    border: 1px solid var(--primary-red);
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    background-color: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--primary-red);
    transition: all 0.5s ease;
}

header.scrolled {
    padding: 15px 0;
    background-color: rgba(18, 18, 18, 0.95);
    box-shadow: 0 5px 20px rgba(227, 27, 35, 0.2);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-red);
    text-decoration: none;
    position: relative;
    padding: 5px 10px;
    overflow: hidden;
}

.logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--gradient-red);
    transition: all 0.5s ease;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -100%;
    width: 100%;
    height: 2px;
    background: var(--gradient-red);
    transition: all 0.5s ease;
}

.logo:hover::before {
    left: 0;
}

.logo:hover::after {
    right: 0;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.nav-links a:hover {
    color: var(--primary-red);
}

.nav-links a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-red);
    transition: width 0.3s ease;
}

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: none;
}

section {
    min-height: 100vh;
    padding: 120px 0;
    display: flex;
    align-items: center;
    position: relative;
}

.hero {
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    color: var(--primary-red);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1.2;
    background: var(--gradient-red);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradient 5s ease infinite;
    opacity: 0;
    transform: translateY(20px);
}

.hero-description {
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 20px;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(20px);
}

.hero-buttons {
    opacity: 0;
    transform: translateY(20px);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background-color: var(--primary-red);
    color: var(--text-color);
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: none;
    transition: all 0.3s ease;
    max-width: fit-content;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    z-index: -1;
}

.btn:hover::before {
    width: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(227, 27, 35, 0.3);
}

.btn .btn-icon {
    transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
    transform: translateX(5px);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
}

.section-title:after {
    content: '';
    position: absolute;
    width: 50%;
    height: 3px;
    left: 0;
    bottom: -10px;
    background: var(--gradient-red);
    background-size: 200% auto;
    animation: gradient 5s ease infinite;
}

.projects {
    background-color: rgba(18, 18, 18, 0.7);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--dark-gray);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.5s ease;
    position: relative;
    border-left: 3px solid var(--primary-red);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(30px);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(to bottom, rgba(227, 27, 35, 0.1), transparent);
    transition: height 0.5s ease;
    z-index: 1;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 25px rgba(227, 27, 35, 0.2);
}

.project-card:hover::before {
    height: 100%;
}

.project-content {
    padding: 25px;
    position: relative;
    z-index: 2;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-red);
    transition: transform 0.3s ease;
}

.project-card:hover .project-title {
    transform: translateX(5px);
}

.project-description {
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.05);
}

.project-link:hover {
    color: var(--primary-red);
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.contact {
    background-color: rgba(18, 18, 18, 0.7);
}

.contact-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-text {
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 20px;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(20px);
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background-color: var(--light-gray);
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

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

.social-link:hover {
    background-color: var(--primary-red);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(227, 27, 35, 0.3);
}

.social-link:hover::before {
    left: 100%;
}

.social-icon {
    font-size: 20px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.social-link:hover .social-icon {
    transform: scale(1.2);
}

footer {
    background-color: var(--dark-gray);
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid var(--primary-red);
    position: relative;
}

.footer-text {
    font-size: 0.9rem;
    color: #aaa;
    position: relative;
    z-index: 2;
}

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-red);
    color: var(--text-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 99;
    box-shadow: 0 5px 15px rgba(227, 27, 35, 0.3);
    cursor: none;
}

.scroll-top.active {
    opacity: 1;
    animation: pulse 2s infinite;
}

.scroll-top:hover {
    transform: translateY(-5px);
}

/* Loading animation */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    font-size: 60px;
    font-weight: bold;
    color: var(--primary-red);
    margin-bottom: 20px;
    animation: float 2s ease-in-out infinite;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(227, 27, 35, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-red);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto;
}

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

/* Progress bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 101;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-red);
    width: 0%;
    background-size: 200% auto;
    animation: gradient 5s ease infinite;
}

/* Mouse trail effect */
.trail {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary-red);
    opacity: 0;
    pointer-events: none;
    z-index: 9998;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    * {
        cursor: auto;
    }
    
    .cursor-dot, .cursor-outline, .trail {
        display: none;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: rgba(18, 18, 18, 0.95);
        flex-direction: column;
        padding: 20px;
        align-items: center;
        border-bottom: 1px solid var(--primary-red);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block;
        cursor: pointer;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .project-card {
        transform: translateY(0);
    }
}