/* ===== VARIABLES ===== */
:root {
    --bg-color: #0f0f1a;
    --card-bg: #1a1a2e;
    --text-color: #e6e6f0;
    --text-muted: #a0a0b8;
    --accent-color: #6c63ff;
    --accent-light: #a29bfe;
    --border-color: #2a2a45;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --nav-h: 76px;
}

[data-theme="light"] {
    --bg-color: #f5f5fa;
    --card-bg: #ffffff;
    --text-color: #1a1a2e;
    --text-muted: #555570;
    --accent-color: #6c63ff;
    --accent-light: #4b46c9;
    --border-color: #e0e0f0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* ===== THEME TOGGLE BUTTON ===== */
#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--accent-color);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

#theme-toggle:hover {
    transform: scale(1.1) rotate(20deg);
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 3rem;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: background 0.3s ease;
}

[data-theme="light"] .navbar {
    background: rgba(245, 245, 250, 0.85);
}

.nav-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
}

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

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

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

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

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

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

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

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(108, 99, 255, 0.25), transparent 45%),
        radial-gradient(circle at 80% 30%, rgba(162, 155, 254, 0.2), transparent 45%),
        radial-gradient(circle at 50% 90%, rgba(108, 99, 255, 0.15), transparent 50%);
    z-index: 0;
    animation: floatBg 12s ease-in-out infinite alternate;
}

