/* Fonts are self-hosted: no request to Google Fonts (privacy) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/inter-latin-700-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/manrope-latin-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/manrope-latin-700-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('fonts/manrope-latin-800-normal.woff2') format('woff2');
}

:root {
    --primary: #6c7bd9;
    --primary-dark: #5463c7;
    --primary-light: #96a2e8;
    --primary-lighter: #eceefb;
    --text: #1d2240;
    --text-light: #5b6183;
    --dark: #1d2240;
    --light: #f7f8fc;
    --surface: #ffffff;
    --header-bg: rgba(247, 248, 252, 0.8);
    --header-bg-scrolled: rgba(247, 248, 252, 0.95);
    --accent-green: #3f8f74;
    --accent-purple: #8a74d6;
    --accent-orange: #5aa9e0;
    --grain-opacity: 0;
    --on-primary: #ffffff;
}

/* Dark theme: applied automatically from OS preference, unless the visitor
   has explicitly picked a theme (data-theme on <html>, saved in localStorage
   by theme.js), in which case that explicit choice always wins. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary: #9aa5ee;
        --primary-dark: #7f8be3;
        --primary-light: #b8c0f4;
        --primary-lighter: #272c50;
        --text: #e7e9f7;
        --text-light: #a2a7c7;
        --dark: #0d0f22;
        --light: #12152b;
        --surface: #1b1f3b;
        --header-bg: rgba(18, 21, 43, 0.8);
        --header-bg-scrolled: rgba(18, 21, 43, 0.95);
        --accent-green: #6cc4a3;
        --accent-purple: #b3a3ee;
        --accent-orange: #7cc0ee;
        --grain-opacity: 0;
        --on-primary: #12152b;
    }
}

:root[data-theme="dark"] {
    --primary: #9aa5ee;
    --primary-dark: #7f8be3;
    --primary-light: #b8c0f4;
    --primary-lighter: #272c50;
    --text: #e7e9f7;
    --text-light: #a2a7c7;
    --dark: #0d0f22;
    --light: #12152b;
    --surface: #1b1f3b;
    --header-bg: rgba(18, 21, 43, 0.8);
    --header-bg-scrolled: rgba(18, 21, 43, 0.95);
    --accent-green: #6cc4a3;
    --accent-purple: #b3a3ee;
    --accent-orange: #7cc0ee;
    --grain-opacity: 0;
    --on-primary: #12152b;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background-color: var(--light);
    line-height: 1.7;
    font-size: 0.95rem;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Subtle film-grain texture over the whole page for a warmer, less "flat SaaS" surface */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

h1, h2 {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

h3, h4 {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--primary-lighter);
    transition: background 0.3s ease, border-color 0.3s ease;
}

header.scrolled {
    background: var(--header-bg-scrolled);
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

.logo {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    white-space: nowrap;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Nav dropdown (Projets, Emulations, Competences) */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 8px);
    background: var(--surface);
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(29, 34, 64, 0.12);
    padding: 1rem;
    min-width: 240px;
    max-width: 320px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 100;
}

.nav-dropdown-menu .icon {
    display: inline-block;
    width: 1.1em;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.nav-dropdown-category + .nav-dropdown-category {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--primary-lighter);
}

.nav-dropdown-category-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
    margin-bottom: 0.4rem;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: var(--surface);
    padding: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(29, 34, 64, 0.1);
}

.lang-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.lang-btn.active {
    opacity: 1;
    background: var(--primary-lighter);
}

.lang-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Language Switcher Fixed (pour pages de projets) */
.language-switcher {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
    background: var(--surface);
    padding: 0.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.1);
    z-index: 1000;
}

.language-switcher .lang-btn {
    background: transparent;
    border: 2px solid transparent;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.language-switcher .lang-btn:hover {
    background: var(--primary-lighter);
    color: var(--primary);
}

.language-switcher .lang-btn.active {
    background: var(--primary);
    color: var(--on-primary);
    border-color: var(--primary);
    opacity: 1;
}

/* Burger Menu */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 0.375rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Theme toggle (injected by theme.js on every page) */
.theme-toggle-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    background: var(--surface);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.15);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle-btn:hover {
    transform: scale(1.08);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 4px 20px rgba(108, 123, 217, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(108, 123, 217, 0.4);
}

.btn-secondary {
    background: var(--surface);
    color: var(--primary);
    border: 2px solid var(--primary-lighter);
}

.btn-secondary:hover {
    background: var(--primary-lighter);
    border-color: var(--primary-light);
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--primary);
    color: var(--on-primary);
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 600;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(108, 123, 217, 0.3);
}

.back-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(108, 123, 217, 0.4);
}

/* GitHub Button */
.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: var(--dark);
    color: white;
    text-decoration: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.3);
}

.github-btn:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(29, 34, 64, 0.4);
}

/* Hero Section (Page d'accueil) */
.hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    padding-top: 120px;
    padding-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-lighter);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    animation: slideUp 0.6s ease;
}

.hero-tag span::first-letter {
    margin-top: 0.125rem;
}

.hero h1 {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    margin-bottom: 1.5rem;
    animation: slideUp 0.6s ease 0.1s both;
}

