/* ===========================================================================
   Portfolio Thomas Sak — feuille de style unique.

   TYPOGRAPHIE DES TITRES
   Pour en changer : remplace la valeur de --font-display ci-dessous, ET le lien
   Google Fonts dans le <head> de chaque page HTML (utilise « Rechercher /
   Remplacer dans tous les fichiers » de ton éditeur).

     Playfair Display  ->  family=Playfair+Display:ital,wght@0,400;0,500;1,400
     Cormorant Garamond -> family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300
     Jost              ->  family=Jost:wght@300;400
   =========================================================================== */

:root {
  --paper: #FBFAF7;   /* fond */
  --ash:   #F1EFE9;   /* fond des images en attente */
  --line:  #E8E5DE;   /* filets */
  --ink:   #1C1C1A;   /* texte principal */
  --muted: #6E6B64;   /* texte secondaire */

  --font-display: 'Playfair Display', Georgia, serif;
  --dw: 400;          /* graisse des titres — 300 pour Jost */
  --dt: -0.015em;     /* espacement des titres — 0.08em pour Jost */
  --dc: none;         /* casse des titres — uppercase pour Jost */
  --ds: 1;            /* taille des titres — 1.12 pour Cormorant, 0.86 pour Jost */

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Site en une seule page : les liens de l'en-tête sont des ancres.
   Le défilement est doux, et chaque section réserve la hauteur de la barre
   collante au-dessus d'elle pour ne pas se retrouver cachée dessous. */
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 5.5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p, figure, dl, dd { margin: 0; }
a { color: inherit; }
img, video { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.skip {
  position: absolute; left: -9999px;
}
.skip:focus {
  position: fixed; left: 1rem; top: 1rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .75rem 1.25rem;
  font-size: 14px; text-decoration: none;
}

/* ─────────── typographie ─────────── */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--dw);
  letter-spacing: var(--dt);
  text-transform: var(--dc);
  margin: 0;
  text-wrap: balance;
}

.h-xl { font-size: calc(clamp(2.6rem, 6vw, 4.75rem) * var(--ds)); line-height: 1.03; }
.h-lg { font-size: calc(clamp(1.9rem, 3.6vw, 2.85rem) * var(--ds)); line-height: 1.08; }
.h-md { font-size: calc(clamp(1.4rem, 2.2vw, 1.9rem) * var(--ds)); line-height: 1.15; }
.h-sm { font-size: calc(clamp(1.15rem, 1.6vw, 1.4rem) * var(--ds)); line-height: 1.2; }
.it { font-style: italic; }

.lead { font-size: clamp(1.1rem, 1.4vw, 1.28rem); line-height: 1.6; max-width: 62ch; }
.body-text { font-size: 17px; line-height: 1.75; max-width: 62ch; }
.muted { color: var(--muted); }
.sm { font-size: 15px; }
.label {
  font-size: 11px; font-weight: 500; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
.droite { text-align: right; }

.lead + .body-text, .body-text + .body-text { margin-top: 1.25rem; }

/* Respiration entre un grand titre et le texte qui le suit */
.h-xl + .lead, .h-xl + .body-text { margin-top: 2.5rem; }
.h-lg + .lead, .h-lg + .body-text,
.h-md + .lead, .h-md + .body-text { margin-top: 1.5rem; }
.label + .h-xl { margin-top: 1rem; }
.sous-titre { margin-top: 1.25rem; color: var(--muted); }

/* ─────────── structure ─────────── */

/* Largeur du contenu. Elle suit l'écran au lieu d'être figée :
   — petit écran  : toute la largeur disponible ;
   — jusqu'à 1440 px : comme avant ;
   — au-delà : 92 % de l'écran, donc les blocs s'écartent sur grand moniteur ;
   — plafonnée à 1800 px pour que les lignes de texte restent lisibles. */
.shell, .shell-large {
  max-width: min(100%, max(1440px, 92vw), 1800px);
  margin: 0 auto;
  padding-inline: clamp(1.5rem, 4vw, 2.5rem);
}

.profil  { padding-top: clamp(3rem, 6vw, 5rem); }
.bloc    { margin-top: clamp(4.5rem, 9vw, 8rem); }
.bloc-s  { margin-top: clamp(2.5rem, 5vw, 4rem); }

.grid12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3.5rem; }
.c4 { grid-column: span 4; }
.c5 { grid-column: span 5; }
.c7 { grid-column: span 7; }
.offset { grid-column: 9 / span 4; }
.vcenter { display: flex; flex-direction: column; justify-content: center; }

