/* CSS Variables for Light/Dark Mode */
:root {
    /* Light Mode Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #6366f1;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --card-bg: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --nav-blur: blur(10px);
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --bg-primary: #0b1121; /* Rich navy for alternating sections */
    --bg-secondary: #0f1629; /* Slightly lighter navy for main sections */
    --bg-tertiary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent-primary: #60a5fa;
    --accent-secondary: #818cf8;
    --accent-gradient: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%);
    --border-color: #1a233a; /* Custom sleek borders */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
    --card-bg: #131c31; /* Slightly brighter cards to pop against deep navy */
    --nav-bg: rgba(15, 22, 41, 0.9);
    --nav-blur: blur(10px);
}

[data-theme="dark"] .hero-title {
    color: #ffffff;
}

[data-theme="dark"] .hero-subtitle {
    color: #8892b0;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: var(--nav-blur);
    -webkit-backdrop-filter: var(--nav-blur);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 48px;
    /* ← change this to fit your design */
    width: auto;
    display: block;
}

/* Optional: make sure it looks good in dark mode too */
[data-theme="dark"] .logo-img {
    /* if your logo has light background and needs adjustment */
    filter: brightness(1.1) contrast(1.05);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    width: 50px;
    height: 28px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 4px;
    transition: all 0.3s ease;
}

.theme-toggle i {
    font-size: 0.85rem;
    position: absolute;
    transition: all 0.3s ease;
}

.theme-toggle .fa-sun {
    left: 6px;
    color: #f59e0b;
    opacity: 1;
}

.theme-toggle .fa-moon {
    right: 6px;
    color: #818cf8;
    opacity: 0;
}

[data-theme="dark"] .theme-toggle .fa-sun {
    opacity: 0;
}

[data-theme="dark"] .theme-toggle .fa-moon {
    opacity: 1;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    left: 4px;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle::before {
    transform: translateX(22px);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.home-section {
    padding: 120px 0 0;
    /* Removed bottom padding since sections were extracted */
    min-height: 100vh;
    position: relative;
    /* Bounds the new sidebars to the home unit */
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.home-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 500px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(96, 165, 250, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 15% 0%, rgba(56, 189, 248, 0.08) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 0%, rgba(56, 189, 248, 0.08) 0%, transparent 45%);
    pointer-events: none;
    z-index: 0;
}

.hero-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    margin-bottom: 0;
    /* Obsolete spacing since Skills/Education moved down */
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
    max-width: 650px;
}

.hero-intro {
    color: var(--accent-primary);
    font-family: 'Fira Code', monospace;
    /* Developer looking font if available, or just keeping the color */
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.hero-title {
    font-size: clamp(35px, 6vw, 65px);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 15px;
}

.hero-subtitle {
    font-size: clamp(30px, 5.5vw, 55px);
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.1;
    margin-bottom: 30px;
}

.hero-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 540px;
    margin-bottom: 20px;
}

.hero-action {
    display: flex;
}

.btn-outline {
    display: inline-block;
    padding: 1rem 1.75rem;
    color: var(--accent-primary);
    background-color: transparent;
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    /* Sleeker, less rounded border */
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.btn-outline:hover,
.btn-outline:focus-visible {
    background-color: rgba(64, 112, 244, 0.1);
    /* Subtle tint using an rgba assuming accent is blue/teal */
    transform: translateY(-3px);
}

.hero-image-container {
    flex: 0 0 320px;
    position: relative;
}

.profile-image-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: 10px;
    /* Creating a subtle geometric frame effect common in dev portfolios */
    box-shadow: 20px 20px 0 var(--border-color);
    transition: all 0.3s ease;
}

.profile-image-wrapper:hover {
    box-shadow: 10px 10px 0 var(--accent-primary);
    transform: translate(-5px, -5px);
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.5s ease;
}

.profile-image-wrapper:hover .hero-img {
    transform: scale(1.05);
}

.location {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.location i {
    color: #ef4444;
}

.course {
    font-size: 1.2rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.profile-img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--accent-gradient);
    box-shadow: var(--shadow-md);
}

/* Action Buttons (for resume, etc.) */
.action-buttons {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn.primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, #2563eb, #4f46e5);
}

/* Section Title */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 3px;
}