.hero h1 .gradient-text {
    color: var(--primary);
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    max-width: 600px;
    animation: slideUp 0.6s ease 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    animation: slideUp 0.6s ease 0.3s both;
}

/* Hero Section (Pages de projets) */
.hero.project-hero {
    min-height: auto;
    background: var(--surface);
    border-radius: 1.5rem;
    padding: 4rem 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.05);
    text-align: center;
    flex-direction: column;
}

.hero.project-hero h1 {
    font-size: clamp(1.75rem, 4vw, 3rem);
    background: linear-gradient(135deg, var(--primary), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: none;
}

.hero.project-hero h2 {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.hero.project-hero p {
    font-size: 1.0625rem;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
}

/* Floating elements: soft, warm, low-contrast glows rather than saturated SaaS blobs */
.floating-element {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    animation: float 24s infinite ease-in-out;
}

.floating-1 {
    width: 420px;
    height: 420px;
    background: var(--primary-light);
    top: 8%;
    right: -10%;
}

.floating-2 {
    width: 320px;
    height: 320px;
    background: var(--accent-orange);
    bottom: 10%;
    left: -5%;
    opacity: 0.18;
    animation-delay: 7s;
}

.floating-3 {
    width: 220px;
    height: 220px;
    background: var(--accent-green);
    top: 40%;
    right: 20%;
    opacity: 0.14;
    animation-delay: 14s;
}

/* Section */
section {
    padding: 6rem 0;
    position: relative;
}

.section {
    background: var(--surface);
    border-radius: 1.5rem;
    padding: 2.75rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.05);
    animation: fadeIn 0.6s ease-out;
}

.section h3 {
    font-size: clamp(1.5rem, 3vw, 2.125rem);
    color: var(--primary);
    margin-bottom: 1.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-lighter);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-tag {
    display: inline-block;
    background: var(--primary-lighter);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.0625rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Badges */
.badges {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.badge {
    background: var(--primary-lighter);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.badge:hover {
    background: var(--primary);
    color: var(--on-primary);
    transform: scale(1.05);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--light);
    padding: 2rem;
    border-radius: 1rem;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(29, 34, 64, 0.03);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(29, 34, 64, 0.1);
}

/* Emulations list */
.emulations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.emulation-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--light);
    padding: 1.5rem;
    border-radius: 1rem;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 10px rgba(29, 34, 64, 0.03);
    transition: all 0.3s ease;
    flex-wrap: wrap;
}

.emulation-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(29, 34, 64, 0.1);
}

.emulation-item-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.emulation-item-content {
    flex: 1;
    min-width: 200px;
}

.emulation-item-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.emulation-item-content p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.feature-card h4 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Tech Stack */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.tech-item {
    background: var(--primary-lighter);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.tech-item:hover {
    background: var(--primary);
    color: var(--on-primary);
    transform: scale(1.05);
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.skill-category {
    background: var(--surface);
    padding: 2.25rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.05);
    transition: transform 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
}

.skill-category h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skill-category .icon {
    font-size: 1.5rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    background: var(--primary-lighter);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.skill-level {
    font-weight: 400;
    font-size: 0.75rem;
    opacity: 0.75;
    margin-left: 0.25rem;
}

.skill-level::before {
    content: '· ';
}

.skill-tag:hover {
    background: var(--primary);
    color: var(--on-primary);
    transform: scale(1.05);
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--surface);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px rgba(29, 34, 64, 0.15);
}

.project-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--accent-orange));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--on-primary);
}

.project-content {
    padding: 2rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.project-tag {
    background: var(--primary-lighter);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Featured Experience */
.featured-experience {
    border: 3px solid var(--primary);
    box-shadow: 0 8px 32px rgba(108, 123, 217, 0.22);
}

.featured-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: var(--on-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
}

@media (max-width: 768px) {
    .featured-badge {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
    }
}

.project-content h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.project-content p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.project-link.primary {
    background: var(--primary);
    color: var(--on-primary);
}

.project-link.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.project-link.secondary {
    background: var(--light);
    color: var(--primary);
}

.project-link.secondary:hover {
    background: var(--primary-lighter);
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 4rem 0;
}

.stat-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(29, 34, 64, 0.1);
}

.stat-card .icon {
    font-size: 1.875rem;
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--text-light);
    font-size: 0.875rem;
}

.stat-card.internship-highlight {
    background: linear-gradient(135deg, var(--surface), var(--primary-lighter));
    border: 2px solid var(--accent-green);
    box-shadow: 0 8px 30px rgba(63, 143, 116, 0.18);
}

.stat-card.internship-highlight .icon {
    font-size: 2.25rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2.5rem 0;
}

/* Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 2rem 0;
    border-radius: 1rem;
    box-shadow: 0 8px 30px rgba(29, 34, 64, 0.15);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 1rem;
}

/* Code Preview */
.game-preview {
    background: #1e1e1e;
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
    box-shadow: inset 0 2px 10px rgba(29, 34, 64, 0.5);
}

.ascii-art {
    font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
    font-size: 0.7em;
    line-height: 1.2;
    color: #00ff00;
    white-space: pre;
    text-shadow: 0 0 5px #00ff00;
}

.start-screen {
    color: #ffff00;
    text-align: center;
    font-size: 0.9em;
    text-shadow: 0 0 10px #ffff00;
}