@media (max-width: 860px) {
  .grid12 { grid-template-columns: 1fr; gap: 2.5rem; }
  .c4, .c5, .c7, .offset { grid-column: auto; }
}

/* ─────────── en-tête ─────────── */

.bar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, .95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.bar .in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; padding-block: 1.15rem;
}
.brand {
  font-family: var(--font-display); font-weight: var(--dw);
  font-size: calc(1.35rem * var(--ds)); letter-spacing: var(--dt);
  text-transform: var(--dc); text-decoration: none;
}
.bar nav ul { display: flex; gap: 2.25rem; }
.bar nav a {
  position: relative; font-size: 15px; text-decoration: none;
  color: var(--muted); padding-bottom: .25rem; transition: color .3s;
}
.bar nav a:hover { color: var(--ink); }
.bar nav a.is-active { color: var(--ink); }
.bar nav a.is-active::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--ink);
}

.menu-btn {
  display: none; background: none; border: 0; font-family: inherit;
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); cursor: pointer; padding: .25rem;
}

@media (max-width: 640px) {
  .menu-btn { display: block; }
  .bar .in { flex-wrap: wrap; }
  .bar nav { display: none; width: 100%; }
  .bar nav.ouvert { display: block; }
  .bar nav ul { flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
  .bar nav li { border-bottom: 1px solid var(--line); }
  .bar nav li:last-child { border-bottom: 0; }
  .bar nav a { display: block; padding: 1rem 0; font-size: 17px; }
  .bar nav a.is-active::after { display: none; }
  .bar nav a.is-active { color: var(--ink); font-weight: 500; }
}

/* ─────────── liens et boutons ─────────── */

.btns { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ink); padding: .8rem 1.75rem;
  font-size: 14px; text-decoration: none;
  transition: background-color .3s, color .3s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-q { border-color: var(--line); }
.btn-q:hover { background: transparent; color: var(--ink); border-color: var(--ink); }

.lk { position: relative; display: inline-block; text-decoration: none; }
.lk::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px; background: var(--line);
  transition: background-color .4s;
}
.lk:hover::after { background: var(--ink); }

.trait { border-bottom: 1px solid var(--line); padding-bottom: 1.25rem; }

/* ─────────── médias ─────────── */

.media { position: relative; background: var(--ash); overflow: hidden; }
.media img, .media video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1s var(--ease);
}
.media .ph {
  display: none; position: absolute; inset: 0;
  flex-direction: column; align-items: center; justify-content: center;
  gap: .4rem; text-align: center; padding: 1rem;
  border: 1px dashed var(--line); background: var(--ash);
}
.media .ph code {
  font-family: Inter, sans-serif; font-size: 12px;
  color: var(--muted); word-break: break-all;
}
.media.manquant .ph { display: flex; }
.media.manquant img, .media.manquant video { visibility: hidden; }

.r-1x1  { aspect-ratio: 1/1; }
.r-2x3  { aspect-ratio: 2/3; }   /* format appareil photo, portrait */
.r-4x5  { aspect-ratio: 4/5; }
.r-3x4  { aspect-ratio: 3/4; }
.r-4x3  { aspect-ratio: 4/3; }
.r-3x2  { aspect-ratio: 3/2; }
.r-16x9 { aspect-ratio: 16/9; }

/* Mode « libre » : l'image n'est pas recadrée, elle garde ses proportions.
   Le format de la classe ne sert plus qu'au cadre d'attente si le fichier manque. */
.media.libre:not(.manquant) { aspect-ratio: auto; }
.media.libre img, .media.libre video { height: auto; object-fit: contain; }

