@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 600;
    font-display: optional;
    src: url("../assets/fonts/inter.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400 600;
    font-display: optional;
    src: url("../assets/fonts/jetbrains-mono.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 500 700;
    font-display: optional;
    src: url("../assets/fonts/space-grotesk.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #07090f;
    --bg-2: #0c1120;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.07);
    --line: rgba(255, 255, 255, 0.09);
    --text: #e8ecf4;
    --muted: #8d96ab;
    --accent: #4cc9f0;
    --accent-2: #7b61ff;
    --ok: #3ddc97;
    --radius: 18px;
    --header-h: 72px;
    --font-display: "Space Grotesk", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img, svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

.container {
    width: min(1180px, 100% - 32px);
    margin-inline: auto;
}

.grad {
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

/* ---------- Typo ---------- */
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4.2vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 26px;
    text-wrap: balance;
}

.section-title.big {
    font-size: clamp(2.6rem, 7vw, 5.6rem);
}

.lead {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 52ch;
    margin-bottom: 22px;
}

h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1.25;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    color: #05070d;
    box-shadow: 0 10px 30px -10px rgba(76, 201, 240, 0.6);
}

.btn-primary:hover {
    box-shadow: 0 14px 40px -10px rgba(123, 97, 255, 0.7);
}

.btn-ghost {
    border: 1px solid var(--line);
    background: var(--surface);
}

.btn-ghost:hover {
    border-color: rgba(76, 201, 240, 0.5);
    background: var(--surface-2);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------- Progress & header ---------- */
.scroll-progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    z-index: 1001;
}

.scroll-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform-origin: 0 50%;
    transform: scaleX(0);
}

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--header-h);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0 clamp(16px, 4vw, 48px);
    background: rgba(7, 9, 15, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.site-header.scrolled {
    border-bottom-color: var(--line);
    background: rgba(7, 9, 15, 0.82);
}

.brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.02em;
}

.brand span {
    color: var(--accent);
}

.site-nav {
    display: flex;
    gap: 26px;
    margin-left: auto;
}

.site-nav a {
    font-size: 0.92rem;
    color: var(--muted);
    position: relative;
    transition: color 0.2s ease;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--text);
}

.site-nav a.active::after {
    transform: scaleX(1);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    position: relative;
}

.nav-toggle span {
    position: absolute;
    left: 11px;
    right: 11px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, top 0.3s ease;
}

.nav-toggle span:first-child { top: 15px; }
.nav-toggle span:last-child { top: 25px; }

.nav-toggle[aria-expanded="true"] span:first-child { top: 20px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 20px; transform: rotate(-45deg); }

/* ---------- Side dots ---------- */
.side-dots {
    position: fixed;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.side-dots a {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--muted);
    position: relative;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.side-dots a::before {
    content: attr(data-label);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translate(6px, -50%);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    white-space: nowrap;
    color: var(--text);
    background: rgba(12, 17, 32, 0.9);
    border: 1px solid var(--line);
    padding: 3px 9px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.side-dots a:hover::before {
    opacity: 1;
    transform: translate(0, -50%);
}

.side-dots a.active {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.3);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 40px) clamp(16px, 6vw, 90px) 90px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.grid-floor {
    position: absolute;
    left: -50%;
    right: -50%;
    bottom: -10%;
    height: 70%;
    overflow: hidden;
    transform: perspective(600px) rotateX(62deg);
    transform-origin: 50% 0;
    mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 60%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 60%, transparent);
}

.grid-floor::before {
    content: "";
    position: absolute;
    inset: -60px 0 0 0;
    background-image:
        linear-gradient(rgba(76, 201, 240, 0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(76, 201, 240, 0.18) 1px, transparent 1px);
    background-size: 60px 60px;
    will-change: transform;
    animation: grid-move 6s linear infinite;
}

@keyframes grid-move {
    to { transform: translateY(60px); }
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
}

.orb-a {
    width: 520px;
    height: 520px;
    background: var(--accent-2);
    top: -160px;
    right: -120px;
    animation: float 14s ease-in-out infinite;
}

.orb-b {
    width: 420px;
    height: 420px;
    background: var(--accent);
    bottom: -160px;
    left: -140px;
    opacity: 0.25;
    animation: float 18s ease-in-out infinite reverse;
}

@keyframes float {
    50% { transform: translate(40px, 30px); }
}

.hero-inner {
    position: relative;
    width: min(1240px, 100%);
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: clamp(30px, 5vw, 80px);
    align-items: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(61, 220, 151, 0.35);
    background: rgba(61, 220, 151, 0.08);
    color: #b8f3d8;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 26px;
}

.status-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    position: relative;
}

