:root {
    --bg-color: #0c0c0e;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-1: #4a90e2; /* Slate Blue Primary */
    --accent-2: #6366f1; /* Deep Indigo Secondary */
    --accent-3: #38bdf8; /* Bright Cyan Accent */
    --card-bg: rgba(15, 23, 42, 0.6);
    --border-color: rgba(255, 255, 255, 0.05);
    --glow-color: rgba(56, 189, 248, 0.25);
    --glass-grad: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    --surface-glass: rgba(255, 255, 255, 0.02);
}

[data-theme="emerald"] {
    --bg-color: #060e0d;
    --accent-1: #10b981;
    --accent-2: #06b6d4;
    --accent-3: #14b8a6;
    --glow-color: rgba(16, 185, 129, 0.25);
}

[data-theme="violet"] {
    --bg-color: #0d0814;
    --accent-1: #8b5cf6;
    --accent-2: #ec4899;
    --accent-3: #a855f7;
    --glow-color: rgba(168, 85, 247, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Dynamic Top Scroll Line (Glides Left-to-Right on Scroll, Visible All The Time) ── */
.scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(11, 15, 26, 0.75);
    border-bottom: 1px solid rgba(74, 144, 226, 0.25);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 999999;
    pointer-events: none;
    overflow: hidden;
}
.scroll-progress-line {
    position: absolute;
    top: 0;
    left: 0;
    width: clamp(90px, 14vw, 170px);
    height: 100%;
    transform: translate3d(0, 0, 0);
    background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.9), 0 0 20px rgba(129, 140, 248, 0.6), 0 0 30px rgba(192, 132, 252, 0.4);
    will-change: transform;
    pointer-events: none;
    transition: transform 0.05s linear;
}
.scroll-progress-line::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35%;
    height: 140%;
    background: rgba(255, 255, 255, 0.85);
    filter: blur(1px);
    border-radius: 999px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--accent-1), var(--accent-2));
    border-radius: 20px;
    border: 2px solid var(--bg-color);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(74, 144, 226, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(99, 102, 241, 0.03) 0%, transparent 50%);
}



/* Legacy Scroll Progress Class (Deprecated) */
.scroll-progress {
    display: none;
}



/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 8%;
    background: rgba(3, 7, 18, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    transition: width 0.3s ease;
}

.static-dashboard-btn {
    text-decoration: none;
    color: var(--accent-1);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--accent-1);
    border-radius: 6px;
    margin-left: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.static-dashboard-btn::before {
    content: 'ðŸ ';
    font-size: 1rem;
}

.static-dashboard-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.nav-links a:hover {
    color: var(--accent-1);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Sections Structure */
section {
    min-height: 100vh;
    padding: 10rem 5% 6rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    transform-style: preserve-3d;
    perspective: 2000px;
}

.section-segment {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 4rem;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 50px;
    transform-style: preserve-3d;
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0.5;
    transform: translateY(100px) rotateX(15deg) scale(0.9);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.section-segment.active-segment {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1) translateZ(0px);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5), 
                0 0 40px rgba(74, 144, 226, 0.1);
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Theme Specific Glows */
.section-segment[data-theme="about"].active-segment {
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.6), 0 0 100px rgba(74, 144, 226, 0.7);
}

.section-segment[data-theme="services"].active-segment {
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.6), 0 0 100px rgba(99, 102, 241, 0.7);
}

.section-segment[data-theme="projects"].active-segment {
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.6), 0 0 100px rgba(59, 130, 246, 0.7);
}

.section-segment[data-theme="library"].active-segment {
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.6), 0 0 100px rgba(168, 85, 247, 0.7);
}

/* 3D Section Divider */
.section-divider {
    height: 2px;
    width: 60%;
    margin: 6rem auto;
    background: linear-gradient(90deg, transparent, var(--accent-1), var(--accent-2), transparent);
    opacity: 0.15;
    border-radius: 50%;
    filter: blur(1px);
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

h1 {
    font-size: clamp(3.5rem, 9vw, 6rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

h2 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 5rem;
    text-align: center;
    letter-spacing: -1.5px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h2 span,
.gradient-text {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3), var(--accent-1));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    animation: gradientShift 8s ease infinite;
}

.subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* Buttons */
.cta-button {
    display: inline-block;
    padding: 1.1rem 2.8rem;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 0px rgba(59, 130, 246, 0.6), 0 10px 20px rgba(74, 144, 226, 0.2);
    z-index: 100;
    transform-style: preserve-3d;
    position: relative;
}

.cta-button:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0px rgba(59, 130, 246, 0.6), 0 5px 10px rgba(74, 144, 226, 0.2);
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4), 0 0 15px rgba(74, 144, 226, 0.5);
}

