:root {
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --primary-dark: #1d4ed8;
    --accent: #38bdf8;

    --background: #f8fafc;
    --background-alt: #eef4ff;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;

    --text: #0f172a;
    --text-muted: #64748b;
    --heading: #0f172a;

    --border: rgba(148, 163, 184, .28);
    --shadow: 0 20px 60px rgba(15, 23, 42, .10);
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, .08);
    --radius: 24px;
    --radius-sm: 16px;

    --container: min(1180px, 90vw);
    --transition: 220ms ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: auto;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.7;
}

body.menu-open {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

:focus-visible {
    outline: 3px solid rgba(96, 165, 250, .65);
    outline-offset: 4px;
}

.container {
    width: var(--container);
    margin-inline: auto;
}

.section {
    position: relative;
    padding: clamp(84px, 10vw, 128px) 0;
}

.section-alt {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .08), transparent 34%),
        linear-gradient(180deg, transparent, rgba(37, 99, 235, .03));
}

.section-heading {
    max-width: 780px;
    margin: 0 auto 56px;
    text-align: center;
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .85rem;
    padding: .45rem .9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--primary);
    background: rgba(37, 99, 235, .08);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.section-title {
    color: var(--heading);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.12;
    letter-spacing: -.04em;
}

.section-description {
    max-width: 920px;
    margin: 0 auto 1rem;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.site-header {
    position: relative;
    z-index: 1000;
}

.navbar {
    position: fixed;
    inset: 16px 50% auto auto;
    transform: translateX(50%);
    width: min(1180px, calc(100% - 32px));
    min-height: 72px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 14px 18px;
    border: 1px solid rgba(148, 163, 184, .25);
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 14px 40px rgba(15, 23, 42, .08);
    backdrop-filter: blur(18px);
    transition: background var(--transition), box-shadow var(--transition), border-color var(--transition), min-height var(--transition);
}

.navbar-scrolled {
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 18px 48px rgba(15, 23, 42, .14);
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    font-weight: 800;
    letter-spacing: -.04em;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .32);
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(.6rem, 1.4vw, 1.4rem);
}

.nav-links a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    color: var(--text);
    font-size: .95rem;
    font-weight: 650;
    transition: color var(--transition);
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    height: 2px;
    border-radius: 999px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

.menu-toggle,
#theme-toggle {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255, 255, 255, .64);
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

#theme-toggle:hover,
.menu-toggle:hover {
    transform: translateY(-2px);
    background: rgba(37, 99, 235, .10);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    width: 19px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.hero {
    min-height: 100svh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 1.5rem 96px;
    overflow: hidden;
    text-align: center;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -3;
    background:
        radial-gradient(circle at 18% 18%, rgba(37, 99, 235, .20), transparent 28%),
        radial-gradient(circle at 82% 26%, rgba(56, 189, 248, .18), transparent 28%),
        linear-gradient(-45deg, #eff6ff, #dbeafe, #e0e7ff, #f8fafc);
    background-size: 100% 100%, 100% 100%, 400% 400%;
    animation: gradientFlow 18s ease infinite;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 10% -140px;
    height: 300px;
    z-index: -2;
    border-radius: 50%;
    background: rgba(37, 99, 235, .16);
    filter: blur(80px);
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;      
    object-position: center; 
    opacity: .50;
    pointer-events: none;
}


@keyframes gradientFlow {
    0% { background-position: 0 0, 0 0, 0% 50%; }
    50% { background-position: 0 0, 0 0, 100% 50%; }
    100% { background-position: 0 0, 0 0, 0% 50%; }
}

.hero-content {
    width: min(1000px, 100%);
    margin-inline: auto;
    margin-top: -15px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .6rem 1rem;
    border: 1px solid rgba(37, 99, 235, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .70);
    color: var(--primary);
    font-weight: 800;
    box-shadow: var(--shadow-soft);
}

.hero h1 {
    margin-top: 1.4rem;
    color: var(--heading);
    font-size: clamp(3rem, 9vw, 6.7rem);
    font-weight: 900;
    line-height: auto;
    letter-spacing: -.075em;
}

.hero h2 {
    min-height: 1.6em;
    margin-top: 1.1rem;
    color: #334155;
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 750;
}

#typing-text::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 5px;
    vertical-align: -.12em;
    background: var(--primary);
    animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .85rem;
    margin-top: 2rem;
}

.hero-tags span {
    padding: .82rem 1.2rem;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .74);
    box-shadow: var(--shadow-soft);
    color: var(--text);
    font-weight: 700;
}

.hero p {
    max-width: 790px;
    margin: 2rem auto 0;
    color: var(--text-muted);
    font-size: clamp(1rem, 2vw, 1.18rem);
}