/* La couverture d'une page projet ne dépasse pas la hauteur de l'écran */
.couv .media img, .couv .media video { max-height: 78vh; width: auto; margin-inline: auto; }
.couv .media.libre:not(.manquant) { display: flex; justify-content: center; }

/* Vidéo YouTube / Vimeo */
.embed { position: relative; aspect-ratio: 16/9; background: var(--ink); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Format vertical (Shorts, Reels) : 9:16, largeur limitée, centré */
.embed.vertical {
  aspect-ratio: 9/16;
  max-width: min(420px, 100%);
  max-height: 80vh;
  margin-inline: auto;
}
.embed.vertical + figcaption { text-align: center; }

/* La même vidéo verticale, mais placée dans une colonne à côté du texte :
   elle est poussée vers la droite de la page, avec de l'air entre elle et
   le texte. La légende reste alignée sur le bord gauche de la vidéo. */
.embed.vertical.colonne { margin-inline: 0; max-width: 100%; max-height: 72vh; }
.embed.vertical.colonne + figcaption { text-align: left; margin-top: 1rem; }

.col-video { grid-column: 9 / span 4; }
.col-video figure { margin-left: auto; width: min(400px, 100%); }
@media (max-width: 1200px) { .col-video { grid-column: 8 / span 5; } }
@media (max-width: 860px)  { .col-video { grid-column: auto; }
                             .col-video figure { margin-left: 0; } }

/* ─────────── vignettes projets ─────────── */

/* L'écart entre les vignettes grandit avec l'écran, il n'est pas figé. */
.cards {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(3.5rem, 6vw, 6.5rem) clamp(2rem, 4vw, 5rem);
  margin-top: 3rem;
}
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; gap: 3.5rem; } }

.card a { text-decoration: none; display: block; }
.card a:hover .media img, .card a:hover .media video { transform: scale(1.03); }
.card-t {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1.5rem; margin-top: 1.25rem;
}
.card .sm { margin-top: .25rem; }
.card .body-text { margin-top: .75rem; font-size: 16px; }
.card .see { margin-top: 1.25rem; font-size: 14px; }
.card .arw { display: inline-block; margin-left: .5rem; transition: transform .5s var(--ease); }
.card a:hover .arw { transform: translateX(4px); }

.titre-rang {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: baseline; gap: .5rem 2rem;
  border-bottom: 1px solid var(--line); padding-bottom: 1.25rem;
}

/* ─────────── mots-clés qui défilent ─────────── */

.marquee {
  overflow: hidden; border-block: 1px solid var(--line);
  padding-block: 1.75rem; margin-top: clamp(4.5rem, 9vw, 8rem);
}
.mq-track {
  display: flex; width: max-content; align-items: center; gap: 3rem;
  animation: defile 45s linear infinite;
}
.mq-i { display: flex; align-items: center; gap: 3rem; }
.mq-i .h-md { white-space: nowrap; color: rgba(28, 28, 26, .8); }
.dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(110, 107, 100, .5); }

@keyframes defile { to { transform: translateX(-50%); } }

/* ─────────── bandeau de photographies ─────────── */

/* La hauteur du bandeau est fixe ; la largeur de chaque photo en découle,
   calculée explicitement à partir de son format.

   Pourquoi ne pas se contenter de `aspect-ratio` sur les <li> : la piste est
   en `width: max-content`, et dans cette passe de calcul le navigateur ne
   connaît pas encore la hauteur. Une largeur déduite d'un aspect-ratio y vaut
   alors zéro dès que le contenu n'a plus de largeur propre — c'est-à-dire dès
   que les vraies photos remplacent les cadres d'attente, et le bandeau
   disparaît. Des largeurs en `calc()` suppriment cette dépendance circulaire. */

.strip { --h: clamp(240px, 32vw, 420px); overflow: hidden; width: 100%; margin-top: 2.5rem; }
.strip ul {
  display: flex; width: max-content; gap: 1rem; align-items: flex-start;
  height: var(--h);
  animation: defile 70s linear infinite;
}
/* Le bandeau ne s'arrête jamais : pas de pause au survol. */

