:root {
    --primary-bg: #09090b;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-secondary: #cbd5e1;
    --glass-bg: rgba(9, 9, 11, 0.35);
    --glass-border: rgba(255, 255, 255, 0.08);

    --h1-grad-start: #ffffff;
    --h1-grad-end: #a1a1aa;

    --btn-border: rgba(255, 255, 255, 0.15);

    --linkedin-bg: rgba(37, 99, 235, 0.25);
    --linkedin-bg-hover: rgba(37, 99, 235, 0.4);
    --linkedin-text: #bfdbfe;
    --linkedin-border: rgba(96, 165, 250, 0.4);

    --email-bg: rgba(255, 255, 255, 0.1);
    --email-bg-hover: rgba(255, 255, 255, 0.2);
    --email-border: rgba(255, 255, 255, 0.2);
    --email-shadow: rgba(255, 255, 255, 0.2);

    --learn-bg: rgba(139, 92, 246, 0.25);
    --learn-bg-hover: rgba(139, 92, 246, 0.4);
    --learn-text: #ddd6fe;
    --learn-border: rgba(139, 92, 246, 0.4);

    --badge-bg: rgba(59, 130, 246, 0.25);
    --badge-text: #bfdbfe;
    --badge-border: rgba(59, 130, 246, 0.5);

    --badge-accent-bg: rgba(139, 92, 246, 0.25);
    --badge-accent-text: #ddd6fe;
    --badge-accent-border: rgba(139, 92, 246, 0.5);

    --theme-switch-bg: rgba(255, 255, 255, 0.1);
    --theme-switch-border: rgba(255, 255, 255, 0.2);
    --theme-switch-thumb: #ffffff;
}

@media (prefers-color-scheme: light) {
    :root {
        --primary-bg: #f8fafc;
        --accent-blue: #2563eb;
        --accent-purple: #7c3aed;
        --text-main: #0f172a;
        --text-muted: #475569;
        --text-secondary: #334155;
        --glass-bg: rgba(255, 255, 255, 0.35);
        --glass-border: rgba(0, 0, 0, 0.1);

        --h1-grad-start: #0f172a;
        --h1-grad-end: #3b82f6;

        --btn-border: rgba(0, 0, 0, 0.2);

        --linkedin-bg: rgba(10, 102, 194, 0.15);
        --linkedin-bg-hover: rgba(10, 102, 194, 0.25);
        --linkedin-text: #08427b;
        --linkedin-border: rgba(10, 102, 194, 0.4);

        --email-bg: rgba(0, 0, 0, 0.08);
        --email-bg-hover: rgba(0, 0, 0, 0.15);
        --email-border: rgba(0, 0, 0, 0.2);
        --email-shadow: rgba(0, 0, 0, 0.1);

        --learn-bg: rgba(124, 58, 237, 0.15);
        --learn-bg-hover: rgba(124, 58, 237, 0.25);
        --learn-text: #5b21b6;
        --learn-border: rgba(124, 58, 237, 0.4);

        --badge-bg: rgba(37, 99, 235, 0.2);
        --badge-text: #1e3a8a;
        --badge-border: rgba(37, 99, 235, 0.4);

        --badge-accent-bg: rgba(124, 58, 237, 0.2);
        --badge-accent-text: #4c1d95;
        --badge-accent-border: rgba(124, 58, 237, 0.4);

        --theme-switch-bg: rgba(0, 0, 0, 0.05);
        --theme-switch-border: rgba(0, 0, 0, 0.1);
        --theme-switch-thumb: #0f172a;
    }
}