.code-preview {
    background: #282c34;
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(29, 34, 64, 0.3);
}

.code-preview pre {
    margin: 0;
}

.code-preview code {
    font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9em;
    color: #abb2bf;
    line-height: 1.5;
}

.code-preview .keyword {
    color: #c678dd;
}

.code-preview .function {
    color: #61afef;
}

.code-preview .string {
    color: #98c379;
}

.code-preview .comment {
    color: #5c6370;
    font-style: italic;
}

.code-preview .number {
    color: #d19a66;
}

.screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.screenshot-box {
    background: #1e1e1e;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(29, 34, 64, 0.1);
}

.screenshot-title {
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-align: center;
}

/* Contact Section (Page d'accueil) */
.contact-section {
    background: var(--surface);
    padding: 4rem 3rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.05);
    text-align: center;
}

.contact-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-section > p {
    color: var(--text-light);
    font-size: 1.0625rem;
    margin-bottom: 2rem;
}

.contact-methods {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--light);
    border: 2px solid var(--primary-lighter);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: var(--primary-lighter);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(29, 34, 64, 0.1);
}

/* GitHub activity stats (theme-aware: swapped via data-theme, see theme.js) */
.github-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.github-stats-img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
}

.github-stats-img.dark {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .github-stats-img.light {
        display: none;
    }
    :root:not([data-theme="light"]) .github-stats-img.dark {
        display: block;
    }
}

:root[data-theme="dark"] .github-stats-img.light {
    display: none;
}

:root[data-theme="dark"] .github-stats-img.dark {
    display: block;
}

@media (max-width: 768px) {
    .contact-section {
        padding: 2.5rem 1.5rem;
    }

    .contact-section h2 {
        font-size: 1.75rem;
    }

    .contact-methods {
        flex-direction: column;
        gap: 1rem;
    }

    .contact-item {
        width: 100%;
        justify-content: center;
    }
}

/* Footer */
footer, .footer {
    background: var(--dark);
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer {
    border-radius: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.05);
}

footer p, .footer p {
    opacity: 0.9;
    margin: 0.5rem 0;
}

/* Contact specific styles */
.contact-hero {
    min-height: 40vh;
    display: flex;
    align-items: center;
    padding-top: 120px;
    padding-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary-lighter), var(--light));
    position: relative;
    overflow: hidden;
}

.contact-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
}

.contact-hero h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
}

.gradient-text {
    color: var(--primary);
}

.contact-hero p {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.contact-content {
    padding: 4rem 0;
}

.contact-form-section {
    background: var(--surface);
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.05);
    margin-bottom: 3rem;
}

.contact-form-section h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.contact-form-section > p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.contact-form {
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--primary-lighter);
    border-radius: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--light);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(108, 123, 217, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary);
    color: var(--on-primary);
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(108, 123, 217, 0.3);
}

.submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(108, 123, 217, 0.4);
}

.submit-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.form-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
    font-weight: 600;
    display: none;
}

.form-status.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
}

.form-status.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.contact-card {
    background: var(--surface);
    padding: 2.25rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(29, 34, 64, 0.1);
}

.contact-card .icon {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.contact-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.contact-card p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.contact-card a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    word-break: break-all;
    transition: color 0.3s ease;
}

.contact-card a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--primary);
    color: var(--on-primary);
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(108, 123, 217, 0.3);
    margin-top: 1rem;
}

.social-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(108, 123, 217, 0.4);
}

.linkedin-btn {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 4px 20px rgba(108, 123, 217, 0.3);
}

.linkedin-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 8px 30px rgba(108, 123, 217, 0.4);
}

.github-btn {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 4px 20px rgba(108, 123, 217, 0.3);
}

.github-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 8px 30px rgba(108, 123, 217, 0.4);
}

/* Force white color for text in social buttons */
.social-btn span,
.linkedin-btn span,
.github-btn span {
    color: var(--on-primary);
}

.social-btn:hover span,
.linkedin-btn:hover span,
.github-btn:hover span {
    color: var(--on-primary);
}

.map-section {
    background: var(--surface);
    padding: 3rem 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.05);
}

.map-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.map-section p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.address-info {
    display: flex;
    align-items: start;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light);
    border-radius: 1rem;
    border-left: 4px solid var(--primary);
}

.address-info .icon {
    font-size: 1.5rem;
    color: var(--primary);
}

.address-info .info {
    flex: 1;
}

.address-info h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.address-info p {
    text-align: left;
    margin: 0.25rem 0;
    color: var(--text);
}

.map-container {
    width: 100%;
    height: 450px;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.1);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* CV Modal */
.cv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(29, 34, 64, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.cv-modal-overlay.active {
    display: flex;
}

.cv-modal {
    background: var(--surface);
    border-radius: 1.5rem;
    padding: 3rem;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(29, 34, 64, 0.3);
    animation: slideUp 0.3s ease;
}

.cv-modal h3 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary);
}

.cv-modal > p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.cv-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.cv-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: var(--light);
    border: 2px solid var(--primary-lighter);
    border-radius: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cv-option:hover {
    background: var(--primary-lighter);
    border-color: var(--primary);
    transform: translateX(5px);
}

.cv-option-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cv-option-flag {
    font-size: 1.875rem;
}