@keyframes floatBg {
    from {
        transform: scale(1) translate(0, 0);
    }
    to {
        transform: scale(1.1) translate(-20px, 20px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero::before {
        animation: none;
    }
}

/* ===== FOND ANIMÉ : réseau de particules, sur tout le site (thème SISR) =====
   Fixe au viewport (pas à la page) : il reste visible en filigrane derrière
   chaque section pendant le défilement, sans avoir à redimensionner un
   canvas de la hauteur totale du document. Le "voile" semi-opaque au-dessus
   garde le texte lisible tout en laissant deviner le réseau en mouvement. */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: -2;
    display: block;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

#bg-veil {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg-color);
    opacity: 0.62;
    pointer-events: none;
    transition: background-color 0.3s ease;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content h2 {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    min-height: 2rem;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 0.9rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.btn-outline:hover {
    background: var(--accent-color);
    color: #fff;
    transform: translateY(-3px);
}

.btn-disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    border: 2px solid var(--border-color);
    opacity: 0.6;
}

.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ===== SECTIONS GENERIQUES ===== */
.section {
    padding: 6rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 0.8rem auto 0;
    border-radius: 4px;
}

/* ===== REVEAL ANIMATION ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== SKILLS ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
    border-color: var(--accent-color);
}

.skill-card i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1.2rem;
}

.skill-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.skill-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

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

.projects-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.92rem;
    margin: -1.5rem 0 2rem;
}

.projects-hint i {
    color: var(--accent-color);
    margin-right: 0.4rem;
}

.project-card {
    position: relative;
    display: block;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover,
.project-card:focus-visible {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
    border-color: var(--accent-color);
}

.project-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
}

.project-card:hover .project-more i,
.project-card:focus-visible .project-more i {
    transform: translateX(4px);
}

.project-more i {
    font-size: 0.78rem;
    transition: transform 0.25s ease;
}

.project-card i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.project-card h3 {
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.project-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

.project-card--featured {
    position: relative;
    border-color: var(--accent-color);
    background: linear-gradient(160deg, rgba(108, 99, 255, 0.1), var(--card-bg) 55%);
}

.project-badge {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    background: var(--accent-color);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
}

.project-badge--outline {
    color: var(--accent-color);
    background: transparent;
    border: 1.5px solid var(--accent-color);
}

/* ===== VEILLE ===== */
.veille-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
}

.veille-content h3 {
    color: var(--accent-color);
    margin: 1.5rem 0 0.8rem;
    font-size: 1.3rem;
}

.veille-content p,
.veille-content li {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 0.6rem;
}

.veille-content ul {
    padding-left: 1.5rem;
}

.veille-actions {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

/* ===== CONTACT (pleine largeur) ===== */
.contact-section {
    padding-bottom: 6rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 2.5rem;
    align-items: start;
}

.contact-info {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    height: 100%;
}

.contact-lead {
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0 0 0.4rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-size: 1.1rem;
    padding: 0.4rem 0;
}

.contact-item i {
    color: var(--accent-color);
    font-size: 1.4rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.contact-item a {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
    word-break: break-word;
}

.contact-item a:hover,
.contact-item a:focus-visible {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* ===== FORMULAIRE DE CONTACT ===== */
.contact-form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-row input,
.form-row textarea {
    font: inherit;
    color: var(--text-color);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.18);
}

.form-row textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form .btn {
    align-self: flex-start;
    border: none;
}

.form-hint {
    min-height: 1.2em;
    font-size: 0.88rem;
    color: var(--accent-color);
    margin: 0;
}

/* ===== FOOTER ===== */
footer {
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-copy {
    margin: 0;
}

.footer-socials {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1.1rem;
    text-decoration: none;
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

a.footer-social-link:hover,
a.footer-social-link:focus-visible {
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.footer-social-link--todo {
    cursor: not-allowed;
    opacity: 0.55;
}

/* ===== BACK TO TOP ===== */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

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

#back-to-top:hover {
    background: var(--accent-light);
    transform: translateY(-5px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: var(--nav-h);
        left: -100%;
        flex-direction: column;
        background: var(--card-bg);
        width: 100%;
        text-align: center;
        padding: 2rem 0;
        gap: 1.5rem;
        transition: left 0.3s ease, visibility 0s linear 0.3s;
        border-bottom: 1px solid var(--border-color);
        visibility: hidden;
    }

    .nav-menu.active {
        left: 0;
        visibility: visible;
        transition: left 0.3s ease, visibility 0s;
    }

    .hamburger {
        display: flex;
    }

    .hero-content h1 {
        font-size: 2.3rem;
    }

    .hero-content h2 {
        font-size: 1.1rem;
    }

    .section {
        padding: 4rem 1.5rem;
    }

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

    .contact-info,
    .contact-form {
        padding: 2rem;
    }

    .footer-inner {
        justify-content: center;
        text-align: center;
    }
}
/* =========================================================
   AJOUTS — accessibilité, corrections et nouveaux éléments
   ========================================================= */

/* ===== LIEN D'ÉVITEMENT (navigation clavier) ===== */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1100;
    background: var(--accent-color);
    color: #fff;
    padding: 0.8rem 1.4rem;
    border-radius: 0 0 8px 0;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    left: 0;
}

/* ===== FOCUS VISIBLE (il n'y en avait aucun) ===== */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ===== ANCRES : ne pas passer sous la navbar fixe ===== */
section[id] {
    scroll-margin-top: calc(var(--nav-h) + 18px);
}

/* ===== HAMBURGER : c'est maintenant un <button>, il faut neutraliser
   les styles natifs, et animer les barres en croix à l'ouverture ===== */
.hamburger {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    align-items: center;
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

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

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ===== CORRECTION : le bouton de thème (fixe, en haut à droite)
   recouvrait le dernier lien du menu sur desktop et le hamburger sur mobile.
   On réserve la place à droite dans la navbar (élargi pour le bouton CTA
   "Tableau de synthèse", plus large qu'un simple lien). ===== */
.navbar {
    padding-right: 6.2rem;
}

/* ===== VEILLE : éléments d'accroche de la section ===== */
.veille-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-color);
    background: rgba(108, 99, 255, 0.12);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
}

.veille-content strong {
    color: var(--text-color);
    font-weight: 650;
}

.veille-hint {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 1.4rem;
}

/* ===== RESPONSIVE : compléments ===== */
@media (max-width: 768px) {
    .navbar {
        padding-left: 1.3rem;
        padding-right: 4.5rem;
    }

    .section {
        padding-left: 1.3rem;
        padding-right: 1.3rem;
    }
}

/* ===== IMPRESSION ===== */
@media print {
    .navbar,
    #theme-toggle,
    #back-to-top,
    .skip-link,
    .hero-buttons,
    .veille-actions,
    footer {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
    }

    .hero {
        min-height: auto;
        padding: 0 0 2rem;
    }

    .hero::before {
        display: none;
    }

    .hero-content h1 {
        -webkit-text-fill-color: #000;
        color: #000;
    }

    .section {
        padding: 1.5rem 0;
        max-width: none;
    }

    /* Les animations au scroll ne se déclenchent pas à l'impression :
       il faut forcer l'affichage, sinon la page sort blanche. */
    .reveal,
    .contact-info {
        opacity: 1 !important;
        transform: none !important;
    }

    .skill-card,
    .project-card,
    .veille-content,
    .contact-info,
    .contact-form {
        break-inside: avoid;
        page-break-inside: avoid;
        background: #fff !important;
        border: 1px solid #999 !important;
        box-shadow: none !important;
    }

    .contact-form .btn,
    .footer-socials {
        display: none !important;
    }

    p, li, span {
        color: #000 !important;
    }
}

/* ===== Hauteur de navbar fixe : le menu déroulant mobile s'aligne dessus ===== */
.navbar {
    min-height: var(--nav-h);
}

/* ===== Cible tactile du hamburger : 44x44 minimum (WCAG 2.5.8) ===== */
.hamburger {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
}

/* ===== Coordonnées non encore renseignées ===== */
.contact-todo {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.75;
}

/* ===== Ombre de la navbar au scroll
   (le JS posait déjà la classe .scrolled, mais aucune règle ne l'utilisait) ===== */
.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ===== BANDEAU : tableau de synthèse (section Projets) ===== */
.synthese-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.4rem;
    flex-wrap: wrap;
    background: var(--card-bg);
    border: 1px solid var(--accent-color);
    border-radius: 14px;
    padding: 1.4rem 1.8rem;
    margin-bottom: 2.5rem;
}

.synthese-banner-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.synthese-banner-text > i {
    font-size: 1.6rem;
    color: var(--accent-color);
    flex-shrink: 0;
}

.synthese-banner-title {
    font-weight: 700;
    margin: 0 0 0.2rem;
}

.synthese-banner-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

@media (max-width: 768px) {
    .synthese-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .synthese-banner-text {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== BOUTON "TABLEAU DE SYNTHÈSE" DANS LA NAVBAR (bien visible, en haut à droite) ===== */
.nav-item--cta {
    margin-left: 0.4rem;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--accent-color);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.98rem;
    padding: 0.65rem 1.3rem;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(108, 99, 255, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    white-space: nowrap;
}

.nav-cta:hover,
.nav-cta:focus-visible {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 99, 255, 0.45);
}

.nav-cta i {
    font-size: 1rem;
}

@media (max-width: 768px) {
    .nav-item--cta {
        margin: 0.4rem 0 0;
    }

    .nav-cta {
        font-size: 1.05rem;
        padding: 0.8rem 1.6rem;
    }
}

/* ===== UTILITAIRE : visible seulement des lecteurs d'écran ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================================
   TERMINAL INTERACTIF (easter egg BTS SISR)
   ========================================================= */
#terminal-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--accent-color);
    border: 1px solid var(--border-color);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    z-index: 999;
    transition: transform 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

#terminal-toggle:hover,
#terminal-toggle:focus-visible {
    transform: scale(1.08);
    color: #fff;
    background: var(--accent-color);
}

#terminal-toggle[aria-expanded="true"] {
    color: #fff;
    background: var(--accent-color);
}

.terminal-panel {
    position: fixed;
    left: 30px;
    bottom: 96px;
    width: min(440px, calc(100vw - 60px));
    max-height: min(480px, calc(100vh - 150px));
    display: flex;
    flex-direction: column;
    background: #0d0d16;
    border: 1px solid #2a2a45;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: hidden;
    font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
}

.terminal-panel[hidden] {
    display: none;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
    background: #16162a;
    border-bottom: 1px solid #2a2a45;
}

.terminal-dots {
    display: inline-flex;
    gap: 0.4rem;
}

.terminal-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-dot--red { background: #ff5f56; }
.terminal-dot--yellow { background: #ffbd2e; }
.terminal-dot--green { background: #27c93f; }

.terminal-title {
    flex: 1;
    text-align: center;
    font-size: 0.78rem;
    color: #8888a8;
}

.terminal-close {
    background: none;
    border: none;
    color: #8888a8;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.terminal-close:hover,
.terminal-close:focus-visible {
    color: #fff;
}

.terminal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.9rem 1rem;
    font-size: 0.83rem;
    line-height: 1.65;
    color: #d6d6f5;
}

.terminal-line { margin: 0 0 0.35rem; white-space: pre-wrap; word-break: break-word; }
.terminal-line--cmd { color: #7effa0; }
.terminal-line--cmd::before { content: 'mehdi@sisr:~$ '; color: #6c63ff; }
.terminal-line--error { color: #ff8484; }
.terminal-line--accent { color: #a29bfe; }

.terminal-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-top: 1px solid #2a2a45;
    background: #101020;
}

.terminal-prompt {
    color: #6c63ff;
    font-size: 0.83rem;
    flex-shrink: 0;
}

.terminal-input-row input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f0f0ff;
    font: inherit;
    font-size: 0.83rem;
}

@media (max-width: 600px) {
    #terminal-toggle {
        left: 20px;
        bottom: 20px;
        width: 46px;
        height: 46px;
    }

    .terminal-panel {
        left: 12px;
        right: 12px;
        width: auto;
        bottom: 82px;
    }
}

/* =========================================================
   MODALE DE DÉTAIL PROJET
   ========================================================= */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vh 1.2rem;
}

.project-modal[hidden] {
    display: none;
}

.project-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 12, 0.72);
    backdrop-filter: blur(3px);
}

.project-modal-dialog {
    position: relative;
    width: min(760px, 100%);
    max-height: 92vh;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-modal-scroll {
    overflow-y: auto;
    padding: 2.4rem 2.4rem 2.6rem;
}

.project-modal-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 2;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.project-modal-close:hover,
.project-modal-close:focus-visible {
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: rotate(90deg);
}

.project-modal-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-color);
    background: rgba(108, 99, 255, 0.12);
    border: 1px solid var(--accent-color);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.9rem;
}

.project-modal-badge:empty {
    display: none;
}

.project-modal-head h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    padding-right: 2.2rem;
}

.project-modal-context {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

.project-modal-context:empty {
    display: none;
}

.project-modal-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.6rem;
}

.project-modal-tags li {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 0.28rem 0.7rem;
    border-radius: 8px;
}

.project-modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.8rem;
}

