/* Portfolio — rebranding « archipel » : crème et noir, Righteous pour les titres, Kablammo pour le
   monogramme, Archivo et IBM Plex Mono pour le reste. Polices hébergées sur le site (licence OFL). */
@font-face { font-family: "Kablammo TM"; font-display: block; src: url("../fonts/kablammo-tm.woff2") format("woff2"); }
@font-face { font-family: "Righteous"; font-weight: 400; font-display: swap; src: url("../fonts/righteous-latin-400-normal.woff2") format("woff2"); }
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-standard-normal.woff2") format("woff2-variations"), url("../fonts/archivo-latin-standard-normal.woff2") format("woff2");
}
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --cream: #f2efe6; --ink: #121110;
  --bg: var(--cream); --fg: var(--ink); --mute: #77736b; --hair: rgb(18 17 16 / .16);
  --ile: #1d1c1a; --ile-fg: #f2efe6;          /* îles sombres sur une mer crème */
  --display: "Righteous", "Archivo", sans-serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --pad: clamp(18px, 3.4vw, 48px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: var(--ink); --fg: var(--cream); --mute: #9a958b; --hair: rgb(242 239 230 / .16); --ile: #e8e4d9; --ile-fg: #121110; color-scheme: dark; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 1.0625rem/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--pad); top: -60px; z-index: 60; background: var(--fg); color: var(--bg); padding: 10px 14px; font: 500 .8rem var(--mono); }
.skip:focus { top: 12px; }
.label, .meta, .status, .scroll-hint, .archipel-titre, .menu-btn, .langues, .foot, .side-tab {
  font: 500 .75rem/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase;
}

/* --- Lenis (défilement doux) ------------------------------------------------------------- */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }

/* --- En-tête : lisible sur le noir comme sur le crème (mélange « différence ») ------------- */
.top {
  position: fixed; inset: 0 0 auto; z-index: 47; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px var(--pad); color: #f2efe6; mix-blend-mode: difference; pointer-events: none;
}
.top > * { pointer-events: auto; }
.mark { font: 400 1.35rem/1 var(--display); text-decoration: none; letter-spacing: .01em; justify-self: start; }
.status { display: flex; gap: .6em; }
.status .sep { opacity: .5; }
.top-droite { justify-self: end; display: flex; align-items: center; gap: clamp(16px, 2.2vw, 30px); }
.menu-btn { padding: 8px 0; }
/* Choix de la langue : la langue affichée est pleine, l'autre en retrait. */
.langues { display: flex; gap: .45em; }
.langues a { text-decoration: none; opacity: .45; padding: 8px 0; }
.langues a[aria-current] { opacity: 1; }
.langues a:hover { opacity: 1; text-decoration: underline; }
.langues span { opacity: .45; padding: 8px 0; }
.menu-btn:hover, .mark:hover { text-decoration: underline; }
@media (max-width: 700px) { .status { display: none; } .top { grid-template-columns: 1fr auto; } }

/* Onglet vertical collé à droite (vers Recto) */
.side-tab {
  position: fixed; right: 0; top: 50%; z-index: 35; transform: translateY(-50%); writing-mode: vertical-rl;
  background: var(--fg); color: var(--bg); padding: 16px 9px; text-decoration: none; letter-spacing: .1em;
  transition: padding .2s ease;
}
.side-tab:hover { padding-right: 14px; }
@media (max-width: 700px) { .side-tab { display: none; } }

/* --- Menu plein écran ------------------------------------------------------------------------ */
.menu {
  position: fixed; inset: 0; z-index: 45; background: var(--ink); color: var(--cream);
  display: grid; align-content: center; padding: 90px var(--pad) 40px;
}
.menu-links { list-style: none; padding: 0; display: grid; gap: clamp(4px, 1.2vh, 14px); }
.menu-links a { display: flex; align-items: baseline; gap: 18px; font: 400 clamp(2.6rem, 8.5vw, 7rem)/1 var(--display); text-decoration: none; }
.menu-links a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .12em; }
.menu-links .n { font: 500 .8rem var(--mono); letter-spacing: .08em; opacity: .55; }
.menu-links .arrow { font-size: .5em; }
.menu-foot { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 48px; font: 500 .85rem var(--mono); letter-spacing: .05em; }
@media (prefers-color-scheme: dark) { .menu { background: var(--cream); color: var(--ink); } }

