:root {
    --primary: #7b1e3a;
    --primary-dark: #541126;
    --primary-light: #9c274a;
    --accent: #c09030;
    --accent-light: #e6b74a;
    --success: #10b981;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --bg-card: #1e293b;
    --bg-overlay: rgba(15, 23, 42, 0.95);
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.2);
    --shadow-lg: rgba(0, 0, 0, 0.35);
    --white: #ffffff;
}

.light-theme {
    --dark: #ffffff;
    --dark-light: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-tertiary: #64748b;
    --bg-card: #ffffff;
    --bg-overlay: rgba(255, 255, 255, 0.97);
    --border-color: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.06);
    --shadow-lg: rgba(0, 0, 0, 0.12);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--dark);
    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 24px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-overlay);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 24px;
    gap: 1rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
    white-space: nowrap;
}

.nav-logo {
    width: 2.4rem;
    height: auto;
    max-width: 42px;
    background: transparent;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.75rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    position: relative;
    padding: 0.25rem 0;
}

.light-theme .nav-link {
    color: #0f172a;
    font-weight: 600;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: all 0.25s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
}

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

.btn-retour {
    background: rgba(123, 30, 58, 0.2);
    color: #fbcfe8 !important;
    border: 1px solid rgba(224, 98, 135, 0.4);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-retour:hover {
    background: var(--primary);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 30, 58, 0.3);
}

.light-theme .btn-retour {
    background: #ffffff;
    color: var(--primary) !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.light-theme .btn-retour:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.light-theme .theme-toggle {
    color: #0f172a;
}

.theme-toggle:hover {
    background-color: var(--dark-light);
    color: var(--primary);
    transform: rotate(15deg);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 65px;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.94) 100%);
    backdrop-filter: blur(2px);
}

.light-theme .hero-overlay {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 250, 252, 0.96) 100%);
    backdrop-filter: blur(2px);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 3rem 1.5rem;
    max-width: 900px;
}

.hero-badge {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(123, 30, 58, 0.3);
    border: 2px solid rgba(192, 144, 48, 0.4);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.light-theme .hero-badge {
    background: rgba(123, 30, 58, 0.1);
    color: var(--primary);
    border-color: rgba(123, 30, 58, 0.2);
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 1.25rem;
    color: #ffffff !important;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.light-theme .hero-title {
    color: #0f172a !important;
    text-shadow: none;
}

.hero-description {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--text-secondary) !important;
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.7;
}

.light-theme .hero-description {
    color: #475569 !important;
}

/* Breadcrumbs & Hero Enhancements */
.hero-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
    padding: 0.35rem 0.95rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.light-theme .hero-breadcrumb {
    background: rgba(255, 255, 255, 0.85);
    border-color: #e2e8f0;
    color: #64748b;
}

.hero-breadcrumb a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.hero-breadcrumb a:hover {
    color: var(--primary);
}

.hero-breadcrumb span {
    color: var(--primary);
    font-weight: 600;
}

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

.hero-actions .btn {
    padding: 0.85rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-actions .btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(123, 30, 58, 0.4);
}

.hero-actions .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 30, 58, 0.5);
}

.hero-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
}

.light-theme .hero-actions .btn-secondary {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

.hero-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

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

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.95rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    backdrop-filter: blur(6px);
}

.light-theme .hero-pill {
    background: rgba(123, 30, 58, 0.05);
    border-color: rgba(123, 30, 58, 0.15);
    color: #334155;
}

.hero-pill i {
    color: var(--accent);
}

/* Sections */
.section {
    padding: 5rem 0;
}

.section-alt {
    background-color: var(--dark-light);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-tertiary);
    max-width: 650px;
    margin: 0 auto;
}

/* Responsable Section */
.responsable-card {
    max-width: 650px;
    margin: 0 auto;
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.responsable-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px var(--shadow-lg);
}

.responsable-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--accent);
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.responsable-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.responsable-role {
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.light-theme .responsable-role {
    color: var(--primary);
}

.responsable-bio {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
}

/* Cards Grid (Compétences) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
}

.card {
    background-color: var(--bg-card);
    padding: 2rem 1.75rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px var(--shadow-lg);
    border-color: var(--primary);
}

.card-icon {
    font-size: 2.25rem;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.light-theme .card-icon {
    color: var(--primary);
}

.card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.card p {
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 0.95rem;
}

/* Tags (Technologies) */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
}

.tag {
    padding: 0.5rem 1.15rem;
    background-color: rgba(123, 30, 58, 0.2);
    color: #fbcfe8;
    border-radius: 50px;
    border: 1px solid rgba(224, 98, 135, 0.3);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.light-theme .tag {
    background-color: rgba(123, 30, 58, 0.08);
    color: var(--primary);
    border-color: rgba(123, 30, 58, 0.2);
}

.tag:hover {
    background-color: var(--primary);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(123, 30, 58, 0.3);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--bg-card);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 14px var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 32px var(--shadow-lg);
    border-color: var(--primary);
}

.project-image {
    height: 200px;
    position: relative;
    background: linear-gradient(135deg, var(--dark-light), var(--primary-dark));
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-view {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
    transition: transform 0.2s ease, background 0.2s ease;
}

.project-view:hover {
    transform: scale(1.1);
    background: var(--accent);
}

.project-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-info h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

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

.project-tag {
    padding: 0.25rem 0.75rem;
    background-color: rgba(123, 30, 58, 0.2);
    color: #fbcfe8;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(224, 98, 135, 0.3);
}

.light-theme .project-tag {
    background-color: rgba(123, 30, 58, 0.08);
    color: var(--primary);
    border-color: rgba(123, 30, 58, 0.2);
}

/* Call to Action */
.cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 5rem 0;
    text-align: center;
    color: #ffffff;
}

.cta h2 {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: #ffffff !important;
}

.cta p {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    margin-bottom: 2.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.85rem 1.85rem;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.25s ease;
    margin: 0.4rem;
}

.btn-light {
    background-color: #ffffff !important;
    color: #7b1e3a !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    background-color: #f8fafc !important;
}

.btn-outline {
    background-color: transparent;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
}

.btn-outline:hover {
    background-color: #ffffff !important;
    color: var(--primary) !important;
    border-color: #ffffff !important;
    transform: translateY(-2px);
}

/* Footer */
.department-footer {
    background-color: #0a0f1d;
    padding: 2.5rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.light-theme .department-footer {
    background-color: #f1f5f9;
    border-top: 1px solid #e2e8f0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-copy {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 992px) {
    .nav-menu {
        display: none;
    }
    
    .nav-menu.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-overlay);
        padding: 1.5rem 2rem;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 25px rgba(0,0,0,0.2);
        gap: 1rem;
    }

    .mobile-toggle {
        display: flex;
    }
}

/* Scroll-to-Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

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

.scroll-top-btn:hover {
    background-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(192, 144, 48, 0.4);
}

