* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

:root {
    --primary: #00f5ff;
    --secondary: #7b2ff7;
    --accent: #ff006e;
    --bg-dark: #0a0e27;
}

body {
    font-family: 'Inter', sans-serif;
    color: #fff;
    background: var(--bg-dark);
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Canvas */
#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Cursor Trail Effect */
.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary), transparent);
    pointer-events: none;
    opacity: 0.6;
    z-index: 9999;
    transition: transform 0.15s ease-out;
}

/* Navigation with Glassmorphism */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.2rem 3rem;
    background: rgba(10, 14, 39, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 245, 255, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

header.scrolled {
    padding: 0.8rem 3rem;
    background: rgba(10, 14, 39, 0.9);
    box-shadow: 0 8px 32px rgba(0, 245, 255, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 16px rgba(123, 47, 247, 0.8));
    }
}

nav ul {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

nav a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

nav a:hover {
    color: var(--primary);
}

nav a:hover::after {
    width: 100%;
}

/* Hero Section with 3D Text */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    position: relative;
    perspective: 1000px;
}

.hero-text {
    z-index: 10;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h2 {
    font-size: 5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: textShine 3s ease-in-out infinite;
    text-shadow: 0 0 40px rgba(0, 245, 255, 0.3);
}

@keyframes textShine {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.hero p {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 1rem 0 2.5rem;
    font-weight: 300;
    max-width: 800px;
}

.typing-effect {
    overflow: hidden;
    border-right: 3px solid var(--primary);
    white-space: nowrap;
    animation: typing 4s steps(70) 1s forwards, blink 0.75s step-end infinite;
    width: 0;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 8px 30px rgba(0, 245, 255, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 245, 255, 0.5);
}

/* Sections */
section {
    max-width: 1200px;
    margin: auto;
    padding: 8rem 3rem;
    position: relative;
}

h2 {
    font-size: 3rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    text-align: center;
}

.section-number {
    position: absolute;
    top: 6rem;
    left: 1rem;
    font-size: 8rem;
    font-weight: 700;
    color: rgba(0, 245, 255, 0.05);
    font-family: 'Montserrat', sans-serif;
    z-index: -1;
}

/* About Section with Floating Cards */
#about {
    text-align: center;
}

#about p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8);
    max-width: 800px;
    margin: 0 auto;
}

/* Project Cards with 3D Hover */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 245, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(10px);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.1), transparent);
    transition: left 0.5s;
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover {
    transform: translateY(-15px) rotateX(5deg);
    box-shadow: 0 20px 60px rgba(0, 245, 255, 0.3);
    border-color: var(--primary);
}

.project-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.project-card p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* Glass Résumé with Particles */
.glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 25px;
    padding: 3rem;
    box-shadow: 0 8px 32px rgba(0, 245, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    position: relative;
    overflow: hidden;
}

.glass::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 245, 255, 0.05), transparent);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.glass h3 {
    color: var(--primary);
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.glass p,
.glass li {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.glass ul {
    list-style: none;
    padding-left: 0;
}

.glass li {
    padding-left: 2rem;
    position: relative;
}

.glass li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 1.2rem;
}

/* Contact Section */
#contact {
    text-align: center;
}

.socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Live Demos (Devpost) - ONE RECTANGLE SPLIT INTO 3 TRIANGULAR SECTIONS */
#live-demos {
    text-align: center;
}

.devpost-stack {
    position: relative;
    max-width: 900px;
    height: 400px;
    margin: 0 auto;
    border: 3px solid rgba(0, 245, 255, 0.5);
    border-radius: 20px;
    overflow: hidden;
    background: rgba(10, 14, 39, 0.5);
    box-shadow: 0 20px 60px rgba(0, 245, 255, 0.3);
}

.devpost-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-decoration: none;
    transition: filter 0.4s ease;
}

.devpost-card:hover {
    filter: brightness(1.25);
    z-index: 10;
}

/* Section 1 (LEFT): Triangle from top-left, middle-top, bottom-left */
.devpost-card:nth-child(1) .devpost-frame {
    clip-path: polygon(
        0% 0%,      /* Top left corner */
        50% 0%,     /* Middle of top edge */
        0% 100%     /* Bottom left corner */
    );
}

/* Section 2 (MIDDLE/BOTTOM): Triangle from bottom-left, middle-top, bottom-right */
.devpost-card:nth-child(2) .devpost-frame {
    clip-path: polygon(
        0% 100%,    /* Bottom left corner */
        50% 0%,     /* Middle of top edge */
        100% 100%   /* Bottom right corner */
    );
}

/* Section 3 (RIGHT): Triangle from middle-top, top-right, bottom-right */
.devpost-card:nth-child(3) .devpost-frame {
    clip-path: polygon(
        50% 0%,     /* Middle of top edge */
        100% 0%,    /* Top right corner */
        100% 100%   /* Bottom right corner */
    );
}

.devpost-frame {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.devpost-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.15), rgba(123, 47, 247, 0.15));
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

.devpost-card:hover .devpost-frame::before {
    opacity: 0.8;
}

.devpost-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.1) contrast(1.08);
    transition: transform 0.5s ease, filter 0.5s ease;
}

.devpost-card:hover .devpost-frame img {
    transform: scale(1.1);
    filter: saturate(1.3) contrast(1.18);
}

.devpost-label {
    display: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(0, 245, 255, 0.1);
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.show {
    opacity: 1;
    transform: translateY(0);
}

/* Floating Particles (CSS definition, actual creation is in JS) */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.6;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(-20px) translateX(10px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 3rem;
    }
    nav ul {
        gap: 1.5rem;
    }
    section {
        padding: 5rem 2rem;
    }
    h2 {
        font-size: 2rem;
    }
    .devpost-stack {
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 3rem;
        align-items: center;
    }
    .devpost-card {
        width: 280px;
        height: 320px;
    }
}

/* Passion Section Styles */
.passion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.passion-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 245, 255, 0.1);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(10px);
}

/* Color Wipe Animation */
.passion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 245, 255, 0.2), 
        rgba(123, 47, 247, 0.2),
        transparent);
    transition: left 0.8s ease;
}

.passion-card.wipe::before {
    left: 100%;
}

/* Reverse wipe animation */
.passion-card.wipe-reverse::before {
    left: -100%;
    transition: left 0.8s ease;
}

/* Add fade out effect */
.passion-card {
    opacity: 1;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.6s ease;
}

.passion-card.wipe-reverse {
    opacity: 0.3;
}

.passion-card.wipe {
    opacity: 1;
}

/* Make only the Passion section h3's larger */
#passion h3 {
    font-size: 1.8rem; 
    color: var(--primary);
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
}
