:root {
    --color-bg: #F9F9FB;
    --color-primary: #4285F4;
    --color-secondary: #EA4335;
    --color-tertiary: #b100ff;
    --color-text: #202124;
    --color-text-muted: #5f6368;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

/* Light to Dark Theme Stages */
body.theme-1 {
    /* Hero (Default Light) */
}

body.theme-2 {
    /* About */
    --color-bg: #D4DFEB; 
    --glass-bg: rgba(255, 255, 255, 0.4);
}

body.theme-3 {
    /* Skills - Transitioning Dark */
    --color-bg: #2C3E50;
    --color-text: #F9F9FB;
    --color-text-muted: #B0BEC5;
    --glass-bg: rgba(20, 20, 35, 0.5);
    --glass-border: rgba(255, 255, 255, 0.2);
}

body.theme-4 {
    /* Experience / Footer - Fully Dark Deep Space */
    --color-bg: #05050A;
    --color-text: #ffffff;
    --color-text-muted: #a0a0a0;
    --glass-bg: rgba(10, 10, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background-color 1.5s ease, color 1.5s ease;
}

.glass-card, .section-title, p, h1, h2, h3, h4, .timeline-dot {
    transition: background-color 1.5s ease, color 1.5s ease, border-color 1.5s ease, background 1.5s ease;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    box-shadow: inset 0 0 100px rgba(66, 133, 244, 0.15);
    pointer-events: none;
    z-index: 0;
}

/* Background Canvas */
#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--color-text);
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin: 0 auto 3rem auto;
    width: fit-content;
    background: linear-gradient(90deg, var(--color-primary), var(--color-tertiary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Glassmorphism Utilities */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 240, 255, 0.1);
}

.content-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    perspective: 1200px; /* Enables 3D space for children */
}

.section-padding {
    padding: 100px 0;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.hero-content {
    max-width: 800px;
    animation: slideUpFade 1s ease forwards;
}

.greeting {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.name {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.tagline {
    font-size: 2rem;
    color: var(--color-tertiary);
    margin-bottom: 1.5rem;
}

.headline {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.cta-btn {
    display: inline-block;
    padding: 12px 32px;
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: 30px;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.cta-btn:hover {
    background: var(--color-primary);
    color: var(--color-bg);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
    transform: translateY(-3px);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--color-text-muted);
    border-radius: 15px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: scrollWheel 2s infinite;
}

/* Tilt Card Effect & Profile Image */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.1s ease-out;
}

.profile-image-wrapper {
    width: 160px;
    height: 160px;
    margin: 0 auto 2rem auto;
    border-radius: 50%;
    position: relative;
    transform: translateZ(50px);
    /* 3D pop out effect */
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--color-primary);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    position: relative;
    z-index: 2;
}

.img-glow {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background: linear-gradient(45deg, var(--color-primary), var(--color-tertiary));
    border-radius: 50%;
    filter: blur(15px);
    opacity: 0.6;
    z-index: 1;
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    from {
        opacity: 0.4;
        filter: blur(10px);
        transform: scale(1);
    }

    to {
        opacity: 0.8;
        filter: blur(20px);
        transform: scale(1.05);
    }
}

/* About Section & Gallery */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Modern Interactive Gallery */
.gallery-container {
    display: flex;
    width: 100%;
    height: 400px;
    gap: 10px;
    border-radius: 12px;
    overflow: hidden;
}

.gallery-item {
    position: relative;
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: flex 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.gallery-item:hover {
    flex: 5; /* Expands smoothly to reveal full image */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease;
}

.gallery-item:hover img {
    transform: scale(1.05); /* Slight zoom effect when focused */
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.about-text h4 {
    color: var(--color-tertiary);
    margin-top: 2rem;
    font-size: 1.4rem;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill-card {
    text-align: center;
    padding: 2rem;
}

.skill-icon {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.skill-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.skill-card p {
    font-size: 1rem;
    color: var(--color-text-muted);
}

/* Experience Timeline */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--color-primary), var(--color-tertiary));
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    padding-left: 60px;
}

.timeline-dot {
    position: absolute;
    left: 11px;
    top: 20px;
    width: 20px;
    height: 20px;
    background: var(--color-bg);
    border: 3px solid var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-primary);
}

.timeline-content h3 {
    color: var(--color-primary);
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.timeline-content h4 {
    color: var(--color-text-muted);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.timeline-date {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(177, 0, 255, 0.1);
    color: var(--color-tertiary);
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.timeline-content ul {
    list-style-type: none;
}

.timeline-content li {
    margin-bottom: 0.8rem;
    position: relative;
    padding-left: 20px;
    color: var(--color-text-muted);
}

.timeline-content li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--color-tertiary);
}

.timeline-content strong {
    color: var(--color-text);
}

/* Footer Section */
.footer-card {
    text-align: center;
    padding: 4rem 2rem;
}

.footer-card h2 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, var(--color-primary), var(--color-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-card p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 3rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text);
    font-size: 1.5rem;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Explicitly make icons light on the dark footer */
.theme-4 .social-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.social-icon:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white !important;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(66, 133, 244, 0.3);
}

.copyright {
    font-size: 0.9rem !important;
    color: var(--color-text-muted) !important;
    margin-bottom: 0 !important;
}

/* Animations */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-20px) translateX(-50%);
    }

    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

@keyframes scrollWheel {
    0% {
        top: 10px;
        opacity: 1;
    }

    100% {
        top: 30px;
        opacity: 0;
    }
}

/* Smooth Native CSS Scroll Reveal */
.scroll-section {
    opacity: 0;
    transform: scale(0.85) translateY(80px);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

.scroll-section.is-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.scroll-section.is-past {
    opacity: 0;
    transform: scale(0.9) translateY(-80px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .name {
        font-size: 3rem;
    }

    .tagline {
        font-size: 1.5rem;
    }

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

    .glass-card {
        padding: 1.5rem;
    }

    .timeline::before {
        left: 15px;
    }

    .timeline-dot {
        left: 6px;
    }

    .timeline-item {
        padding-left: 45px;
    }
}