.hero p i {
    margin-right: .4rem;
    color: var(--primary);
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.7rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 52px;
    padding: .95rem 1.35rem;
    border-radius: 16px;
    font-weight: 800;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-primary {
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
    box-shadow: 0 14px 32px rgba(37, 99, 235, .32);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 42px rgba(37, 99, 235, .42);
}

.btn-secondary {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .72);
    color: var(--text);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, .35);
    background: rgba(255, 255, 255, .95);
    color: var(--primary);
}

.glass-card,
.card,
.timeline-item,
.experience-card,
.project-card,
.certifications-grid div,
.contact-grid a {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.glass-card {
    padding: clamp(1.4rem, 4vw, 3rem);
    border-radius: var(--radius);
}

.expertise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.card {
    position: relative;
    min-height: 240px;
    padding: 2rem;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, .12), transparent 44%);
    opacity: 0;
    transition: opacity var(--transition);
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(37, 99, 235, .30);
    box-shadow: 0 26px 64px rgba(15, 23, 42, .14);
}

.card:hover::before {
    opacity: 1;
}

.card i,
.project-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 1.1rem;
    border-radius: 18px;
    background: rgba(37, 99, 235, .10);
    color: var(--primary);
    font-size: 1.65rem;
}

.card h3,
.timeline-item h3,
.experience-card h3,
.project-card h3 {
    position: relative;
    color: var(--heading);
    line-height: 1.25;
}

.card p,
.timeline-item p,
.experience-card p,
.project-card p {
    position: relative;
    color: var(--text-muted);
}

.card p {
    margin-top: .7rem;
}

.timeline {
    position: relative;
    max-width: 940px;
    margin: auto;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 16px;
    width: 2px;
    background: linear-gradient(var(--primary), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.35rem;
    margin-left: 42px;
    padding: 1.6rem;
    border-radius: var(--radius-sm);
    transition: transform var(--transition), border-color var(--transition);
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -34px;
    top: 28px;
    width: 14px;
    height: 14px;
    border: 4px solid var(--surface);
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .18);
}

.timeline-item:hover {
    transform: translateX(4px);
    border-color: rgba(37, 99, 235, .35);
}

.timeline-item span,
.experience-card span {
    display: inline-flex;
    margin-bottom: .55rem;
    color: var(--primary);
    font-weight: 800;
}

.experience-list {
    display: grid;
    gap: 1.4rem;
}

.experience-card {
    padding: clamp(1.35rem, 3vw, 2.25rem);
    border-radius: var(--radius);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.experience-card:hover {
    transform: translateY(-5px);
    border-color: rgba(37, 99, 235, .28);
    box-shadow: 0 26px 64px rgba(15, 23, 42, .13);
}

.experience-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.experience-card h4 {
    margin: .35rem 0 1rem;
    color: var(--heading);
    font-size: 1.02rem;
    line-height: 1.6;
}

.experience-points {
    display: grid;
    gap: .7rem;
    margin-top: .65rem;
}

.experience-points li {
    position: relative;
    padding-left: 1.35rem;
    color: var(--text-muted);
}

.experience-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .72em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
}

.project-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .9rem;
    margin-bottom: 2rem;
}

.project-tab {
    border: 1px solid var(--border);
    padding: .85rem 1.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .76);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

.project-tab:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, .34);
}

.project-tab.active {
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
}

.project-content {
    display: none;
}

.project-content.active {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    position: relative;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    border-radius: var(--radius);
    overflow: hidden;
    text-align: center;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .10), transparent 48%),
        radial-gradient(circle at top right, rgba(56, 189, 248, .18), transparent 32%);
}

.project-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: rgba(37, 99, 235, .35);
    box-shadow: 0 28px 70px rgba(15, 23, 42, .18);
}

.project-card h3,
.project-icon {
    z-index: 1;
}

.project-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.7rem;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity var(--transition), transform var(--transition);
    background: linear-gradient(135deg, rgba(37, 99, 235, .96), rgba(14, 116, 144, .96));
}

.project-overlay p {
    color: #ffffff;
    font-weight: 750;
}

.project-card:hover .project-overlay,
.project-card:focus-within .project-overlay {
    opacity: 1;
    transform: translateY(0);
}

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.certifications-grid div {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    border-radius: var(--radius-sm);
    color: var(--heading);
    text-align: center;
    font-weight: 800;
    transition: transform var(--transition), border-color var(--transition);
}

.certifications-grid div:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, .32);
}

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.contact-grid a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    min-height: 58px;
    padding: 1rem 1.35rem;
    border-radius: 18px;
    color: var(--text);
    font-weight: 800;
    transition: transform var(--transition), color var(--transition), border-color var(--transition), background var(--transition);
}

.contact-grid i {
    color: var(--primary);
}