.cta-button-outline {
    display: inline-block;
    padding: 1.1rem 2.8rem;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 100;
    cursor: pointer;
    margin-left: 1.5rem;
}

.cta-button-outline:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-2);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.2);
}

/* About Section */
.about-container {
    display: flex;
    gap: 4rem;
    align-items: center;
    text-align: left;
}

.about-text {
    flex: 1.5;
}

.about-text p {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.skill-item {
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metrics-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

.metric-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.metric-card h3, 
.metric-card p {
    transform: translateZ(40px);
}

.metric-card h3 {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.metric-card:hover {
    transform: scale(1.05);
    border-color: var(--accent-1);
    box-shadow: 0 10px 30px var(--glow-color);
}

/* Timeline Styles */
.education-timeline {
    margin-top: 4rem;
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.7rem;
    top: 0.5rem;
    width: 20px;
    height: 20px;
    background: var(--bg-color);
    border: 3px solid var(--accent-1);
    border-radius: 50%;
    z-index: 1;
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--accent-1);
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: block;
}

.timeline-content h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.timeline-content p {
    font-size: 1rem;
    margin-bottom: 0;
}

.timeline-content .institution {
    color: var(--accent-2);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}


.tech-stack {
    margin-top: 3rem;
}

.tech-stack h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.tech-tags {
    margin-bottom: 1.5rem;
}

.tech-category {
    display: block;
    font-size: 0.9rem;
    color: var(--accent-1);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
}

.tags-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tags-group span {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.tags-group span:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--glow-color);
}

@media (max-width: 968px) {
    .about-container {
        flex-direction: column;
    }
    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    .cta-button-outline {
        margin-left: 0;
    }
}

/* Hero Section */
.hero {
    align-items: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 5;
}

.hero-btns {
    position: relative;
    z-index: 50;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.profile-container {
    margin-bottom: 2rem;
    position: relative;
    width: 180px;
    height: 180px;
    transform-style: preserve-3d;
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid transparent;
    background: linear-gradient(var(--bg-color), var(--bg-color)) padding-box,
                linear-gradient(135deg, var(--accent-1), var(--accent-2)) border-box;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.3);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    animation: floating 6s ease-in-out infinite;
    transform: translateZ(50px); /* Lift off base */
}

.profile-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, var(--glow-color), transparent 70%);
    transform: translate(-50%, -50%) translateZ(-20px);
    opacity: 0.5;
    pointer-events: none;
}

@keyframes floating {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.profile-pic:hover {
    transform: scale(1.08) rotate(2deg);
}

#dynamic-name {
    transition: opacity 0.5s ease, transform 0.5s ease;
    display: inline-block;
    text-shadow: 0 0 20px var(--glow-color);
}

/* Engineering Excellence (Services) */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
}

.service-card {
    background: var(--card-bg);
    padding: 3rem 2rem;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.service-card::before,
.project-card::before,
.lib-item::before,
.contact-item::before,
.stat-box::before,
.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.service-card:hover::before,
.project-card:hover::before,
.lib-item:hover::before,
.contact-item:hover::before,
.stat-box:hover::before,
.cert-card:hover::before {
    opacity: 1;
}

.service-card:hover,
.lib-item:hover,
.contact-item:hover,
.stat-box:hover,
.cert-card:hover {
    transform: translateY(-15px);
    border-color: var(--accent-1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2), 0 0 30px var(--glow-color);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 2rem;
    display: block;
    filter: drop-shadow(0 0 10px var(--glow-color));
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.service-card p {
    color: var(--text-muted);
    font-size: 1rem;
}


/* Scroll Down Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scroll-indicator:hover {
    color: var(--accent-1);
}

.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--accent-1);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(15px); opacity: 0; }
}

/* Projects Section */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    width: 100%;
}

.project-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform-style: preserve-3d;
}

.project-img,
.project-info h3,
.project-info p,
.repo-link {
    transform: translateZ(30px);
}

.project-card:hover {
    transform: translateY(-15px) rotateX(10deg) rotateY(10deg);
    border-color: var(--accent-1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 
                0 0 40px var(--glow-color);
}

/* Interactive Card Lighting Replaced by Uniform Excellence Effect */

/* 3D Reflection Shimmer */
.project-card::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: rotate(45deg);
    transition: transform 0.8s ease;
    pointer-events: none;
}

.project-card:hover::after {
    transform: rotate(45deg) translate(50%, 50%);
}

