/*
 * Système repris de diggerz : toile blanche, encre, DM Sans 900 italique en capitales pour tout
 * ce qui est affiche, filets fins, aucun arrondi ni ombre. Écart assumé : la couleur des lieux
 * de création porte la lecture (années, lieux, carte), là où diggerz n'a aucune couleur.
 */

@font-face {
    font-family: "DM Sans";
    src: url("/fonts/dm-sans-normal.woff2") format("woff2");
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "DM Sans";
    src: url("/fonts/dm-sans-italic.woff2") format("woff2");
    font-weight: 400 900;
    font-style: italic;
    font-display: swap;
}

:root {
    --fond: #ffffff;
    --encre: #1a1a1a;
    --encre-douce: #1a1a2e;
    --muet-60: rgba(26, 26, 46, 0.6);
    --muet-40: rgba(26, 26, 46, 0.4);
    --filet: rgba(0, 0, 0, 0.08);
    --vide: rgba(0, 0, 0, 0.06);
    --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--fond);
    color: var(--encre);
    font-family:
        "DM Sans",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    font-kerning: normal;
}

button {
    font: inherit;
    color: inherit;
}

/* Typographie de titrage : 900 italique, capitales, approche serrée */

.entete h1,
.annee-nom,
.detail-annee,
.lieu,
.detail-lieu {
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
}

/* Étiquettes : 700, capitales espacées */

.resume,
.annee-nombre,
.lieu-nombre,
.survol-etiquette,
.detail-fiche dt,
.detail-lien {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}

/* En-tête */

.haut {
    display: flex;
    align-items: flex-start;
    padding-right: 32px;
    border-bottom: 1px solid var(--filet);
}

.haut-texte {
    flex: 1;
    min-width: 0;
}

.entete {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px 0;
}

.entete-titre {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.entete h1 {
    margin: 0;
    font-size: 56px;
    line-height: 0.88;
    letter-spacing: -0.045em;
    color: var(--encre-douce);
}

.choix-peintre {
    position: relative;
}

.choix-peintre select {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 16px;
}

.choix-peintre:has(select:not([hidden])) h1::after {
    content: "";
    display: inline-block;
    width: 0.16em;
    height: 0.16em;
    margin-left: 0.22em;
    border-right: 0.07em solid currentColor;
    border-bottom: 0.07em solid currentColor;
    transform: translateY(-0.18em) rotate(45deg);
    opacity: 0.35;
    transition: opacity 0.15s;
}

.choix-peintre:hover h1::after {
    opacity: 0.8;
}

.resume {
    margin: 0;
    color: var(--muet-40);
}

.zoom {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    cursor: pointer;
}

.zoom-petit,
.zoom-grand {
    flex-shrink: 0;
    border: 1.5px solid var(--encre);
}

.zoom-petit {
    width: 7px;
    height: 9px;
}

.zoom-grand {
    width: 13px;
    height: 17px;
}

/* Curseur : un filet d'encre, une poignée carrée */
.zoom input {
    -webkit-appearance: none;
    appearance: none;
    width: 140px;
    height: 20px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}

.zoom input::-webkit-slider-runnable-track {
    height: 2px;
    background: var(--encre);
}

.zoom input::-moz-range-track {
    height: 2px;
    background: var(--encre);
}

.zoom input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -6px;
    border: none;
    background: var(--encre);
    transition: scale 0.12s var(--ease);
}

.zoom input::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: none;
    border-radius: 0;
    background: var(--encre);
}

.zoom input:active::-webkit-slider-thumb {
    scale: 1.25;
}

/* Lieux : des mots en couleur ; le lieu choisi s'inverse en aplat */

.lieux {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 4px;
    padding: 22px 32px 0;
}

.lieu {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 5px 8px 4px;
    border: none;
    background: none;
    font-size: 15px;
    letter-spacing: -0.01em;
    color: var(--lieu);
    cursor: pointer;
    transition:
        background 0.15s var(--ease),
        color 0.15s var(--ease),
        opacity 0.15s var(--ease),
        scale 0.12s var(--ease);
}

.lieu:first-child {
    margin-left: -8px;
}

.lieu:hover {
    background: color-mix(in srgb, var(--lieu) 12%, transparent);
}

.lieu.actif {
    background: var(--lieu);
    color: var(--fond);
}