.contact-grid a:hover {
    transform: translateY(-5px);
    border-color: rgba(37, 99, 235, .36);
    color: var(--primary);
}

footer {
    padding: 2.2rem 1rem;
    color: var(--text-muted);
    text-align: center;
}

#backToTop {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity var(--transition), transform var(--transition);
    z-index: 999;
    box-shadow: 0 14px 34px rgba(37, 99, 235, .34);
}

#backToTop.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.hidden {
    opacity: 0;
    transform: translateY(34px);
    transition: opacity .75s ease, transform .75s ease;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

body.dark {
    --background: #020617;
    --background-alt: #07111f;
    --surface: #0f172a;
    --surface-soft: #111c33;
    --text: #f8fafc;
    --text-muted: #cbd5e1;
    --heading: #ffffff;
    --border: rgba(148, 163, 184, .18);
    --shadow: 0 22px 70px rgba(0, 0, 0, .30);
    --shadow-soft: 0 14px 40px rgba(0, 0, 0, .20);

    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .16), transparent 30%),
        radial-gradient(circle at top right, rgba(56, 189, 248, .10), transparent 30%),
        #020617;
    color: var(--text);
}

body.dark .navbar {
    border-color: rgba(255, 255, 255, .10);
    background: rgba(15, 23, 42, .82);
    box-shadow: 0 16px 44px rgba(0, 0, 0, .30);
}

body.dark .navbar-scrolled {
    background: rgba(15, 23, 42, .94);
}

body.dark .nav-links a {
    color: #e2e8f0;
}

body.dark .nav-links a:hover,
body.dark .nav-links a.active {
    color: var(--primary-light);
}

body.dark #theme-toggle,
body.dark .menu-toggle {
    border-color: rgba(255, 255, 255, .12);
    background: rgba(30, 41, 59, .72);
    color: #f8fafc;
}

body.dark .hero::before {
    background:
        radial-gradient(circle at 18% 18%, rgba(37, 99, 235, .28), transparent 30%),
        radial-gradient(circle at 82% 26%, rgba(56, 189, 248, .18), transparent 30%),
        linear-gradient(-45deg, #020617, #0f172a, #111827, #1e293b);
    background-size: 100% 100%, 100% 100%, 400% 400%;
}

body.dark .hero h1 {
    background: linear-gradient(90deg, #ffffff, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 26px rgba(96, 165, 250, .18);
}

body.dark .hero h2 {
    color: #e2e8f0;
}

body.dark .hero-badge,
body.dark .hero-tags span,
body.dark .btn-secondary,
body.dark .project-tab,
body.dark .glass-card,
body.dark .card,
body.dark .timeline-item,
body.dark .experience-card,
body.dark .project-card,
body.dark .certifications-grid div,
body.dark .contact-grid a {
    border-color: rgba(148, 163, 184, .18);
    background: rgba(17, 28, 51, .78);
    color: #f8fafc;
}

body.dark .hero-badge,
body.dark .section-kicker,
body.dark .card i,
body.dark .project-icon,
body.dark .contact-grid i,
body.dark .timeline-item span,
body.dark .experience-card span {
    color: var(--primary-light);
}

body.dark .section-kicker {
    border-color: rgba(96, 165, 250, .20);
    background: rgba(37, 99, 235, .12);
}

body.dark .btn-secondary:hover,
body.dark .contact-grid a:hover {
    background: rgba(37, 99, 235, .18);
    color: #ffffff;
}

body.dark .project-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
}

body.dark .timeline-item::before {
    border-color: #020617;
}

body.dark footer {
    border-top: 1px solid rgba(148, 163, 184, .12);
    color: #94a3b8;
}

@media (max-width: 1024px) {
    .navbar {
        border-radius: 28px;
    }

    .nav-links {
        gap: .85rem;
    }

    .nav-links a {
        font-size: .9rem;
    }
}

@media (max-width: 900px) {
    .navbar {
        min-height: 68px;
        border-radius: 24px;
    }

    .menu-toggle {
        display: inline-flex;
        order: 3;
    }

    #theme-toggle {
        order: 2;
        margin-left: auto;
    }

    .nav-links {
        position: fixed;
        top: 96px;
        right: 16px;
        width: min(330px, calc(100vw - 32px));
        max-height: calc(100svh - 120px);
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: .35rem;
        padding: 1rem;
        border: 1px solid var(--border);
        border-radius: 24px;
        background: rgba(255, 255, 255, .96);
        box-shadow: var(--shadow);
        backdrop-filter: blur(18px);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px) scale(.98);
        transform-origin: top right;
        transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
    }

    .nav-links.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

    .nav-links a {
        justify-content: center;
        min-height: 46px;
        border-radius: 14px;
    }

    .nav-links a::after {
        display: none;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(37, 99, 235, .10);
    }

    body.dark .nav-links {
        background: rgba(15, 23, 42, .96);
        border-color: rgba(255, 255, 255, .10);
    }

    .hero {
        padding-top: 128px;
    }
}

