/* Valley3D - feuille de style (13/10/2026)
   Galerie sombre, mobile d'abord. Polices auto-hébergées (OFL).
   Formes : cadres d'œuvres à angles vifs, commandes interactives en pilule. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url(/assets/cormorant-garamond-latin-500-normal.8197bf5361.woff2) format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url(/assets/cormorant-garamond-latin-500-italic.4fb55a7a6d.woff2) format("woff2");
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url(/assets/cormorant-garamond-latin-600-normal.ae062b6d5a.woff2) format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url(/assets/manrope-latin-400-normal.849290ef12.woff2) format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url(/assets/manrope-latin-600-normal.f7ac6258da.woff2) format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --fond: #0f0f10;
  --surface: #18181a;
  --surface-2: #202023;
  --texte: #ecebe8;
  --doux: #a3a19c;
  --trait: rgb(236 235 232 / 0.12);
  --accent: #b9c6d3;           /* gris acier : focus et état actif, seule couleur d'accent */
  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --marge: 16px;
  --gouttiere: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
@media (min-width: 700px)  { :root { --marge: 32px; --gouttiere: 20px; } }
@media (min-width: 1100px) { :root { --marge: 56px; --gouttiere: 28px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.verrou { overflow: hidden; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  color: var(--texte);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.icone { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; flex: none; }

.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.evitement {
  position: absolute; left: var(--marge); top: -100px; z-index: 30;
  background: var(--texte); color: var(--fond); padding: 10px 16px; border-radius: 999px;
  text-decoration: none; font-weight: 600;
}
.evitement:focus { top: 12px; }

/* ------------------------------------------------------------------ en-tête */
.entete {
  padding: max(14px, env(safe-area-inset-top)) var(--marge) 0;
  max-width: 1600px; width: 100%; margin: 0 auto;
}
.entete__barre {
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  min-height: 44px;
}
/* --t : taille du titre ; --jambage : profondeur des jambages (y, 3) sous la boîte du titre, mesurée = 0,145 × --t.
   Espace en-tête -> grille = 1,5 × l'ancien (28-64 px) : clamp(42px, 7.5vw, 96px). */
.entete__texte {
  --t: clamp(3.6rem, 17vw, 9.5rem);
  --jambage: calc(var(--t) * 0.145);
  /* haut : 30 % d'espace en moins au-dessus du titre (barre 14 + 44 px comprise) */
  padding: calc(clamp(28px, 7vw, 88px) * 0.7 - 17.4px) 0 clamp(42px, 7.5vw, 96px);
}
.titre {
  margin: 0;
  font: 500 var(--t)/0.9 var(--serif);
  letter-spacing: -0.02em;
}
.titre__3d { font-style: italic; color: var(--doux); margin-left: 0.04em; }
/* « .art » : pastille arc-en-ciel (nuancier de « art », fixe, taille d'un point de « art ») posée sur la ligne de base,
   puis une lettre par couleur primaire en dégradé vertical clair -> profond.
   Teintes recalculées en OKLCH pour une luminance perçue identique (L 0.78 en haut, 0.58 en bas). */
.titre, .marque { white-space: nowrap; }
.titre__point {
  /* dans .titre__art : 1em = taille de « art » ; espacement d'un point typographique normal */
  display: inline-block; width: 0.13em; height: 0.13em; border-radius: 50%;
  margin: 0 0.05em 0 0.04em; vertical-align: baseline;
  background: conic-gradient(#b8323f, #e07a3f, #c9952b, #5e9e6e, #2a5db0, #4b4aa8, #7a4fa0, #b8323f);
}
/* « .art » : 46,2 % de la taille de « Valley3D » (33 % + 40 %), sur la même ligne de base */
.titre__art { font-size: 0.462em; vertical-align: baseline; }
/* Arrêts à 40 % / 78 % de la boîte : le dégradé couvre la hauteur réelle des lettres (x-height -> ligne de base) */
.titre__a, .titre__r, .titre__t {
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.titre__a { background-image: linear-gradient(180deg, #fe949b 40%, #cb454e 78%); }
.titre__r { background-image: linear-gradient(180deg, #d4b45c 40%, #9f7100 78%); }
.titre__t { background-image: linear-gradient(180deg, #8fb9fa 40%, #4478ce 78%); }
/* Accroche : une seule phrase discrète sous le titre (gris clair, taille du texte courant) */
.accroche {
  margin: 20px 0 0;
  color: #c4c2bd;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
/* Desktop : à droite du titre, alignée en bas, sur 2 lignes équilibrées */
@media (min-width: 900px) {
  .entete__texte {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 48px;
    /* mention hors flux en desktop (l'accroche ne bouge pas) et logée au-dessus des jambages :
       le bas de l'en-tête est l'encre des jambages, l'espace jusqu'à la grille reste 1,5 × l'ancien */
    padding-bottom: calc(var(--jambage) + 1.5 * (clamp(28px, 5vw, 64px) - var(--jambage)));
  }
  .titre-bloc { position: relative; }
  .titre-bloc .titre__mention { position: absolute; left: 0; top: 100%; font-size: 0.8rem; white-space: nowrap; }
  .accroche { margin: 0 0 1.1em; max-width: 46ch; text-align: right; flex: 0 1 auto; }
}

/* « Impression depuis 2021 » : sous le « V » (sans jambage), haut de l'encre à 0,5 rem de sa ligne de base.
   0,14 × --t = ligne de base -> bas de la boîte du titre ; 0,19em = blanc au-dessus de l'encre de la mention.
   -0,67 px : alignement optique sur le bord visible du « V » (mesuré au pixel en DPR 3). */
.titre__mention {
  margin: calc(0.5rem - 0.19em - var(--t) * 0.14) 0 0 -0.67px;
  font: italic 500 0.7rem/1.3 var(--serif);
  letter-spacing: 0.08em;
  color: #8c8a86;          /* gris de la famille du dégradé, plus atténué que « 3D » (#a3a19c) */
}

.marque { font: 600 1.6rem/1 var(--serif); text-decoration: none; letter-spacing: -0.01em; }
.entete--court .entete__barre { justify-content: space-between; padding-bottom: 12px;
  border-bottom: 1px solid var(--trait); }
.retour { color: var(--doux); font-size: 0.92rem; text-decoration: none; padding: 10px 0; }
.retour:hover { color: var(--texte); }

.bouton-tiktok, .bouton {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--trait); border-radius: 999px;
  text-decoration: none; font-size: 0.92rem; font-weight: 600; letter-spacing: 0.01em;
  transition: background-color .25s var(--ease), border-color .25s var(--ease), transform .15s var(--ease);
}
.bouton-tiktok:hover, .bouton:hover { background: var(--surface-2); border-color: rgb(236 235 232 / 0.28); }
.bouton-tiktok:active, .bouton:active { transform: scale(0.98); }

/* ------------------------------------------------------------------ filtres */
.oeuvres { flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; padding: 0 var(--marge); }
.filtres {
  position: sticky; top: 0; z-index: 5;
  margin: 0 calc(var(--marge) * -1) clamp(16px, 3vw, 32px);
  padding: 10px var(--marge);
  background: rgb(15 15 16 / 0.86);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.filtres.colle { border-bottom-color: var(--trait); }
.filtres__rail {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.filtres__rail::-webkit-scrollbar { display: none; }
.filtre {
  flex: none; scroll-snap-align: start;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--trait); border-radius: 999px; background: transparent;
  color: var(--doux); font-size: 0.9rem; cursor: pointer;
  transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}
.filtre:hover { color: var(--texte); border-color: rgb(236 235 232 / 0.3); }
.filtre[aria-pressed="true"] { background: var(--texte); border-color: var(--texte); color: var(--fond); }
.filtre__n { opacity: 0.6; font-size: 0.82em; margin-left: 2px; }

/* ------------------------------------------------------------------ grille */
/* Sans JS : colonnes CSS. Avec JS : colonnes construites (ordre chronologique de gauche à droite). */
/* Cadres « mi-taille » : 4 colonnes mobile, 6 desktop, 8 très grand écran ; gouttières divisées par deux.
   --n doit rester synchronisé avec nbColonnes() dans app.js. */
.oeuvres { --n: 4; --g-grille: calc(var(--gouttiere) / 2); }
@media (min-width: 900px)  { .oeuvres { --n: 6; } }
@media (min-width: 1800px) { .oeuvres { --n: 8; } }
.grille { columns: var(--n); column-gap: var(--g-grille); }
.grille > .piece { break-inside: avoid; margin-bottom: calc(var(--g-grille) * 2); }
.grille.maconnerie { columns: auto; display: flex; gap: var(--g-grille); align-items: flex-start; }
.maconnerie > .colonne { flex: 1 1 0; min-width: 0; }
.maconnerie .piece { margin-bottom: calc(var(--g-grille) * 2); }

.piece { margin: 0; }
.piece__lien {
  display: block; position: relative; overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
}
.piece__lien img {
  width: 100%;
  transition: transform .9s var(--ease), opacity .7s var(--ease);
}
@media (hover: hover) {
  .piece__lien:hover img { transform: scale(1.025); }
}
.js .piece__lien img:not(.charge) { opacity: 0; }
.piece figcaption { padding: 10px 2px 0; display: flex; flex-direction: column; gap: 2px; }
.piece figcaption { padding-top: 6px; }
.piece__titre { font: italic 500 0.9rem/1.2 var(--serif); overflow-wrap: anywhere; }
.piece__cat { color: var(--doux); font-size: 0.66rem; letter-spacing: 0.04em; }
@media (min-width: 700px) { .piece__titre { font-size: 1.02rem; } .piece__cat { font-size: 0.72rem; } }
.piece[hidden] { display: none; }

/* Apparition douce lors d'un changement de filtre */
@media (prefers-reduced-motion: no-preference) {
  .maconnerie.anime .piece { animation: apparait .6s var(--ease) both; }
  @keyframes apparait { from { opacity: 0; transform: translateY(14px); } }
}

/* ------------------------------------------------------------------ dépôt vide */
.grille--vide {
  columns: auto; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start;
  gap: var(--g-grille);
}
.grille--vide .piece { margin: 0; width: calc((100% - (var(--n) - 1) * var(--g-grille)) / var(--n)); }
/* seul le cadre du milieu descend : 15 % de la hauteur d'un cadre 4:5 (= largeur × 1,25).
   En marge, % = largeur de la grille, comme pour la largeur du cadre. */
.grille--vide .piece:nth-child(2) { margin-top: calc((100% - (var(--n) - 1) * var(--g-grille)) / var(--n) * 1.25 * 0.15); }
/* Mobile < 600 px : 2 colonnes (~170 px en 390), colonne de droite décalée de 15 % ;
   le 3e cadre remonte sous le 1er (marge négative = décalage) pour ne pas laisser de trou. */
@media (max-width: 599.98px) {
  .oeuvres { --n: 2; --g-grille: var(--gouttiere); }
  .grille--vide { justify-content: flex-start; }
  .grille--vide .piece:nth-child(3) { margin-top: calc((100% - (var(--n) - 1) * var(--g-grille)) / var(--n) * -1.25 * 0.15); }
}
@media (min-width: 900px) {
}
.bientot {
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgb(236 235 232 / 0.07), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--trait);
}
/* Cadres « Bientôt » : tous identiques, portrait 4:5, alignés en haut (les vraies photos gardent leur ratio) */
.piece--bientot .bientot { aspect-ratio: 4 / 5; }
.bientot::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgb(236 235 232 / 0.06) 50%, transparent 65%);
  transform: translateX(-100%);
}
@media (prefers-reduced-motion: no-preference) {
  .bientot::after { animation: reflet 5.5s var(--ease) infinite; }
  .piece:nth-child(2) .bientot::after { animation-delay: 1.2s; }
  .piece:nth-child(3) .bientot::after { animation-delay: 2.4s; }
  @keyframes reflet { 0% { transform: translateX(-100%); } 45%, 100% { transform: translateX(100%); } }
}
.bientot__mot { font: italic 500 clamp(0.75rem, 3vw, 1.1rem)/1 var(--serif); color: var(--doux); }

/* ------------------------------------------------------------------ pied */
.pied {
  margin-top: clamp(72px, 13.5vw, 180px);           /* +50 % avant la ligne */
  padding: 69px var(--marge) max(48px, env(safe-area-inset-bottom));  /* ligne -> texte x2, marge basse */
  border-top: 1px solid var(--trait);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px;
  color: var(--doux); font-size: 0.88rem;
}
.pied p { margin: 0; margin-right: auto; }
.pied a { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.pied a:hover { color: var(--texte); }

/* ------------------------------------------------------------------ pages texte */
.page-texte .entete { padding-bottom: 0; }
.texte { flex: 1; width: 100%; max-width: 68ch; margin: 0 auto; padding: clamp(32px, 7vw, 80px) var(--marge) 0; }
.texte h1 { font: 500 clamp(2.4rem, 9vw, 3.6rem)/1.05 var(--serif); margin: 0 0 clamp(24px, 5vw, 48px); }
.texte h2 { font: italic 500 1.5rem/1.2 var(--serif); margin: 0 0 10px; }
.texte section { padding: 24px 0; border-top: 1px solid var(--trait); }
.texte p { margin: 0 0 12px; color: #cfcdc8; }
.texte--centre { text-align: center; }
.texte--centre .bouton { margin-top: 12px; }

/* ------------------------------------------------------------------ visionneuse */
.visionneuse {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgb(10 10 11 / 0.97); color: var(--texte);
  overflow: hidden; overscroll-behavior: contain;
}
.visionneuse::backdrop { background: rgb(10 10 11 / 0.9); }
.visionneuse[open] { display: grid; grid-template-rows: 1fr auto; }
@media (prefers-reduced-motion: no-preference) {
  .visionneuse[open] { animation: ouvre .35s var(--ease); }
  @keyframes ouvre { from { opacity: 0; } }
}
.visionneuse__scene {
  position: relative; min-height: 0;
  display: grid; place-items: center;
  padding: max(56px, env(safe-area-inset-top)) 8px 8px;
  touch-action: pan-y pinch-zoom;
}
.visionneuse__image {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  user-select: none; -webkit-user-drag: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.visionneuse__image.sortie, .visionneuse__video.sortie { opacity: 0; }
.visionneuse__video {
  max-width: 100%; max-height: 100%; width: auto; height: auto; background: #000;
  transition: opacity .3s var(--ease);
}
.visionneuse__video[hidden], .visionneuse__image[hidden] { display: none; }

/* Vidéos dans la grille : petite pastille « lecture » */
.piece__lecture {
  position: absolute; left: 6px; bottom: 6px;
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px;
  background: rgb(15 15 16 / 0.62); border: 1px solid rgb(236 235 232 / 0.22);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  pointer-events: none;
}
.piece__lecture .icone { width: 11px; height: 11px; fill: var(--texte); stroke: var(--texte); stroke-width: 1.4; margin-left: 2px; }
.visionneuse__legende {
  padding: 12px var(--marge) max(18px, env(safe-area-inset-bottom));
  text-align: center;
}
.visionneuse__titre { margin: 0; font: italic 500 1.4rem/1.2 var(--serif); }
.visionneuse__desc { margin: 6px auto 0; max-width: 60ch; color: var(--doux); font-size: 0.92rem;
  white-space: pre-line; max-height: 7.5em; overflow-y: auto; }
.visionneuse__desc:empty { display: none; }
.vbouton {
  position: absolute; display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 999px;
  border: 1px solid var(--trait); background: rgb(24 24 26 / 0.7);
  cursor: pointer; font-size: 1.3rem;
  transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.vbouton:hover { background: var(--surface-2); }
.vbouton:active { transform: scale(0.95); }
.vbouton--fermer { top: max(8px, env(safe-area-inset-top)); right: 8px; }
.vbouton--prec, .vbouton--suiv { top: 50%; transform: translateY(-50%); }
.vbouton--prec:active, .vbouton--suiv:active { transform: translateY(-50%) scale(0.95); }
.vbouton--prec { left: 12px; }
.vbouton--suiv { right: 12px; }
.vbouton[hidden] { display: none; }
/* Sur écran tactile : navigation au doigt, flèches masquées */
@media (hover: none) and (pointer: coarse) {
  .vbouton--prec, .vbouton--suiv { display: none; }
}
@media (min-width: 900px) {
  .vbouton--prec { left: 24px; }
  .vbouton--suiv { right: 24px; }
  .vbouton--fermer { right: 24px; top: 20px; }
  .visionneuse__scene { padding: 72px 96px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