/* Project Images */
.project-img {
    height: 220px;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img {
    transform: scale(1.05);
}

.bg-1 {
    background-image: linear-gradient(rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.2)), url('images/chatbot.png');
}

.bg-2 {
    background-image: linear-gradient(rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.2)), url('images/puzzle.png');
}

.bg-3 {
    background-image: linear-gradient(rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.2)), url('images/ui.png');
}

.bg-4 {
    background-image: linear-gradient(rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.2)), url('images/greenpulse.png');
}

.bg-5 {
    background-image: linear-gradient(rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.2)), url('images/civix.png');
}

.bg-6 {
    background-image: linear-gradient(rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.2)), url('images/gait.png');
}

.bg-7 {
    background-image: linear-gradient(rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.2)), url('images/disease.png');
}

.project-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-info h3 {
    margin-bottom: 0.8rem;
    font-size: 1.6rem;
    color: var(--text-main);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tags span {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.3rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--accent-1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}


.repo-link {
    margin-top: 1.5rem;
    color: var(--accent-1);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
}

.repo-link:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateX(5px);
}

.repo-link::after {
    content: 'â†’';
}

.project-info p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    flex-grow: 1;
}

/* Contact Section */
.contact {
    align-items: center;
    text-align: center;
    min-height: 80vh;
}

.contact p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3.5rem;
    max-width: 600px;
}

.contact-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    width: 100%;
    max-width: 800px;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    width: 100%;
}

.contact-item {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    flex: 1;
    min-width: 280px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.contact-item:hover {
    transform: translateY(-8px);
    border-color: var(--accent-1);
    background: rgba(255, 255, 255, 0.05);
}

.contact-item .label {
    display: block;
    color: var(--accent-1);
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.contact-item a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.1rem;
    word-break: break-all;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: var(--accent-1);
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
}

.social-icon {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.2);
}

.social-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.contact-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    width: 100%;
}

.contact-form input {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}

.contact-form input:focus {
    outline: none;
    border-color: var(--accent-1);
    background: rgba(30, 41, 59, 0.6);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.contact-form .cta-button {
    width: fit-content;
    align-self: center;
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    background: rgba(3, 7, 18, 0.5);
}

footer p {
    letter-spacing: 0.5px;
}


/* Coding Libraries Section */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.lib-item {
    background: var(--card-bg);
    padding: 2.5rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.lib-item::before {
    content: '';
    position: absolute;
    top: var(--mouse-y, 0);
    left: var(--mouse-x, 0);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle at center, rgba(74, 144, 226, 0.1), transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lib-item:hover::before {
    opacity: 1;
}

.lib-item:hover {
    transform: translateY(-10px) rotateX(5deg);
    border-color: var(--accent-1);
    background: var(--surface-glass);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2), 0 0 20px var(--glow-color);
}

.lib-item img {
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.lib-item:hover img {
    transform: scale(1.1);
}

.lib-item span {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-muted);
    transition: color 0.3s;
}

.lib-item:hover span {
    color: var(--text-main);
}


/* Certificates Page Styles */
.certificates-page {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 4rem;
}

.certificate-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    max-width: 700px; /* Reduced from 850px */
    margin: 0 auto 4rem auto;
}

/* â”€â”€ Certificates Student Note â”€â”€ */
.cert-student-note {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.4rem;
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 30px;
    font-size: 0.95rem;
    color: var(--accent-1);
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* â”€â”€ Horizontal Certificate Timeline Layout â”€â”€ */
.cert-timeline-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 4rem auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: relative;
}

.cert-timeline-line {
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-1), var(--accent-2), var(--accent-1), transparent);
    border-radius: 10px;
    margin: 0 auto;
    opacity: 0.5;
    position: relative;
}

.cert-timeline-line::before,
.cert-timeline-line::after {
    content: 'â—†';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-1);
    font-size: 0.8rem;
}

.cert-timeline-line::before { left: -1.2rem; }
.cert-timeline-line::after  { right: -1.2rem; }

.cert-timeline-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding-left: 2rem;
}

.cert-timeline-label.end-label {
    justify-content: flex-end;
    padding-right: 2rem;
    padding-left: 0;
}

.cert-timeline-label::before,
.cert-timeline-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-2), transparent);
    opacity: 0.3;
}

.cert-timeline-label.end-label::after {
    background: linear-gradient(90deg, transparent, var(--accent-2));
}

/* â”€â”€ Horizontal certificate rows: scroll right-to-left â”€â”€ */
.cert-row {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    overflow-x: auto;
    padding: 1rem 0.5rem 1.5rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-1) transparent;
}