@media (max-width: 640px) {
    :root {
        --container: min(100% - 32px, 1180px);
    }

    .navbar {
        inset: 10px 50% auto auto;
        width: calc(100% - 20px);
        padding: 10px 12px;
    }

    .logo,
    #theme-toggle,
    .menu-toggle {
        width: 44px;
        height: 44px;
    }

    .nav-links {
        top: 78px;
        right: 10px;
        width: calc(100vw - 20px);
    }

    .hero {
        padding-inline: 1rem;
    }

    .hero-tags span {
        width: 100%;
        max-width: 340px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        width: min(360px, 100%);
        margin-inline: auto;
    }

    .btn {
        width: 100%;
    }

    .section-heading {
        margin-bottom: 38px;
    }

    .glass-card {
        padding: 1.25rem;
    }

    .section-description {
        text-align: left;
        font-size: 1rem;
    }

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

    .timeline-item {
        margin-left: 30px;
        padding: 1.25rem;
    }

    .timeline-item::before {
        left: -27px;
    }

    .card,
    .experience-card,
    .project-card {
        border-radius: 20px;
    }

    .contact-grid {
        flex-direction: column;
    }

    .contact-grid a {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
.project-card-pro {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100%;
    text-align: left;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .10);
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.project-card-pro:hover {
    transform: translateY(-8px);
    box-shadow: 0 28px 70px rgba(37, 99, 235, .18);
    border-color: rgba(37, 99, 235, .35);
}

.project-media {
    width: 100%;
    height: 210px;
    overflow: hidden;
    background: linear-gradient(135deg, #020617, #1e293b);
}

.project-media img,
.project-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: .92;
    transition: transform .45s ease;
}

.project-card-pro:hover .project-media img,
.project-card-pro:hover .project-media video {
    transform: scale(1.06);
}

.project-body {
    padding: 1.6rem;
}

.project-category {
    display: inline-flex;
    margin-bottom: .8rem;
    padding: .35rem .75rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, .10);
    color: #2563eb;
    font-size: .78rem;
    font-weight: 700;
}

.project-body h3 {
    margin-bottom: .7rem;
    font-size: 1.35rem;
}

.project-summary,
.project-contribution p,
.project-impact p {
    color: var(--text-light);
    font-size: .95rem;
    line-height: 1.7;
}

.project-contribution,
.project-impact {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, .22);
}

.project-contribution strong,
.project-impact strong {
    display: block;
    margin-bottom: .35rem;
    color: var(--secondary);
    font-size: .9rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.2rem;
}

.project-tech span {
    padding: .35rem .7rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, .10);
    color: #2563eb;
    font-size: .78rem;
    font-weight: 600;
}
body.dark .project-card-pro {
    background: rgba(15, 23, 42, .88);
    border-color: rgba(96, 165, 250, .18);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

body.dark .project-card-pro:hover {
    border-color: rgba(96, 165, 250, .45);
    box-shadow: 0 30px 80px rgba(37, 99, 235, .22);
}

body.dark .project-category,
body.dark .project-tech span {
    background: rgba(96, 165, 250, .12);
    color: #60a5fa;
}

body.dark .project-contribution strong,
body.dark .project-impact strong {
    color: #f8fafc;
}

body.dark .project-summary,
body.dark .project-contribution p,
body.dark .project-impact p {
    color: #cbd5e1;
}

#open-avatar-modal {
  cursor: pointer;
}

/* L'arrière-plan de la modale prend maintenant TOUT l'écran réel */
.avatar-modal {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999; /* Au-dessus de absolument tout */
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.avatar-modal.active {
  opacity: 1;
  pointer-events: auto;
}

/* Le contenu qui va descendre à l'ouverture */
.avatar-modal-content {
  position: relative;
  max-width: 320px;
  width: 90%;
}

/* Application de l'animation de descente uniquement quand la modale est ACTIVE */
.avatar-modal.active .avatar-modal-content {
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.avatar-modal-content img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.avatar-modal-close {
  position: absolute;
  top: -45px;
  right: 0;
  color: #ffffff;
  font-size: 35px;
  cursor: pointer;
}

/* Nouvelle animation : commence à -30px (plus haut) et descend à sa place (0) */
@keyframes slideDown {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}



.avatar-modal-close {
  position: absolute;
  top: -45px;
  right: 0;
  color: #ffffff;
  font-size: 35px;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}

.avatar-modal-close:hover {
  color: #38bdf8; 
  transform: scale(1.1);
}

@keyframes zoomInModale {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