.status-pill .dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--ok);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.6; }
    70%, 100% { transform: scale(3.4); opacity: 0; }
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.1rem, 5.2vw, 5rem);
    line-height: 1;
    letter-spacing: -0.035em;
    margin-bottom: 26px;
}

.hero-title .line {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    padding-bottom: 0.06em;
}

.hero-title .line span {
    display: inline-block;
}

.hero-title .line:last-child span {
    background: linear-gradient(100deg, #ffffff 20%, var(--accent) 70%, var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-role {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    color: var(--muted);
    max-width: 46ch;
    margin-bottom: 32px;
}

.hero-role strong {
    color: var(--text);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 34px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    color: var(--muted);
    font-size: 0.9rem;
}

.hero-meta i {
    color: var(--accent);
    margin-right: 6px;
}

.terminal {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(10, 14, 26, 0.85);
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(76, 201, 240, 0.06);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
}

.terminal-bar span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #ff5f57;
}

.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }

.terminal-bar p {
    margin-left: 10px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

.terminal-body {
    padding: 22px;
}

.terminal-id {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 16px;
    border-bottom: 1px dashed var(--line);
}

.terminal-id img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    object-position: 50% 20%;
    border: 1px solid var(--line);
}

.t-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
}

.t-sub {
    font-size: 0.85rem;
    color: var(--muted);
}

#terminal-out {
    font-family: var(--font-mono);
    font-size: 0.86rem;
    line-height: 1.75;
    color: #c8d1e4;
    white-space: pre-wrap;
    min-height: 13.5em;
}

#terminal-out .p { color: var(--ok); }
#terminal-out .c { color: var(--accent); }
#terminal-out .k { color: #ffd36b; }

