/* Global Styles & CSS Variables */
:root {
    --primary-color: #00f2fe;
    --secondary-color: #4facfe;
    --dark-bg: #0f172a;
    --darker-bg: #020617;
    --text-light: #f8fafc;
    --text-gray: #cbd5e1;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition-speed: 0.3s;
}

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

html {
    scroll-behavior: smooth;
    font-family: 'Inter', sans-serif;
    color: var(--text-light);
    background-color: var(--dark-bg);
}

body {
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Navigation Bar */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: all var(--transition-speed) ease-in-out;
}

#navbar.scrolled {
    padding: 1rem 0;
    background: linear-gradient(135deg, #020617, #06265e, #020617);
    background-size: 400% 400%;
    animation: neonPan 15s ease infinite;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 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: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
}

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

.nav-links li a {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-gray);
    transition: color var(--transition-speed);
    position: relative;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width var(--transition-speed) ease;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--text-light);
}

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

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-light);
    margin: 5px;
    transition: all 0.3s ease;
}

/* Hero Section & Video Background */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    overflow: hidden;
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.8s ease;
    transform: translateZ(0); /* Hardware acceleration */
    will-change: opacity; /* Optimize paint */
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0;
    margin-left: 5vw;
    max-width: 600px;
    opacity: 0;
    transform: translateX(-30px);
    animation: fadeInLeft 1s ease forwards 0.5s;
}

.hero-title {
    font-size: clamp(2rem, 8vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 0 0 30px rgba(0, 242, 254, 0.6);
    animation: textGlow 3s ease-in-out infinite alternate;
}

.name-glow {
    font-weight: 900;
    background: linear-gradient(to right, #00f2fe, #a855f7, #ec4899, #00f2fe);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientFlow 4s linear infinite;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.5));
}

.hero-subtitle {
    font-size: clamp(1.1rem, 4vw, 1.8rem);
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.hero-details {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 2.5rem;
    line-height: 1.6;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed), background var(--transition-speed);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 242, 254, 0.5);
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
}

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

.secondary-btn:hover {
    background: rgba(0, 242, 254, 0.1);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

/* Animations */
@keyframes fadeInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes gradientText {
    to {
        background-position: 200% center;
    }
}

@keyframes textGlow {
    from {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.4), 0 0 20px rgba(0, 242, 254, 0.4);
    }
    to {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(0, 242, 254, 0.8);
    }
}

@keyframes gradientFlow {
    to {
        background-position: 200% center;
    }
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(80px) scale(0.95);
    transition: all 1s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: opacity, transform;
}

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

/* Content Sections */
.section {
    padding: 6rem 2rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #020617, #06265e, #020617);
    background-size: 400% 400%;
    animation: neonPan 15s ease infinite;
}

#projects {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0, 100, 200, 0.25), rgba(0, 242, 254, 0.15));
    backdrop-filter: blur(2px);
    border-top: 1px solid rgba(79, 172, 254, 0.3);
    border-bottom: 1px solid rgba(79, 172, 254, 0.3);
}

#laser-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

#projects .container {
    position: relative;
    z-index: 1;
}

#projects h2 {
    background: linear-gradient(135deg, #ffffff, #a8d8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 2px 10px rgba(0, 242, 254, 0.5));
}

#projects > .container > p {
    color: rgba(200, 235, 255, 0.9);
    text-shadow: none;
}

/* Project card staggered scroll reveal */
.card-reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    will-change: opacity, transform;
}

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

.bg-dark {
    background: linear-gradient(135deg, #01030d, #041b44, #01030d);
    background-size: 400% 400%;
    animation: neonPan 15s ease infinite reverse;
}

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

.container h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-light), var(--text-gray));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.container p {
    color: var(--text-gray);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 1100px) {
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .projects-grid { grid-template-columns: 1fr; }
}

.project-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
    backdrop-filter: blur(10px);
    animation: floatCard 5s ease-in-out infinite;
    will-change: transform, box-shadow;
}