.lieux.filtre .lieu:not(.actif) {
    opacity: 0.35;
}

.lieu-nombre {
    font-style: normal;
    font-size: 10px;
    color: var(--muet-40);
}

.lieu.actif .lieu-nombre {
    color: rgba(255, 255, 255, 0.75);
}

/* Vue d'ensemble */

.survol {
    position: relative;
    margin: 20px 32px 0;
    height: 52px;
    cursor: pointer;
    user-select: none;
}

.survol-barres {
    display: flex;
    align-items: stretch;
    height: 100%;
    padding-bottom: 18px;
}

.survol-annee {
    position: relative;
    flex: 1;
    display: flex;
    align-items: flex-end;
    padding: 0 1px;
}

.survol-pile {
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    overflow: hidden;
}

.survol-annee:hover .survol-pile {
    outline: 1px solid var(--encre);
}

.survol-etiquette {
    position: absolute;
    left: 0;
    bottom: -18px;
    font-size: 10px;
    color: var(--muet-40);
    white-space: nowrap;
}

.survol-fenetre {
    position: absolute;
    top: -4px;
    bottom: 14px;
    border-bottom: 2px solid var(--encre);
    background: rgba(0, 0, 0, 0.04);
    pointer-events: none;
    transition:
        left 0.2s var(--ease),
        width 0.2s var(--ease);
}

/* Frise */

.frise {
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
    user-select: none;
    scrollbar-width: none;
}

.frise::-webkit-scrollbar {
    display: none;
}

.frise.glisse {
    cursor: grabbing;
}

.piste {
    position: relative;
    height: 100%;
}

.annee {
    position: absolute;
    top: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    white-space: nowrap;
}

.annee.apparait {
    animation: apparait 0.3s var(--ease) both;
}

@keyframes apparait {
    from {
        opacity: 0;
        translate: 0 6px;
    }
}

.annee-nom {
    font-size: 38px;
    line-height: 0.88;
    letter-spacing: -0.04em;
    color: var(--lieu);
}

.annee-nombre {
    font-size: 10px;
    color: var(--muet-40);
}

.oeuvre {
    position: absolute;
    top: 0;
    left: 0;
    padding: 0;
    border: none;
    overflow: hidden;
    background: var(--vide);
    cursor: pointer;
    outline: 3px solid transparent;
    outline-offset: -3px;
    transition:
        transform 0.3s var(--ease),
        width 0.3s var(--ease),
        height 0.3s var(--ease),
        opacity 0.2s var(--ease),
        scale 0.12s var(--ease),
        outline-color 0.15s var(--ease);
}

.piste.fige .oeuvre {
    transition:
        opacity 0.2s var(--ease),
        scale 0.12s var(--ease),
        outline-color 0.15s var(--ease);
}

.oeuvre.masquee {
    opacity: 0;
    scale: 0.94;
    pointer-events: none;
}

.frise:not(.glisse) .oeuvre:hover {
    outline-color: var(--lieu);
    z-index: 1;
}

.frise:not(.glisse) .oeuvre:active {
    scale: 0.97;
}

.oeuvre img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.2s var(--ease);
    pointer-events: none;
}

.oeuvre img.charge {
    opacity: 1;
}

/* Infobulle : une bande d'encre */

.infobulle {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5;
    max-width: 300px;
    padding: 9px 12px 8px;
    background: var(--encre);
    color: var(--fond);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.infobulle[hidden] {
    display: none;
}

.infobulle strong {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.infobulle span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

/* Fiche */

.detail {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.detail[hidden] {
    display: none;
}

.detail-fond {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.94);
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}

.detail.ouvert .detail-fond {
    opacity: 1;
}

.detail-carte,
.detail-nav {
    opacity: 0;
    translate: 0 12px;
    transition:
        opacity 0.25s var(--ease),
        translate 0.3s var(--ease),
        scale 0.12s var(--ease);
}

.detail.ouvert .detail-carte,
.detail.ouvert .detail-nav {
    opacity: 1;
    translate: 0 0;
}

.detail-carte {
    position: relative;
    display: flex;
    max-width: min(1120px, 86vw);
    height: min(820px, 86vh);
    overflow: hidden;
    background: var(--fond);
    border: 1px solid var(--encre);
}

.detail-image-cadre {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--vide);
}

.detail-image-cadre img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.detail-image-cadre img.vers-suiv {
    animation: vers-suiv 0.3s var(--ease);
}

.detail-image-cadre img.vers-prec {
    animation: vers-prec 0.3s var(--ease);
}

@keyframes vers-suiv {
    from {
        opacity: 0;
        translate: 24px 0;
    }
}

@keyframes vers-prec {
    from {
        opacity: 0;
        translate: -24px 0;
    }
}

.detail-texte {
    position: relative;
    width: 320px;
    flex-shrink: 0;
    padding: 32px 28px 28px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--filet);
}