.caret {
    display: inline-block;
    width: 8px;
    height: 1.05em;
    background: var(--accent);
    vertical-align: -2px;
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.mouse {
    width: 22px;
    height: 34px;
    border: 1.5px solid var(--muted);
    border-radius: 12px;
    position: relative;
}

.mouse span {
    position: absolute;
    left: 50%;
    top: 7px;
    width: 3px;
    height: 7px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: var(--accent);
    animation: wheel 1.6s ease-in-out infinite;
}

@keyframes wheel {
    0% { opacity: 0; transform: translateY(0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(10px); }
}

/* ---------- Generic section ---------- */
.section {
    padding: clamp(90px, 14vh, 150px) 0;
    position: relative;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(30px, 5vw, 70px);
    align-items: start;
}

.about-text p {
    color: #c2c9d8;
    font-size: 1.08rem;
    margin-bottom: 18px;
}

.about-text strong {
    color: var(--text);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.stat {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.stat-k {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2rem;
    line-height: 1.1;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-v {
    font-size: 0.88rem;
    color: var(--muted);
}

/* ---------- Cards ---------- */
.card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
    padding: 22px 24px;
}

.card p {
    color: #b9c1d2;
    font-size: 0.95rem;
}

.card h3 {
    margin-bottom: 6px;
}

.card-sub {
    color: var(--muted) !important;
    font-size: 0.88rem !important;
    margin-bottom: 10px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.card-icon {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(76, 201, 240, 0.1);
    color: var(--accent);
    border: 1px solid rgba(76, 201, 240, 0.2);
}

.badge {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
}

.badge-accent {
    color: #b8f3d8;
    border-color: rgba(61, 220, 151, 0.35);
    background: rgba(61, 220, 151, 0.08);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.tags span {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(123, 97, 255, 0.12);
    color: #cfc5ff;
}

.bullets li {
    position: relative;
    padding-left: 18px;
    color: #b9c1d2;
    font-size: 0.94rem;
    margin-bottom: 8px;
}

.bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--accent);
    transform: rotate(45deg);
}

.glass {
    background: rgba(9, 13, 24, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* ---------- Scenes (pinned on desktop) ---------- */
.scene {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    align-items: center;
    gap: clamp(30px, 4vw, 70px);
    padding: calc(var(--header-h) + 24px) clamp(16px, 6vw, 90px) 40px;
    overflow: hidden;
}

.scene::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 60% at 30% 55%, rgba(76, 201, 240, 0.08), transparent 70%);
    pointer-events: none;
}

.scene-art {
    position: relative;
    width: 100%;
}

.scene-art svg {
    width: 100%;
    height: auto;
    max-height: calc(100vh - var(--header-h) - 80px);
    margin-inline: auto;
}

.scene-text {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 560px;
}

.scene-text .section-title {
    margin-bottom: 8px;
}

.svg-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    fill: var(--muted);
}

.svg-label.lg {
    font-size: 15px;
    fill: #dfe6f3;
    opacity: 0.85;
}

.blink {
    animation: led 1.4s steps(2) infinite;
}

.blink.b2 { animation-delay: 0.3s; animation-duration: 0.9s; }
.blink.b3 { animation-delay: 0.6s; animation-duration: 1.7s; }
.blink.b4 { animation-delay: 0.1s; animation-duration: 1.1s; }

@keyframes led {
    50% { opacity: 0.25; }
}

/* Homelab */
.lab-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 18px 20px;
}

.lab-card h3 {
    font-size: 1.05rem;
}

.lab-card p {
    font-size: 0.92rem;
}

/* ---------- Horizontal experience ---------- */
.h-scene {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--header-h) + 24px) 0 50px;
    overflow: hidden;
}

.h-head {
    margin-bottom: 10px;
}

.h-viewport {
    width: 100%;
    perspective: 1100px;
    perspective-origin: 50% 50%;
    padding: 30px 0;
}

.h-track {
    transform-style: preserve-3d;
}

@media (min-width: 960px) and (min-height: 640px) {
    /* Bords de l'écran incurvé qui s'estompent */
    .h-viewport {
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
        mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
    }
}

.h-track {
    display: flex;
    gap: 24px;
    padding: 0 max(16px, calc((100vw - 1180px) / 2));
    width: max-content;
}

.xp-card {
    width: min(420px, 82vw);
    flex: none;
    padding: 26px 28px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    backface-visibility: hidden;
}

.xp-card:hover {
    border-color: rgba(76, 201, 240, 0.35);
}

.xp-featured {
    width: min(500px, 86vw);
    border-color: rgba(61, 220, 151, 0.3);
    background: linear-gradient(180deg, rgba(61, 220, 151, 0.08), rgba(255, 255, 255, 0.02));
}

/* ---------- Expérience entreprise ---------- */
.work-card {
    display: grid;
    grid-template-columns: minmax(240px, 0.9fr) 1.4fr;
    gap: clamp(24px, 4vw, 56px);
    padding: clamp(24px, 3.5vw, 40px);
    border-color: rgba(61, 220, 151, 0.28);
    background: linear-gradient(135deg, rgba(61, 220, 151, 0.07), rgba(255, 255, 255, 0.02) 60%);
}

.work-meta h3 {
    font-size: 1.7rem;
    margin: 16px 0 4px;
}

.work-company {
    color: var(--accent) !important;
    font-weight: 600;
    font-size: 1.05rem !important;
    margin-bottom: 16px;
}

.work-company i,
.work-facts i {
    width: 18px;
    margin-right: 6px;
}

