/* Luc Borho — portfolio
   Police : Neue Haas Grotesk Text via Adobe Fonts (kit vgt1qpz) (lien use.typekit.net dans le <head> de chaque page).
   Grille : 6 colonnes, marges et gouttières de 20px. Infos sticky sur les colonnes 1–2, visuels sur 3–6. */

:root {
  --m: 20px;                                   /* marge */
  --g: 20px;                                   /* gouttière */
  --col: calc((100vw - 2 * var(--m) - 5 * var(--g)) / 6);
  --lh: 1.45;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #000; color: #fff; }
body {
  font-family: neue-haas-grotesk-text, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 15px;
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: opacity .6s ease; }
a:hover { opacity: .8; }
ul { list-style: none; }

/* ---------- Fondu entre les pages ---------- */
:root { --fade: 500ms; }  /* doit correspondre à FADE dans nav.js */
/* On fond tout SAUF le bloc nom + infos (.top), qui reste fixe */
.head-row, .more, .gallery, .index { animation: fade-in var(--fade) ease both; }
body.leaving .head-row, body.leaving .more,
body.leaving .gallery,
body.leaving .index { animation: fade-out var(--fade) ease forwards; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

/* Vrai crossfade entre les pages (View Transitions — Chrome, Edge, Safari 18.2+, en http/https).
   Les autres navigateurs gardent le fondu par le noir ci-dessus. */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 700ms;
  animation-timing-function: ease;
}
html.vt .head-row, html.vt .more, html.vt .gallery, html.vt .index { animation: none; }
/* Nom + infos perso et navigation du bas : aucun fondu ni mouvement pendant la transition */
.top { view-transition-name: me; }
.pager { view-transition-name: pager; }
::view-transition-group(me), ::view-transition-new(me),
::view-transition-group(pager), ::view-transition-new(pager) { animation: none; }
::view-transition-old(me), ::view-transition-old(pager) { display: none; }

/* Page projet : après le titre, apparition en fondu successive
   1. activité  2. key points  3. lien vers le site */
.sub, .services, .link { animation: fade-in 400ms ease both; }
.sub { animation-delay: 200ms; }
.services { animation-delay: 320ms; }
.link { animation-delay: 440ms; }

@media (prefers-reduced-motion: reduce) {
  .sub, .services, .link { animation: none; }
  .head-row, .more, .gallery, .index,
  body.leaving .head-row, body.leaving .more, body.leaving .gallery, body.leaving .index { animation: none; }
  @view-transition { navigation: none; }
}
img { display: block; width: 100%; height: auto; }
.url { white-space: nowrap; }
.arrow { display: inline-block; width: .6em; height: .6em; margin-left: .3em; vertical-align: .05em; }

/* ---------- Panneau gauche (sticky) ---------- */
.panel {
  position: fixed;
  top: 0; left: var(--m);
  width: calc(2 * var(--col) + var(--g));
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 14px 0 20px;
  z-index: 2;
}
.top, .head-row, .more, .pager {
  display: grid;
  grid-template-columns: var(--col) var(--col);
  column-gap: var(--g);
  align-items: start;
}
.name, .title { font-size: 25px; line-height: 1.2; font-weight: 400; }
.about { padding-top: 5px; }

/* Le haut du titre est toujours à la même hauteur, quelle que soit la longueur des infos */
.info { position: absolute; top: 40vh; left: 0; width: 100%; }
/* Pages projet : nom + infos perso en gris clair */
.project .top, .project .pager { color: rgba(255, 255, 255, .35); }
.head-row { align-items: baseline; }   /* titre et activité alignés sur la ligne de base */
.more > * { grid-column: 2; }
.services { margin: 1.2em 0; }
.services li { position: relative; padding-left: .8em; }
.services li::before { content: "·"; position: absolute; left: 0; }

.pager { align-self: end; }
.counter { grid-column: 1; }   /* compteur en bas à gauche, indication de scroll en colonne 2 */
.home .pager { display: none; }

/* ---------- Visuels (scroll) ---------- */
.gallery {
  margin-left: calc(var(--m) + 2 * var(--col) + 2 * var(--g));
  margin-right: var(--m);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: var(--g);
}
/* Les captures ont une bande noire de 52px sur 2400 (≈2.17% de la largeur) :
   on remonte le 1er visuel pour que le contenu visible démarre à 20px du haut.
   (margin-top en % = relatif à la largeur du conteneur) */
.gallery { padding-top: 0; }
.gallery img:first-child { margin-top: calc(20px - 52 / 2400 * 100%); }
.gallery img.bordered { outline: .5px solid #232323; outline-offset: -.5px; }

/* ---------- Home ---------- */
.home .index {
  position: fixed;
  right: var(--m);
  bottom: 20px;
  text-align: right;
}
.index-label { font-size: 15px; margin-bottom: 10px; }
.index li {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;          /* lien aligné sur le bas du titre */
  gap: 14px;
  font-size: 60px;
  line-height: 1.1;
}
.index .site {
  font-size: 15px;
  line-height: 1;
  opacity: 0;                     /* l'URL n'apparaît qu'au survol de la ligne */
  pointer-events: none;
  transition: opacity .15s ease;   /* disparition rapide en quittant la ligne */
}
.index li:hover .site { opacity: 1; pointer-events: auto; transition-duration: .6s; }

/* Une seule ligne active : la ligne quittée s'éteint vite, la ligne survolée s'allume en douceur */
.index li { transition: opacity .15s ease; }
.index ul:hover li { opacity: .8; }
.index ul:hover li:hover { opacity: 1; transition-duration: .6s; }
.index .name-link:hover { opacity: 1; }

/* Aperçu : 1re image du projet survolé, largeur d'une colonne, colonne 2, aligné en bas */
.index .thumb {
  position: fixed;
  left: calc(var(--m) + var(--col) + var(--g));
  bottom: 20px;
  width: var(--col);
  height: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.index li:hover .thumb { opacity: 1; transition-duration: .6s; }

/* ---------- Curseur Previous / Next (desktop) ---------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  [data-next], [data-next] * { cursor: none; }
  [data-next] a, [data-next] a * { cursor: pointer; }
  .cursor {
    display: block;
    position: fixed; left: 0; top: 0;
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: difference;
    font-size: 25px;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .15s;
  }
  .cursor.on { opacity: 1; }
}

/* ---------- Tablette / mobile : tout s'empile ---------- */
@media (max-width: 1000px) {
  /* Pas de compteur ni de « Scroll down to see more » sur mobile / tablette */
  .pager { display: none !important; }
  /* Bloque le scroll horizontal sur mobile / tablette */
  html, body { overflow-x: hidden; overflow-x: clip; max-width: 100%; }
  body { overscroll-behavior-x: none; touch-action: pan-y pinch-zoom; }
  :root { --col: calc((100vw - 2 * var(--m) - var(--g)) / 2); }
  .panel, .info { display: contents; }
  .top { margin: 0 var(--m); padding-top: 14px; }
  /* Titre + activité collés en haut de l'écran au scroll, sur fond noir */
  .head-row {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #000;
    margin-top: 36px;
    padding: 12px var(--m);
  }
  .more { margin: 0 var(--m) 24px; }
  .services { margin-top: .6em; }
  .gallery { margin: 0 var(--m); padding: 0 0 20px; gap: 10px; }
  .gallery img:first-child { margin-top: 0; }
  .home .index { position: static; text-align: left; margin: 48px var(--m) 80px; }
  .index li { flex-direction: column-reverse; align-items: flex-start; gap: 2px; margin-bottom: 14px; }
  .index .thumb { display: none; }
  .index .site { display: none; }   /* pas d'URL sous les titres sur mobile */
}
@media (max-width: 600px) {
  .url { white-space: normal; overflow-wrap: anywhere; }  /* les longues URL passent à la ligne */
  :root { --m: 12px; --g: 12px; }
  .name, .title { font-size: 22px; }
  .index li { font-size: 40px; }
}

/* ---------- Swipe mobile : le nouveau projet entre par le côté ---------- */
html.swipe-in-next :is(.head-row, .more, .gallery, .index) { animation: slide-in-next .35s ease both; }
html.swipe-in-prev :is(.head-row, .more, .gallery, .index) { animation: slide-in-prev .35s ease both; }
@keyframes slide-in-next { from { transform: translateX(35%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-in-prev { from { transform: translateX(-35%); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html.swipe-in-next :is(.head-row, .more, .gallery, .index),
  html.swipe-in-prev :is(.head-row, .more, .gallery, .index) { animation: none; }
}

/* Fantôme du projet voisin pendant le swipe */
.swipe-ghost {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  z-index: 4;
  background: #000;
}
.swipe-ghost .head-row { position: relative; }
.swipe-ghost * { animation: none !important; }
/* Arrivée après un swipe complet : la page est déjà en place, pas d'animation d'entrée */
html.swipe-in-done :is(.head-row, .more, .gallery, .index, .sub, .services, .link) { animation: none !important; }
@media (min-width: 1001px) { .swipe-ghost { display: none; } }

/* ---------- Écrans tactiles : pas d'effets de survol ---------- */
@media (hover: none) {
  a:hover,
  .index ul:hover li,
  .index ul:hover li:hover,
  .index .name-link:hover { opacity: 1; }
  .index li:hover .site,
  .index li:hover .thumb { opacity: 0; pointer-events: none; }
  a, .index li { transition: none; }
}
