/* Titres : Avenir Next Condensed Ultra Light quand l'appareil l'a (Apple),
   sinon Encode Sans Condensed ExtraLight auto-hébergée (OFL). */
@font-face {
  font-family: "Titre";
  font-weight: 200;
  font-style: normal;
  font-display: swap;
  src: local("AvenirNextCondensed-UltraLight"),
       local("Avenir Next Condensed Ultra Light"),
       url("/fonts/EncodeSansCondensed-ExtraLight.woff2") format("woff2");
}

/* Corps : Geist Mono Regular (OFL). */
@font-face {
  font-family: "Geist Mono";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/GeistMono-Regular.woff2") format("woff2");
}

:root {
  --bg: #fff;
  --fg: #000;
  --line: #000;
  --gutter: clamp(16px, 3.4vw, 72px);
  --line-w: 1.5px;

  /* Maquette A4 paysage : titre 23pt ≈ 2.73 % de la largeur, corps 12pt ≈ 1.43 %. */
  --title-size: clamp(26px, 2.73vw, 60px);
  --body-size: clamp(12px, 1.43vw, 22px);
  --slant: -15deg;

  --font-title: "Titre", "Avenir Next Condensed", sans-serif;
  --font-body: "Geist Mono", ui-monospace, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--body-size)/1.37 var(--font-body);
  padding: var(--gutter);
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Inclinaison type InDesign : cisaillement, pas l'italique synthétique du navigateur. */
.slant {
  display: inline-block;
  transform: skewX(var(--slant));
  transform-origin: 0 100%;
}

.title {
  font: 200 var(--title-size)/1.1 var(--font-title);
  text-transform: uppercase;
  margin: 0;
}

.site-header { position: relative; z-index: 2; width: max-content; max-width: 100%; }
.site-header .title { margin-left: 5.35vw; margin-bottom: 0.25em; }
.bio { margin: 0 0 0.3em; }

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  position: fixed;
  z-index: 2;
  right: var(--gutter);
  bottom: var(--gutter);
  text-align: right;
}
/* Sommaire : 0,75 × la taille du nom. */
.projects .title {
  font-size: calc(var(--title-size) * 0.75);
  line-height: 0.86;
  padding-top: 0.12em;
  transition: color 0.25s ease;
}
.projects a:hover { text-decoration: none; }

/* Scène : plein écran en paysage, dans le flux en portrait. */
.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.stage.is-ready { opacity: 1; }

.cell {
  position: absolute;
  left: 0;
  top: 0;
  /* +line-w : les bordures de deux cases voisines se superposent en un seul trait. */
  width: calc(var(--cell) + var(--line-w));
  height: calc(var(--cell) + var(--line-w));
  margin: calc((var(--cell) + var(--line-w)) / -2) 0 0 calc((var(--cell) + var(--line-w)) / -2);
  border: var(--line-w) solid var(--line);
  background: var(--bg);
  overflow: hidden;
  will-change: transform;
  pointer-events: auto;
}
a.cell { display: block; color: inherit; }
.cell.has-project { cursor: pointer; }
.cell.is-hidden { pointer-events: none; }
/* Visuel qui déborde de sa case (rogné par clip-path dans la grille). */
.cell.has-overflow { overflow: visible; z-index: 2; }
.cell img.overflow { inset: auto; }
.cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.ext-line {
  position: absolute;
  left: 0;
  top: 0;
  height: var(--line-w);
  margin-top: calc(var(--line-w) / -2);
  background: var(--line);
  transform-origin: 0 50%;
}

@media (orientation: portrait) {
  .stage {
    position: relative;
    inset: auto;
    margin: calc(var(--gutter) * 1.5) 0;
  }
  .projects { position: static; }
}

/* ---------- Pages projet ---------- */

body.project { padding: 0; }

.home-link {
  position: fixed;
  z-index: 10;
  top: var(--gutter);
  left: calc(var(--gutter) + 5.35vw);
  display: block;
}
.home-link:hover { text-decoration: none; }

.page { position: relative; width: 100%; overflow: hidden; }

.artboard {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.pg-el { position: absolute; }
.pg-image { overflow: hidden; }
.pg-image img {
  position: absolute;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}
.pg-text-inner {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  transform-origin: 0 100%;
}
.pg-link { position: absolute; inset: 0; }

.not-found { padding: calc(var(--gutter) * 4) var(--gutter); }