.cv-option-text h4 {
    color: var(--text);
    margin-bottom: 0.25rem;
    font-size: 1.0625rem;
}

.cv-option-text p {
    color: var(--text-light);
    font-size: 0.875rem;
    margin: 0;
}

.cv-option-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

.cv-modal-close {
    width: 100%;
    padding: 1rem;
    background: var(--text-light);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cv-modal-close:hover {
    background: var(--text);
}

@media (max-width: 768px) {
    .cv-modal {
        padding: 2rem 1.5rem;
    }

    .cv-modal h3 {
        font-size: 1.5rem;
    }

    .cv-option {
        padding: 1rem;
    }

    .cv-option-flag {
        font-size: 1.625rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(30px, -30px);
    }
    50% {
        transform: translate(-20px, 20px);
    }
    75% {
        transform: translate(20px, 10px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .burger-menu {
        display: flex;
        order: 2;
    }

    .logo {
        order: 1;
    }

    .lang-switcher {
        order: 3;
        margin-left: auto;
    }

    .nav-links {
        display: none;
        order: 4;
        flex-direction: column;
        width: 100%;
        gap: 0;
        background: var(--header-bg-scrolled);
        backdrop-filter: blur(12px);
        border-radius: 0.5rem;
        padding: 1rem 0;
        box-shadow: 0 4px 20px rgba(29, 34, 64, 0.1);
        margin-top: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--primary-lighter);
    }

    .nav-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        box-shadow: none;
        padding: 0.5rem 0 0;
        min-width: 0;
    }

    .nav-dropdown-menu a {
        text-align: center;
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

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

    .hero {
        padding-top: 100px;
    }

    .hero h1 {
        font-size: clamp(1.875rem, 8vw, 2.5rem);
    }

    .hero p {
        font-size: 1rem;
    }

    section {
        padding: 4rem 0;
    }

    .section {
        padding: 1.5rem;
    }

    .hero.project-hero {
        padding: 2.5rem 1.5rem;
    }

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

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

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

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

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

    .map-container {
        height: 350px;
    }

    .language-switcher {
        top: 1rem;
        right: 1rem;
        padding: 0.4rem;
    }

    .language-switcher .lang-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem;
    }

    .ascii-art {
        font-size: 0.5em;
    }
}

/* BUT year by year */
.but-years-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: stretch;
}

.but-year-block {
    margin-top: 1.25rem;
}