.project-card:nth-child(2) { animation-delay: -1.2s; }
.project-card:nth-child(3) { animation-delay: -2.4s; }
.project-card:nth-child(4) { animation-delay: -3.6s; }
.project-card:nth-child(5) { animation-delay: -0.8s; }
.project-card:nth-child(6) { animation-delay: -2.0s; }
.project-card:nth-child(7) { animation-delay: -3.2s; }
.project-card:nth-child(8) { animation-delay: -4.4s; }

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


.project-card:hover {
    transform: translateY(-14px) scale(1.03);
    box-shadow: 0 22px 44px rgba(0, 242, 254, 0.3);
    animation-play-state: paused;
}

.card-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 30, 80, 0.97), rgba(0, 100, 200, 0.97));
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.2rem;
    opacity: 0;
    transform: translateY(100%) scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(12px);
}

.project-card:hover .card-hover-overlay {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.card-hover-overlay p {
    color: rgba(200, 235, 255, 0.95);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0;
}

.card-hover-overlay .project-link {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #ffffff;
    padding: 0.6rem 1.4rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.3s, transform 0.2s;
    align-self: flex-start;
    text-shadow: none;
}

.card-hover-overlay .project-link:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
    text-shadow: none;
}

.project-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.project-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    color: var(--text-light);
}

.project-card p {
    font-size: 0.95rem;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.tag {
    font-family: 'Space Grotesk', sans-serif;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.project-link {
    color: var(--primary-color);
    font-weight: 600;
    position: relative;
    transition: color 0.3s;
}

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

/* Skills Layout */
.skills-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 2rem;
}

.skill-category h3 {
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    color: var(--text-light);
}

.skills-list {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.skill-badge {
    font-family: 'Space Grotesk', sans-serif;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--clr);
    color: var(--text-light);
    padding: 0.8rem 1.8rem;
    border-radius: 30px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: default;
    animation: badgePulse 3s ease-in-out infinite;
    will-change: transform, box-shadow;
}

/* stagger each badge independently */
.skill-badge:nth-child(1)  { animation-delay: 0s; }
.skill-badge:nth-child(2)  { animation-delay: -0.5s; }
.skill-badge:nth-child(3)  { animation-delay: -1s; }
.skill-badge:nth-child(4)  { animation-delay: -1.5s; }
.skill-badge:nth-child(5)  { animation-delay: -2s; }
.skill-badge:nth-child(6)  { animation-delay: -2.5s; }

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 6px var(--clr), 0 0 0px var(--clr);
        transform: translateY(0);
    }
    50% {
        box-shadow: 0 0 20px var(--clr), 0 0 35px var(--clr);
        transform: translateY(-4px);
    }
}

.skill-badge:hover {
    background: var(--clr);
    color: #fff;
    box-shadow: 0 0 30px var(--clr);
    transform: translateY(-6px) scale(1.08);
    animation-play-state: paused;
}

/* Contact Layout */
.contact-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 3rem;
    max-width: 600px;
    margin: 2rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    backdrop-filter: blur(10px);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 1.2rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    transition: background 0.3s;
    background: rgba(255, 255, 255, 0.03);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.contact-icon {
    font-size: 1.8rem;
}

.contact-item a {
    color: var(--text-light);
    transition: color 0.3s;
}

.contact-item a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        right: -100%;
        top: 0;
        flex-direction: column;
        background: var(--glass-bg);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        width: 100%;
        height: 100vh;
        text-align: center;
        padding-top: 6rem;
        transition: 0.4s ease-in-out;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    .nav-links li a {
        font-size: 1.5rem;
    }

    .hamburger {
        display: block;
        z-index: 1001;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Fix hero video alignment on mobile */
    .bg-video {
        object-position: 70% center; /* Adjust horizontally to keep subject in frame */
    }

    .hero-content {
        margin-left: 0;
        padding: 0 2rem;
        text-align: center;
        background: rgba(2, 6, 23, 0.4);
        backdrop-filter: blur(4px);
        padding: 2rem;
        border-radius: 1rem;
        margin: 0 1rem;
    }

    .hero-buttons {
        justify-content: center;
    }
}