.work-facts li {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.work-facts i {
    color: var(--muted);
}

.mini-dash {
    width: 100%;
    max-width: 280px;
    margin-top: 22px;
}

.mini-dash .bars rect {
    fill: rgba(76, 201, 240, 0.75);
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: bar 3.2s ease-in-out infinite;
}

.mini-dash .bars rect:nth-child(2) { animation-delay: 0.2s; fill: rgba(123, 97, 255, 0.8); }
.mini-dash .bars rect:nth-child(3) { animation-delay: 0.4s; }
.mini-dash .bars rect:nth-child(4) { animation-delay: 0.6s; fill: rgba(123, 97, 255, 0.8); }
.mini-dash .bars rect:nth-child(5) { animation-delay: 0.8s; }

@keyframes bar {
    0%, 100% { transform: scaleY(0.35); }
    50% { transform: scaleY(1); }
}

.mini-dash .trend {
    stroke-dasharray: 90;
    animation: trend 3.2s ease-in-out infinite;
}

@keyframes trend {
    0% { stroke-dashoffset: 90; }
    50%, 100% { stroke-dashoffset: 0; }
}

.mini-dash .trend-dot {
    animation: blink 1.6s steps(1) infinite;
}

.work-body .bullets li {
    font-size: 1rem;
    margin-bottom: 12px;
}

/* ---------- Projets : lien repo ---------- */
.xp-card {
    display: flex;
    flex-direction: column;
}

.xp-card .tags {
    margin-bottom: 4px;
}

.repo-link {
    align-self: flex-start;
    margin-top: auto;
    padding-top: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    transition: color 0.2s ease;
}

/* La flèche glisse au survol sans changer la taille du lien (évite les sauts de ligne en boucle) */
.repo-link .icon:last-child {
    transition: transform 0.2s ease;
}

.repo-link:hover .icon:last-child {
    transform: translate(2px, -2px);
}

.repo-link .icon:last-child {
    font-size: 0.72rem;
}

.repo-link:hover {
    color: var(--text);
}

.repo-link[href=""] {
    display: none;
}

/* ---------- Projets perso ---------- */
.perso-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.perso-card {
    display: flex;
    flex-direction: column;
    padding: 26px;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.perso-card:hover {
    border-color: rgba(76, 201, 240, 0.35);
}

.perso-card h3 {
    font-size: 1.35rem;
    margin-bottom: 10px;
}

.perso-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 18px;
    margin-top: auto;
}

/* Les liens d'une carte restent sur une seule ligne : aucun retour à la ligne possible au survol */
.perso-links .repo-link,
.repo-link {
    white-space: nowrap;
}

.lab-card .repo-link {
    padding-top: 8px;
}

/* ---------- Jeux vidéo ---------- */
.games {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.games li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.games i {
    color: var(--accent);
    margin-top: 4px;
    width: 18px;
    text-align: center;
}

.games strong {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.98rem;
}

.games span {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* ---------- Skills ---------- */
.scene-skills {
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.scene-skills::before {
    background: radial-gradient(50% 50% at 50% 50%, rgba(123, 97, 255, 0.12), transparent 70%);
}

.coins {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    pointer-events: none;
}

.coin {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: calc(96px * var(--s));
    height: calc(96px * var(--s));
    transform-style: preserve-3d;
    opacity: calc(0.45 + var(--d) * 0.35);
}

.coin-spin {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: grid;
    place-items: center;
    transform-style: preserve-3d;
    animation: spin var(--t, 8s) ease-in-out infinite alternate;
}

/* Face avant + tranche simulée */
.coin-spin::before,
.coin-spin::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.coin-spin::before {
    background: radial-gradient(circle at 30% 25%, #ffffff, #dfe4ee 55%, #b8c0d0);
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.8), inset 0 -6px 14px rgba(0, 0, 0, 0.18), 0 18px 28px -10px rgba(0, 0, 0, 0.6);
    transform: translateZ(5px);
}

.coin-spin::after {
    background: linear-gradient(90deg, #6f7888, #b9c0cc 50%, #6f7888);
    transform: translateZ(-6px) scale(0.99);
}

.coin-spin img,
.coin-spin .mask,
.coin-spin .mono-logo {
    position: relative;
    width: 54%;
    height: 54%;
    transform: translateZ(6px);
    backface-visibility: visible;
}

.coin-spin .mask {
    display: block;
    background: var(--c);
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.coin-spin .mono-logo {
    display: grid;
    place-items: center;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: calc(22px * var(--s, 1));
    color: #e2442f;
}

@keyframes spin {
    from { transform: rotateY(-50deg) rotateX(14deg) rotateZ(-6deg); }
    to { transform: rotateY(50deg) rotateX(-8deg) rotateZ(6deg); }
}

.skills-panel {
    position: relative;
    z-index: 2;
    width: min(1100px, 100%);
    padding: clamp(24px, 4vw, 44px);
    border-radius: 26px;
    border: 1px solid var(--line);
    background: rgba(9, 13, 24, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.9);
}

.panel-h {
    font-size: 0.95rem;
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 6px 0 14px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 0.92rem;
    font-weight: 500;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.chip:hover {
    border-color: rgba(76, 201, 240, 0.5);
    background: rgba(76, 201, 240, 0.08);
    transform: translateY(-2px);
}

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

.skill-cats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.skill-cat {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    transition: border-color 0.25s ease, background 0.25s ease;
}

.skill-cat:hover {
    border-color: rgba(76, 201, 240, 0.4);
    background: rgba(76, 201, 240, 0.05);
}

.skill-cat h4 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-cat h4 i {
    color: var(--accent);
    width: 16px;
}

.chips-sm {
    gap: 6px;
    margin-bottom: 0;
}

.chips-sm li {
    font-size: 0.76rem;
    padding: 3px 9px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.05);
    color: #c8d0df;
}

.chips-soft .chip {
    border-style: dashed;
}

.panel-cols {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 30px;
}

.lang-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.lang-row span:last-child {
    font-family: var(--font-mono);
    color: var(--accent);
}

.lang-bar {
    height: 6px;
    border-radius: 6px;
    background: var(--surface-2);
    margin-bottom: 16px;
    overflow: hidden;
}

.lang-bar span {
    display: block;
    height: 100%;
    width: var(--w);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ---------- Off-IT ---------- */
.scene-offit .scene-art svg {
    border-radius: 22px;
    border: 1px solid var(--line);
    box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}

.zzz {
    animation: zzz 3s ease-in-out infinite;
}

.zzz-2 {
    animation-delay: 1.5s;
}

@keyframes zzz {
    0%, 100% { opacity: 0.2; transform: translateY(0); }
    50% { opacity: 0.9; transform: translateY(-8px); }
}

.steam path {
    animation: steam 2.4s ease-in-out infinite;
}

.steam path:nth-child(2) { animation-delay: 0.4s; }
.steam path:nth-child(3) { animation-delay: 0.8s; }

@keyframes steam {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    50% { transform: translateY(-8px); opacity: 1; }
}

/* ---------- Hobbies ---------- */
.scene-hobbies {
    display: block;
    padding: 0;
}

.scene-hobbies::before {
    display: none;
}

.hobby-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.stage-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
}

@media (min-width: 960px) and (min-height: 640px) {
    html:not(.anim) .space-layer { display: none; }
    html:not(.anim) #hobby-space {
        position: relative;
        opacity: 1;
        visibility: visible;
        margin-top: 16px;
    }
}

.speed-lines line {
    animation: speed 0.6s linear infinite;
}

.speed-lines line:nth-child(2) { animation-delay: 0.2s; }
.speed-lines line:nth-child(3) { animation-delay: 0.4s; }

@keyframes speed {
    from { transform: translateX(40px); opacity: 0; }
    40% { opacity: 1; }
    to { transform: translateX(-60px); opacity: 0; }
}

.flame {
    animation: flame 0.18s ease-in-out infinite alternate;
    transform-box: fill-box;
    transform-origin: 100% 50%;
}

@keyframes flame {
    to { transform: scaleX(0.8); opacity: 0.8; }
}

.ship-bob {
    animation: bob 3s ease-in-out infinite;
}

@keyframes bob {
    50% { transform: translateY(-10px); }
}

.twinkle {
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    50% { opacity: 0.25; }
}

.hobby-texts {
    position: absolute;
    top: calc(var(--header-h) + 30px);
    left: clamp(16px, 6vw, 90px);
    width: min(500px, calc(100% - 32px));
    z-index: 2;
}

.hobby-text {
    padding: 26px 28px;
}

.hobby-text .section-title {
    font-size: clamp(1.8rem, 3.4vw, 2.8rem);
    margin-bottom: 12px;
}

.hobby-text p {
    margin-bottom: 18px;
}

.hobby-text .chips {
    margin-bottom: 0;
}

#hobby-space {
    position: absolute;
    inset: 0 0 auto 0;
    opacity: 0;
    visibility: hidden;
}

/* ---------- Contact & footer ---------- */
.contact {
    text-align: center;
    background: radial-gradient(50% 60% at 50% 100%, rgba(123, 97, 255, 0.18), transparent 70%);
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--header-h);
}

.contact-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact .lead {
    margin-inline: auto;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 10px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 28px clamp(16px, 4vw, 48px);
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .site-nav { gap: 18px; }
    .side-dots { display: none; }
}

@media (max-width: 959px), (max-height: 639px) {
    .scene {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 90px 16px 70px;
    }

    .scene-art svg {
        max-height: none;
    }

    .scene-text {
        max-width: none;
    }

    .h-scene {
        min-height: auto;
        padding: 90px 0 70px;
    }

    .h-track {
        flex-direction: column;
        width: auto;
        padding: 0 16px;
    }

    .xp-card,
    .xp-featured {
        width: 100%;
    }

    .scene-skills {
        display: block;
    }

    .coins {
        opacity: 0.55;
    }

    .scene-hobbies {
        display: flex;
        flex-direction: column;
        padding: 90px 16px 70px;
        gap: 18px;
    }

    .hobby-stage {
        display: contents;
    }

    .stage-layer {
        position: relative;
        height: auto;
        aspect-ratio: 2 / 1;
        border-radius: 18px;
        border: 1px solid var(--line);
        transform: none;
    }

    #sport-svg { order: 2; }
    #space-svg { order: 4; }

    .hobby-texts {
        display: contents;
    }

    #hobby-sport { order: 1; }

    #hobby-space {
        order: 3;
        position: relative;
        opacity: 1;
        visibility: visible;
        margin-top: 18px;
    }

    .hobby-text {
        width: 100%;
    }
}

@media (max-width: 960px) {
    .site-nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        padding: 10px 16px 20px;
        background: rgba(7, 9, 15, 0.96);
        border-bottom: 1px solid var(--line);
        transform: translateY(-12px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    }

    .site-nav.open {
        transform: none;
        opacity: 1;
        visibility: visible;
    }

    .site-nav a {
        padding: 14px 4px;
        font-size: 1.05rem;
        border-bottom: 1px solid var(--line);
    }

    .site-nav a::after { display: none; }

    .header-cv { margin-left: auto; }

    .nav-toggle { display: block; }

    .hero-inner,
    .about-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: calc(var(--header-h) + 30px) 16px 100px;
    }
}

@media (max-width: 1100px) {
    .skill-cats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
    .perso-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .work-card { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .games { grid-template-columns: 1fr; }
    .skill-cats { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat { padding: 16px; }
    .stat-k { font-size: 1.6rem; }
    .panel-cols { grid-template-columns: 1fr; gap: 0; }
    .hero-meta { gap: 14px; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .contact-actions .btn { width: 100%; justify-content: center; white-space: normal; }
    .site-footer { flex-direction: column; }
    .terminal-body { padding: 16px; }
    #terminal-out { font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Panneau compétences compact pour tenir dans un écran */
.skills-panel {
    padding: clamp(20px, 2.6vw, 32px);
}

.skills-panel .section-title {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    margin-bottom: 14px;
}

.skills-panel .eyebrow {
    margin-bottom: 8px;
}

.skills-panel .panel-h {
    margin: 0 0 10px;
    font-size: 0.82rem;
}

.skills-panel .skill-cats {
    margin-bottom: 16px;
}

.skills-panel .chips-soft {
    gap: 8px;
    margin-bottom: 0;
}

.skills-panel .chips-soft .chip {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.skills-panel .lang-bar {
    margin-bottom: 10px;
}

.skills-panel .skill-cats {
    gap: 10px;
}

.skills-panel .skill-cat {
    padding: 11px 13px;
}

.skills-panel .skill-cat h4 {
    margin-bottom: 8px;
}

.skills-panel .chips-sm {
    gap: 5px;
}

.skills-panel .chips-sm li {
    padding: 2px 8px;
}

/* ---------- Jeux vidéo : icône voiture ---------- */
.games .icon-car {
    flex: none;
    width: 24px;
    height: 12px;
    margin-top: 6px;
    color: var(--accent);
}

/* ---------- Satisfactory : usine animée ---------- */
.sf-belt {
    animation: belt 0.6s linear infinite;
}

@keyframes belt {
    to { stroke-dashoffset: -12; }
}

.sf-items rect {
    animation: conveyor 2.4s linear infinite;
}

.sf-items rect:nth-child(2) { animation-delay: -0.8s; }
.sf-items rect:nth-child(3) { animation-delay: -1.6s; }

@keyframes conveyor {
    0% { transform: translateX(0); opacity: 0; }
    10% { opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translateX(52px); opacity: 0; }
}

.sf-gear {
    stroke-dasharray: 6 4;
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: gear 1.6s linear infinite;
}

@keyframes gear {
    to { transform: rotate(360deg); }
}

.sf-smoke {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: smoke 3s ease-out infinite;
}

.sf-smoke.s2 { animation-delay: 1.5s; }
.sf-smoke.s3 { animation-delay: 0.7s; }
.sf-smoke.s4 { animation-delay: 2.2s; }

@keyframes smoke {
    0% { transform: translate(0, 0) scale(0.6); opacity: 0.8; }
    100% { transform: translate(10px, -46px) scale(2.2); opacity: 0; }
}

.sf-lights rect {
    animation: led 1.2s steps(2) infinite;
}

.sf-lights rect:nth-child(2) { animation-delay: 0.4s; }
.sf-lights rect:nth-child(3) { animation-delay: 0.8s; }

.sf-glow {
    animation: furnace 1.4s ease-in-out infinite alternate;
}

@keyframes furnace {
    from { fill: #ff7a1a; }
    to { fill: #ffc04d; }
}

.sf-fan {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: gear 0.8s linear infinite;
}

/* ---------- Performance : animations en pause hors écran ---------- */
.offscreen *,
.offscreen *::before,
.offscreen *::after {
    animation-play-state: paused !important;
}

.coin-spin {
    will-change: transform;
}

/* Mobile : espace entre les soft skills et les langues (panneau sur une colonne) */
@media (max-width: 560px) {
    .skills-panel .chips-soft {
        margin-bottom: 24px;
    }
}

/* ---------- Icônes SVG (sprite intégré) ---------- */
.icon {
    display: inline-block;
    width: 1.25em;
    height: 1em;
    vertical-align: -0.125em;
    flex: none;
}

.icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* ---------- Entrée du hero en CSS : visible dès le premier affichage, sans attendre le JS ---------- */
.status-pill,
.hero-actions,
.hero-meta,
.hero-card {
    animation: hero-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-actions { animation-delay: 0.08s; }
.hero-meta { animation-delay: 0.16s; }
.hero-card { animation-delay: 0.12s; }

@keyframes hero-in {
    from { opacity: 0; transform: translateY(18px); }
}

/* ---------- Rechargement : page masquée le temps de restaurer la position, puis fondu ---------- */
html.restoring main,
html.restoring footer {
    opacity: 0;
}

main,
footer {
    transition: opacity 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
    .status-pill,
    .hero-actions,
    .hero-meta,
    .hero-card {
        animation: none;
    }
}

/* Défilement des projets : le premier projet commence au centre de l'écran,
   le dernier termine au centre (marge = moitié de l'écran moins une demi-carte) */
@media (min-width: 960px) and (min-height: 640px) {
    .h-track {
        padding-left: calc(50vw - 210px);
        padding-right: calc(50vw - 210px);
    }
}