.but-year-block strong {
    display: block;
    color: var(--text);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.but-year-block ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

.but-year-block li::marker {
    color: var(--primary);
}

.but-year-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.but-year-link:hover {
    text-decoration: underline;
}

/* Project screenshots */
.project-image.project-shot {
    padding: 0;
    overflow: hidden;
    background: var(--bg-alt, #eef0fa);
}

.project-image.project-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.project-card:hover .project-image.project-shot img {
    transform: scale(1.04);
}

.project-figure {
    margin: 0 0 2rem;
    border-radius: 16px;
    overflow: hidden;
    background: var(--white, #fff);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

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

.project-figure figcaption {
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

.project-figure--narrow {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* Right now: current courses */
.now-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.75rem;
    align-items: stretch;
}

.now-card .project-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.now-card h3 {
    margin-bottom: 0.5rem;
}

.project-tag.now-live {
    background: var(--accent-green);
    color: var(--on-primary);
}

.now-intro {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.now-list {
    margin: 0 0 0.9rem;
    padding-left: 1.1rem;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.6;
}

.now-list li::marker {
    color: var(--primary);
}

.now-next {
    font-size: 0.88rem;
    color: var(--text-light);
    border-left: 3px solid var(--accent-green);
    padding-left: 0.75rem;
    margin-bottom: 1rem;
}

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

.now-techs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
}

.now-tech {
    font-size: 0.75rem;
    border: 1px solid var(--primary-lighter);
    color: var(--text-light);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
}

.now-card .but-year-link {
    margin-top: 0.9rem;
    font-size: 0.9rem;
}

.now-code,
.now-repos {
    margin-top: 3rem;
    background: var(--surface);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.05);
    scroll-margin-top: 90px;
}

.now-code h3,
.now-repos h3 {
    margin-bottom: 0.5rem;
}

.now-note {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.now-excerpt {
    border-top: 1px solid var(--primary-lighter);
    padding: 0.9rem 0;
}

.now-excerpt summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
}

.now-excerpt summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.now-why {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0.6rem 0 0;
}

.now-excerpt .code-preview {
    margin: 0.75rem 0 0;
    padding: 1rem 1.1rem;
}

.now-excerpt .code-preview code {
    font-size: 0.82rem;
}

.now-repo-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.now-repo {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border-radius: 0.75rem;
    border: 1px solid var(--primary-lighter);
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.now-repo:hover {
    background: var(--primary-lighter);
}

@media (max-width: 600px) {
    .now-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .now-code,
    .now-repos {
        padding: 1.25rem;
    }
}

/* Below 860px the menu switches to the burger */
@media (max-width: 860px) {
    nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .burger-menu {
        display: flex;
        order: 2;
    }

    .logo {
        order: 1;
    }

    .lang-switcher {
        order: 3;
        margin-left: auto;
    }

    .nav-links {
        display: none;
        order: 4;
        flex-direction: column;
        width: 100%;
        gap: 0;
        background: var(--header-bg-scrolled);
        backdrop-filter: blur(12px);
        border-radius: 0.5rem;
        padding: 1rem 0;
        box-shadow: 0 4px 20px rgba(29, 34, 64, 0.1);
        margin-top: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--primary-lighter);
    }

    .nav-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        box-shadow: none;
        padding: 0.5rem 0 0;
        min-width: 0;
    }

    .nav-dropdown-menu a {
        text-align: center;
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

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

/* Keep the desktop menu on one line now that it has one more entry */
@media (min-width: 861px) and (max-width: 1360px) {
    .nav-links {
        gap: 1.1rem;
        font-size: 0.9rem;
    }
}


/* ---------- Multi-page layout ---------- */
.floating-element,
body::before {
    display: none;
}

.nav-links a.active {
    color: var(--primary);
}

.nav-links a.active::after {
    width: 100%;
}

.page-hero {
    padding-top: 140px;
}

.page-hero .section-header {
    margin-bottom: 2rem;
}

.page-hero .section-header h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
    margin-bottom: 1rem;
}

.page-hero .section-header p {
    font-size: 1.0625rem;
    color: var(--text-light);
    max-width: 640px;
    margin: 0 auto;
}

section.page-hero + section {
    padding-top: 2rem;
}

.page-subnav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.chip-link {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--primary-lighter);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.chip-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

[id] {
    scroll-margin-top: 90px;
}

/* Projects page */
.project-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.filter-btn {
    font: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.45rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
}

.filter-btn.active {
    background: var(--primary);
    color: var(--on-primary);
}

.project-category {
    padding: 2.5rem 0;
}

.category-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--primary-lighter);
}

/* Home: explore cards */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
}

.explore-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.75rem;
    background: var(--surface);
    border: 1px solid var(--primary-lighter);
    border-radius: 1rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.explore-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.explore-icon {
    font-size: 1.6rem;
}

.explore-card p {
    color: var(--text-light);
    font-size: 0.92rem;
    flex: 1;
}

.explore-more {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.now-repo-main {
    background: var(--primary);
    color: var(--on-primary);
    border-color: var(--primary);
}

.now-repo-main:hover {
    background: var(--primary-dark);
}

@media (max-width: 768px) {
    .page-hero {
        padding-top: 110px;
    }
}

.now-code-group {
    margin: 1.5rem 0 0.4rem;
    font-size: 1rem;
    color: var(--primary);
}

.now-src {
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Privacy: click-to-load embeds, form notice, legal page ---------- */
.embed-facade {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    min-height: 260px;
    padding: 2rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 1rem;
    border: 1px dashed var(--primary-light);
    background: var(--primary-lighter);
    color: var(--text);
}

.embed-facade p {
    max-width: 520px;
    font-size: 0.92rem;
    color: var(--text-light);
}

.embed-alt {
    font-size: 0.88rem;
    color: var(--primary);
}

.video-container > .embed-facade {
    position: absolute;
    inset: 0;
    margin: 0;
    min-height: 0;
}

.map-container > .embed-facade {
    height: 100%;
    margin: 0;
}

.form-privacy {
    font-size: 0.82rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-top: 0.75rem;
}

.form-privacy a,
.footer-legal,
.mini-footer a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-content {
    max-width: 820px;
}

.legal-content h2 {
    font-size: 1.35rem;
    margin: 2.25rem 0 0.75rem;
}

.legal-content h3 {
    font-size: 1.05rem;
    margin: 1.5rem 0 0.5rem;
}

.legal-content p,
.legal-content li {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.legal-content ul {
    padding-left: 1.2rem;
}

.legal-content a {
    color: var(--primary);
}

.legal-updated {
    font-size: 0.85rem;
}

.mini-footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

section.page-hero:has(+ .legal-section) {
    padding-bottom: 1rem;
}

.legal-section {
    padding-top: 0;
}

/* ---------- Mini-games ---------- */
.game-hero {
    padding-bottom: 1rem;
}

.game-back {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.game-back:hover {
    text-decoration: underline;
}

.game-section {
    padding-top: 0;
}

.game-wrap {
    max-width: 460px;
}

.game-wrap-wide {
    max-width: 720px;
}

.game-hud {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.game-hud b {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.game-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 640 / 480;
    border-radius: 1rem;
    box-shadow: 0 8px 30px rgba(29, 34, 64, 0.15);
    touch-action: none;
    user-select: none;
    cursor: crosshair;
}

.game-canvas-tall {
    aspect-ratio: 420 / 620;
    width: min(100%, 52vh);
    margin: 0 auto;
    cursor: pointer;
}

.game-touch {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.game-touch .btn {
    flex: 1;
    justify-content: center;
    touch-action: none;
    user-select: none;
}

@media (hover: hover) and (pointer: fine) {
    .game-touch {
        display: none;
    }
}

.game-notes {
    margin-top: 1.5rem;
    color: var(--text-light);
    font-size: 0.92rem;
}

.game-notes h2 {
    font-size: 1.1rem;
    color: var(--text);
    margin: 1.25rem 0 0.4rem;
}

.game-controls-text {
    background: var(--primary-lighter);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text);
}

/* Spot the bug */
.bug-card {
    background: var(--surface);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(29, 34, 64, 0.06);
}

#bugStart,
#bugEnd {
    text-align: center;
}

#bugStart .btn,
#bugEnd .btn {
    margin-top: 1rem;
}

.bug-top {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-light);
}

.bug-top b {
    color: var(--text);
}

.bug-lang {
    background: var(--primary-lighter);
    color: var(--primary);
    font-weight: 700;
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    font-size: 0.8rem;
}

.bug-timer {
    height: 6px;
    border-radius: 3px;
    background: var(--primary-lighter);
    margin: 0.75rem 0;
    overflow: hidden;
}

.bug-timer div {
    height: 100%;
    background: var(--primary);
    transition: width 1s linear;
}

.bug-hint {
    font-size: 0.88rem;
    color: var(--text-light);
    margin-bottom: 0.6rem;
}

.bug-code {
    background: #1f2337;
    border-radius: 0.75rem;
    padding: 0.5rem 0;
    overflow-x: auto;
}

.bug-line {
    display: flex;
    gap: 0.9rem;
    width: 100%;
    min-width: max-content;
    text-align: left;
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    color: #e6e8f2;
    padding: 0.3rem 1rem 0.3rem 0.75rem;
    font: 0.85rem/1.5 'JetBrains Mono', Consolas, 'Courier New', monospace;
    cursor: pointer;
}

.bug-line code {
    white-space: pre;
    font: inherit;
}

.bug-num {
    color: #6f7699;
    min-width: 1.2rem;
    text-align: right;
}

.bug-line:hover:not(:disabled),
.bug-line:focus-visible {
    background: rgba(154, 165, 238, 0.18);
    border-left-color: #9aa5ee;
    outline: none;
}

.bug-line:disabled {
    cursor: default;
}

.bug-line.is-bug {
    background: rgba(108, 196, 163, 0.22);
    border-left-color: #6cc4a3;
}

.bug-line.is-wrong {
    background: rgba(240, 120, 120, 0.22);
    border-left-color: #f07878;
}

.bug-feedback {
    margin-top: 1rem;
}

#bugVerdict {
    font-weight: 800;
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.1rem;
}

#bugVerdict.ok {
    color: var(--accent-green);
}

#bugVerdict.ko {
    color: #d64545;
}