.detail-fermer {
    position: absolute;
    top: 14px;
    right: 16px;
    border: none;
    background: none;
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
    color: var(--encre);
    cursor: pointer;
}

.detail-annee {
    margin: 0 0 14px;
    font-size: 72px;
    line-height: 0.85;
    letter-spacing: -0.05em;
    color: var(--lieu, var(--encre-douce));
}

.detail-texte h2 {
    margin: 0 0 12px;
    font-size: 26px;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.detail-lieu {
    align-self: flex-start;
    margin: 0 0 22px;
    padding: 4px 8px 3px;
    font-size: 13px;
    background: var(--lieu);
    color: var(--fond);
}

.detail-fiche {
    margin: 0;
}

.detail-fiche dt {
    color: var(--muet-40);
    margin-bottom: 4px;
}

.detail-fiche dd {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.5;
}

.detail-lien {
    align-self: flex-start;
    margin-top: auto;
    padding: 14px 0 0;
    font-weight: 900;
    font-style: italic;
    color: var(--encre);
    text-decoration: none;
    transition: translate 0.2s var(--ease);
}

.detail-lien:hover {
    translate: 4px 0;
}

/* Flèches de navigation : du texte, pas de cadre */
.detail-nav {
    position: relative;
    padding: 12px;
    border: none;
    background: none;
    font-size: 40px;
    font-weight: 400;
    line-height: 1;
    color: var(--muet-40);
    cursor: pointer;
    transition:
        color 0.15s var(--ease),
        translate 0.2s var(--ease);
}

.detail-nav:hover {
    color: var(--encre);
}

.detail-prec:hover {
    translate: -4px 0;
}

.detail-suiv:hover {
    translate: 4px 0;
}

/* Cartes */

.geo {
    --mer: #e6edf0;
    display: block;
    flex-shrink: 0;
    width: 330px;
    margin: 24px 0 20px;
    overflow: hidden;
    background: var(--mer);
}

.geo[hidden] {
    display: none;
}

.geo-fond {
    fill: #d9d3c6;
    stroke: var(--mer);
    stroke-width: 2.5;
    stroke-linejoin: round;
}

.geo-trajet {
    fill: none;
    stroke: var(--encre);
    stroke-width: 3.5;
    stroke-dasharray: 4 10;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.8;
}

.geo-lieu {
    cursor: pointer;
    transition: opacity 0.15s var(--ease);
}

.geo-lieu circle {
    fill: var(--lieu);
    stroke: var(--mer);
    stroke-width: 5;
    transform-box: fill-box;
    transform-origin: center;
    transition:
        stroke 0.15s var(--ease),
        scale 0.3s var(--ease);
}

.geo-lieu.actif circle {
    scale: 1.3;
}

.geo-lieu text {
    font-size: 40px;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    fill: var(--encre);
    paint-order: stroke;
    stroke: var(--mer);
    stroke-width: 10px;
    stroke-linejoin: round;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s var(--ease);
}

.geo-lieu.survole text,
.geo-lieu.actif text {
    opacity: 1;
}

.geo-lieu.survole circle,
.geo-lieu.actif circle {
    stroke: var(--encre);
}

.geo.filtre .geo-lieu:not(.actif):not(.survole) {
    opacity: 0.25;
}

.geo-autre {
    fill: #a9a497;
}

.geo-detail {
    width: 100%;
    margin: -6px 0 22px;
    pointer-events: none;
}

.geo-detail .geo-lieu circle {
    stroke: var(--mer);
    stroke-width: 6;
}

/* Retours au clic */

.lieu:active,
.detail-nav:active,
.detail-lien:active {
    scale: 0.97;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0s !important;
        animation-duration: 0s !important;
    }
}
