/* Thème cosmique bleu */
:root {
    /* Variables globales (couleurs, rayons, ombres). */
    --bg: #050c1d;
    --bg-strong: #07152d;
    --bg-soft: rgba(16, 34, 64, 0.8);
    --primary: #3fa2ff;
    --primary-strong: #68c3ff;
    --text: #e9f0ff;
    --muted: #94a8c9;
    --input-bg: rgba(255, 255, 255, 0.1);
    --input-bg-focus: rgba(255, 255, 255, 0.16);
    --input-text: #f4f8ff;
    --placeholder: rgba(233, 240, 255, 0.7);
    --input-border: rgba(120, 170, 255, 0.5);
    --border: rgba(255, 255, 255, 0.1);
    --card: rgba(13, 26, 52, 0.75);
    --shadow: 0 15px 45px rgba(23, 63, 122, 0.35);
    --radius: 16px;
}

/* Palette alternative conservee pour compatibilite future (non activee par defaut). */
.theme-light {
    --bg: #f7f9fc;
    --bg-strong: #ffffff;
    --bg-soft: rgba(255, 255, 255, 0.9);
    --primary: #2155d9;
    --primary-strong: #1b44b6;
    --text: #1c2140;
    --muted: #4b5876;
    --input-bg: rgba(255, 255, 255, 0.95);
    --input-bg-focus: #ffffff;
    --input-text: #1c2140;
    --placeholder: #7a8299;
    --input-border: rgba(32, 55, 110, 0.2);
    --border: rgba(18, 51, 102, 0.12);
    --card: rgba(255, 255, 255, 0.95);
    --shadow: 0 12px 30px rgba(20, 35, 70, 0.12);
}

* { scroll-behavior: smooth; }

/* Fond global spatial: gradients + texture d'etoiles. */
body {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at 20% 20%, rgba(63, 162, 255, 0.12), transparent 30%),
        radial-gradient(circle at 80% 10%, rgba(104, 195, 255, 0.1), transparent 35%),
        linear-gradient(180deg, var(--bg-strong), var(--bg));
    color: var(--text);
    transition: background 0.4s ease, color 0.4s ease;
    position: relative;
    min-height: 100vh;
}

/* Couche d'etoiles fines en arriere-plan. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 140px 140px, 220px 220px;
    background-position: 0 0, 40px 60px;
    opacity: 0.35;
    pointer-events: none;
    z-index: -1;
}

/* Couche de nebulosite diffuse. */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 80% 10%, rgba(63, 162, 255, 0.12), transparent 35%),
                radial-gradient(circle at 10% 80%, rgba(86, 199, 255, 0.1), transparent 30%);
    pointer-events: none;
    z-index: -2;
}

/* Navigation principale fixe. */
.navbar {
    background: rgba(6, 14, 30, 0.82);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    letter-spacing: 0.01em;
}

.navbar-brand {
    font-weight: 700;
}

/* Variante logo en bloc (non utilisee actuellement). */
.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(140deg, var(--primary), var(--primary-strong));
    color: #041029;
    font-weight: 700;
    box-shadow: 0 10px 26px rgba(63, 162, 255, 0.4);
}

/* Logo image de la marque. */
.brand-logo {
    width: 34px;
    height: 34px;
    display: inline-block;
    border-radius: 10px;
    object-fit: contain;
    object-position: center;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    box-shadow: 0 10px 26px rgba(63, 162, 255, 0.4);
}

/* Liens du menu et etat actif. */
.nav-link {
    color: var(--muted) !important;
    position: relative;
    padding: 0.75rem 1rem !important;
}

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

.nav-link.active {
    color: #fff !important;
}

.nav-link.active::after,
.nav-link:hover::after {
    content: '';
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 8px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 1;
}

/* Hero d'introduction (zone visible au chargement). */
.hero {
    position: relative;
    padding: 160px 0 120px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(16, 30, 64, 0.6), rgba(5, 12, 29, 0.8));
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('images/photo-1593959734793-6e92d102da1e.jpg') center/cover no-repeat;
    opacity: 0.15;
    mix-blend-mode: screen;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2.4rem, 3vw + 1rem, 3.6rem);
    font-weight: 700;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.hero-lead {
    max-width: 720px;
    margin: 12px auto 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.hero-eyebrow {
    letter-spacing: 0.25em;
    font-size: 0.8rem;
    color: var(--primary-strong);
    margin-bottom: 10px;
}

.hero-meta {
    color: var(--muted);
    gap: 12px;
}

.hero-highlights {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.highlight-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 0.88rem;
}

/* Blocs de section reutilisables. */
.section-block {
    padding: 80px 0;
    position: relative;
}

.section-header {
    margin-bottom: 32px;
}

.section-kicker {
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--primary-strong);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.section-title {
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: none;
}

.section-desc {
    max-width: 720px;
    color: var(--muted);
}

/* Zone parcours (timeline). */
.section-journey {
    background: linear-gradient(180deg, rgba(6, 13, 27, 0), rgba(18, 32, 57, 0.26));
}

/* Carte "glass" generique reutilisee partout. */
.glass-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(130deg, rgba(63, 162, 255, 0.08), transparent 60%);
    opacity: 0.8;
    pointer-events: none;
}

