:root {
    --primary: #ff6b6b;
    --secondary: #4ecdc4;
    --accent: #ffd166;
    --dark: #1a1a2e;
    --darker: #0d0d1a;
    --light: #f7f9fc;
    --gray: #8a8f9d;
    --pixel-size: 4px;
    --transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --pixel-border: 2px solid var(--dark);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Rubik', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
    color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
    background-attachment: fixed;
    position: relative;
    min-height: 100vh;
}

/* Dynamic Triangle Background */
#triangle-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.triangle {
    position: absolute;
    opacity: 0.15;
    transition: all 5s ease;
    filter: blur(1px);
}

.triangle.red {
    background: linear-gradient(45deg, #ff0000, #ff4d4d);
}

.triangle.violet {
    background: linear-gradient(45deg, #8a2be2, #9370db);
}

.triangle.blue {
    background: linear-gradient(45deg, #0000ff, #4169e1);
}

.pixel-font {
    font-family: 'Press Start 2P', cursive;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo .pixel {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--primary);
    margin-right: 10px;
    box-shadow: 0 0 10px var(--primary);
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    text-decoration: none;
    color: var(--light);
    font-weight: 500;
    font-size: 1.1rem;
    position: relative;
    padding: 5px 0;
    transition: var(--transition);
}

nav ul li a:hover {
    color: var(--accent);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--accent);
    transition: var(--transition);
}

nav ul li a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    color: var(--light);
    font-size: 1.5rem;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
            radial-gradient(circle at 20% 30%, rgba(255, 107, 107, 0.1) 0%, transparent 40%),
            radial-gradient(circle at 80% 70%, rgba(78, 205, 196, 0.1) 0%, transparent 40%);
    z-index: -1;
}

.hero-content {
    max-width: 650px;
    z-index: 2;
}

.hero-subtitle {
    color: var(--accent);
    font-weight: 500;
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--light);
}

.hero-title span {
    color: var(--primary);
    position: relative;
}

.hero-title span::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    height: 12px;
    background: rgba(255, 107, 107, 0.3);
    z-index: -1;
}

.hero-text {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 30px;
    max-width: 600px;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: #ff5252;
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.btn::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn:hover::after {
    transform: translateX(100%);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    margin-left: 15px;
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--dark);
}

.hero-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.hero-image {
    position: absolute;
    right: 120px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    width: 45%;
    max-width: 600px;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
    animation: float 6s ease-in-out infinite;
}

/* About Section */
.about {
    position: relative;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 60px;
    color: var(--light);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-image {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    height: 500px;
    background: linear-gradient(45deg, rgba(26, 26, 46, 0.8), rgba(13, 13, 26, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    border: var(--pixel-border);
}

.about-image::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    opacity: 0.2;
    animation: pulse 8s infinite;
}

.about-image img {
    width: 80%;
    position: relative;
    border-radius: 50%;
    border: 5px solid var(--dark);
    box-shadow: var(--shadow);
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--accent);
}

.about-text p {
    margin-bottom: 20px;
    color: var(--gray);
    font-size: 1.1rem;
    line-height: 1.8;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
}

.skill {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.skill:hover {
    background: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

/* Projects Section */
.projects {
    position: relative;
    overflow: hidden;
}

.projects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="2" height="2" x="20" y="20" fill="rgba(255,255,255,0.05)"/><rect width="2" height="2" x="50" y="50" fill="rgba(255,255,255,0.05)"/><rect width="2" height="2" x="80" y="80" fill="rgba(255,255,255,0.05)"/></svg>');
    z-index: -1;
}

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

.project-card {
    background: rgba(26, 26, 46, 0.7);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    border: var(--pixel-border);
    backdrop-filter: blur(5px);
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg);
    background: rgba(26, 26, 46, 0.9);
}

.project-image {
    height: 250px;
    background: linear-gradient(45deg, rgba(26, 26, 46, 0.8), rgba(13, 13, 26, 0.9));
    position: relative;
    overflow: hidden;
    border-bottom: var(--pixel-border);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top */
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center; /* Ensure top is never cut off */
    display: block;
}

.project-content {
    padding: 25px;
}

.project-category {
    display: inline-block;
    background: rgba(255, 209, 102, 0.2);
    color: var(--accent);
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--light);
}

.project-description {
    color: var(--gray);
    margin-bottom: 20px;
    font-size: 1rem;
}

