/* Apply the font globally */
html,
body {
    font-family: 'IS-ArzierVF', sans-serif;
    font-weight: 350;
    font-feature-settings: "ss03";
    line-height: 1.3;
}

:root {
    --ui-space-unit: 4px;
    /* unité de base pour tous les espacements (tags, rails, footer) */
    --ui-space-half: calc(var(--ui-space-unit) / 2);
    /* demi-unité pour micro-ajustements (chips, animations) */
    --ui-space-1_5: calc(var(--ui-space-unit) * 1.5);
    /* espacement intermédiaire légèrement supérieur (toper__tag) */
    --ui-space-double: calc(var(--ui-space-unit) * 2);
    /* double unité pour grands gaps horizontaux/verticaux (groupes topper) */
    --ui-space-triple: calc(var(--ui-space-unit) * 3);
    /* triple unité pour espacements généreux (layouts ponctuels) */
    --ui-space-quad: calc(var(--ui-space-unit) * 4);
    /* quadruple unité pour marges très larges (utilitaires futurs) */
    --ui-shell-edge: 10px;
    /* marge commune entre toper, footer, vertical rail et la fenêtre */
    --ui-shell-edge-inline: var(--ui-shell-edge);
    /* équivalent horizontal de la marge commune (padding-inline UI) */
    --ui-shell-edge-block: var(--ui-shell-edge);
    /* équivalent vertical de la marge commune (padding-block UI) */
    --ui-gap: var(--ui-space-double);
    /* espacement standard entre éléments frères du topper (.toper__*) */
    --ui-chip-gap: var(--ui-space-unit);
    /* espacement entre les tags / chips interactifs (.toper__tags) */
    --ui-padding-inline: var(--ui-space-1_5);
    /* padding horizontal partagé par les tags et le nom du projet */
    --ui-font-size: 15px;
    /* corps de texte par défaut des éléments UI (.ui_text, rail, footer) */
    --ui-line-height: 1.3;
    /* interlignage pour lisibilité du texte (toper, footer, rail) */
    --ui-font-weight: 300;
    /* graisse par défaut des textes UI (.ui_text et descendants) */
    --ui-bio-desc-line-height: 1.3;
    /* interlignage spécifique pour bio/description (#text_overlay_container_*) */
}

/* Shared edge padding keeps UI text evenly inset from the viewport */
.toper,
.project-footer,
.project-vertical-rail {
    padding-block: var(--ui-shell-edge-block);
    padding-inline: var(--ui-shell-edge-inline);
    margin: 0;
}

.ui_text {
    font-size: var(--ui-font-size);
    font-family: 'IS-ArzierVF', sans-serif;
    font-weight: var(--ui-font-weight);
    line-height: var(--ui-line-height);
}

:root {
    --toper-height: calc(var(--ui-font-size) * var(--ui-line-height) + 2 * var(--ui-shell-edge-block));
}

.toper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    display: flex;
    align-items: flex-start;
    gap: var(--ui-space-unit);
    color: #ffffff;
    mix-blend-mode: difference;
    pointer-events: none;
    box-sizing: border-box;
}

.toper__bio,
.toper__title-group,
.toper__tags,
.toper__splitter {
    position: relative;
    z-index: 1;
}

.toper__bio,
.toper__title,
.toper__tags,
.toper__title-group {
    pointer-events: auto;
}

.toper__bio {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--ui-space-unit);
    mix-blend-mode: inherit;
    font: inherit;
    line-height: inherit;
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    max-width: clamp(0px, 30vw, 460px);
}

.toper__title-group {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: var(--ui-space-unit);
    flex: 0 0 auto;
    max-width: 60vw;
    width: auto;
    min-width: 0;
    mix-blend-mode: inherit;
    color: inherit;
    font: inherit;
    line-height: inherit;
}

.toper__title {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-start;
    flex-wrap: nowrap;
    width: auto;
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    line-height: inherit;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-align: left;
    mix-blend-mode: inherit;
}

.toper__title:focus,
.toper__title:hover,
.toper__title:active {
    background: transparent;
    color: inherit;
    mix-blend-mode: inherit;
    outline: none;
}