/* Custom theme overrides */
body.light-theme {
    --primary-bg: #f8fafc;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-secondary: #334155;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.1);

    --h1-grad-start: #0f172a;
    --h1-grad-end: #3b82f6;

    --btn-border: rgba(0, 0, 0, 0.2);

    --linkedin-bg: rgba(10, 102, 194, 0.15);
    --linkedin-bg-hover: rgba(10, 102, 194, 0.25);
    --linkedin-text: #08427b;
    --linkedin-border: rgba(10, 102, 194, 0.4);

    --email-bg: rgba(0, 0, 0, 0.08);
    --email-bg-hover: rgba(0, 0, 0, 0.15);
    --email-border: rgba(0, 0, 0, 0.2);
    --email-shadow: rgba(0, 0, 0, 0.1);

    --learn-bg: rgba(124, 58, 237, 0.15);
    --learn-bg-hover: rgba(124, 58, 237, 0.25);
    --learn-text: #5b21b6;
    --learn-border: rgba(124, 58, 237, 0.4);

    --badge-bg: rgba(37, 99, 235, 0.2);
    --badge-text: #1e3a8a;
    --badge-border: rgba(37, 99, 235, 0.4);

    --badge-accent-bg: rgba(124, 58, 237, 0.2);
    --badge-accent-text: #4c1d95;
    --badge-accent-border: rgba(124, 58, 237, 0.4);

    --theme-switch-bg: rgba(0, 0, 0, 0.05);
    --theme-switch-border: rgba(0, 0, 0, 0.1);
    --theme-switch-thumb: #0f172a;
}