.cert-row::-webkit-scrollbar { height: 5px; }
.cert-row::-webkit-scrollbar-track { background: transparent; }
.cert-row::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--accent-1), var(--accent-2));
    border-radius: 10px;
}

/* RTL = latest first â†’ displayed right-to-left by reversing flex order */
.cert-row.rtl {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.cert-row .cert-card {
    flex: 0 0 340px;  /* fixed-width card in row */
    max-width: 340px;
}

/* â”€â”€ Row section divider â”€â”€ */
.cert-row-divider {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1rem;
}

.cert-row-divider span {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    white-space: nowrap;
}

.cert-row-divider::before,
.cert-row-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.cert-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s ease;
    text-align: left;
    transform-style: preserve-3d;
}

.cert-img-container,
.cert-embed-container,
.cert-info h3,
.cert-info p,
.cert-footer {
    transform: translateZ(30px);
}

.cert-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: var(--accent-1);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 
                0 0 20px var(--glow-color);
}

.cert-img-container {
    height: 180px; /* Reduced from 200px */
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.cert-placeholder {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 2rem;
    text-align: center;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    width: 80%;
}

.cert-info {
    padding: 1.2rem; /* Reduced from 1.5rem */
}

.cert-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.cert-info p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.cert-issuer {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-1);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
}

.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-link {
    color: var(--accent-2);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s;
}

.view-link:hover {
    color: var(--accent-1);
    text-decoration: underline;
}

.cert-card.highlight {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.1);
}

.file-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-2);
}

.cert-embed-container {
    width: 100%;
    height: 320px; /* Reduced from 400px */
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.cert-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cert-card:hover .cert-img {
    transform: scale(1.05);
}

.cert-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.back-home {
    margin-top: 2rem;
}

.nav-links a.active {
    color: var(--accent-1);
}

.nav-links a.active::after {
    width: 100%;
}

/* Fade in animations config */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjust */
@media (max-width: 768px) {
    nav {
        padding: 1.2rem 5%;
    }

    .nav-links {
        display: none;
    }

    /* Simplified for mobile out of the box */
    section {
        padding: 6rem 5% 3rem;
    }
}

/* Custom Persistent Buttons (Alterego) */
.theme-changer-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    font-size: 24px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    z-index: 150000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.theme-changer-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

/* Cyber Quantum Warp Effect (Unified Theme Transition) */
.quantum-warp {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-3), var(--accent-2) 60%, transparent 80%);
    box-shadow: 0 0 50px var(--accent-3), 0 0 100px var(--accent-2);
    z-index: 9999999;
    pointer-events: none;
    animation: quantumWarpPulse 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes quantumWarpPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.9;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(120);
        opacity: 0;
    }
}

.impact-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.25), transparent 75%);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
}

.animate-flash {
    animation: flashEffect 0.4s ease-out;
}

@keyframes flashEffect {
    0% { opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 0; }
}

/* Floating Dashboard */
.floating-dashboard {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 100000;
    display: flex;
    flex-direction: column-reverse;
    gap: 15px;
    align-items: flex-start;
}

.dashboard-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    color: var(--accent-1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent-1);
    box-shadow: 0 0 20px var(--glow-color);
}

.dashboard-content {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    width: 200px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.floating-dashboard.active .dashboard-content {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.floating-dashboard.active .dashboard-toggle {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    transform: rotate(45deg);
}

.dash-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dash-item .dash-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.dash-item .dash-value {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .floating-dashboard {
        bottom: 20px;
        left: 20px;
    }
    
    .dashboard-content {
        width: 160px;
        padding: 1rem;
    }
    
    .dash-item .dash-value {
        font-size: 1.2rem;
    }
}
/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #030712;
    z-index: 1000000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

.preloader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.preloader-logo {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
}

.preloader-bar {
    width: 180px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
}

.preloader-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-3), var(--accent-2), transparent);
    animation: loading 0.6s infinite ease-in-out;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Scroll to Top */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 110px; /* Offset from theme changer */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 140000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--accent-1);
    color: white;
    box-shadow: 0 0 20px var(--glow-color);
    transform: translateY(-5px);
}

/* Refined Highlights */
.service-card:hover,
.project-card:hover,
.lib-item:hover,
.contact-item:hover,
.cert-card:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 40px var(--glow-color);
    border-color: rgba(74, 144, 226, 0.4);
}

.skill-item {
    transition: all 0.3s ease;
}

.skill-item:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.05);
}