.toper__title-text {
    display: inline-block;
    pointer-events: none;
    white-space: nowrap;
    vertical-align: baseline;
    background: transparent;
    color: inherit;
    transition: background-color .25s ease, color .25s ease;
    flex: 0 0 auto;
    position: relative;
    z-index: 0;
    overflow: visible;
    padding: 0 var(--ui-padding-inline);
}

.toper__title-text::after {
    content: "";
    position: absolute;
    inset: 0;
    background: transparent;
    transition: background-color .25s ease, top .25s ease;
    z-index: -1;
}

.toper__title:not(.is-description-open):hover .toper__title-text,
.toper__title:not(.is-description-open):focus-visible .toper__title-text {
    color: #000000;
    mix-blend-mode: normal;
}

.toper__title:not(.is-description-open):active .toper__title-text {
    color: #000000;
    mix-blend-mode: normal;
}

.toper__title:not(.is-description-open):hover .toper__title-text::after,
.toper__title:not(.is-description-open):focus-visible .toper__title-text::after {
    background: rgba(255, 255, 255, 0.8);
    top: -4px;
}

.toper__title:not(.is-description-open):active .toper__title-text::after {
    background: #ffffff;
    top: -4px;
}

.toper__splitter {
    width: 2px;
    height: 1em;
    background: currentColor;
    mix-blend-mode: difference;
    align-self: baseline;
    display: inline-block;
    pointer-events: none;
    flex: 0 0 2px;
    margin: 0;
}

.toper__splitter:first-of-type {
    margin-inline-start: var(--ui-space-unit);
}

.toper__tags {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--ui-space-unit);
    mix-blend-mode: inherit;
    font: inherit;
    line-height: inherit;
}

.toper__tag {
    display: inline-flex;
    align-items: baseline;
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    line-height: inherit;
    padding: 0 var(--ui-space-1_5);
    margin: 0;
    cursor: pointer;
    mix-blend-mode: inherit;
    transition: background-color .2s ease, color .2s ease, opacity .2s ease;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    z-index: 0;
    overflow: visible;
}

.toper__tag::after {
    content: "";
    position: absolute;
    inset: 0;
    background: transparent;
    transition: background-color .2s ease, top .2s ease;
    z-index: -1;
}

.toper__tag:hover,
.toper__tag:focus {
    color: #000000;
    mix-blend-mode: normal;
    outline: none;
}

.toper__tag:hover::after,
.toper__tag:focus::after {
    background: rgba(255, 255, 255, 0.8);
    top: -4px;
}

.toper__tag.is-active {
    color: #000000;
    mix-blend-mode: normal;
}

.toper__tag.is-active::after {
    background: #ffffff;
    top: -4px;
}

#text_overlay_container_left {
    position: static;
    display: block;
    width: auto;
    max-width: clamp(0px, 30vw, 460px);
    z-index: 998;
    padding: 0;
    margin: 0;
    color: inherit;
    mix-blend-mode: inherit;
    -webkit-text-stroke: 0;
    text-shadow: none;
    user-select: none;
    pointer-events: auto;
    line-height: var(--ui-bio-desc-line-height);
}

/* Slight left indent for left overlay text without shifting layout */
/* Make the name interactive (hover/click) without enabling the whole overlay */
#left_name {
    pointer-events: auto;
    cursor: pointer;
}

/* Enable interaction on the bio only when expanded */
#text_overlay_container_left.bio-expanded #left_bio {
    pointer-events: auto;
    cursor: pointer;
}

#left_bio {
    display: none;
    pointer-events: none;
    line-height: var(--ui-bio-desc-line-height);
    margin-top: 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#text_overlay_container_left.bio-expanded #left_bio {
    display: block;
    opacity: 1;
    margin-top: var(--ui-space-unit);
}

/* Avoid nested spans capturing hover/leave on the name wrapper */
.char {
    display: inline;
    pointer-events: none;
}

/* Hover chip for email/instagram inherits the overlay blend */
#text_overlay_container_left .contact-chip {
    transition: background-color .25s ease, color .25s ease, opacity .25s ease;
    border-radius: 0px;
    cursor: pointer;
    pointer-events: auto;
    /* re-enable interaction inside left overlay */
    mix-blend-mode: inherit;
    background: transparent;
    color: inherit;
}

