:root {
    --background: #191a1b;
    --surface: #202224;
    --surface-hover: #292c2f;

    --text: #e8e8e8;
    --muted: #a7aaae;
    --border: #3b3d40;

    --accent: #788653;
    --accent-hover: #94a467;
    --accent-text: #ffffff;

    --header-height: 72px;
    --container-width: 1250px;

    --radius: 7px;
    --transition: 180ms ease;

    color-scheme: dark;
}

html[data-theme="light"] {
    --background: #f7f7f5;
    --surface: #ffffff;
    --surface-hover: #eeeeea;

    --text: #202124;
    --muted: #62666c;
    --border: #d2d5d8;

    --accent: #56603d;
    --accent-hover: #3f482b;
    --accent-text: #ffffff;

    color-scheme: light;
}

/* ==========================================================
   RÉINITIALISATION
   ========================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;

    display: flex;
    flex-direction: column;

    background: var(--background);
    color: var(--text);

    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    font-size: 16px;
    line-height: 1.55;

    transition:
        background-color var(--transition),
        color var(--transition);
}

main {
    flex: 1;
}

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

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--accent);
    text-decoration: none;

    transition:
        color var(--transition),
        background-color var(--transition),
        border-color var(--transition);
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

p {
    margin: 0 0 1.1rem;
}

h1,
h2,
h3 {
    margin-top: 0;
    line-height: 1.2;
}

h1,
h2 {
    font-weight: 300;
}

h3 {
    font-weight: 650;
}

/* ==========================================================
   CONTENEUR
   ========================================================== */

.container {
    width: min(
        calc(100% - 40px),
        var(--container-width)
    );

    margin-inline: auto;
}

/* ==========================================================
   NAVIGATION
   ========================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    min-height: var(--header-height);

    border-bottom: 1px solid var(--border);
    background: var(--background);

    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

@supports (
    background:
        color-mix(
            in srgb,
            white 50%,
            transparent
        )
) {
    .site-header {
        background:
            color-mix(
                in srgb,
                var(--background) 94%,
                transparent
            );
    }
}

.navbar {
    min-height: var(--header-height);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.brand {
    flex-shrink: 0;

    color: var(--text);
    font-size: clamp(1.2rem, 1.6vw, 1.55rem);
    white-space: nowrap;
}

.brand:hover {
    color: var(--text);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 28px);
}

.nav-links > a {
    position: relative;

    color: var(--text);
    font-size: 0.95rem;
}

.nav-links > a:hover,
.nav-links > a.active {
    color: var(--accent);
    text-decoration: none;
}

.nav-links > a.active::after {
    content: "";

    position: absolute;
    right: 0;
    bottom: -10px;
    left: 0;

    height: 2px;

    background: var(--accent);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-toggle,
.language-toggle,
.theme-toggle {
    padding: 0;

    border: 0;
    background: transparent;
    color: var(--text);

    cursor: pointer;
}

.menu-toggle {
    display: none;

    width: 42px;
    height: 42px;

    place-items: center;

    border-radius: 50%;

    font-size: 1.45rem;
    line-height: 1;
}

.language-toggle,
.theme-toggle {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    transition:
        color var(--transition),
        background-color var(--transition);
}

.language-toggle {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.theme-toggle {
    font-size: 1.25rem;
}

.menu-toggle:hover,
.language-toggle:hover,
.theme-toggle:hover {
    color: var(--accent);
    background: var(--surface-hover);
}

/* ==========================================================
   STRUCTURE DES PAGES
   ========================================================== */

.page {
    padding-block: clamp(50px, 6vw, 85px);
}

.page-title {
    margin-bottom: 55px;
    font-size: clamp(2.4rem, 5vw, 4rem);
}

.content-section {
    margin-top: 55px;
}

.content-section:first-child {
    margin-top: 0;
}

.content-section > h2 {
    margin-bottom: 32px;
    font-size: clamp(1.65rem, 3vw, 2.6rem);
}

/* ==========================================================
   PROFIL
   ========================================================== */

.profile-section {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        340px;

    align-items: start;

    gap: clamp(35px, 5vw, 70px);
}

.profile-content {
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
}

.profile-content h1 {
    margin-bottom: 24px;
    font-size: clamp(2.8rem, 6vw, 4.5rem);
}

.profile-picture {
    margin: 75px 0 0;
}

