/* ======================== VARIABLES GLOBALES ======================== */

:root {
    --bg:      #07071a;
    --text:    white;
    --muted:   #6b6b8a;
    --purple:  #a855f7;
    --surface: rgba(255,255,255,0.04);
    --border:  rgba(168,85,247,0.25);
}

/* --------------------- RESET --------------------- */

* {
    margin: 0;
    padding: 0;
    text-decoration: none;
    list-style: none;
    box-sizing: border-box;
}

/* --------------------- BODY --------------------- */

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #07071a;
    color: white;
    overflow-x: hidden;
}

/* ================================================= */

/* ======================== CANVAS ÉTOILES ======================== */

#starCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* Tout le contenu au-dessus du canvas */
main, .navbar, .site-footer,
.service-card, .card, .timeline-card,
.profile-card, .cta-contact, .form-card,
.services-grid, .cards-grid, .timeline {
    position: relative;
    z-index: 1;
}
/* ================================================= */

/* ======================== NAVBAR ======================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 20px clamp(16px, 4vw, 40px);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    width: 100%;
    background: rgba(7, 7, 26, 0.7);
    backdrop-filter: blur(10px);
}

/* --- Logo --- */
.navbar .logo { justify-self: start; }

.navbar .logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: clamp(28px, 5vw, 40px);
    width: auto;
    max-width: clamp(120px, 30vw, 180px);
    display: block;
    object-fit: contain;
}

/* --- Liens --- */
.nav-links { justify-self: center; }

.nav-links {
    display: flex;
    gap: clamp(12px, 2vw, 25px);
    list-style: none;
}