#text_overlay_container_left .contact-chip:hover,
#text_overlay_container_left .contact-chip:focus {
    background: #ffffff;
    color: #000000;
    mix-blend-mode: normal;
    text-decoration: none;
    outline: none;
}

/* Left overlay tokens inherit blend settings for name and bio */
#text_overlay_container_left .word,
#text_overlay_container_left .space {
    background: transparent;
    color: inherit;
    mix-blend-mode: inherit;
    border-radius: 0px;
    line-height: var(--ui-bio-desc-line-height);
}

#text_overlay_container_left .char {
    background: transparent;
    color: inherit;
    mix-blend-mode: inherit;
}

/* Language toggle styles */
#text_overlay_container_left .lang-option {
    cursor: pointer;
    pointer-events: auto;
    transition: background-color .25s ease, color .25s ease;
}

#text_overlay_container_left .lang-option.inactive {
    opacity: 0.5;
}

#text_overlay_container_left .lang-option:hover,
#text_overlay_container_left .lang-option:focus {
    background: #ffffff;
    color: #000000;
    mix-blend-mode: normal;
    text-decoration: none;
    outline: none;
}

#text_overlay_container_left .lang-toggle {
    white-space: nowrap;
}

/* Remove default hyperlink styling in left overlay */
#text_overlay_container_left a,
#text_overlay_container_left a:visited,
#text_overlay_container_left a:hover,
#text_overlay_container_left a:focus,
#text_overlay_container_left a:active {
    color: inherit;
    text-decoration: none;
}

/* Meta line under EN/FR */
#text_overlay_container_left .left-meta {
    font-size: var(--ui-font-size);
    line-height: var(--ui-bio-desc-line-height);
    mix-blend-mode: inherit;
    color: #ffffff;
    pointer-events: auto;
    -webkit-text-stroke: 0;
    text-shadow: none;
}

/* Inherit blending on meta and descendants */
#text_overlay_container_left .left-meta,
#text_overlay_container_left .left-meta * {
    mix-blend-mode: inherit;
}

#text_overlay_container_left .left-meta .word,
#text_overlay_container_left .left-meta .space,
#text_overlay_container_left .left-meta .char {
    background: transparent;
    color: inherit;
    mix-blend-mode: inherit;
}

#text_overlay_container_left .left-meta a {
    color: inherit;
    text-decoration: none;
    pointer-events: auto;
    cursor: pointer;
    mix-blend-mode: inherit;
}

#text_overlay_container_left .left-meta a:hover,
#text_overlay_container_left .left-meta a:focus,
#text_overlay_container_left .left-meta .contact-chip:hover,
#text_overlay_container_left .left-meta .contact-chip:focus {
    background: #ffffff;
    color: #000000;
    mix-blend-mode: normal;
    outline: none;
}

#text_overlay_container {
    position: static;
    display: inline-block;
    width: auto;
    max-width: 60vw;
    padding: 0;
    margin: 0 5px 0 0;
    color: inherit;
    mix-blend-mode: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    white-space: normal;
    line-height: var(--ui-bio-desc-line-height);
    vertical-align: baseline;
    flex: 0 1 auto;
    min-width: 0;
    font-weight: 300;
}

#text_overlay_container.is-open {
    pointer-events: auto;
    opacity: 1;
    margin-left: 10px;
}

.project-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: none;
    font-size: var(--ui-font-size);
    font-weight: var(--ui-font-weight);
    color: white;
    mix-blend-mode: difference;
    pointer-events: none;
    z-index: 1000;
    box-sizing: border-box;
    height: calc(var(--ui-font-size) * var(--ui-line-height) + 2 * var(--ui-shell-edge-block));
}

.project-footer-track {
    position: relative;
    width: 100%;
    height: calc(var(--ui-font-size) * 2);
}

.project-footer .pagination {
    position: absolute;
    left: 0;
    white-space: nowrap;
    will-change: left;
    background: transparent;
    color: #ffffff;
    font-size: var(--ui-font-size);
    font-weight: var(--ui-font-weight);
    line-height: calc(var(--ui-font-size) * var(--ui-line-height));
    border-radius: 0px;
    margin: 0;
    mix-blend-mode: difference;
    display: inline-block;
    transition: left 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
    top: 50%;
    transform: translateY(-50%);
}