#bugExplain {
    color: var(--text-light);
    margin: 0.4rem 0 1rem;
}

.bug-final {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    color: var(--primary);
}

.bug-record {
    color: var(--accent-green);
    font-weight: 700;
}

.bug-best-line {
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Spot the bug v2 (modes, rating, stats) */
.game-wrap-xl {
    max-width: 860px;
}

.bug-app {
    background: var(--surface);
    border-radius: 1.25rem;
    box-shadow: 0 4px 24px rgba(29, 34, 64, 0.07);
    padding: 1.25rem;
    min-height: 420px;
}

.bug-profile {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--primary-lighter);
}

.bug-rating {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.bug-rating b {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.bug-rating-label,
.bug-tier {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bug-tier {
    background: var(--primary-lighter);
    color: var(--primary);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.bug-profile-actions,
.bug-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.bug-chip {
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--primary-lighter);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.bug-chip.is-on {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.bug-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 0.9rem;
}

.bug-mode {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    text-align: left;
    font: inherit;
    padding: 1.1rem;
    border-radius: 1rem;
    border: 1px solid var(--primary-lighter);
    background: var(--light);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.bug-mode:hover,
.bug-mode:focus-visible {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.bug-mode-icon {
    font-size: 1.6rem;
}

.bug-mode-name {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
}

.bug-mode-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.45;
}

.bug-mode-extra {
    margin-top: auto;
    padding-top: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
}

.bug-practice {
    margin-top: 1rem;
    padding: 1.1rem;
    border-radius: 1rem;
    border: 1px dashed var(--primary-light);
    display: grid;
    gap: 0.7rem;
}

.bug-practice-head {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.bug-practice-head p {
    font-size: 0.85rem;
    color: var(--text-light);
}

.bug-filter > span {
    font-size: 0.8rem;
    color: var(--text-light);
    min-width: 5.5rem;
}

.bug-practice .btn {
    justify-self: start;
}

.bug-muted {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0.5rem 0;
}

.bug-kbd {
    margin-top: 1rem;
}

.bug-mode-tag {
    font-weight: 800;
    color: var(--text);
}

.bug-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--text);
}

.bug-strikes {
    color: #d64545;
    letter-spacing: 0.15em;
}

.bug-timer div.low {
    background: #d64545;
}

.bug-line.is-dim {
    opacity: 0.3;
}

.bug-hint-box {
    margin-top: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-radius: 0.75rem;
    background: var(--primary-lighter);
    font-size: 0.9rem;
}

.bug-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.bug-actions.center {
    justify-content: center;
}

.bug-verdict {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.bug-verdict.ok {
    color: var(--accent-green);
}

.bug-verdict.ko {
    color: #d64545;
}

.bug-delta {
    font-size: 0.9rem;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
}

.bug-delta.up {
    background: rgba(63, 143, 116, 0.15);
    color: var(--accent-green);
}

.bug-delta.down {
    background: rgba(214, 69, 69, 0.12);
    color: #d64545;
}

.bug-explain {
    color: var(--text-light);
    margin: 0.4rem 0 0.75rem;
}

.bug-diff {
    display: grid;
    gap: 0.15rem;
    background: #1f2337;
    border-radius: 0.75rem;
    padding: 0.7rem 1rem;
    overflow-x: auto;
}

.bug-diff-label {
    font-size: 0.75rem;
    color: #9aa0bd;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.bug-diff code {
    font: 0.83rem/1.5 'JetBrains Mono', Consolas, 'Courier New', monospace;
    white-space: pre;
}

.bug-diff .minus {
    color: #f3a0a0;
}

.bug-diff .plus {
    color: #8fe0b8;
}

.bug-result {
    text-align: center;
    padding: 1.5rem 0.5rem;
}

.bug-result-icon {
    font-size: 2.6rem;
}

.bug-result h3 {
    margin: 0.4rem 0;
}

.bug-stats h3 {
    margin-bottom: 0.9rem;
}

.bug-stats h4 {
    margin: 1.4rem 0 0.6rem;
    font-size: 1rem;
}

.bug-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.6rem;
}

.bug-tile {
    background: var(--light);
    border-radius: 0.8rem;
    padding: 0.7rem 0.8rem;
    display: grid;
}

.bug-tile b {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
}

.bug-tile span {
    font-size: 0.78rem;
    color: var(--text-light);
}

.bug-chart {
    width: 100%;
    height: auto;
    background: var(--light);
    border-radius: 0.8rem;
}

.bug-chart .line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2.5;
    stroke-linejoin: round;
}

.bug-chart .area {
    fill: var(--primary);
    opacity: 0.12;
}

.bug-chart .dot {
    fill: var(--primary);
}

.bug-chart .lbl {
    fill: var(--text-light);
    font-size: 11px;
}

.bug-bars {
    display: grid;
    gap: 0.45rem;
}

.bug-bar-row {
    display: grid;
    grid-template-columns: 6.5rem 1fr 3.2rem 3rem;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
}

.bug-bar-row small {
    color: var(--text-light);
}

.bug-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--primary-lighter);
    overflow: hidden;
}

.bug-bar div {
    height: 100%;
    background: var(--primary);
}

.bug-themes {
    padding-left: 1.1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.bug-badges {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
}

.bug-badge {
    display: grid;
    gap: 0.15rem;
    padding: 0.7rem;
    border-radius: 0.8rem;
    border: 1px solid var(--primary-lighter);
    opacity: 0.55;
}

.bug-badge.got {
    opacity: 1;
    border-color: var(--primary-light);
    background: var(--primary-lighter);
}

.bug-badge span {
    font-size: 1.4rem;
}

.bug-badge b {
    font-size: 0.88rem;
}

.bug-badge small {
    font-size: 0.75rem;
    color: var(--text-light);
}

.bug-reset {
    margin-top: 1.5rem;
    font: inherit;
    font-size: 0.82rem;
    background: none;
    border: 0;
    color: var(--text-light);
    text-decoration: underline;
    cursor: pointer;
}

.bug-toasts {
    position: fixed;
    right: 1rem;
    bottom: 5rem;
    display: grid;
    gap: 0.5rem;
    z-index: 50;
}

.bug-toast {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--primary-light);
    border-radius: 0.9rem;
    padding: 0.7rem 1rem;
    box-shadow: 0 10px 30px rgba(29, 34, 64, 0.2);
    animation: bugToastIn 0.25s ease-out;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.bug-toast.out {
    opacity: 0;
    transform: translateY(8px);
}

.bug-toast-icon {
    font-size: 1.6rem;
}

.bug-toast small {
    display: block;
    font-size: 0.72rem;
    color: var(--text-light);
}

@keyframes bugToastIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .bug-toast { animation: none; }
    .bug-mode { transition: none; }
}

@media (max-width: 600px) {
    .bug-app { padding: 0.9rem; }
    .bug-bar-row { grid-template-columns: 5rem 1fr 2.8rem; }
    .bug-bar-row small { display: none; }
}

/* ---------- Arcade ---------- */
.arcade-section {
    padding-top: 1rem;
}

.arcade-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--primary-lighter);
    border-radius: 1.5rem;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 8px 30px rgba(29, 34, 64, 0.08);
    transition: border-color 0.2s ease, transform 0.2s ease;
    margin-bottom: 3rem;
}