.section-title.centered {
    text-align: center;
}

.section-title.centered::after {
    left: 50%;
    transform: translateX(-50%);
}

/* About Section */
.about-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.about-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Education Section */
.education-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
    /* Prevents touching the Tech Stack section */
}

.education-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.education-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.education-item:hover {
    transform: translateX(5px);
}

.education-icon {
    width: 50px;
    height: 50px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.education-content h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.education-content .school {
    color: var(--accent-primary);
    font-weight: 500;
}

.education-content .year {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Bento Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    perspective: 1000px;
    margin-top: 2rem;
}

@media (min-width: 900px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: minmax(250px, auto);
    }
    .bento-frontend {
        grid-column: 1 / 3;
        grid-row: 1 / 2;
    }
    .bento-backend {
        grid-column: 3 / 4;
        grid-row: 1 / 2;
    }
    .bento-tools {
        grid-column: 1 / 4;
        grid-row: 2 / 3;
    }
}

/* Bento scroll animation */
@keyframes bentoReveal {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.92);
        filter: blur(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.bento-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    opacity: 0;
    transform: translateY(60px) scale(0.92);
    filter: blur(6px);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.bento-item.show {
    animation: bentoReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.bento-item.show:nth-child(1) { animation-delay: 0.1s; }
.bento-item.show:nth-child(2) { animation-delay: 0.25s; }
.bento-item.show:nth-child(3) { animation-delay: 0.4s; }

.bento-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.bento-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--accent-primary) 0%, transparent 40%);
    opacity: 0;
    z-index: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.bento-item:hover::before {
    opacity: 0.1;
}

.bento-item h3 {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bento-item h3 i {
    color: var(--accent-primary);
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: 12px;
}

.tech-items {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tech-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--bg-primary);
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.tech-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: scale(1.05);
}

.tech-item i {
    font-size: 1.1rem;
}

.tech-item i.fa-html5 { color: #e34c26; }
.tech-item i.fa-css3-alt { color: #264de4; }
.tech-item i.fa-js { color: #f7df1e; }
.tech-item i.fa-php { color: #777bb4; }
.tech-item i.fa-database { color: #00758f; }

/* Skills Section */
.skills-section {
    padding: 80px 0;
    background: var(--bg-primary);
}

/* Projects Section */
.projects-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 3rem auto 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--text-muted);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
    z-index: 0;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background: inherit;
    width: 50%;
    z-index: 1;
}

.timeline-item.left {
    left: 0;
}

.timeline-item.right {
    left: 50%;
}

.timeline-dot {
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    top: 15px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.timeline-item.left .timeline-dot {
    right: -20px;
}

.timeline-item.right .timeline-dot {
    left: -20px;
}

/* Timeline animations */
.timeline-item {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.timeline-item .project-card {
    transition: transform 0.8s ease;
}

.timeline-item.left .project-card {
    transform: translateX(-50px);
}

.timeline-item.right .project-card {
    transform: translateX(50px);
}

.timeline-item.show {
    opacity: 1;
}

.timeline-item.show .project-card {
    transform: translateX(0) !important;
}

.timeline-item .project-card {
    border-top: 4px solid var(--accent-primary);
    margin: 0;
    position: relative;
}

/* Arrows pointing to the line */
.timeline-item.left .project-card::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -9px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 10px solid var(--card-bg);
    z-index: 1;
}

.timeline-item.right .project-card::after {
    content: '';
    position: absolute;
    top: 20px;
    left: -9px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid var(--card-bg);
    z-index: 1;
}

.project-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.project-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.project-year {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.project-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.project-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.project-description ul {
    list-style: none;
    padding: 0;
}

.project-description li {
    color: var(--text-secondary);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.project-description li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: bold;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tag {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

/* ===================== */
/* Certificates Bento Grid */
/* ======================= */
.certificates-section {
    padding: 80px 0;
    background: var(--bg-primary);
}

.cert-bento {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (min-width: 900px) {
    .cert-bento {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: minmax(250px, auto);
    }
    .cert-1 { grid-column: 1 / 3; grid-row: 1 / 3; }
    .cert-2 { grid-column: 3 / 4; grid-row: 1 / 2; }
    .cert-3 { grid-column: 3 / 4; grid-row: 2 / 3; }
    .cert-4 { grid-column: 1 / 4; grid-row: 3 / 4; }
}

.bento-cert-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 1.5rem;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.bento-cert-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.bento-cert-image {
    width: 100%;
    height: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 14px;
    transition: transform 0.5s ease, filter 0.3s ease;
}

[data-theme="dark"] .bento-cert-image {
    filter: brightness(0.85) contrast(1.1);
}

.bento-cert-card:hover .bento-cert-image {
    transform: scale(1.03);
}

[data-theme="dark"] .bento-cert-card:hover .bento-cert-image {
    filter: brightness(1) contrast(1);
}

.cert-label {
    margin-top: 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-align: center;
}

/* Remove any leftover old icon styles */
.certificate-icon {
    display: none;
}

/* ===================== */
/* Gallery Marquee       */
/* ===================== */
.gallery-section {
    padding: 80px 0;
    background: var(--bg-secondary);
    overflow: hidden;
}

.gallery-marquee-wrapper {
    margin-top: 2.5rem;
    position: relative;
}

/* Edge fade gradients */
.gallery-marquee-wrapper::before,
.gallery-marquee-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    z-index: 2;
    pointer-events: none;
}

.gallery-marquee-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-secondary) 0%, transparent 100%);
}

.gallery-marquee-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-secondary) 0%, transparent 100%);
}

.gallery-marquee-row {
    overflow: hidden;
    width: 100%;
}

.gallery-marquee-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: galleryScroll 60s linear infinite;
}