/* --- Écran d'ouverture : noir, monogramme géant qui ondule ---------------------------------- */
.ouverture {
  position: relative; z-index: 20; height: 100svh; min-height: 520px; background: var(--ink); color: var(--cream);
  display: grid; place-items: center; overflow: hidden;
}
.tm {
  font: 400 min(62vh, 52vw)/.8 "Kablammo TM", var(--display); letter-spacing: -.02em; user-select: none;
  animation: ondule 6s linear infinite; will-change: transform;
}
/* L'axe « MORF » de Kablammo est une boucle : 0 et 60 sont la même forme. */
@keyframes ondule { from { font-variation-settings: "MORF" 0; } to { font-variation-settings: "MORF" 60; } }
.manifeste {
  position: absolute; left: 50%; bottom: clamp(70px, 12vh, 120px); transform: translateX(-50%); width: min(92vw, 34ch);
  text-align: center; font: 400 clamp(1rem, 1.6vw, 1.25rem)/1.35 var(--sans);
}
.scroll-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); opacity: .7; }
.scroll-hint::after { content: " ↓"; }
@media (prefers-color-scheme: dark) { .ouverture { background: var(--cream); color: var(--ink); } }
/* Avec JavaScript : l'ouverture recouvre l'archipel et se referme en cercle au défilement. */
html.ouverture-fixe .ouverture { position: fixed; inset: 0; height: auto; z-index: 30; cursor: pointer; }

/* --- L'archipel : toutes les îles dans un écran ------------------------------------------------ */
.archipel { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: var(--bg); }
.archipel-titre { position: absolute; left: var(--pad); top: 76px; z-index: 5; }
.archipel-titre .count { opacity: .55; }
.monde { position: absolute; inset: 0; }

/* Sur ordinateur, le JS donne à chaque île sa taille et sa position (elles respirent et se poussent). */
.ile { position: absolute; left: 0; top: 0; display: block; text-decoration: none; color: var(--fg); transform-origin: 50% 50%; will-change: transform; -webkit-tap-highlight-color: transparent; }
.ile.active { z-index: 2; }
.ile svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ile .fond { fill: var(--ile); }
/* Pas de légende sous les îles : le nom suit le curseur (et apparaît au clavier). */
.ile-nom, .ile-meta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ile-nom { font: 400 clamp(1.1rem, 1.6vw, 1.7rem)/1 var(--display); }
.ile-meta { font: 500 .68rem/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--mute); }
.ile:focus-visible { outline: none; }
.ile:focus-visible .ile-nom {
  width: auto; height: auto; clip-path: none; left: 50%; top: 50%; translate: -50% -50%;
  background: var(--fg); color: var(--bg); padding: 10px 16px 9px; border-radius: 999px;
}
@media (min-width: 761px) { html.js .archipel-titre { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }

/* Sans JavaScript (ou avant le chargement) : les projets en liste lisible. */
.projets { position: relative; z-index: 2; padding: 130px var(--pad) 60px; display: grid; gap: 56px; max-width: 1100px; }
.projet h3 { font: 400 clamp(2rem, 5vw, 3.6rem)/1 var(--display); }
.projet .meta, .fiche-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--mute); margin-top: 10px; }
.projet figure { margin: 18px 0; background: var(--ile); border-radius: 46% 54% 42% 58% / 52% 44% 56% 48%; overflow: hidden; max-width: 640px; }
.projet .desc, .fiche-corps .desc { font-size: 1.15rem; max-width: 46ch; }
.points { padding-left: 1.1em; margin-top: 12px; color: var(--mute); max-width: 56ch; }
.points li + li { margin-top: 6px; }
.links { display: flex; gap: 12px 16px; flex-wrap: wrap; margin-top: 22px; }
.links a { font: 500 .78rem/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; text-decoration: none; padding: 10px 16px; border: 1px solid currentColor; border-radius: 999px; }
.links a::after { content: " ↗"; }
.links a[href^="/"]::after, .links a[href^="#"]::after, .links a[href^="mailto:"]::after { content: " →"; }
.links a:hover { background: var(--fg); color: var(--bg); }
/* Avec JavaScript : les fiches restent dans la page (lecteurs d'écran, moteurs) mais l'archipel les montre. */
html.js .archipel .projets { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); padding: 0; }
html:not(.js) .archipel { height: auto; overflow: visible; }
html:not(.js) .monde { display: none; }

/* --- Fiche d'un projet (s'ouvre depuis son île) ------------------------------------------------ */
.fiche {
  position: fixed; inset: 0; z-index: 50; background: var(--bg); color: var(--fg); overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 70px); align-items: center;
  padding: 90px calc(var(--pad) + 30px) 96px var(--pad);
}
.fiche-ile svg { width: 100%; height: auto; overflow: visible; }
.fiche-ile .fond { fill: var(--ile); }
.fiche-n { font: 500 .8rem var(--mono); letter-spacing: .08em; color: var(--mute); }
.fiche-titre { font: 400 clamp(2.6rem, 6vw, 5.6rem)/.95 var(--display); margin-top: 8px; }
.fiche-corps { margin-top: 26px; }
.fiche-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center;
  padding: 16px var(--pad); background: linear-gradient(transparent, var(--bg) 40%);
}
.fiche-nav button { font: 500 .75rem/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; padding: 10px 14px; border-radius: 999px; }
.fiche-nav button:hover { background: var(--fg); color: var(--bg); }
.fiche-fermer { border: 1px solid currentColor; }
@media (max-width: 860px) {
  .fiche { grid-template-columns: 1fr; align-items: start; padding: 80px var(--pad) 96px; }
  .fiche-ile { width: min(100%, 520px); justify-self: center; }
}