.strip li { flex: none; height: var(--h); }
.strip li.r-2x3  { width: calc(var(--h) * 2 / 3); }
.strip li.r-3x4  { width: calc(var(--h) * 3 / 4); }
.strip li.r-4x5  { width: calc(var(--h) * 4 / 5); }
.strip li.r-1x1  { width: var(--h); }
.strip li.r-4x3  { width: calc(var(--h) * 4 / 3); }
.strip li.r-3x2  { width: calc(var(--h) * 3 / 2); }
.strip li.r-16x9 { width: calc(var(--h) * 16 / 9); }

/* Le cadre intérieur suit son <li> : c'est lui qui porte le format. */
.strip li .media { width: 100%; height: 100%; aspect-ratio: auto; }

/* ─────────── page projet ─────────── */

/* Mise en page « vidéo verticale » : titre et texte à gauche, vidéo à droite.
   Les deux colonnes démarrent en haut et se remplissent l'une l'autre. */
.projet-video { padding-top: clamp(2.5rem, 5vw, 4rem); }
.projet-video .grid12 { margin-top: 2rem; align-items: start; gap: 4.5rem; }
.projet-video .h-xl { margin-bottom: 1rem; }
.projet-video .sous { margin-bottom: 2.5rem; }
.projet-video .lead + .body-text { margin-top: 1.5rem; }

/* Texte de projet un cran plus grand : les pages respirent moins dans le vide */
.body-text.grand { font-size: 18px; line-height: 1.7; }
.projet-video .lead { max-width: 52ch; }

/* La vidéo reste visible pendant qu'on lit, sur grand écran */
@media (min-width: 1100px) {
  .col-video { position: sticky; top: 6rem; }
}

/* Fiche technique en ligne, sous le texte (pages avec vidéo verticale) */
.fiche {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
  border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1.5rem;
}
.fiche dd { margin-top: .5rem; font-size: 16px; }
@media (max-width: 600px) { .fiche { grid-template-columns: 1fr; gap: 1.25rem; } }

.meta { border-top: 1px solid var(--line); padding-block: 1.25rem; }
.meta:first-child { border-top: 0; padding-top: 0; }
.meta p + p { margin-top: .5rem; font-size: 16px; }

.figs { display: flex; flex-direction: column; gap: 3.5rem; margin-top: 1rem; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 720px) { .trio { grid-template-columns: 1fr; gap: 1rem; } }

/* Deux médias côte à côte (ex. deux vidéos verticales), l'un sous l'autre sur mobile */
.duo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem; align-items: start; }
@media (max-width: 720px) { .duo { grid-template-columns: 1fr; gap: 3rem; } }
.figs figcaption { margin-top: 1rem; }

.voisins {
  display: flex; justify-content: space-between; gap: 2rem;
  border-top: 1px solid var(--line); padding-top: 2rem; margin-top: 2rem;
}
.voisins a { text-decoration: none; }
.voisins .h-sm { display: block; margin-top: .5rem; }
.voisins .droite { text-align: right; }

/* ─────────── contact ─────────── */

.dl { margin-top: 3rem; max-width: 42rem; }
.dl > div { border-top: 1px solid var(--line); padding-block: 2rem; }
.dl > div:last-child { border-bottom: 1px solid var(--line); }
.dl dd { margin-top: .75rem; }
.dl a { word-break: break-word; }

/* ─────────── pied de page ─────────── */

footer { border-top: 1px solid var(--line); margin-top: clamp(4.5rem, 9vw, 8rem); }
.foot {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 1rem 2rem; padding-block: 2rem;
}
.foot-liens { display: flex; gap: 1.75rem; }
.foot-liens a {
  font-size: 14px; text-decoration: none; color: var(--muted); transition: color .3s;
}
.foot-liens a:hover { color: var(--ink); }

/* ─────────── accessibilité ─────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .mq-track, .strip ul { animation: none; }
  .strip { overflow-x: auto; }
  html { scroll-behavior: auto; }
}