.glass-card h5,
.glass-card h6 {
    color: #fff;
}

.highlight-card {
    background: linear-gradient(160deg, rgba(63, 162, 255, 0.18), var(--card));
}

.stat-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-strong);
}

.info-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.info-list li:last-child {
    margin-bottom: 0;
}

/* Timeline du parcours. */
.timeline {
    display: grid;
    gap: 16px;
}

.timeline-item {
    padding-left: 60px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 30px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-strong);
    box-shadow: 0 0 0 6px rgba(104, 195, 255, 0.12);
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 29px;
    top: 44px;
    bottom: -18px;
    width: 2px;
    background: linear-gradient(180deg, rgba(104, 195, 255, 0.4), rgba(104, 195, 255, 0.08));
}

.timeline-year {
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary-strong);
    margin-bottom: 8px;
}

/* Cartes projets + tags techniques. */
.project-card {
    height: 100%;
}

.badge.text-bg-dark {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text);
    border: 1px solid var(--border);
}

.tags span {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.85rem;
    margin-right: 8px;
    margin-bottom: 8px;
}

.project-status {
    color: var(--primary-strong);
    font-weight: 600;
}

/* Liens rapides de la section contact. */
.contact-links {
    display: grid;
    gap: 10px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.contact-link i {
    font-size: 1.05rem;
    color: var(--primary-strong);
}

.contact-link:hover {
    transform: translateY(-2px);
    border-color: rgba(104, 195, 255, 0.6);
    color: var(--text);
}

/* Cartes competences. */
.skill-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.skill-card i {
    font-size: 2rem;
    color: var(--primary-strong);
    margin-bottom: 10px;
}

.skill-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(63, 162, 255, 0.3);
}

/* Boutons generiques et variantes. */
.btn {
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(120deg, var(--primary), var(--primary-strong));
    border: 1px solid var(--primary-strong);
    box-shadow: 0 10px 30px rgba(63, 162, 255, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(120deg, var(--primary-strong), var(--primary));
}

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

.btn-outline-light:hover {
    border-color: var(--primary-strong);
    color: #fff;
}

/* Champs de formulaire. */
.form-control {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
    border-radius: 12px;
    padding: 12px;
}

.form-control::placeholder {
    color: var(--placeholder);
    opacity: 1;
}

.form-control:focus {
    border-color: var(--primary-strong);
    box-shadow: 0 0 0 0.15rem rgba(63, 162, 255, 0.25);
    background: var(--input-bg-focus);
    color: var(--input-text);
}

.text-muted {
    color: var(--muted) !important;
}

/* Footer. */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0 32px;
    background: rgba(3, 9, 20, 0.6);
}

.site-footer p {
    color: var(--muted);
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
}

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

/* Bandeau d'information cookies RGPD/CNIL. */
.cookie-notice {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    display: grid;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(6, 14, 30, 0.96);
    box-shadow: 0 14px 36px rgba(4, 10, 26, 0.52);
    z-index: 80;
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity 0.24s ease, transform 0.24s ease;
}

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

.cookie-notice-text {
    margin: 0;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.4;
}

.cookie-notice-text a {
    color: var(--primary-strong);
}

.cookie-notice-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Couche de rendu pour l'effet etoiles filantes au curseur. */
.mouse-star-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 35;
    overflow: hidden;
}

.mouse-star {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--star-size, 2px);
    height: var(--star-size, 2px);
    border-radius: 50%;
    background: rgba(225, 244, 255, 0.95);
    box-shadow: 0 0 10px rgba(145, 217, 255, 0.62), 0 0 18px rgba(102, 195, 255, 0.4);
    transform: translate(-50%, -50%) rotate(var(--shoot-rotate, 0deg));
    opacity: 0;
    will-change: transform, opacity;
    animation: shooting-star var(--star-duration, 460ms) cubic-bezier(0.2, 0.65, 0.25, 1) forwards;
}

.mouse-star::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: var(--trail-length, 24px);
    height: 1.6px;
    border-radius: 999px;
    transform: translate(-100%, -50%);
    background: linear-gradient(90deg, rgba(95, 185, 255, 0), rgba(143, 220, 255, 0.52), rgba(225, 247, 255, 0.95));
    filter: blur(0.2px);
}

.mouse-star.soft {
    opacity: 0.45;
}