.arcade-featured:hover,
.arcade-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.arcade-featured img,
.arcade-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--primary-lighter);
}

.arcade-featured-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
}

.arcade-featured-body h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.arcade-featured-body p {
    color: var(--text-light);
}

.arcade-badge {
    background: var(--primary);
    color: var(--on-primary);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
}

.arcade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.arcade-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--primary-lighter);
    border-radius: 1.25rem;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.arcade-card img {
    aspect-ratio: 16 / 10;
    height: auto;
}

.arcade-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.arcade-card-body p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.arcade-stat {
    font-size: 0.85rem;
    color: var(--text-light);
    min-height: 1.2em;
}

.arcade-stat b {
    color: var(--primary);
}

.arcade-play {
    margin-top: auto;
    color: var(--primary);
    font-weight: 700;
}

.arcade-tech {
    margin-top: 3rem;
    background: var(--surface);
    border-radius: 1.5rem;
    padding: 2rem;
}

.arcade-tech h2 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.arcade-tech ul {
    padding-left: 1.2rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.arcade-tech li {
    margin-bottom: 0.4rem;
}

.arcade-cta {
    text-align: center;
    margin-bottom: 2rem;
}

@media (max-width: 760px) {
    .arcade-featured {
        grid-template-columns: 1fr;
    }
    .arcade-featured img {
        aspect-ratio: 16 / 10;
        height: auto;
    }
    .arcade-featured-body {
        padding: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .arcade-featured, .arcade-card { transition: none; }
}

section.page-hero:has(+ .arcade-section) {
    padding-bottom: 1.5rem;
}

@media (max-width: 860px) {
    .page-hero {
        padding-top: 150px;
    }
}

/* Bandeau « jouable dans le navigateur » des pages projet (Zelda, Survival Island) */
.emulation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    background: var(--primary-lighter);
    border-left: 4px solid var(--primary);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}
.emulation-banner-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.emulation-banner-text .icon {
    font-size: 1.5rem;
}
.emulation-banner-text span:last-child {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 400;
}
.emulation-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 0.6rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.15s ease, background 0.15s ease;
}
.emulation-play-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Lien vers la page détaillée d'un cours */
.now-detail { display: inline-flex; margin: .4rem 0 .6rem; font-size: .9rem; padding: .6rem 1.1rem; }