.profile-picture img {
    width: 100%;
    max-height: 460px;

    object-fit: cover;

    border-radius: var(--radius);

    box-shadow:
        0 20px 50px
        rgb(0 0 0 / 24%);
}

.contact-list {
    margin-top: 30px;
    font-size: 0.9em;
}

.contact-list > div {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;

    margin-bottom: 8px;
}

.contact-list strong {
    min-width: 105px;
    font-weight: 700;
}

/* ==========================================================
   ACTUALITÉS
   ========================================================== */

.news-list {
    display: grid;
    gap: 24px;
}

.news-item {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

.news-date {
    padding-top: 3px;

    display: flex;
    flex-direction: column;
    gap: 2px;

    color: var(--muted);
    font-weight: 600;
    line-height: 1.35;
}

.news-date-end::before {
    content: "– ";
    color: var(--accent);
}

.news-item p {
    margin: 0;
}

/* ==========================================================
   PUBLICATIONS
   ========================================================== */

.year-heading {
    margin: -15px 0 28px;
    padding-top: 20px;

    border-top: 1px solid var(--border);

    color: var(--muted);
    font-size: clamp(2rem, 4vw, 3.3rem);
    font-weight: 300;
    text-align: right;
}

.publication {
    display: grid;

    grid-template-columns:
        155px
        minmax(0, 1fr);

    align-items: start;
    gap: 35px;
}

.publication-badge {
    margin-top: 4px;
    padding: 5px 12px;

    border-radius: var(--radius);

    background: var(--accent);
    color: var(--accent-text);

    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    text-transform: lowercase;

    box-shadow:
        0 8px 20px
        rgb(0 0 0 / 20%);
}

.publication-content {
    position: relative;
    min-width: 0;
}

.publication-content h3 {
    max-width: 1000px;
    margin-bottom: 8px;

    font-size: clamp(1.05rem, 1.7vw, 1.4rem);
}

.publication-content p {
    margin: 0 0 4px;
}

.publication-author {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.publication-status {
    color: var(--muted);
    font-style: italic;
}

.publication-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: 14px;
}

/* ==========================================================
   BOUTONS
   ========================================================== */

.button {
    min-width: 80px;
    min-height: 35px;
    padding: 7px 15px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 2px solid var(--text);
    border-radius: 4px;

    background: transparent;
    color: var(--text);

    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 650;
    line-height: 1;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition:
        color var(--transition),
        border-color var(--transition),
        background-color var(--transition);
}

.button:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-text);

    text-decoration: none;
}

.primary-button {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-text);
}

.primary-button:hover {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
}

.bib-toggle[aria-expanded="true"] {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-text);
}

/* ==========================================================
   PANNEAU BIBTEX
   ========================================================== */

.bib-panel {
    width: 100%;
    margin-top: 12px;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: #30322e;
    color: #e8e8e8;

    box-shadow:
        0 14px 35px
        rgb(0 0 0 / 25%);
}

.bib-panel[hidden] {
    display: none;
}

.bib-panel:not([hidden]) {
    animation: open-bib-panel 180ms ease;
}

.bib-panel-header {
    min-height: 42px;
    padding: 8px 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    border-bottom:
        1px solid
        rgb(255 255 255 / 12%);

    font-size: 0.82rem;
}

.bib-copy {
    padding: 5px 11px;

    border:
        1px solid
        rgb(255 255 255 / 35%);

    border-radius: 4px;

    background: transparent;
    color: #e8e8e8;

    font-size: 0.75rem;
    cursor: pointer;

    transition:
        background-color var(--transition),
        border-color var(--transition),
        color var(--transition);
}

.bib-copy:hover,
.bib-copy.copied {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.bib-copy:disabled {
    cursor: wait;
}

.bib-panel pre {
    max-width: 100%;
    margin: 0;
    padding: 18px 20px;

    overflow-x: auto;

    white-space: pre;
    tab-size: 4;
}

.bib-code {
    color: #e4e4e4;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;

    font-size: 0.82rem;
    line-height: 1.6;

    cursor: text;
    user-select: text;
}

@keyframes open-bib-panel {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================
   CV
   ========================================================== */

.title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;

    margin-bottom: 55px;
}

.title-row .page-title {
    margin-bottom: 0;
}

.timeline {
    display: grid;
    gap: 20px;
}

.timeline-item {
    display: grid;

    grid-template-columns:
        170px
        minmax(0, 1fr);

    gap: 30px;
    padding: 22px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);

    transition:
        border-color var(--transition),
        background-color var(--transition),
        transform var(--transition);
}

