:root {
    --night-0: #07061a;
    --night-1: #110e33;
    --night-2: #1d1752;
    --panel: rgba(16, 14, 38, 0.82);
    --panel-border: rgba(155, 92, 255, 0.18);

    --text: #e9e6fb;
    --muted: #a6a1cc;

    --pink: #ff4fa3;
    --mint: #52e5c4;
    --violet: #a46bff;
    --moon: #d7ecff;
    --lamp: #ffb547;

    --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
    --font-tag: "Permanent Marker", "Comic Sans MS", cursive;

    --sidebar-w: 280px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: linear-gradient(180deg, var(--night-2) 0%, var(--night-1) 35%, var(--night-0) 100%) fixed;
    background-color: var(--night-0);
}

a {
    color: var(--mint);
}

::selection {
    background: var(--pink);
    color: var(--night-0);
}

/* ---------- Décor : étoiles + lune ---------- */
.sky {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: var(--moon);
    animation: twinkle var(--d, 4s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.9; }
}

.moon {
    position: absolute;
    top: 8vh;
    right: 8vw;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9), transparent 45%),
        radial-gradient(circle at 66% 58%, rgba(140, 170, 230, 0.35) 0 13%, transparent 14%),
        radial-gradient(circle at 38% 78%, rgba(140, 170, 230, 0.22) 0 6%, transparent 7%),
        radial-gradient(circle at 72% 28%, rgba(140, 170, 230, 0.18) 0 5%, transparent 6%),
        var(--moon);
    box-shadow:
        0 0 40px 10px rgba(180, 210, 255, 0.35),
        0 0 140px 60px rgba(120, 110, 255, 0.18);
    will-change: transform;
}

/* ---------- Étoiles filantes (et refs crypto), créées par script.js ---------- */
.shooter {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform, opacity;
}

/* tournée dans le sens du mouvement : la traînée part vers l'arrière */
.shooter-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shooter-trail {
    position: absolute;
    right: 50%;
    top: 50%;
    width: var(--trail-len, 140px);
    height: 2px;
    transform: translateY(-50%);
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--trail));
    filter: blur(0.4px);
}

.shooter-head {
    position: relative;
    display: block;
    line-height: 0;
}

.shooter-head svg {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 0 6px var(--glow, transparent));
}

.shooter-head .spark {
    display: block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px 2px rgba(215, 236, 255, 0.8);
}

/* les pièces tournent sur elles-mêmes */
.shooter-head .coin {
    animation: coin-spin 1.4s linear infinite;
}