.navbar a       { color: white; }
.navbar a:hover { color: #a855f7; }

/* Lien actif */
.nav-links .active { color: #a855f7; }

/* --- Bouton thème desktop --- */
.theme-toggle { justify-self: end; }

.theme-toggle {
    background: none;
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    padding: 6px 10px;
    font-size: 0.9em;
    margin-left: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
    background: rgba(168,85,247,0.15);
    border-color: rgba(168,85,247,0.6);
}
/* ================================================= */

/* ======================== HAMBURGER ======================== */

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 200;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform 0.35s ease, opacity 0.25s ease;
    transform-origin: center;
}

/* --- Animation hamburger → croix --- */
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Bouton thème mobile --- */
.theme-toggle-mobile { margin-top: 8px; }

.theme-toggle-mobile-btn {
    background: none;
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    padding: 8px 20px;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.theme-toggle-mobile-btn:hover { background: rgba(168,85,247,0.15); }
/* ================================================= */

/* ======================== FOOTER ======================== */

.site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(168,85,247,0.15);
    padding: clamp(20px, 3vw, 32px) clamp(16px, 4vw, 40px);
}

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

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-copy { font-size: 0.8em; color: #6b6b8a; }

.footer-location {
    font-size: 0.78em;
    color: #4a4a6a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-location i { color: #a855f7; font-size: 0.85em; }

.footer-links {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8em;
    flex-wrap: wrap;
}

.footer-links a {
    color: #6b6b8a;
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-links a:hover { color: #a855f7; }
.footer-sep { color: #3d3d5c; }
/* ================================================= */

/* ======================== PAGES INTÉRIEURES ======================== */

/* --------------------- Bouton retour --------------------- */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82em;
    color: #6b6b8a;
    margin-bottom: 24px;
    transition: color 0.2s;
}
.back-link:hover { color: #a855f7; }

/* --------------------- Séparateur de section --------------------- */

.section-title {
    font-size: 0.72em;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #a855f7;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(168,85,247,0.2);
}

/* --------------------- CTA contact --------------------- */

.cta-contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: rgba(168,85,247,0.06);
    border: 1px solid rgba(168,85,247,0.25);
    border-radius: 16px;
    padding: 28px 32px;
    flex-wrap: wrap;
}

.cta-text { font-size: 1em; font-weight: 700; color: white; margin-bottom: 4px; }
.cta-sub  { font-size: 0.85em; color: #6b6b8a; }

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border-radius: 10px;
    color: white;
    font-size: 0.88em;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(168,85,247,0.4);
}
/* ================================================= */

/* ======================== CARTES SERVICES ACCORDION ======================== */

/* --------------------- Carte --------------------- */

.service-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(168,85,247,0.15);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    color: inherit;
    transition: border-color 0.3s, background 0.3s;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168,85,247,0.6), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.service-card:hover,
.service-card.open {
    border-color: rgba(168,85,247,0.4);
    background: rgba(168,85,247,0.04);
}

.service-card:hover::before,
.service-card.open::before { opacity: 1; }

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.service-icon  { font-size: 1.5em; flex-shrink: 0; }
.service-name  { font-size: 0.98em; font-weight: 700; color: white; }
.service-desc  { font-size: 0.83em; color: #9d9db5; line-height: 1.6; }

.service-price {
    font-size: 0.75em;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- Badges tarifs --- */
.price-fixed {
    color: #86efac;
    background: rgba(134,239,172,0.08);
    border: 1px solid rgba(134,239,172,0.2);
    border-radius: 20px;
    padding: 3px 10px;
}

.price-demand {
    color: #c4b5fd;
    background: rgba(168,85,247,0.1);
    border: 1px solid rgba(168,85,247,0.2);
    border-radius: 20px;
    padding: 3px 10px;
}

/* --------------------- Toggle accordion --------------------- */

.service-toggle {
    font-size: 0.78em;
    color: #a855f7;
    display: flex;
    align-items: center;
    gap: 6px;
}

.service-toggle i {
    transition: transform 0.3s;
    font-size: 0.9em;
}

.service-card.open .service-toggle i { transform: rotate(180deg); }

/* --------------------- Détails accordion --------------------- */

.service-details {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease, opacity 0.3s ease, padding-top 0.3s ease, border-color 0.3s;
    opacity: 0;
    overflow: hidden;
    border-top: 1px solid transparent;
}

.service-details-inner {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-card.open .service-details {
    grid-template-rows: 1fr;
    opacity: 1;
    padding-top: 12px;
    border-top-color: rgba(168,85,247,0.15);
}

.service-details-title {
    font-size: 0.72em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a855f7;
    margin-bottom: 4px;
}

.service-details ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.service-details ul li {
    font-size: 0.82em;
    color: #9d9db5;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.service-details ul li::before {
    content: '✦';
    color: #a855f7;
    font-size: 0.7em;
    margin-top: 2px;
    flex-shrink: 0;
}

.service-note {
    font-size: 0.78em;
    color: #6b6b8a;
    font-style: italic;
    padding: 8px 12px;
    background: rgba(168,85,247,0.05);
    border-radius: 8px;
    border-left: 2px solid rgba(168,85,247,0.3);
}

/* --------------------- Grille services --------------------- */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 64px;
}
/* ================================================= */

/* ======================== ACCESSIBILITÉ ======================== */

/* Focus visible — contour clavier */
:focus-visible {
    outline: 2px solid #a855f7;
    outline-offset: 2px;
    border-radius: inherit;
}

.theme-toggle:focus-visible {
    outline-offset: 3px;
    border-radius: 10px;
}

/* Supprimer outline souris */
:focus:not(:focus-visible) { outline: none; }

/* Réduction des animations si demandée */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* ================================================= */

/* ======================== RESPONSIVE ======================== */

/* --------------------- Mobile (≤ 768px) --------------------- */

@media screen and (max-width: 768px) {

    .navbar {
        padding: 16px 20px;
        display: flex;
        justify-content: space-between;
    }

    .menu-toggle { display: flex; }

    .nav-links {
        position: fixed;
        top: 0; left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(7,7,26,0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        justify-self: unset;
        transform: translateX(-100%);
        transition: transform 0.5s ease;
    }

    .nav-links.mobile-menu { transform: translateX(0); }

    .nav-links li {
        margin: clamp(10px, 3vh, 20px) 0;
        font-size: clamp(1.1em, 4vw, 1.5em);
    }

    /* Boutons thème */
    .theme-toggle        { display: none !important; }
    .theme-toggle-mobile { display: block !important; }

}

/* --------------------- Desktop (≥ 769px) --------------------- */

@media (min-width: 769px) {
    .theme-toggle        { display: flex; }
    .theme-toggle-mobile { display: none !important; }
}

/* --------------------- Très petits écrans (≤ 360px) --------------------- */

@media screen and (max-width: 360px) {
    .logo-img { max-width: 110px; }
    .nav-links li { margin: 8px 0; }
}

/* --------------------- Pages intérieures (≤ 600px) --------------------- */

@media (max-width: 600px) {
    main           { padding: 48px 16px 80px !important; }
    .services-grid { grid-template-columns: 1fr; }
    .cta-contact   { flex-direction: column; align-items: flex-start; }
    .footer-inner  { flex-direction: column; align-items: flex-start; }
    .rate-grid     { grid-template-columns: repeat(2, 1fr); }
}
/* ================================================= */

/* ======================== MODE CLAIR ======================== */

/* --------------------- Variables --------------------- */

[data-theme="light"] {
    --bg:      #07071a;
    --text:    white;
    --muted:   #6b6b8a;
    --purple:  #a855f7;
    --border:  rgba(168,85,247,0.25);
    --surface: rgba(255,255,255,0.04);
}

/* --------------------- Navbar --------------------- */

[data-theme="light"] .navbar {
    background: rgba(200, 200, 208, 0.7);
    backdrop-filter: blur(10px);
}

[data-theme="light"] .navbar a:hover     { color: #7c3aed; }
[data-theme="light"] .nav-links .active  { color: #a855f7; }
[data-theme="light"] .menu-toggle span   { background: #1a1a2e; }

@media (max-width: 768px) {
    [data-theme="light"] .nav-links { background-color: rgba(7,7,26,0.97); }
}

/* --------------------- Footer --------------------- */

[data-theme="light"] .site-footer      { border-top-color: rgba(124,58,237,0.2); }
[data-theme="light"] .footer-copy,
[data-theme="light"] .footer-location  { color: #2a2a3a; }
[data-theme="light"] .footer-links a   { color: #2a2a3a; }
[data-theme="light"] .footer-links a:hover { color: #7c3aed; }
[data-theme="light"] .footer-sep       { color: #707070; }

/* --------------------- Bouton retour --------------------- */

[data-theme="light"] .back-link       { color: #5a5a7a; }
[data-theme="light"] .back-link:hover { color: #7c3aed; }

/* --------------------- CTA --------------------- */

[data-theme="light"] .cta-contact {
    background: rgba(255,255,255,0.4);
    border-color: rgba(124,58,237,0.25);
}

/* --------------------- Cartes services accordion --------------------- */

[data-theme="light"] .service-card {
    background: rgba(255,255,255,0.7);
    border-color: rgba(124,58,237,0.2);
}

[data-theme="light"] .service-card:hover,
[data-theme="light"] .service-card.open {
    background: rgba(255,255,255,0.9);
    border-color: rgba(124,58,237,0.4);
}

[data-theme="light"] .service-card.open .service-details {
    border-top-color: rgba(124,58,237,0.2);
}

/* --------------------- Badges tarifs --------------------- */

[data-theme="light"] .price-fixed {
    background: rgba(34,197,94,0.1);
    border-color: rgba(34,197,94,0.4);
    color: #15803d !important;
}

[data-theme="light"] .price-demand {
    background: rgba(124,58,237,0.1);
    border-color: rgba(124,58,237,0.3);
    color: #6d28d9 !important;
}

/* --------------------- Badges divers --------------------- */

[data-theme="light"] .card-lang {
    background: rgba(124,58,237,0.1);
    border-color: rgba(124,58,237,0.3);
    color: #6d28d9 !important;
}

[data-theme="light"] .badge-formation {
    background: rgba(59,130,246,0.1) !important;
    border-color: rgba(59,130,246,0.4) !important;
    color: #1d4ed8 !important;
}

[data-theme="light"] .badge-pro {
    background: rgba(34,197,94,0.1);
    border-color: rgba(34,197,94,0.4);
    color: #15803d !important;
}

[data-theme="light"] .badge-autre {
    background: rgba(251,191,36,0.1) !important;
    border-color: rgba(251,191,36,0.5) !important;
    color: #92400e !important;
}

[data-theme="light"] .badge-current {
    background: rgba(124,58,237,0.1);
    border-color: rgba(124,58,237,0.3);
    color: #6d28d9 !important;
}

/* --------------------- Tags skills / intérêts --------------------- */

[data-theme="light"] .skill-tag {
    background: rgba(124,58,237,0.1);
    border-color: rgba(124,58,237,0.25);
    color: #6d28d9 !important;
}

[data-theme="light"] .interest-tag {
    background: rgba(124,58,237,0.08);
    border-color: rgba(124,58,237,0.2);
    color: #6d28d9 !important;
}

/* --------------------- Rate banner --------------------- */

[data-theme="light"] .rate-banner {
    background: rgba(124,58,237,0.08) !important;
    border-color: rgba(124,58,237,0.25) !important;
    color: #4a1d96 !important;
}

[data-theme="light"] .rate-banner strong { color: #1a1a2e !important; }
[data-theme="light"] .rate-banner i      { color: #7c3aed !important; }

/* --------------------- Accents violets --------------------- */

[data-theme="light"] .section-title  { color: #a855f7 !important; }
[data-theme="light"] .heading-tag    { color: #a855f7 !important; }
[data-theme="light"] .inline-link    { color: #a855f7 !important; }
[data-theme="light"] .service-more   { color: #a855f7 !important; }

/* --------------------- Boutons --------------------- */

[data-theme="light"] .btn-cta,
[data-theme="light"] .btn-cta *      { color: white !important; }
[data-theme="light"] .btn-download,
[data-theme="light"] .btn-download * { color: white !important; }
[data-theme="light"] .btn-submit     { color: white !important; }
[data-theme="light"] .btn-github     {
    color: #1a1a2e !important;
    background: rgba(0,0,0,0.08) !important;
    border-color: rgba(0,0,0,0.15) !important;
}

/* --------------------- Texte dans les cartes --------------------- */

[data-theme="light"] .service-card *,
[data-theme="light"] .detail-card *,
[data-theme="light"] .timeline-card *,
[data-theme="light"] .skill-group *,
[data-theme="light"] .lang-item *,
[data-theme="light"] .award-item *,
[data-theme="light"] .card *,
[data-theme="light"] .project-card *,
[data-theme="light"] .cta-contact *,
[data-theme="light"] .form-card * {
    color: #1a1a2e !important;
}

/* --------------------- Contraste texte muted --------------------- */

[data-theme="dark"] .subtitle,
[data-theme="dark"] .hero-desc,
[data-theme="dark"] .card-desc,
[data-theme="dark"] .timeline-desc,
[data-theme="dark"] .service-desc,
[data-theme="dark"] .cta-sub {
    color: #a0a0b8;
}
/* ================================================= */