/* ===== Recherche dans le site (search.js) ===== */
.search-btn { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border: none; border-radius: 0.375rem; background: transparent; color: var(--text); cursor: pointer; transition: background 0.2s ease; }
.search-btn:hover, .search-btn:focus-visible { background: var(--primary-lighter); }
.search-btn svg, .site-search-bar svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.language-switcher .search-btn { border: 2px solid transparent; }
html.site-search-open { overflow: hidden; }
.site-search { position: fixed; inset: 0; z-index: 2000; display: flex; justify-content: center; align-items: flex-start; padding: 8vh 1rem 1rem; }
.site-search[hidden] { display: none; }
.site-search-backdrop { position: absolute; inset: 0; background: rgba(13, 15, 34, 0.55); backdrop-filter: blur(3px); }
.site-search-box { position: relative; width: 100%; max-width: 680px; max-height: 84vh; display: flex; flex-direction: column; background: var(--surface); color: var(--text); border-radius: 1rem; box-shadow: 0 24px 60px rgba(13, 15, 34, 0.35); overflow: hidden; border: 1px solid var(--primary-lighter); }
.site-search-bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--primary-lighter); color: var(--primary); }
.site-search-bar input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 1.1rem; padding: 0.2rem 0; }
.site-search-bar input::-webkit-search-cancel-button { display: none; }
.site-search-close { border: 1px solid var(--primary-lighter); background: var(--light); color: var(--text-light); border-radius: 0.4rem; padding: 0.15rem 0.45rem; cursor: pointer; font-size: 0.75rem; }
.site-search-close kbd { font: inherit; }
.site-search-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.site-search-status { margin: 0; padding: 0.6rem 1rem 0.2rem; font-size: 0.85rem; color: var(--text-light); }
.site-search-chip { border: 1px solid var(--primary-lighter); background: var(--light); color: var(--primary); border-radius: 999px; padding: 0.15rem 0.6rem; margin: 0.15rem 0.1rem; font: inherit; font-size: 0.8rem; cursor: pointer; }
.site-search-chip:hover { background: var(--primary-lighter); }
.site-search-list { list-style: none; margin: 0; padding: 0.3rem 0.5rem 0.6rem; overflow-y: auto; overscroll-behavior: contain; }
.site-search-list li { margin: 0.15rem 0; }
.site-search-item { display: block; padding: 0.6rem 0.75rem; border-radius: 0.6rem; text-decoration: none; color: inherit; border: 1px solid transparent; }
.site-search-item[aria-selected="true"] { background: var(--primary-lighter); border-color: var(--primary-light); }
.site-search-title { display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline; font-weight: 700; color: var(--text); }
.site-search-title small { font-weight: 500; font-size: 0.72rem; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.site-search-text { display: block; margin-top: 0.2rem; font-size: 0.85rem; line-height: 1.45; color: var(--text-light); overflow-wrap: anywhere; }
.site-search-sub { display: block; margin: 0 0 0 1.4rem; padding: 0.2rem 0.6rem; font-size: 0.82rem; color: var(--primary); text-decoration: none; border-radius: 0.4rem; }
.site-search-sub:hover, .site-search-sub:focus-visible { background: var(--primary-lighter); }
.site-search mark { background: rgba(244, 183, 64, 0.35); color: inherit; border-radius: 0.2rem; padding: 0 0.1rem; }
.site-search-keys { margin: 0; padding: 0.5rem 1rem; font-size: 0.75rem; color: var(--text-light); border-top: 1px solid var(--primary-lighter); }
@media (max-width: 600px) {
    .site-search { padding: 0; }
    .site-search-box { max-width: none; max-height: 100%; height: 100%; border-radius: 0; border: none; }
    .site-search-keys { display: none; }
}