/* --- À propos ---------------------------------------------------------------------------------- */
.apropos { padding: clamp(90px, 16vh, 180px) var(--pad); border-top: 1px solid var(--hair); }
.statement { font: 500 clamp(1.8rem, 4.6vw, 4rem)/1.08 var(--sans); font-stretch: 92%; letter-spacing: -.02em; max-width: 22ch; margin-top: 22px; }
html.js .statement .mot { opacity: .16; }
.outils { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin-top: clamp(60px, 10vh, 110px); }
.outils dt { font: 500 .72rem var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--mute); padding-bottom: 10px; border-bottom: 1px solid var(--hair); margin-bottom: 12px; }
.outils dd { font: 400 1.1rem/1.6 var(--display); }
@media (max-width: 760px) { .outils { grid-template-columns: 1fr 1fr; } }

/* --- Contact : retour au noir ------------------------------------------------------------------- */
.contact { background: var(--ink); color: var(--cream); padding: clamp(90px, 16vh, 170px) var(--pad); display: grid; gap: 26px; }
.contact-titre { font: 400 clamp(2.8rem, 9vw, 8.5rem)/.92 var(--display); max-width: 12ch; }
.mail { font: 500 clamp(1.2rem, 3vw, 2.2rem)/1.2 var(--sans); justify-self: start; }
.contact .links a:hover { background: var(--cream); color: var(--ink); }
@media (prefers-color-scheme: dark) { .contact { background: var(--cream); color: var(--ink); } .contact .links a:hover { background: var(--ink); color: var(--cream); } }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px var(--pad) 28px; background: var(--ink); color: rgb(242 239 230 / .6); }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--cream); }
@media (prefers-color-scheme: dark) { .foot { background: var(--cream); color: rgb(18 17 16 / .6); } .foot a:hover { color: var(--ink); } }

/* --- Téléphone : les îles en colonne, avec leur nom ---------------------------------------------- */
@media (max-width: 760px) {
  html.js .archipel { height: auto; overflow: visible; padding: 120px 0 70px; }
  html.js .monde { position: relative; inset: auto; display: grid; gap: 54px; padding: 0 var(--pad); }
  html.js .ile { position: relative; display: grid; justify-items: center; gap: 10px; width: min(78vw, 360px); justify-self: start; will-change: auto; }
  html.js .ile:nth-child(even) { justify-self: end; }
  html.js .ile svg { height: auto; }
  html.js .ile-nom, html.js .ile-meta { position: static; width: auto; height: auto; clip-path: none; }
  html.js .ile:focus-visible .ile-nom { translate: none; }
}

/* --- Curseur : disque qui inverse ce qu'il survole (souris uniquement) ------------------------- */
html.custom-cursor, html.custom-cursor * { cursor: none !important; }
.cursor {
  position: fixed; left: 0; top: 0; z-index: 100; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: #fff; mix-blend-mode: difference; pointer-events: none; opacity: 0;
  transition: width .2s ease, height .2s ease, margin .2s ease, opacity .2s ease; will-change: transform;
}
.cursor.on { opacity: 1; }
.cursor.big { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
.cursor.down { width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; }
.cursor.big.down { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
.cursor-nom {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; display: flex; align-items: baseline; gap: 10px;
  padding: 10px 15px 9px; border-radius: 999px; background: var(--fg); color: var(--bg); white-space: nowrap;
  font: 400 1.05rem/1 var(--display); opacity: 0; scale: .85; transition: opacity .18s ease, scale .18s ease; will-change: transform;
}
.cursor-nom.on { opacity: 1; scale: 1; }
.cursor-nom small { font: 500 .62rem/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; opacity: .7; }

@media (prefers-reduced-motion: reduce) {
  .tm { animation: none; font-variation-settings: "MORF" 18; }
  .cursor, .cursor-nom, .side-tab { transition: none; }
}

/* --- Page introuvable (404), en français et en anglais ------------------------------------------ */
.introuvable { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 90px var(--pad); text-align: center; }
.introuvable h1 { font: 400 clamp(6rem, 26vw, 18rem)/.85 var(--display); }
.introuvable p { font: 500 .8rem/1.6 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--mute); }
.introuvable .links { justify-content: center; }
