/* ===== CSS Custom Properties ===== */
:root {
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Outfit', sans-serif;

    /* Light mode palette */
    --bg-primary: #f0f2f8;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.65);
    --bg-card-hover: rgba(255, 255, 255, 0.85);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #7a7a9a;
    --accent-1: #6a11cb;
    --accent-2: #2575fc;
    --accent-gold: #f4c542;
    --gradient-primary: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    --gradient-hero: linear-gradient(135deg, #6a11cb 0%, #2575fc 50%, #1a0533 100%);
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    --card-border: rgba(106, 17, 203, 0.15);
    --nav-bg: rgba(255, 255, 255, 0.42);
    --nav-bg-scrolled: rgba(255, 255, 255, 0.92);
    --footer-bg: #0a0a1a;
    --section-alt-bg: #f7f8fc;
    --chart-grid: rgba(0, 0, 0, 0.06);
    --badge-bg: rgba(106, 17, 203, 0.1);
    --badge-text: #6a11cb;
    --badge-border: rgba(106, 17, 203, 0.2);
    --hero-bg: linear-gradient(135deg, #fbfaff 0%, #f0edff 48%, #eaf3ff 100%);
    --hero-text: #17152b;
    --hero-text-secondary: rgba(23, 21, 43, 0.72);
    --hero-scroll: rgba(23, 21, 43, 0.55);
    --nav-text: rgba(23, 21, 43, 0.82);
    --nav-text-hover: #17152b;
    --nav-hover-bg: rgba(106, 17, 203, 0.08);
    --nav-border: rgba(106, 17, 203, 0.12);
}

.dark-mode {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f24;
    --bg-card: rgba(20, 20, 50, 0.6);
    --bg-card-hover: rgba(30, 30, 70, 0.75);
    --text-primary: #e8e8f0;
    --text-secondary: #b0b0d0;
    --text-muted: #7070a0;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --card-border: rgba(106, 17, 203, 0.25);
    --nav-bg: rgba(10, 10, 26, 0.4);
    --nav-bg-scrolled: rgba(10, 10, 26, 0.95);
    --section-alt-bg: #0d0d20;
    --chart-grid: rgba(255, 255, 255, 0.06);
    --badge-bg: rgba(106, 17, 203, 0.2);
    --badge-text: #b48cff;
    --badge-border: rgba(106, 17, 203, 0.35);
    --hero-bg: linear-gradient(135deg, #0a0020 0%, #1a0a40 50%, #0a1030 100%);
    --hero-text: #ffffff;
    --hero-text-secondary: rgba(255, 255, 255, 0.85);
    --hero-scroll: rgba(255, 255, 255, 0.6);
    --nav-text: rgba(255, 255, 255, 0.85);
    --nav-text-hover: #ffffff;
    --nav-hover-bg: rgba(255, 255, 255, 0.06);
    --nav-border: rgba(255, 255, 255, 0.06);
}

/* ===== Base Reset & Typography ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding-top: 0;
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1), color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* ===== Animated Gradient Text ===== */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shimmer-text {
    background: linear-gradient(90deg,
            #6a11cb 0%,
            #2575fc 25%,
            #f4c542 50%,
            #2575fc 75%,
            #6a11cb 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}

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

/* ===== Navigation Bar ===== */
.navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--nav-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px 0;
    z-index: 1000;
}

.navbar.scrolled {
    background: var(--nav-bg-scrolled);
    padding: 8px 0;
    box-shadow: 0 4px 30px rgba(31, 38, 135, 0.14);
}

.dark-mode .navbar.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.navbar-nav .nav-link {
    color: var(--nav-text) !important;
    margin: 0 4px;
    padding: 8px 16px !important;
    position: relative;
    font-weight: 500;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--nav-text-hover) !important;
    background: var(--nav-hover-bg);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    color: var(--nav-text);
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid var(--nav-border);
    transition: all 0.3s ease;
    text-decoration: none;
}

.dark-mode-toggle:hover {
    background: var(--nav-hover-bg);
    border-color: var(--accent-1);
    color: var(--nav-text-hover);
}

.navbar-toggler {
    border-color: var(--nav-border);
}

.navbar-toggler-icon {
    filter: invert(1);
}

.dark-mode .navbar-toggler-icon {
    filter: none;
}

.dark-mode-toggle span {
    margin-left: 6px;
    font-size: 0.85em;
    font-weight: 500;
}

/* ===== Hero Section ===== */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--hero-text);
    overflow: hidden;
}

#vanta-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: var(--hero-bg);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 0 20px;
}