.timeline-item:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
}

.timeline-date {
    color: var(--accent);
    font-weight: 700;
}

.timeline-item h3 {
    margin-bottom: 8px;
}

.timeline-item p {
    margin-bottom: 4px;
}

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

.skills {
    margin: 0;
    padding: 0;

    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    list-style: none;
}

.skills li {
    padding: 6px 12px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface);

    font-size: 0.85rem;

    transition:
        border-color var(--transition),
        background-color var(--transition);
}

.skills li:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
}

/* ==========================================================
   PIED DE PAGE
   ========================================================== */

.site-footer {
    padding-block: 20px;

    border-top: 1px solid var(--border);

    color: var(--muted);
    font-size: 0.8rem;
}

.site-footer p {
    margin: 0;
}

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

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

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

/* ==========================================================
   TABLETTES
   ========================================================== */

@media (max-width: 1050px) {
    body {
        font-size: 15px;
    }

    .profile-section {
        grid-template-columns:
            minmax(0, 1fr)
            280px;

        gap: 35px;
    }

    .profile-picture {
        margin-top: 65px;
    }

    .news-item {
        grid-template-columns: 135px minmax(0, 1fr);
        gap: 20px;
    }

    .publication {
        grid-template-columns:
            135px
            minmax(0, 1fr);

        gap: 25px;
    }
}

/* ==========================================================
   MOBILES
   ========================================================== */

@media (max-width: 760px) {
    .container {
        width: min(
            calc(100% - 28px),
            var(--container-width)
        );
    }

    .news-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .news-date {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;

        font-size: 0.75rem;
    }

    .news-date-end::before {
        content: "– ";
    }

    .navbar {
        position: relative;
    }

    .menu-toggle {
        display: grid;
    }

    .nav-links {
        position: absolute;
        top: calc(100% - 1px);
        right: 0;
        left: 0;

        display: none;
        align-items: stretch;
        gap: 0;

        padding: 14px;

        border: 1px solid var(--border);

        border-radius:
            0
            0
            var(--radius)
            var(--radius);

        background: var(--background);

        box-shadow:
            0 15px 30px
            rgb(0 0 0 / 25%);
    }

    .nav-links.open {
        display: flex;
        flex-direction: column;
    }

    .nav-links > a {
        padding: 13px 12px;
    }

    .nav-links > a.active::after {
        top: 50%;
        right: auto;
        bottom: auto;
        left: 0;

        width: 3px;
        height: 55%;

        transform: translateY(-50%);
    }

    .nav-actions {
        justify-content: flex-start;
        gap: 10px;

        margin-top: 7px;
        padding: 7px 4px 0;

        border-top: 1px solid var(--border);
    }

    .page {
        padding-block: 40px 55px;
    }

    .page-title {
        margin-bottom: 38px;
    }

    .profile-section {
        display: flex;
        flex-direction: column;
    }

    .profile-content {
        display: contents;
    }

    .profile-content h1 {
        order: 1;
        margin-bottom: 0;
    }

    .profile-picture {
        order: 2;

        width: min(100%, 280px);
        margin: 0 auto;
    }

    .profile-content > p {
        order: 3;
    }

    .contact-list {
        order: 4;
        margin-top: 15px;
    }

    .contact-list > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;

        margin-bottom: 12px;
    }

    .contact-list strong {
        min-width: 0;
    }

    .content-section {
        margin-top: 45px;
    }

    .content-section > h2 {
        margin-bottom: 25px;
    }

    .news-item,
    .publication,
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .news-date {
        width: min(100%, 235px);
    }

    .news-item p {
        padding-top: 5px;
    }

    .publication-badge {
        width: max-content;
        min-width: 130px;
    }

    .year-heading {
        text-align: left;
    }

    .title-row {
        align-items: flex-start;
        flex-direction: column;

        margin-bottom: 38px;
    }

    .title-row .primary-button {
        width: 100%;
    }

    .bib-panel {
        margin-top: 10px;
    }

    .bib-panel pre {
        padding: 15px;
    }

    .bib-code {
        font-size: 0.75rem;
    }
}