.gallery-marquee-row:hover .gallery-marquee-track {
    animation-play-state: paused;
}

@keyframes galleryScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.gallery-card {
    flex-shrink: 0;
    width: 360px;
    aspect-ratio: 4 / 3;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 0;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-card:hover {
    transform: scale(1.06);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-primary);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.4s ease, filter 0.3s ease;
}

[data-theme="dark"] .gallery-card img {
    filter: brightness(0.85) contrast(1.1);
}

.gallery-card:hover img {
    transform: scale(1.04);
}

[data-theme="dark"] .gallery-card:hover img {
    filter: brightness(1) contrast(1);
}

/* Contact Section */
.contact-section {
    padding: 80px 0;
    background: var(--bg-primary);
}

.contact-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.contact-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
    transition: transform 0.3s ease;
}

.contact-card:hover .contact-icon {
    transform: scale(1.1);
}

.contact-icon.facebook {
    background: linear-gradient(135deg, #1877f2, #166fe5);
}

.contact-icon.github {
    background: linear-gradient(135deg, #333, #24292e);
}

.contact-icon.linkedin {
    background: linear-gradient(135deg, #0a66c2, #0077b5);
}

.contact-icon.phone {
    background: linear-gradient(135deg, #10b981, #059669);
}

.contact-icon.gmail {
    background: linear-gradient(135deg, #ea4335, #d33b28);
}

.contact-card h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

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

/* Home Sidebars */
.fixed-sidebar {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
    animation-delay: 4.8s;
    position: absolute !important;
    /* Forces the sidebars to stick only to the home page! */
    bottom: 0 !important;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateZ(0);
    /* Force hardware acceleration / lock layer */
}

.left-sidebar {
    left: 40px;
}

.right-sidebar {
    right: 40px;
}

.social-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
    margin-bottom: 20px;
}

.social-list li a {
    color: var(--text-muted);
    font-size: 20px;
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.social-list li a:hover {
    color: var(--accent-primary);
    transform: translateY(-3px);
}

.email-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.email-wrapper a {
    color: var(--text-muted);
    font-size: 14px;
    font-family: 'Fira Code', monospace;
    letter-spacing: 0.1em;
    writing-mode: vertical-rl;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    padding: 10px;
    margin-bottom: 20px;
}

.email-wrapper a:hover {
    color: var(--accent-primary);
    transform: translateY(-3px);
}

.fixed-sidebar::after {
    content: '';
    display: block;
    width: 1px;
    height: 90px;
    background-color: var(--text-muted);
    margin: 0 auto;
}

/* Footer */
.footer {
    background: var(--bg-tertiary);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--nav-bg);
        backdrop-filter: var(--nav-blur);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        display: block;
        padding: 1rem;
        margin: 0.5rem 1rem;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .fixed-sidebar {
        display: none;
    }

    .hero-wrapper {
        flex-direction: column-reverse;
        text-align: center;
        gap: 3rem;
    }

    .hero-action {
        justify-content: center;
    }

    .hero-image-container {
        flex: 0 0 auto;
    }

    .profile-image-wrapper {
        width: 250px;
        height: 250px;
        margin: 0 auto;
    }

    .timeline::after {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 55px;
        padding-right: 15px;
    }

    .timeline-item.right {
        left: 0;
    }

    .timeline-item.left .timeline-dot,
    .timeline-item.right .timeline-dot {
        left: 0;
        right: auto;
    }

    .timeline-item.left .project-card::after {
        right: auto;
        left: -9px;
        border-left: none;
        border-right: 10px solid var(--card-bg);
    }

    .tech-categories {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 480px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .profile-placeholder {
        width: 120px;
        height: 120px;
        font-size: 3rem;
    }

    .name {
        font-size: 1.5rem;
    }
}

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

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

@keyframes titleReveal {
    0% { opacity: 0; transform: translateY(20px); letter-spacing: 6px; }
    100% { opacity: 1; transform: translateY(0); letter-spacing: normal; }
}

@keyframes ambientPulse {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.hero-content>* {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.hero-content>*:nth-child(1) {
    animation-delay: 4.1s;
}

.hero-content>*:nth-child(2) {
    animation: titleReveal 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 4.2s;
}

.hero-content>*:nth-child(3) {
    animation-delay: 4.3s;
}

.hero-content>*:nth-child(4) {
    animation-delay: 4.4s;
}

.profile-image-wrapper {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
    animation-delay: 4.6s;
}

/* Intro Animation */
.intro-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}

.intro-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.intro-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.intro-icons {
    display: flex;
    gap: 2rem;
    font-size: 3rem;
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeInDownIntro 0.8s ease forwards;
    margin-bottom: -0.5rem;
}

.intro-icons i {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    /* WebKit browsers & modern standard */
    background-clip: text;
    /* Standard syntax to make IDE happy */
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 6px rgba(59, 130, 246, 0.2));
}


.intro-icons i:nth-child(1) {
    animation: floatIcon 3s ease-in-out infinite 0s;
}

.intro-icons i:nth-child(2) {
    animation: floatIcon 3s ease-in-out infinite 0.5s;
}

.intro-icons i:nth-child(3) {
    animation: floatIcon 3s ease-in-out infinite 1s;
}

.welcome-text {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUpIntro 0.8s ease forwards;
}

.typing-container {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-family: monospace;
    height: 2rem;
    display: flex;
    align-items: center;
}

.cursor {
    display: inline-block;
    width: 10px;
    animation: blinkCursor 1s step-end infinite;
    color: var(--accent-primary);
}

.loading-line {
    width: 250px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
    opacity: 0;
    animation: fadeInIntro 0.5s ease forwards 0.5s;
}

.loading-line .progress {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.2s ease;
}

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

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

@keyframes floatIcon {

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

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

@keyframes fadeInIntro {
    to {
        opacity: 1;
    }
}

@keyframes blinkCursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Hide scrollbar when intro is active */
body.intro-active {
    overflow: hidden;
}

@media (max-width: 480px) {
    .welcome-text {
        font-size: 1.8rem;
    }

    .typing-container {
        font-size: 1.2rem;
    }

    .loading-line {
        width: 200px;
    }
}

/* Image Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

#modalCaption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 15px 0;
    font-size: 1.2rem;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--accent-primary);
    text-decoration: none;
    cursor: pointer;
}

@media only screen and (max-width: 700px) {
    .modal-content {
        width: 100%;
    }
}