.hero-name {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 6vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    line-height: 1.1;
    white-space: nowrap;
    text-shadow: 0 4px 30px rgba(106, 17, 203, 0.2);
}

.dark-mode .hero-name {
    text-shadow: 0 4px 30px rgba(106, 17, 203, 0.4);
}

.hero-typed-wrapper {
    min-height: 50px;
    margin-bottom: 30px;
}

.hero-typed-wrapper .typed-cursor {
    font-size: 1.5rem;
    color: var(--accent-gold);
}

#typed-output {
    font-family: var(--font-body);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 400;
    color: var(--hero-text-secondary);
    letter-spacing: 0.01em;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: bounce 2s ease infinite;
}

.scroll-indicator a {
    color: var(--hero-scroll);
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.scroll-indicator a:hover {
    color: var(--hero-text);
}

@keyframes bounce {

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

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

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

/* ===== Stats Counter Row ===== */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    min-width: 130px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(106, 17, 203, 0.25);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f4c542, #ff9a3c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

/* ===== SVG Wave Dividers ===== */
.wave-divider {
    position: relative;
    width: 100%;
    line-height: 0;
    overflow: hidden;
}

.wave-divider svg {
    display: block;
    width: 100%;
    height: 80px;
}

.wave-divider.flip {
    transform: rotate(180deg);
}

/* ===== Section Base Styles ===== */
.section {
    padding: 100px 0;
    position: relative;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-light {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.section-dark {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.section-gradient {
    background: var(--gradient-primary);
    color: #ffffff;
}

.section-heading {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.section-gradient .section-subtitle {
    color: rgba(255, 255, 255, 0.7);
}

/* ===== About Section ===== */
.about-section {
    text-align: center;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text-secondary);
    max-width: 850px;
    margin: 0 auto;
    padding: 30px 40px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    text-align: justify;
}

/* ===== Glassmorphism Cards ===== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.glass-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(106, 17, 203, 0.2);
    border-color: rgba(106, 17, 203, 0.35);
}

/* ===== Experience Cards ===== */
.experience-card {
    margin-bottom: 30px;
    text-align: left;
}

.experience-card .card-header-custom {
    background: var(--gradient-primary);
    color: #fff;
    padding: 20px 28px;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.experience-card .card-header-custom::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.experience-card .card-header-custom h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 1;
}

.experience-card .card-body {
    padding: 28px;
}

.experience-card h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent-1);
    margin-top: 12px;
}

.dark-mode .experience-card h5 {
    color: #b48cff;
}

.experience-card small {
    color: var(--text-muted);
    font-weight: 500;
}

.experience-card ul {
    list-style: disc;
    padding-left: 20px;
    color: var(--text-secondary);
}

/* ===== Education Section ===== */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 50px;
}

.edu-card {
    padding: 30px;
    text-align: center;
}

.edu-card .edu-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 1.4rem;
    color: #fff;
}

.edu-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.edu-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.edu-card a {
    color: var(--accent-2);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.3s ease;
}

.edu-card a:hover {
    color: var(--accent-1);
}

/* ===== Skills Section ===== */
.skills-section {
    text-align: center;
}

.chart-container {
    max-width: 480px;
    margin: 0 auto 30px;
    padding: 30px;
}

.chart-container canvas {
    max-height: 380px;
}

.chart-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.skill-category {
    margin-bottom: 36px;
}

.skill-category h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 18px;
    color: var(--text-primary);
}

.skill-category h4 i {
    margin-right: 8px;
    color: var(--accent-1);
}

.dark-mode .skill-category h4 i {
    color: #b48cff;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--badge-text);
    background: var(--badge-bg);
    border: 1px solid var(--badge-border);
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.skill-tag:hover {
    background: var(--accent-1);
    color: #fff;
    border-color: var(--accent-1);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(106, 17, 203, 0.3);
}

.skill-tag.green {
    --badge-bg: rgba(16, 185, 129, 0.1);
    --badge-text: #059669;
    --badge-border: rgba(16, 185, 129, 0.2);
}

.skill-tag.green:hover {
    background: #059669;
    border-color: #059669;
    color: #fff;
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.3);
}