.project-modal-gallery:empty {
    display: none;
}

.project-modal-gallery figure {
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
}

.project-modal-gallery img {
    display: block;
    width: 100%;
    height: auto;
}

.project-modal-gallery figcaption {
    font-size: 0.76rem;
    color: var(--text-muted);
    padding: 0.5rem 0.7rem;
    border-top: 1px solid var(--border-color);
}

.project-modal-body {
    color: var(--text-muted);
    line-height: 1.75;
    font-size: 0.96rem;
}

.project-modal-body p {
    margin-bottom: 1rem;
}

.project-modal-body strong {
    color: var(--text-color);
    font-weight: 650;
}

.project-modal-body h4 {
    color: var(--text-color);
    font-size: 1rem;
    margin: 1.6rem 0 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-modal-body h4 i {
    color: var(--accent-color);
}

.project-modal-body ul {
    padding-left: 1.3rem;
    margin-bottom: 1rem;
}

.project-modal-body li {
    margin-bottom: 0.4rem;
}

.project-modal-note {
    font-size: 0.85rem;
    font-style: italic;
    background: rgba(108, 99, 255, 0.1);
    border-left: 3px solid var(--accent-color);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.2rem;
}

.project-modal-body pre {
    background: #0d0d16;
    color: #d6d6f5;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin: 0 0 1.2rem;
    font-size: 0.82rem;
    line-height: 1.6;
    border: 1px solid #2a2a45;
}

.project-modal-body pre code {
    font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
}

.project-modal-body code:not(pre code) {
    font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
    font-size: 0.88em;
    background: rgba(108, 99, 255, 0.14);
    color: var(--accent-light);
    padding: 0.12em 0.4em;
    border-radius: 5px;
}

.project-modal-code-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.4rem;
}

@media (max-width: 600px) {
    .project-modal-scroll {
        padding: 2.2rem 1.3rem 2rem;
    }
}
