/**
 * This file is part of landing.
 *
 * landing - Personal landing page of Grégor Neveu
 *
 * @author    Neveu Grégor <contact.neveugregor@proton.me>
 * @copyright 2026 Neveu Grégor
 * @license   CeCILL-B Free Software License Agreement
 *
 * Governed by the CeCILL-B license under French law — http://www.cecill.info
 */

@font-face {
    font-family: "IBM Plex Sans";
    src: url("fonts/ibm-plex-sans.woff2") format("woff2");
    font-weight: 100 700;
    font-display: swap;
}

/* Identité « Papier & forêt » : Papier par défaut, Forêt sur choix (theme.js). */
:root {
    color-scheme: light;
    --page: #FFF0E1;
    --sheet: #FFFAF4;
    --rule: #D7C9B8;
    --ink: #253D2C;
    --ink-2: #596253;
    --action: #2E6F40;
    --on-action: #FFFAF4;
    --warm: #803600;
    --orange: #FF7518;
    --band: #253D2C;
    --band-ink: #FFF0E1;
    --band-rule: #52634F;
    --serif: Georgia, "Times New Roman", serif;
    --sans: "IBM Plex Sans", system-ui, sans-serif;
    --mono: "JetBrains Mono", "DejaVu Sans Mono", monospace;
}

:root[data-theme="foret"] {
    color-scheme: dark;
    --page: #1B2A21;
    --sheet: #253D2C;
    --rule: #52634F;
    --ink: #FFF0E1;
    --ink-2: #C4CEBA;
    --action: #68BA7F;
    --on-action: #253D2C;
    --warm: #FFC985;
    --band: #253D2C;
}

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

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 400 1rem/1.6 var(--sans);
    -webkit-text-size-adjust: 100%;
}

a {
    color: var(--action);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

a:hover {
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 2px solid var(--action);
    outline-offset: 3px;
}

/* Bandeau commun */

.band {
    background: var(--band);
    color: var(--band-ink);
}

.band-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    max-width: 66rem;
    margin: 0 auto;
    padding: 0.625rem 1rem;
}

.band-name {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    margin-right: auto;
    font-weight: 500;
}

.mark {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    padding-bottom: 0.2rem;
    border-radius: 2px;
    background: var(--orange);
    color: #253D2C;
    font: 400 1.375rem/1 var(--serif);
}

.band a {
    color: var(--band-ink);
    font-size: 0.875rem;
    font-weight: 500;
}

.band :focus-visible {
    outline-color: var(--orange);
}

.themes {
    display: inline-flex;
    border: 1px solid var(--band-rule);
    border-radius: 2px;
}

.themes[hidden] {
    display: none;
}

.themes button {
    padding: 0.4rem 0.625rem;
    border: 0;
    background: transparent;
    color: var(--band-ink);
    font: 500 0.8125rem/1 var(--sans);
    cursor: pointer;
}

.themes button + button {
    border-left: 1px solid var(--band-rule);
}

.themes button[aria-pressed="true"] {
    background: var(--band-ink);
    color: #253D2C;
}

/* Feuille */

main {
    padding: 1.5rem 1rem 0;
}

.sheet {
    max-width: 66rem;
    margin: 0 auto;
    padding: clamp(1.25rem, 5vw, 3.5rem);
    border: 1px solid var(--rule);
    border-radius: 2px;
    background: var(--sheet);
}

.hero,
.section {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    column-gap: 3rem;
}

h1 {
    grid-column: 1 / -1;
    margin: 0 0 1.75rem;
    font: 400 clamp(2.625rem, 1.5rem + 5.4vw, 5.25rem)/1 var(--serif);
    letter-spacing: -0.015em;
}

.role {
    margin: 0.3rem 0 1rem;
    color: var(--warm);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.45;
}

.statement {
    max-width: 32em;
    margin: 0 0 1.75rem;
    font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
    line-height: 1.5;
}

.actions {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.button {
    display: inline-block;
    padding: 0.65rem 1.1rem;
    border: 1px solid var(--ink-2);
    border-radius: 2px;
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
}

.button:hover {
    text-decoration: underline;
}

.button.primary {
    border-color: var(--action);
    background: var(--action);
    color: var(--on-action);
}

/* Sections : repère orange posé sur le filet, numéro et titre dans la marge. */

.section {
    position: relative;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
}

.section::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    width: 2.5rem;
    height: 3px;
    background: var(--orange);
}

.num {
    display: block;
    margin-bottom: 0.375rem;
    color: var(--ink-2);
    font: 400 0.8125rem/1 var(--mono);
}

h2 {
    margin: 0;
    font: 400 1.5rem/1.2 var(--serif);
}

.section-body {
    min-width: 0;
}

p {
    max-width: 38em;
    margin: 0 0 1rem;
}

.note {
    margin-top: 1.5rem;
    color: var(--ink-2);
}

.ledger {
    display: grid;
    grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr);
    margin: 0;
}

/* En tête de section, le filet de section suffit ; après un texte, le registre ouvre le sien. */
.section-body > * + .ledger {
    margin-top: 1.75rem;
    border-top: 1px solid var(--rule);
}

.ledger dt,
.ledger dd {
    margin: 0;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--rule);
}

.ledger dt {
    padding-right: 1rem;
    font-weight: 600;
}

.register {
    margin: 0;
    padding: 0;
    list-style: none;
}

.register li:first-child {
    padding-top: 0;
}

.register li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 7rem;
    column-gap: 1.5rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--rule);
}

.register a {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.register p {
    grid-column: 1;
    margin: 0.2rem 0 0;
}

.tech {
    grid-column: 2;
    grid-row: 1 / span 2;
    color: var(--ink-2);
    font: 400 0.8125rem/1.9 var(--mono);
    text-align: right;
}

.email {
    display: inline-block;
    margin-bottom: 1.75rem;
    font: 400 clamp(1.25rem, 1rem + 1.2vw, 1.75rem)/1.3 var(--serif);
    overflow-wrap: anywhere;
}

footer {
    max-width: 66rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    color: var(--ink-2);
    font-size: 0.875rem;
}

@media (max-width: 47.99rem) {
    .hero,
    .section {
        grid-template-columns: minmax(0, 1fr);
    }

    .actions {
        grid-column: 1;
    }

    .section {
        margin-top: 2.5rem;
        padding-top: 1.5rem;
    }

    .section-head {
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 30rem) {
    /* Le nom reste lu par les lecteurs d'écran ; le titre de la page le porte déjà à l'œil. */
    .band-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .ledger {
        grid-template-columns: minmax(0, 1fr);
    }

    .ledger dt {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .register li {
        grid-template-columns: minmax(0, 1fr);
    }

    .tech {
        grid-column: 1;
        grid-row: auto;
        text-align: left;
    }
}