.dark-mode .skill-tag.green {
    --badge-text: #6ee7b7;
}

.skill-tag.cyan {
    --badge-bg: rgba(6, 182, 212, 0.1);
    --badge-text: #0891b2;
    --badge-border: rgba(6, 182, 212, 0.2);
}

.skill-tag.cyan:hover {
    background: #0891b2;
    border-color: #0891b2;
    color: #fff;
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.3);
}

.dark-mode .skill-tag.cyan {
    --badge-text: #67e8f9;
}

/* Staggered skill-tag animation */
.skill-tag {
    opacity: 0;
    transform: translateY(12px);
    animation: skillFadeIn 0.4s forwards;
}

.skill-tags-animated .skill-tag {
    opacity: 1;
    transform: translateY(0);
}

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

/* ===== Projects Section ===== */
.project-card {
    text-align: center;
    padding: 0;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    perspective: 1000px;
}

.project-card:hover {
    transform: translateY(-8px) rotateX(2deg) rotateY(-1deg);
}

.project-card-img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
    transition: transform 0.5s ease;
}

.project-card:hover .project-card-img {
    transform: scale(1.05);
}

.project-card-img-wrapper {
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.project-card-body {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card-body h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.project-links {
    margin-top: auto;
}

.project-links a {
    display: inline-block;
    margin: 4px;
    padding: 8px 18px;
    color: #fff;
    background: var(--gradient-primary);
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
}

.project-links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 17, 203, 0.4);
}

/* ===== Project Modal ===== */
.modal-dialog {
    max-width: 900px;
    margin: 2rem auto;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--card-border);
    background: var(--bg-card);
}

.modal-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
}

.modal-img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ===== Contact Section ===== */
.contact-section {
    text-align: center;
}

.contact-section p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.contact-section a {
    color: var(--accent-2);
    text-decoration: none;
    font-weight: 600;
}

.contact-section a:hover {
    color: var(--accent-1);
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    color: #fff !important;
}

.social-btn.linkedin {
    background: linear-gradient(135deg, #0077b5, #00a0dc);
}

.social-btn.github {
    background: linear-gradient(135deg, #24292e, #444d56);
}

.social-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    color: #fff !important;
}

/* ===== Footer ===== */
footer {
    padding: 40px 20px;
    background: var(--footer-bg);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    position: relative;
}

footer p {
    font-size: 0.9rem;
    margin: 0;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(106, 17, 203, 0.4);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(106, 17, 203, 0.5);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .stats-row {
        gap: 16px;
    }

    .stat-item {
        min-width: 100px;
        padding: 12px 16px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .hero-name {
        font-size: 2.2rem;
    }

    .section {
        padding: 60px 0;
    }

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

    .chart-container {
        padding: 20px;
    }

    .about-text {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .stats-row {
        gap: 10px;
    }

    .stat-item {
        min-width: 80px;
        padding: 10px 12px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.72rem;
    }
}

/* ===== Profile Picture ===== */
.hero-profile-pic {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid transparent;
    background-clip: padding-box;
    box-shadow:
        0 0 0 4px rgba(106, 17, 203, 0.5),
        0 0 30px rgba(106, 17, 203, 0.3),
        0 0 60px rgba(37, 117, 252, 0.15);
    margin-bottom: 24px;
    animation: profileFloat 4s ease-in-out infinite, profileFadeIn 1s ease-out;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-profile-pic:hover {
    transform: scale(1.08);
    box-shadow:
        0 0 0 4px rgba(106, 17, 203, 0.7),
        0 0 40px rgba(106, 17, 203, 0.5),
        0 0 80px rgba(37, 117, 252, 0.25);
}

@keyframes profileFloat {

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

    50% {
        transform: translateY(-8px);
    }
}

@keyframes profileFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

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

@media (max-width: 768px) {
    .hero-profile-pic {
        width: 120px;
        height: 120px;
        margin-bottom: 18px;
    }
}

/* ===== Utility Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}