/* Animation d'une particule "etoile filante". */
@keyframes shooting-star {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--shoot-rotate, 0deg)) scale(0.74);
    }
    18% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--shoot-x, 0px)), calc(-50% + var(--shoot-y, 0px))) rotate(var(--shoot-rotate, 0deg)) scale(0.62);
    }
}

/* Ajustement du bandeau cookies sur ecrans moyens/grands. */
@media (min-width: 768px) {
    .cookie-notice {
        left: 24px;
        right: 24px;
        bottom: 20px;
        grid-template-columns: 1fr auto;
    }
}

/* Coupe les effets souris sur mobile et pour accessibilite motion-reduce. */
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
    .mouse-star-layer {
        display: none !important;
    }
}

/* Bouton flottant retour en haut. */
.btn-to-top {
    position: fixed;
    bottom: 22px;
    right: 22px;
    display: none;
    background: linear-gradient(150deg, var(--primary), var(--primary-strong));
    color: #041029;
    border: none;
    padding: 12px 14px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(63, 162, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 50;
}

.btn-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(63, 162, 255, 0.45);
}

.btn-to-top.show {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Theme clair (conserve pour evolution future). */
.theme-light .navbar {
    background: rgba(255, 255, 255, 0.88);
    border-bottom-color: rgba(16, 30, 64, 0.1);
}

.theme-light .navbar-brand {
    color: #0f172a !important;
}

.theme-light .navbar-toggler {
    border-color: rgba(15, 23, 42, 0.2);
}

.theme-light .navbar-toggler-icon {
    filter: invert(1);
}

.theme-light .nav-link {
    color: #2b3856 !important;
}

.theme-light .nav-link:hover,
.theme-light .nav-link:focus,
.theme-light .nav-link.active {
    color: #0f172a !important;
}

.theme-light .nav-link.active::after,
.theme-light .nav-link:hover::after {
    background: linear-gradient(90deg, transparent, #2155d9, transparent);
    opacity: 0.7;
}

.theme-light .hero.text-white {
    color: var(--text) !important;
}

.theme-light .hero::before {
    background: linear-gradient(160deg, rgba(248, 250, 255, 0.9), rgba(228, 236, 248, 0.95));
}

.theme-light .hero::after {
    opacity: 0.08;
    mix-blend-mode: normal;
}

.theme-light .hero h1 {
    color: #0f172a;
    text-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.theme-light .hero-lead,
.theme-light .hero-meta {
    color: #4b5876;
}

.theme-light .highlight-pill {
    background: rgba(33, 85, 217, 0.1);
    border-color: rgba(33, 85, 217, 0.22);
    color: #1c2140;
}

.theme-light .hero-eyebrow {
    color: #2155d9;
}

.theme-light body::before {
    opacity: 0.18;
}

.theme-light body::after {
    opacity: 0.35;
}

.theme-light .glass-card h5,
.theme-light .glass-card h6 {
    color: #0f172a;
}

.theme-light .badge.text-bg-dark {
    background: rgba(33, 85, 217, 0.12) !important;
    color: #1c2140;
    border-color: rgba(33, 85, 217, 0.25);
}

.theme-light .tags span {
    background: rgba(33, 85, 217, 0.08);
    border-color: rgba(33, 85, 217, 0.2);
    color: #2a3858;
}

.theme-light .timeline-item::before {
    box-shadow: 0 0 0 6px rgba(33, 85, 217, 0.14);
}

.theme-light .timeline-item:not(:last-child)::after {
    background: linear-gradient(180deg, rgba(33, 85, 217, 0.35), rgba(33, 85, 217, 0.1));
}

.theme-light .btn-outline-light {
    color: #1c2140;
    background: rgba(33, 85, 217, 0.08);
    border-color: rgba(33, 85, 217, 0.25);
}

.theme-light .btn-outline-light:hover {
    color: #0f172a;
    background: rgba(33, 85, 217, 0.16);
    border-color: rgba(33, 85, 217, 0.4);
}

.theme-light .contact-link {
    color: #1c2140;
    background: rgba(33, 85, 217, 0.08);
    border-color: rgba(33, 85, 217, 0.22);
}

.theme-light .contact-link:hover {
    color: #0f172a;
    border-color: rgba(33, 85, 217, 0.45);
}

.theme-light .site-footer {
    background: rgba(255, 255, 255, 0.76);
}

/* Responsive menu. */
@media (max-width: 991px) {
    .nav-link::after {
        display: none;
    }
}

/* Responsive mobile. */
@media (max-width: 768px) {
    .section-block {
        padding: 64px 0;
    }

    .hero {
        padding: 140px 0 80px;
    }

    .timeline-item {
        padding-left: 52px;
    }

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

    .timeline-item:not(:last-child)::after {
        left: 25px;
    }
}