@keyframes coin-spin {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    padding: 40px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(7, 6, 26, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid var(--panel-border);
}

.logo {
    display: block;
    font-family: var(--font-tag);
    font-size: 30px;
    line-height: 1.15;
    color: var(--pink);
    text-decoration: none;
    text-shadow: 0 0 8px rgba(255, 79, 163, 0.6), 0 0 22px rgba(255, 79, 163, 0.35);
    transform: rotate(-3deg);
}

.role {
    margin-top: 14px;
    font-size: 13px;
    color: var(--muted);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav a {
    padding: 6px 0;
    color: var(--muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 13px;
    transition: color 0.2s, transform 0.2s;
}

.nav a span {
    color: var(--violet);
    margin-right: 10px;
}

.nav a:hover,
.nav a.active {
    color: var(--text);
    transform: translateX(6px);
}

.nav a.active span {
    color: var(--mint);
    text-shadow: 0 0 8px var(--mint);
}

.socials {
    display: flex;
    gap: 18px;
    list-style: none;
}

.socials a {
    display: block;
    color: var(--muted);
    transition: color 0.2s, transform 0.2s, filter 0.2s;
}

.socials a:hover {
    color: var(--mint);
    transform: translateY(-2px);
    filter: drop-shadow(0 0 6px var(--mint));
}

/* ---------- Contenu ---------- */
main {
    margin-left: var(--sidebar-w);
    padding: 0 clamp(20px, 6vw, 80px);
}

section {
    max-width: 760px;
    margin: 0 auto;
    padding: 110px 0 40px;
}

.kicker {
    font-size: 13px;
    color: var(--violet);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.section-title {
    position: relative;
    display: inline-block;
    font-family: var(--font-tag);
    font-weight: 400;
    font-size: clamp(34px, 5vw, 46px);
    color: var(--violet);
    text-shadow: 0 0 10px rgba(164, 107, 255, 0.55), 0 0 30px rgba(164, 107, 255, 0.3);
    margin-bottom: 40px;
}

.scribble {
    position: absolute;
    left: -4px;
    bottom: -10px;
    width: 105%;
    height: 16px;
    overflow: visible;
}

.scribble path {
    fill: none;
    stroke: var(--mint);
    stroke-width: 3;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px var(--mint));
}

.scribble path + path {
    stroke: var(--pink);
    stroke-width: 2;
    opacity: 0.8;
    filter: drop-shadow(0 0 4px var(--pink));
}

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 22px 26px;
}

/* ---------- Hero / About ---------- */
.hero {
    min-height: min(100vh, 860px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-family: var(--font-tag);
    font-weight: 400;
    font-size: clamp(38px, 7vw, 72px);
    line-height: 1.1;
    margin-bottom: 14px;
}

.neon {
    display: inline-block;
    color: var(--pink);
    transform: rotate(-2deg);
    text-shadow:
        0 0 6px rgba(255, 79, 163, 0.8),
        0 0 20px rgba(255, 79, 163, 0.5),
        0 0 50px rgba(255, 79, 163, 0.3);
    animation: flicker 6s infinite;
}

@keyframes flicker {
    0%, 92%, 94%, 97%, 100% { opacity: 1; }
    93%, 96% { opacity: 0.55; }
}

.tagline {
    color: var(--mint);
    margin-bottom: 36px;
}

.tagline::before {
    content: "> ";
    color: var(--violet);
}

.about-panel p + p {
    margin-top: 14px;
}

/* ---------- Experience ---------- */
.timeline {
    list-style: none;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding-left: 28px;
}

/* ligne verticale en pointillés */
.timeline::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    border-left: 2px dashed rgba(82, 229, 196, 0.35);
}

.experience {
    position: relative;
    transition: border-color 0.25s, transform 0.25s;
}

/* point lumineux sur la ligne */
.experience::before {
    content: "";
    position: absolute;
    left: -28px;
    top: 28px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--night-0);
    border: 2px solid var(--mint);
    box-shadow: 0 0 10px var(--mint);
}

.experience:hover {
    border-color: rgba(82, 229, 196, 0.5);
    transform: translateX(4px);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-bottom: 10px;
}

.experience h3 {
    font-size: 16px;
}

.place {
    color: var(--muted);
    font-weight: 400;
}

.experience time {
    font-size: 13px;
    color: var(--mint);
    white-space: nowrap;
}

.missions {
    list-style: none;
    color: var(--muted);
}

.missions li::before {
    content: "• ";
    color: var(--pink);
}

.tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.tags li {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 3px;
    color: var(--violet);
    background: rgba(164, 107, 255, 0.12);
    border: 1px solid rgba(164, 107, 255, 0.3);
}

.tags li::before {
    content: "#";
    opacity: 0.6;
}

/* ---------- Projects ---------- */
.projects {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

.project {
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.project:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 181, 71, 0.55);
    box-shadow: 0 10px 40px -10px rgba(255, 181, 71, 0.35);
}

.project h3 {
    font-family: var(--font-tag);
    font-weight: 400;
    font-size: 24px;
    margin-bottom: 8px;
}

.project h3 a {
    color: var(--lamp);
    text-decoration: none;
}

.project h3 a:hover {
    text-shadow: 0 0 12px rgba(255, 181, 71, 0.7);
}

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

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: 100px 0 40px;
    font-size: 13px;
    color: var(--muted);
}

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

/* ---------- Mobile : la sidebar devient une barre en haut ---------- */
@media (max-width: 800px) {
    .sidebar {
        position: static;
        width: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 16px;
        padding: 20px 16px;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
    }

    .logo {
        font-size: 24px;
    }

    .role {
        margin-top: 4px;
    }

    .nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px 16px;
        order: 3;
        width: 100%;
    }

    .nav a:hover,
    .nav a.active {
        transform: none;
    }

    main {
        margin-left: 0;
        padding: 0 16px;
    }

    .hero {
        min-height: auto;
    }

    section {
        padding-top: 70px;
    }

    .moon {
        width: 90px;
        height: 90px;
        top: 4vh;
        right: 6vw;
    }

    .panel {
        padding: 18px;
    }
}

/* Respecte les gens qui désactivent les animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ---------- Contact ---------- */
.contact-name {
    font-weight: 700;
    margin-bottom: 12px;
}

.contact dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 20px;
}

.contact dt {
    color: var(--violet);
}

.contact dd {
    color: var(--muted);
}

/* ---------- Mentions légales ---------- */
.legal h2 {
    font-size: 16px;
    color: var(--mint);
    margin: 24px 0 8px;
}

.legal h2:first-child {
    margin-top: 0;
}

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

.legal p + p {
    margin-top: 10px;
}

.project .project-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--mint);
}

.project-meta a {
    color: var(--muted);
}