body.light-theme .glass-card {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.light-theme .noise-overlay {
    opacity: 0.08;
}

body.dark-theme {
    --primary-bg: #09090b;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-secondary: #cbd5e1;
    --glass-bg: rgba(9, 9, 11, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);

    --h1-grad-start: #ffffff;
    --h1-grad-end: #a1a1aa;

    --btn-border: rgba(255, 255, 255, 0.15);

    --linkedin-bg: rgba(37, 99, 235, 0.25);
    --linkedin-bg-hover: rgba(37, 99, 235, 0.4);
    --linkedin-text: #bfdbfe;
    --linkedin-border: rgba(96, 165, 250, 0.4);

    --email-bg: rgba(255, 255, 255, 0.1);
    --email-bg-hover: rgba(255, 255, 255, 0.2);
    --email-border: rgba(255, 255, 255, 0.2);
    --email-shadow: rgba(255, 255, 255, 0.2);

    --learn-bg: rgba(139, 92, 246, 0.25);
    --learn-bg-hover: rgba(139, 92, 246, 0.4);
    --learn-text: #ddd6fe;
    --learn-border: rgba(139, 92, 246, 0.4);

    --badge-bg: rgba(59, 130, 246, 0.25);
    --badge-text: #bfdbfe;
    --badge-border: rgba(59, 130, 246, 0.5);

    --badge-accent-bg: rgba(139, 92, 246, 0.25);
    --badge-accent-text: #ddd6fe;
    --badge-accent-border: rgba(139, 92, 246, 0.5);

    --theme-switch-bg: rgba(255, 255, 255, 0.1);
    --theme-switch-border: rgba(255, 255, 255, 0.2);
    --theme-switch-thumb: #ffffff;
}

body.dark-theme .glass-card {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.dark-theme .noise-overlay {
    opacity: 0.04;
}

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

body,
html {
    width: 100%;
    height: 100%;
    background-color: var(--primary-bg);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    overflow: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Global Noise Texture */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: light) {
    .noise-overlay {
        opacity: 0.08;
        /* Slightly stronger noise in light mode */
    }
}

/* 3D Background Container */
#webgl-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* Scroll Container Setup */
.scroll-container {
    position: relative;
    z-index: 10;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Individual Sections */
.snap-section {
    position: absolute;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100%;
    display: flex;
    pointer-events: none;
    /* Section is invisible wrapper */
    opacity: 0;
    visibility: hidden;
    z-index: 1;
}

/* Section Alignment for Desktop (50% Width styling) */
.snap-section.align-left {
    justify-content: flex-start;
}

.snap-section.align-right {
    justify-content: flex-end;
}

.snap-section.align-center {
    justify-content: center;
    /* Section 1 forces clear center now */
}

/* GLASS CARD DESKTOP RULES (Full Height, 50% Width) */
.glass-card {
    pointer-events: auto;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    padding: 3rem 4rem;
    width: 50%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@media (prefers-color-scheme: light) {
    .glass-card {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
}

/* Centered Glass Card overriding 50% width default */
.snap-section.align-center .glass-card {
    width: 100%;
    max-width: 600px;
    height: auto;
    min-height: 85svh;
    border: 1px solid var(--glass-border);
    align-items: center;
    text-align: center;
}

/* --- SECTION 1: Linktree Styling --- */
.linktree-card {
    align-items: flex-start;
    text-align: left;
    position: relative;
    padding-bottom: 5rem;
}

/* Theme Toggle Switch */
.theme-switch-container {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.theme-switch {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 30px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--theme-switch-bg);
    border: 1px solid var(--theme-switch-border);
    transition: .4s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.theme-switch .slider.round {
    border-radius: 30px;
}

.theme-switch .slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: var(--theme-switch-thumb);
    transition: .4s;
    border-radius: 50%;
    z-index: 2;
}

.theme-switch input:checked+.slider::before {
    transform: translateX(30px);
}

.theme-switch .icon {
    font-size: 14px;
    z-index: 1;
}

.profile-image-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 2rem;
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50% !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    z-index: 1;
    filter: blur(15px);
    opacity: 0.5;
    animation: pulsate 3s infinite alternate;
}

@keyframes pulsate {
    0% {
        transform: scale(0.9);
        opacity: 0.3;
    }

    100% {
        transform: scale(1.05);
        opacity: 0.6;
    }
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--h1-grad-start), var(--h1-grad-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.vertical-button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

.glow-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.1rem 1.5rem;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 1px solid var(--btn-border);
    cursor: pointer;
}

.glow-btn svg {
    width: 20px;
    height: 20px;
}

.linkedin-btn {
    background: var(--linkedin-bg);
    color: var(--linkedin-text);
    border-color: var(--linkedin-border);
}

.linkedin-btn:hover {
    background: var(--linkedin-bg-hover);
    box-shadow: 0 0 20px var(--linkedin-bg);
    transform: translateY(-2px);
}

.email-btn {
    background: var(--email-bg);
    color: var(--text-main);
    border-color: var(--email-border);
}

.email-btn:hover {
    background: var(--email-bg-hover);
    box-shadow: 0 0 20px var(--email-shadow);
    transform: translateY(-2px);
}

.learn-more-btn {
    appearance: none;
    font-family: inherit;
    background: var(--learn-bg);
    color: var(--learn-text);
    border-color: var(--learn-border);
}

.learn-more-btn:hover {
    background: var(--learn-bg-hover);
    box-shadow: 0 0 20px var(--learn-bg);
    transform: translateY(-2px);
}

.learn-more-btn svg {
    animation: bounceRight 2s infinite;
}

@keyframes bounceRight {

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

    40% {
        transform: translateY(4px);
    }

    60% {
        transform: translateY(2px);
    }
}

/* --- SECTION 2 & 3 Styling --- */
.content-card {
    /* specific rules overlap glass card defaults */
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--badge-bg);
    color: var(--badge-text);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border: 1px solid var(--badge-border);
    width: max-content;
}

.badge-accent {
    background: var(--badge-accent-bg);
    color: var(--badge-accent-text);
    border-color: var(--badge-accent-border);
}

.text-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
}

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

.styled-list {
    list-style: none;
    margin: 1.5rem 0;
}

.styled-list li {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 1.5rem;
    position: relative;
}

.styled-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-purple);
    font-weight: bold;
}

.mt-6 {
    margin-top: 1.5rem;
    max-width: 400px;
}

/* --- MOBILE LAYOUT: CENTERED POPUPS --- */
@media (max-width: 768px) {
    .snap-section {
        justify-content: center !important;
        align-items: center;
        padding: 1.5rem;
    }

    .glass-card {
        width: 100%;
        max-width: 420px;
        height: auto;
        border-radius: 24px;
        border: 1px solid var(--glass-border);
        padding: 2.5rem 2rem;
        align-items: center;
        text-align: center;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .linktree-card {
        align-items: center;
        text-align: center;
        padding-bottom: 5rem !important; /* give space for the toggle switch */
    }

    .styled-list {
        text-align: left;
    }

    .mt-6 {
        max-width: 100%;
    }
}