.project-vertical-rail {
    position: fixed;
    top: 0;
    right: 0;
    height: var(--viewport-block);
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    box-sizing: border-box;
    pointer-events: none;
    mix-blend-mode: difference;
    z-index: 1000;
    overflow: hidden;
}

.project-vertical-rail .vertical-indicator-group {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--ui-space-unit);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.project-vertical-rail .vertical-index,
.project-vertical-rail .vertical-project-name {
    white-space: nowrap;
    background: transparent;
    color: #ffffff;
    font-size: var(--ui-font-size);
    font-weight: var(--ui-font-weight);
    line-height: calc(var(--ui-font-size) * var(--ui-line-height));
    margin: 0;
    border-radius: 0px;
    padding: 0;
    mix-blend-mode: difference;
    display: inline-block;
    transition: opacity 0.5s ease;
}

.project-vertical-rail .vertical-project-name {
    text-align: right;
}

body.ui-idle .project-footer .pagination,
body.ui-idle .project-vertical-rail .vertical-index,
body.ui-idle .project-vertical-rail .vertical-project-name {
    opacity: 0.15;
}

.highlight {
    /* color: yellow; */
}

.tag {
    display: inline;
    transition: background-color .2s ease, color .2s ease, border-radius .2s ease, opacity .2s ease;
    will-change: background-color, color, border-radius, opacity;
    background: transparent;
    color: inherit;
    mix-blend-mode: inherit;
}

body.ui-idle #text_overlay_container {
    opacity: 1;
}

.word {
    display: inline;
    transition: background-color .2s ease, color .2s ease, border-radius .2s ease, opacity .2s ease;
    will-change: background-color, color, border-radius, opacity;
    background: transparent;
    color: inherit;
    mix-blend-mode: inherit;
}

/* (char display kept above with pointer-events: none) */

/* Use pointer cursor only on interactive elements, not globally */

/* --- Phase de chargement (utilisant le nom de gauche) --- */
/* Bloque le scroll et toute interaction */
body.is-loading {
    overflow: hidden;
}

/* Rien de cliquable pendant le loading */
body.is-loading *,
body.is-loading *::before,
body.is-loading *::after {
    pointer-events: none !important;
}

/* Masque noir entre le contenu et le nom (z-index < 999) */
#loading-mask {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: #000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 700ms ease, visibility 0s linear 700ms;
    /* fade-out in 0.7s */
    pointer-events: none;
    /* don’t block clicks after loading */
}

/* Show quickly during loading */
body.is-loading #loading-mask {
    opacity: 1;
    visibility: visible;
    transition: opacity 120ms ease;
}

/* Pendant le loading: cacher l’overlay droit et la bio */
body.is-loading #text_overlay_container {
    display: none !important;
}

body.is-loading #left_bio {
    display: none !important;
}

body.is-loading .toper__title-group,
body.is-loading .toper__tags,
body.is-loading .toper__splitter {
    display: none !important;
}

body.is-loading .project-footer {
    display: none !important;
}

body.is-loading .project-vertical-rail {
    display: none !important;
}

body.is-loading #cursor_arrow {
    display: none !important;
}

/* Space tokens: preserve width of spaces so they can receive background */
.space {
    white-space: normal;
    transition: background-color .2s ease, color .2s ease, border-radius .2s ease, opacity .2s ease;
    will-change: background-color, color, border-radius, opacity;
    background: transparent;
    color: inherit;
    mix-blend-mode: inherit;
}


/* --- Custom Arrow Cursor (IS-Arzier) --- */
.use-arrow-cursor {
    cursor: none !important;
    /* hide system cursor only on target */
}

#cursor_arrow {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms ease;
    font-family: 'IS-ArzierVF', sans-serif;
    font-weight: 400;
    font-size: 25px;
    /* cursor size */
    line-height: 1.3;
    color: #ffffff;
    mix-blend-mode: difference;
    /* visible on any background without outlines */
    text-shadow: none;
    user-select: none;
    will-change: transform, opacity;
}

#cursor_arrow .cursor-arrow-glyph {
    font-size: 16px;
    /* arrow size */
    vertical-align: middle;
}

#cursor_arrow .cursor-arrow-text {
    font-size: 16px;
    /* see text size */
    margin-left: 4px;
    vertical-align: middle;
}