.project-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--secondary);
}

.project-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.project-link i {
    margin-left: 8px;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--primary);
}

.project-link:hover i {
    transform: translateX(5px);
}

/* Contact Section */
.contact {
    position: relative;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.contact-item {
    display: flex;
    gap: 15px;
    align-items: center;
    background: rgba(26, 26, 46, 0.5);
    padding: 20px;
    border-radius: var(--radius);
    transition: var(--transition);
    border: var(--pixel-border);
}

.contact-item:hover {
    background: rgba(26, 26, 46, 0.8);
    transform: translateY(-5px);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 209, 102, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.5rem;
    color: var(--accent);
    transition: var(--transition);
}

.contact-item:hover .contact-icon {
    background: var(--accent);
    color: var(--dark);
    transform: scale(1.1);
}

.contact-details h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--light);
}

.contact-details p {
    color: var(--gray);
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    background: rgba(26, 26, 46, 0.5);
    color: var(--light);
    border: var(--pixel-border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(26, 26, 46, 0.8);
}

.contact-form textarea {
    height: 150px;
    resize: vertical;
}

/* Footer */
footer {
    background: var(--darker);
    color: white;
    padding: 60px 0 30px;
    position: relative;
    border-top: var(--pixel-border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.footer-logo .pixel {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--primary);
    margin-right: 10px;
    box-shadow: 0 0 10px var(--primary);
}

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

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.3rem;
}

.social-links a:hover {
    background: var(--accent);
    color: var(--dark);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 209, 102, 0.3);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    color: var(--gray);
    font-size: 0.9rem;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pixel-grid {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background:
            repeating-linear-gradient(90deg,
            var(--primary) 0, var(--primary) 10px,
            var(--accent) 10px, var(--accent) 20px,
            var(--secondary) 20px, var(--secondary) 30px
            );
}

/* Alert Messages */
.custom-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    min-width: 300px;
    padding: 15px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateX(0);
    transition: all 0.3s ease;
    opacity: 0;
    animation: slideIn 0.5s forwards;
}

@keyframes slideIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.custom-alert.success {
    background: #4caf50;
    border-left: 5px solid #2e7d32;
    color: white;
}

.custom-alert.error {
    background: #f44336;
    border-left: 5px solid #c62828;
    color: white;
}

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

.alert-content p {
    margin: 0;
    font-size: 0.95rem;
    flex-grow: 1;
}

.close-alert {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 15px;
    padding: 0;
    line-height: 1;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
    100% {
        transform: scale(1);
        opacity: 0.2;
    }
}

@keyframes float {
    0% {
        transform: translateY(-50%) translateX(0) rotate(0deg);
    }
    50% {
        transform: translateY(-53%) translateX(10px) rotate(3deg);
    }
    100% {
        transform: translateY(-50%) translateX(0) rotate(0deg);
    }
}
/* Triangle Background */
#triangle-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.triangle {
    position: absolute;
    opacity: 0.1;
    transition: opacity 3s ease, transform 0.5s ease;
    filter: blur(0.5px);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation: triangleFloat 15s infinite ease-in-out;
}

.triangle.blue {
    background: linear-gradient(45deg, rgba(0, 119, 255, 0.8), rgba(0, 183, 255, 0.6));
}

.triangle.violet {
    background: linear-gradient(45deg, rgba(138, 43, 226, 0.8), rgba(186, 85, 211, 0.6));
}

@keyframes triangleFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(5px, 5px) rotate(1deg); }
    50% { transform: translate(10px, 0) rotate(0deg); }
    75% { transform: translate(5px, -5px) rotate(-1deg); }
}


/* Responsive Design */
@media (max-width: 992px) {
    .about-content,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .about-image {
        height: 400px;
        max-width: 500px;
        margin: 0 auto;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-image {
        display: none;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    nav ul {
        position: fixed;
        top: 80px;
        left: -100%;
        flex-direction: column;
        background: var(--dark);
        width: 100%;
        text-align: center;
        box-shadow: var(--shadow);
        transition: var(--transition);
        padding: 20px 0;
        gap: 20px;
    }

    nav ul.active {
        left: 0;
    }

    nav ul li {
        margin: 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

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

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .btn-outline {
        margin-left: 0;
    }

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

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .about-image {
        height: 300px;
    }
}