/* ===================================================================
   DYLAN JEAN — PORTFOLIO
   Style: minimalisme rétro-futuriste, données/infographie apparentes
   =================================================================== */

/* Polices hébergées sur le site (sous-ensemble latin) — Space Grotesk © Florian Karsten, Space Mono © Colophon Foundry,
   licence SIL Open Font 1.1 (voir assets/fonts/LICENSE.txt) */
@font-face{
  font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("../assets/fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face{
  font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/space-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face{
  font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/space-mono-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root{
  --bg:        #0c1214;   /* noir bleuté — palette dot 1 */
  --bg-alt:    #121a1c;   /* dérivé bg, panneaux/cartes */
  --line:      #212b2d;   /* hairline */
  --line-soft: #182022;

  --fg:        #cfd8d7;   /* gris pâle bleuté — palette dot 2 — texte principal */
  --fg-dim:    #7c948d;   /* sauge bleu-vert — palette dot 5 — data / mono */
  --fg-mute:   #66787c;   /* gris bleu moyen — palette dot 3 — bordures / tertiaire */

  --accent:    #ef4b27;   /* orange-rouge — palette dot 4 */
  --accent-dim:#5a2416;   /* dérivé accent, fonds teintés */

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono:    'Space Mono', ui-monospace, monospace;

  --gutter: clamp(20px, 5vw, 72px);
  --spine-x: 48%;                                            /* axe de la colonne, en % de la largeur */
  --spine-w: clamp(240px, 28vw, 520px);                      /* largeur d une tuile de la colonne */
  --spine-reserve: calc(var(--spine-w) * 0.34 + clamp(44px, 6.6vw, 84px));   /* demi-bande libre de part et d autre : griffes + gouttière de légendes */
  --rail-w: 160px;
}

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

html{
  scroll-behavior: smooth;
  background: var(--bg);
}

body{
  margin:0;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.1'/></svg>");
  background-repeat: repeat;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; }

.mono{
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dim{ color: var(--fg-dim); }
.accent{ color: var(--accent); text-shadow: 0 0 10px rgba(239,75,39,.55); }

/* -------------------------------------------------- filets rattachés au curseur */
.cursor-links{
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 60;                       /* au-dessus du contenu, sous l'index (90), la barre HUD (100) et la vignette (500) */
  pointer-events: none;
}
@media (hover: none), (pointer: coarse){
  .cursor-links{ display: none; }
}

/* -------------------------------------------------- CRT (scanlines + vignette) */
.crt{
  position: fixed; inset: 0;
  z-index: 500;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0,0,0,.5) 100%
  );
}
@media (max-width: 700px){
  .crt{ display:none; }
}

/* -------------------------------------------------- HUD (top bar) */
.hud{
  position: fixed; top:0; left:0; right:0;
  z-index: 100;
  display:flex; align-items:center; justify-content:space-between;
  padding: 18px var(--gutter);
  background: rgba(12,18,20,.94);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(6px);
  pointer-events:none;
}
.hud > div{ display:flex; align-items:center; gap:8px; pointer-events:auto; }
.hud-sep{ color: var(--fg-mute); }
.hud-dim{ color: var(--fg-dim); }
.hud-dot{
  width:6px; height:6px; border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent), 0 0 22px rgba(239,75,39,.4);
  display:inline-block;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse{
  0%,100%{ opacity:1; }
  50%{ opacity:.35; }
}
@media (max-width: 760px){
  .hud > .hud-right{ display:none; }
}

/* -------------------------------------------------- index rail */
.rail{
  position: fixed; right: var(--gutter); top:50%;
  transform: translateY(-50%);
  z-index: 90;
  display:flex; flex-direction:column; gap:18px;
  align-items:flex-end;
}
.rail a{
  position: relative;
  display:flex; align-items:center; gap:8px;
  color: var(--fg-mute);
  transition: color .25s ease;
}
.rail a:hover, .rail a.is-active{ color: var(--fg); }
.rail a.is-active .rail-num{ color: var(--accent); }
.rail-label{
  position:absolute; top:50%; right:calc(100% + 12px);
  transform: translateY(-50%);
  white-space:nowrap;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 5px 10px;
  opacity:0; pointer-events:none;
  transition: opacity .2s ease;
}
.rail a:hover .rail-label, .rail a.is-active .rail-label{
  opacity:1;
}
@media (max-width: 900px){ .rail{ display:none; } }
@media (min-width: 901px){
  .section{ padding-right: calc(var(--gutter) + 96px); }
}

/* -------------------------------------------------- corner data marks */
.corner{
  position:absolute;
  color: var(--fg-dim);
  z-index: 5;
}
.corner-tl{ top: 96px; left: var(--gutter); }
.corner-tr{ top: 96px; right: var(--gutter); }
.corner-bl{ bottom: 40px; left: var(--gutter); }
.corner-br{ bottom: 40px; right: var(--gutter); }
.corner-bl a{ border-bottom:1px solid var(--fg-mute); padding-bottom:2px; }
.corner-bl a:hover{ color:var(--fg); border-color:var(--fg); }

/* -------------------------------------------------- colonne vertébrale (PNG alpha, pleine longueur) */
main{ position: relative; }
.spine-mesh{
  position: absolute; top: 0; bottom: 0;
  left: var(--spine-x);
  width: var(--spine-w);
  transform: translateX(-38%);
  background: url("../assets/img/spine-mesh-pair.png") top left / 100% auto repeat-y;
  opacity: .9;
  pointer-events: none;
}
.spine-links{
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}
@media (max-width: 859px){
  .spine-mesh{ left: 50%; width: min(90vw, 460px); opacity: .35; }
  .spine-links{ display: none; }
}

/* -------------------------------------------------- lignes HUD (générées par le script) */
.spine-links .sl-guide{ stroke: var(--fg-mute); stroke-width: 1; opacity: .16; fill: none; }
.spine-links .sl-tick{ stroke: var(--fg-mute); stroke-width: 1; opacity: .4; fill: none; }
.spine-links .sl-line{ stroke: var(--fg-dim); stroke-width: 1; opacity: .6; fill: none; }
.spine-links .sl-line--acc{ stroke: var(--accent); opacity: .85; filter: drop-shadow(0 0 2px rgba(239,75,39,.55)); }
.spine-links .sl-dash{ stroke-dasharray: 2 4; }
.spine-links .sl-curve{ stroke: var(--fg-mute); stroke-width: 1; opacity: .3; fill: none; }
.spine-links .sl-curve--acc{ stroke: var(--accent); opacity: .38; }
.spine-links .sl-node path{ stroke: var(--fg); stroke-width: 1; opacity: .8; fill: none; }
.spine-links .sl-node circle{ fill: var(--fg-dim); opacity: .95; }
.spine-links .sl-node--acc path{ stroke: var(--accent); }
.spine-links .sl-node--acc circle{ fill: var(--accent); filter: drop-shadow(0 0 3px rgba(239,75,39,.7)); }
.spine-links .sl-end{ fill: var(--bg); stroke: var(--fg-dim); stroke-width: 1; opacity: .9; }
.spine-links .sl-end--acc{ stroke: var(--accent); }
.spine-links .sl-text{ font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; fill: var(--fg-dim); }
.spine-links .sl-text--strong{ fill: var(--fg); }
.spine-links .sl-text--acc{ fill: var(--accent); }
.spine-links .sl-text--mute{ font-size: 7.5px; fill: var(--fg-mute); opacity: .85; }
.spine-links .sl-noise{ font-family: var(--font-mono); font-size: 6.5px; letter-spacing: .03em; fill: var(--fg-mute); opacity: .5; }
.spine-links .sl-box{ fill: rgba(12,18,20,.55); stroke: var(--accent); stroke-width: 1; opacity: .85; }
.spine-links .sl-bracket{ stroke: var(--fg-mute); stroke-width: 1; fill: none; opacity: .5; }
.spine-links .sl-frame{ fill: rgba(12,18,20,.4); stroke: var(--fg-mute); stroke-width: 1; opacity: .7; }
.spine-links .sl-bar{ fill: var(--fg-mute); opacity: .38; }
.spine-links .sl-fine{ stroke: var(--fg-mute); stroke-width: 1; fill: none; opacity: .55; }
.spine-links .sl-fine--acc{ stroke: var(--accent); opacity: .8; }
.spine-links .sl-dot{ fill: var(--fg-dim); opacity: .55; }
.spine-links .sl-dot--acc{ fill: var(--accent); opacity: .9; }
.spine-links .sl-mark path{ stroke: var(--fg-mute); stroke-width: 1; fill: none; opacity: .6; }
.spine-links .sl-mark text{ font-family: var(--font-mono); font-size: 6px; fill: var(--fg-mute); opacity: .5; }


/* -------------------------------------------------- section shell */
.section{
  position: relative;
  padding: 140px var(--gutter) 100px;
  border-top: 1px solid var(--line);
}
.section-head{ margin-bottom: 48px; max-width: 640px; }
.section-idx{ color: var(--accent); text-shadow: 0 0 10px rgba(239,75,39,.5); margin-bottom: 10px; }
.section-title{
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 10px;
}
.section-sub{ color: var(--fg-dim); margin:0; max-width: 46ch; }

/* -------------------------------------------------- HERO */
.hero{
  min-height: 100vh;
  display:flex; flex-direction:column; justify-content:center;
  border-top:none;
  padding-top: 96px;
  overflow:hidden;
}
.hero-glow{
  position:absolute; z-index:0;
  width: 60vw; height: 60vw; max-width:800px; max-height:800px;
  right:-10vw; top: -10vw;
  background: radial-gradient(circle, rgba(239,75,39,.22) 0%, rgba(239,75,39,0) 65%);
  filter: blur(10px);
  animation: drift 14s ease-in-out infinite alternate;
  pointer-events:none;
}
@keyframes drift{
  from{ transform: translate(0,0) scale(1); }
  to{ transform: translate(-30px, 30px) scale(1.08); }
}

.hero-body{ position:relative; z-index:1; max-width: 680px; }
.hero-title{
  font-size: clamp(3.4rem, 12vw, 8.5rem);
  line-height: .88;
  font-weight: 700;
  letter-spacing: -.03em;
  margin: 0 0 28px;
  display:flex; flex-direction:column;
  /* franges chromatiques : s'écartent quand le curseur approche (--fr posé par js/cursor-warp.js) */
  text-shadow: calc(-1.5px - var(--fr, 0) * 3px) 0 rgba(239,75,39,.35), calc(1.5px + var(--fr, 0) * 3px) 0 rgba(124,148,141,.4);
}
.hero-roles{
  display:flex; flex-wrap:wrap; gap: 18px 22px;
  color: var(--fg-dim);
  margin-bottom: 28px;
}
.hero-roles span{ white-space:nowrap; }
.hero-text{
  max-width: 52ch;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--fg);
  opacity:.9;
  margin: 0;
}

/* -------------------------------------------------- filters */
.filters{
  display:flex; flex-wrap:wrap; gap:10px;
  margin-bottom: 40px;
}
.filter{
  background:none; border:1px solid var(--line);
  color: var(--fg-dim);
  padding: 9px 14px;
  cursor:pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;   /* pas de transition sur transform : posé image par image par le script */
}
.filter:hover{ border-color: var(--fg-mute); color: var(--fg); }
.filter.is-active{ border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* -------------------------------------------------- work grid */
.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: 900px;
  background: var(--line);
  border: 1px solid var(--line);
}
.grid > .col{ display: contents; }   /* colonnes créées par le script : transparentes hors grand écran */
.card{
  background: var(--bg);
  transition: background .25s ease;
}
.card:hover{ background: var(--bg-alt); }
.card-media{
  position:relative;
  aspect-ratio: 4/3;
  display:flex; align-items:flex-start; justify-content:space-between;
  padding: 14px;
  overflow:hidden;
}
.card-media::after{
  content:"";
  position:absolute; inset:0;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 1px, transparent 1px 14px);
  pointer-events:none;
}
.ph-a{ background: linear-gradient(160deg, #35190f, var(--bg) 70%); }  /* évènementiel — accent */
.ph-b{ background: linear-gradient(160deg, #16232a, var(--bg) 70%); }  /* évènementiel — bleu-gris */
.ph-c{ background: linear-gradient(160deg, #3a2013, var(--bg) 70%); }  /* reels — accent */
.ph-d{ background: linear-gradient(160deg, #131c22, var(--bg) 70%); }  /* corporate — bleu-gris */
.ph-e{ background: linear-gradient(160deg, #1a2420, var(--bg) 70%); }  /* motion design — sauge */
.ph-f{ background: linear-gradient(160deg, #17211d, var(--bg) 70%); }  /* étalonnage — sauge */
.ph-g{ background: linear-gradient(160deg, #182024, var(--bg) 70%); }  /* étalonnage — bleu-gris */

.card-cat{ color: var(--fg-dim); position:relative; z-index:1; }
.rec{ display:flex; align-items:center; gap:6px; color:var(--fg-dim); position:relative; z-index:1; }
.rec-dot{
  width:6px; height:6px; border-radius:50%;
  background: var(--accent); display:inline-block;
  box-shadow: 0 0 8px rgba(239,75,39,.6);
}
.card-body{ padding: 18px 16px 22px; }
.card-body h3{ margin:0 0 8px; font-size:1.05rem; font-weight:600; }
.card-meta{ margin-bottom:8px; }
.card-role{ color: var(--fg-dim); }

@media (max-width: 900px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px){
  .grid{ grid-template-columns: 1fr; }
}

/* -------------------------------------------------- capacités */
.cap-grid{
  display:grid; grid-template-columns: 1.3fr .9fr;
  gap: 60px;
  max-width: 900px;
  align-items:start;
}
.cap-list{ list-style:none; margin:0; padding:0; }
.cap-list li{
  display:grid; grid-template-columns: 48px 1fr;
  gap: 20px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.cap-list li:last-child{ border-bottom: 1px solid var(--line); }
.cap-num{ color: var(--accent); padding-top:4px; }
.cap-list h3{ margin:0 0 6px; font-size:1.15rem; }
.cap-list p{ margin:0; color: var(--fg-dim); max-width:48ch; }

.spec-sheet{
  border: 1px solid var(--line);
  padding: 26px;
  background: var(--bg-alt);
}
.spec-title{ color: var(--fg-mute); margin-bottom:18px; }
.spec-sheet dl{ margin:0; }
.spec-sheet dl > div{
  display:grid; grid-template-columns: 96px 1fr;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--fg);
}
.spec-sheet dl > div:first-child{ border-top:none; }
.spec-sheet dt{ color: var(--fg-mute); }
.spec-sheet dd{ margin: 0; }

@media (max-width: 820px){
  .cap-grid{ grid-template-columns: 1fr; }
}

/* -------------------------------------------------- contact */
.contact{
  min-height: 80vh;
  display:flex; flex-direction:column; justify-content:center;
}
.contact-body{ position:relative; z-index:1; }
.contact-title{
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  line-height:.95;
  letter-spacing:-.02em;
  margin: 0 0 44px;
}
.contact-rows{ display:flex; flex-direction:column; max-width: 640px; }
.contact-row{
  display:flex; justify-content:space-between; align-items:center;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  color: var(--fg);
  transition: color .2s ease, padding-left .2s ease;
}
.contact-rows a:last-child{ border-bottom: 1px solid var(--line); }
.contact-row:hover{ color: var(--accent); padding-left: 10px; }
.footer{
  display:flex; justify-content:space-between;
  margin-top: 80px;
  color: var(--fg-mute);
  flex-wrap:wrap; gap:8px;
}

/* -------------------------------------------------- misc */
::selection{ background: var(--accent); color: var(--bg); }

/* sections de part et d autre de la colonne (écrans larges) */
@media (min-width: 860px){
  /* héros : texte à gauche, la moitié droite reste au HUD */
  .section.side-left{
    padding-left: var(--gutter);
    padding-right: calc(100% - var(--spine-x) + var(--spine-reserve));
  }
  .hero-body{ max-width: none; }
  .hero-title{ font-size: clamp(3rem, 7vw, 7.5rem); }
  .section-head{ max-width: none; }
  .card-media{ aspect-ratio: 16 / 9; }
  .contact-title{ font-size: clamp(2.2rem, 4.4vw, 4rem); }
  .contact-rows{ max-width: none; }

  /* autres sections : grille à 5 pistes — marge | colonne gauche | bande de la colonne | colonne droite | marge */
  .section.side-both{
    --rail-pad: calc(var(--gutter) + 52px);
    --stagger: clamp(36px, 5vw, 72px);
    padding-left: 0; padding-right: 0;
    display: grid;
    grid-template-columns:
      var(--gutter)
      calc(var(--spine-x) - var(--spine-reserve) - var(--gutter))
      calc(var(--spine-reserve) * 2)
      minmax(0, 1fr)
      var(--rail-pad);
    column-gap: 0; row-gap: 26px;
    align-items: start; align-content: start;
  }

  /* travaux : titre à gauche, filtres à droite, cartes réparties en alternance de part et d autre (côté posé par le script) */
  .work .section-head{ grid-column: 2; grid-row: 1; margin-bottom: 0; }
  .work .filters{ grid-column: 4; grid-row: 1; align-self: end; margin-bottom: 0; }
  .work .grid{
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns:
      var(--gutter)
      calc(var(--spine-x) - var(--spine-reserve) - var(--gutter))
      calc(var(--spine-reserve) * 2)
      minmax(0, 1fr)
      var(--rail-pad);
    max-width: none; background: none; border: 0; gap: 0;
    align-items: start;
  }
  .work .grid > .col{ display: flex; flex-direction: column; gap: 22px; }
  .work .grid > .col-l{ grid-column: 2; }
  .work .grid > .col-r{ grid-column: 4; margin-top: var(--stagger); }
  .work .card{ border: 1px solid var(--line); }

  /* capacités : titre + spec sheet à gauche, liste à droite */
  .capabilities .section-head{ grid-column: 2; grid-row: 1; margin-bottom: 0; }
  .capabilities .cap-grid{ display: contents; }
  .capabilities .spec-sheet{ grid-column: 2; grid-row: 2; }
  .capabilities .cap-list{ grid-column: 4; grid-row: 1 / span 2; }

  /* contact : accroche à gauche, coordonnées à droite */
  .contact.side-both{ align-content: center; }
  .contact .contact-body{ display: contents; }
  .contact .contact-title{ grid-column: 2; grid-row: 1; margin: 0; align-self: center; }
  .contact .contact-rows{ grid-column: 4; grid-row: 1; align-self: center; }
  .contact .footer{ grid-column: 2 / 5; grid-row: 2; margin-top: 30px; }

  /* l étiquette de l index recouvrirait la colonne de droite : visible au survol seulement */
  .rail a.is-active .rail-label{ opacity: 0; }
  .rail a:hover .rail-label,
  .rail a.is-active:hover .rail-label{ opacity: 1; }
}
/* pas d index à droite sous 900 px : la colonne de droite va jusqu à la gouttière */
@media (min-width: 860px) and (max-width: 900px){
  .section.side-both{ --rail-pad: var(--gutter); }
}
/* colonnes étroites (fenêtres < 1100 px) : blocs plus compacts */
@media (min-width: 860px) and (max-width: 1099px){
  .spec-sheet{ padding: 20px 16px; }
  .spec-sheet dl > div{ grid-template-columns: 76px 1fr; gap: 8px; }
  .spec-sheet dd{ min-width: 0; overflow-wrap: anywhere; }
  .contact-row{ gap: 12px; font-size: .9rem; }
  .contact-row > :last-child{ min-width: 0; overflow-wrap: anywhere; text-align: right; }
}

/* -------------------------------------------------- apparition au défilement (textes, cartes, lignes HUD) */
/* Le décalage et l'échelle passent par les propriétés translate / scale (et non transform) : ils se cumulent avec la
   réaction au curseur (js/cursor-warp.js) sans jamais se gêner. js/reveal.js pose .rv-on puis retire data-rv. */
:root{ --rv-ease: cubic-bezier(.2, .7, .2, 1); }
.js-reveal [data-rv]{ opacity: 0; translate: 0 26px; }
.js-reveal [data-rv="wipe"]{ translate: 0 14px; clip-path: inset(-14px -14px 100% -14px); }   /* titres : balayage de haut en bas */
.js-reveal [data-rv="card"]{ translate: 0 34px; scale: .965; }
.js-reveal [data-rv].rv-on{
  opacity: 1; translate: 0 0; scale: 1; clip-path: inset(-14px);
  transition:
    opacity .8s var(--rv-ease) var(--rv-delay, 0s),
    translate .95s var(--rv-ease) var(--rv-delay, 0s),
    scale .95s var(--rv-ease) var(--rv-delay, 0s),
    clip-path .95s var(--rv-ease) var(--rv-delay, 0s);
}

/* lignes du HUD : chaque groupe apparaît quand sa position est atteinte ; les filets se tracent (stroke-dashoffset,
   pathLength normalisé à 1), les nœuds et l'extrémité s'allument à l'arrivée du trait */
.js-reveal .spine-links .rv{ opacity: 0; }
.js-reveal .spine-links .rv.is-in{ opacity: 1; transition: opacity .7s ease var(--rv-delay, 0s); }
.js-reveal .spine-links .rv .dr{ stroke-dasharray: 1; stroke-dashoffset: 1; }
.js-reveal .spine-links .rv.is-in .dr{
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.1s var(--rv-ease) calc(var(--rv-delay, 0s) + .08s);
}
.js-reveal .spine-links .rv .sl-node{ opacity: 0; }
.js-reveal .spine-links .rv.is-in .sl-node{ opacity: 1; transition: opacity .35s ease calc(var(--rv-delay, 0s) + .85s); }
.js-reveal .spine-links .rv-now,
.js-reveal .spine-links .rv-now *{ transition: none !important; }   /* groupe déjà révélé (HUD reconstruit) : visible d'emblée */

/* -------------------------------------------------- cartes de catégorie (accueil) et pages de catégorie */
.cat-card{ display: block; position: relative; transition: background .25s ease, border-color .25s ease; }
.cat-card:hover, .cat-card:focus-visible{ border-color: var(--accent); background: var(--bg-alt); }
.cat-card:focus-visible{ outline: 1px solid var(--accent); outline-offset: 3px; }
.cat-card .card-body h3{ font-size: 1.35rem; }
.cat-num{
  position: absolute; right: 14px; bottom: 4px;
  font-family: var(--font-display); font-size: clamp(4.4rem, 9vw, 7rem); font-weight: 700;
  line-height: .78; letter-spacing: -.05em;
  color: transparent; -webkit-text-stroke: 1px rgba(207,216,215,.22);
  pointer-events: none; transition: -webkit-text-stroke-color .3s ease;
}
.cat-card:hover .cat-num, .cat-card:focus-visible .cat-num{ -webkit-text-stroke-color: rgba(239,75,39,.6); }
/* miniature de catégorie : image sans voile ni hachures (seul le numéro est posé dessus) */
.cat-card.card--media .card-media::after{ display: none; }
.cat-card.card--media .cat-num{ -webkit-text-stroke-color: rgba(255,255,255,.62); filter: drop-shadow(0 0 8px rgba(0,0,0,.45)); }
.cat-card.card--media:hover .cat-num, .cat-card.card--media:focus-visible .cat-num{ -webkit-text-stroke-color: rgba(239,75,39,.9); }
/* miniature claire (data-light) : numéro tracé en sombre pour rester lisible sur le ciel */
.cat-card.card--media[data-light] .cat-num{ -webkit-text-stroke-color: rgba(12,18,20,.72); filter: drop-shadow(0 0 8px rgba(255,255,255,.3)); }
.cat-card.card--media[data-light]:hover .cat-num, .cat-card.card--media[data-light]:focus-visible .cat-num{ -webkit-text-stroke-color: rgba(239,75,39,.95); }

.hud-left a{ transition: color .2s ease; }
.hud-left a:hover{ color: var(--accent); }
.back-link{ display: inline-block; margin-bottom: 26px; color: var(--fg-dim); transition: color .2s ease; }
.back-link:hover{ color: var(--accent); }
.cat-page{ min-height: 100vh; }
.cat-page .section-title{ font-size: clamp(1.6rem, 3vw, 2.4rem); overflow-wrap: anywhere; }
.cat-nav{
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px;
  margin-top: 44px; padding-top: 20px;
  border-top: 1px solid var(--line); color: var(--fg-dim);
}
.cat-nav a{ transition: color .2s ease; }
.cat-nav a:hover{ color: var(--accent); }
@media (max-width: 859px){
  .cat-meta{ margin-bottom: 40px; }
}
@media (min-width: 860px){
  .work .cat-meta{ grid-column: 4; grid-row: 1; align-self: end; }
  .work .cat-nav{ grid-column: 2 / 5; margin-top: 30px; }
}

/* petits écrans : cartes séparées (une case vide ne montre plus le fond de la grille quand le nombre de cartes est impair) */
@media (max-width: 859px){
  .grid{ background: none; border: 0; gap: 14px; }
  .card{ border: 1px solid var(--line); }
}
/* écran moyen (deux colonnes) : les mêmes colonnes indépendantes que sur grand écran, sans décalage, pour ne plus laisser de vide
   à côté d'une carte verticale ; en dessous de 560 px, une seule colonne dans l'ordre chronologique */
@media (min-width: 560px) and (max-width: 859px){
  .grid > .col{ display: flex; flex-direction: column; gap: 14px; }
}

/* -------------------------------------------------- projets : affiche, aperçu au survol, lecteur vidéo (js/projects.js) */
html{ scrollbar-gutter: stable; }                       /* le verrouillage du défilement pendant la lecture ne décale plus la page */
.card-media{ aspect-ratio: 16 / 9; }                    /* affiches et vidéos sont en 16:9 : jamais recadrées */

.card-img, .card-preview{
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .5s ease;
}
.card-img.is-loaded, .card-preview.is-on{ opacity: 1; }
.card[data-fit="contain"] .card-img, .card[data-fit="contain"] .card-preview{ object-fit: contain; }
/* avec une vraie image : plus de hachures sur l'image, seulement un voile léger en haut pour garder les libellés lisibles */
.card--media .card-media::after{ background-image: linear-gradient(to bottom, rgba(12,18,20,.5), rgba(12,18,20,0) 36%); }

.card--video{ cursor: pointer; }
.card--video:focus-visible{ outline: 1px solid var(--accent); outline-offset: 3px; }
.card-play{
  position: absolute; left: 50%; bottom: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; color: var(--fg);
  background: rgba(12,18,20,.78); border: 1px solid var(--accent);
  opacity: 0; transform: translate(-50%, 6px);
  transition: opacity .25s ease, transform .3s var(--rv-ease);
  pointer-events: none;
}
.card-play i{ font-style: normal; color: var(--accent); }
.card--video:hover .card-play, .card--video:focus-visible .card-play{ opacity: 1; transform: translate(-50%, 0); }
@media (hover: none){ .card-play{ opacity: 1; transform: translate(-50%, 0); } }   /* tactile : l'invitation à lire reste visible */

.player{
  position: fixed; inset: 0; z-index: 1000;              /* au-dessus de la vignette (500) : la vidéo est montrée sans filtre */
  display: grid; place-items: center; padding: clamp(10px, 3vw, 40px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.player.is-open{ opacity: 1; visibility: visible; transition-delay: 0s; }
.player-backdrop{ position: absolute; inset: 0; background: rgba(5,9,10,.94); }
.player-box{
  position: relative;
  width: min(1280px, 100%, calc((100vh - 150px) * var(--pr, 1.7778)));   /* --pr : format de la vidéo, posé par le script */
  min-width: min(100%, 300px);                          /* lecteur vertical : la barre reste lisible */
  border: 1px solid var(--line); background: var(--bg);
  box-shadow: 0 30px 90px rgba(0,0,0,.65);
  transform: translateY(14px) scale(.985);
  transition: transform .4s var(--rv-ease);
}
.player.is-open .player-box{ transform: none; }
.player-bar{ display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--fg-dim); }
.player-rec{ display: inline-flex; align-items: center; gap: 8px; color: var(--fg-dim); white-space: nowrap; }
.player-title{ flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); text-align: center; }
.player-close, .player-nav{ background: none; border: 1px solid var(--line); color: var(--fg-dim); padding: 6px 10px; cursor: pointer; transition: color .2s ease, border-color .2s ease; }
.player-close:hover, .player-close:focus-visible, .player-nav:hover, .player-nav:focus-visible{ color: var(--accent); border-color: var(--accent); outline: none; }
.player-stage{ position: relative; aspect-ratio: var(--pr, 16 / 9); background: #000; }
.player-stage iframe, .player-stage video{ position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-stage video.is-contain{ object-fit: contain; }
.player-error{ position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--fg-dim); }
.player-meta{ display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 12px 14px; color: var(--fg-dim); }
.player-navs{ display: none; gap: 8px; margin-right: auto; }
.player-stage img.player-img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
/* image seule (étalonnage) : un clic l'agrandit ; cadre sans texte, jamais plus large que les pixels de l'image (--pmax, posé par le script) */
.card--still{ cursor: zoom-in; }
.card--still:focus-visible{ outline: 1px solid var(--accent); outline-offset: 3px; }
.player.is-image .player-box{ width: min(var(--pmax, 1280px), 100%, calc((100vh - 2 * clamp(10px, 3vw, 40px) - 58px) * var(--pr, 1.7778))); min-width: 0; }
.player.is-image .player-rec, .player.is-image .player-title, .player.is-image .player-meta{ display: none; }
.player.is-image .player-navs{ display: inline-flex; }
.player.is-image .player-close{ margin-left: auto; }
html.player-open{ overflow: hidden; }
@media (prefers-reduced-motion: reduce){
  .player, .player-box{ transition: none; }
}

/* carte en portrait : hauteur d image plafonnée à 78 % de l écran (760 px max), collée du côté de la colonne vertébrale */
.card[data-portrait]{ width: 100%; max-width: calc(min(78vh, 760px) * var(--cr, .6)); }
.col-l > .card[data-portrait]{ align-self: flex-end; }
.col-r > .card[data-portrait]{ align-self: flex-start; }
@media (max-width: 859px){ .card[data-portrait]{ justify-self: center; } }
/* affiche claire : libellés sombres, pas de voile */
/* cartes avec affiche : un seul libellé (le format ; la catégorie est déjà dans le titre de la page), sur une pastille pour rester lisible sur n importe quelle image */
.card--media .card-cat{ display: none; }
.card--media .rec{ margin-left: auto; padding: 4px 8px; background: rgba(12,18,20,.74); color: var(--fg); }
.card[data-light] .rec{ background: rgba(255,255,255,.88); color: #22292b; }
.card[data-light].card--media .card-media::after{ display: none; }

/* cartes de projet (pages de catégorie) : l'image occupe toute la carte ; le titre et la ligne d'infos sont posés en bas,
   sur un dégradé léger. Affiche claire (data-light) : dégradé blanc et texte sombre. */
.cat-page .card{ position: relative; container-type: inline-size; }   /* la carte est un conteneur : le texte s'adapte à sa largeur */
.cat-page .card-body{
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 30px 14px 12px;
  background: linear-gradient(to top, rgba(8,13,15,.9) 0%, rgba(8,13,15,.6) 55%, rgba(8,13,15,0) 100%);
}
.cat-page .card-body h3{ margin: 0 0 3px; font-size: .95rem; line-height: 1.25; text-shadow: 0 1px 10px rgba(0,0,0,.45); }
.cat-page .card-meta{ margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* cartes étroites : le titre seul (la ligne d'infos apparaît au survol et reste dans le lecteur) pour laisser l'image respirer */
@container (max-width: 340px){
  .cat-page .card-meta{ display: none; }
  .cat-page .card:hover .card-meta, .cat-page .card:focus-visible .card-meta{ display: block; }
}
.cat-page .card[data-light] .card-body{
  background: linear-gradient(to top, rgba(250,251,250,.95) 0%, rgba(250,251,250,.64) 55%, rgba(250,251,250,0) 100%);
}
.cat-page .card[data-light] .card-body h3{ color: #141a1b; text-shadow: none; }
.cat-page .card[data-light] .card-meta{ color: #4b5659; }
/* l'invitation à lire passe au centre de l'image, pour ne pas couvrir le titre */
.cat-page .card-play{ top: 46%; bottom: auto; transform: translate(-50%, calc(-50% + 6px)); }
.cat-page .card--video:hover .card-play, .cat-page .card--video:focus-visible .card-play{ transform: translate(-50%, -50%); }
@media (hover: none){ .cat-page .card-play{ transform: translate(-50%, -50%); } }

/* -------------------------------------------------- dégradé de palette sous le curseur (js/text-gradient.js) */
/* Au survol, le texte est rempli par un dégradé radial centré sur le curseur : orange-rouge → sauge → couleur normale
   du texte (--tg-base). Le rayon s'ouvre en douceur (propriété enregistrée --tgr) ; hors du rayon le texte garde sa couleur. */
@property --tgr{ syntax: "<length>"; inherits: false; initial-value: 0px; }
.tg{ --tg-base: var(--fg); transition: --tgr .45s cubic-bezier(.2, .7, .2, 1); }
.tg:hover{
  --tgr: var(--tg-r, 120px);
  color: transparent !important;
  text-shadow: none !important;
  background-image: radial-gradient(circle var(--tgr) at var(--mx, 50%) var(--my, 50%), var(--accent) 0%, var(--fg-dim) 58%, var(--tg-base) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.section-sub.tg, .cap-list p.tg{ --tg-base: var(--fg-dim); }
.hero-title span.tg, .section-title.tg, .contact-title.tg{ --tg-r: 200px; }
.cat-page .card[data-light] .card-body h3.tg{ --tg-base: #141a1b; }
@media (prefers-reduced-motion: reduce){ .tg{ transition: none; } }

/* -------------------------------------------------- pages annexes : 404 et mentions légales */
.notfound{ min-height: 100vh; display: flex; flex-direction: column; justify-content: center; border-top: none; }
.notfound-num{
  margin: 0 0 18px; user-select: none;
  font-family: var(--font-display); font-weight: 700; line-height: .8; letter-spacing: -.05em;
  font-size: clamp(5rem, 17vw, 10rem);
  color: transparent; -webkit-text-stroke: 1px rgba(207,216,215,.3);
}
.notfound .section-title{ margin-bottom: 14px; }
.notfound-back{ margin: 30px 0 0; }
.legal{ min-height: 100vh; }
.legal .section-head{ margin-bottom: 30px; }
.legal-body{ max-width: 64ch; }
.legal-body h2{ margin: 34px 0 12px; }
.legal-body p{ margin: 0 0 12px; opacity: .92; }
.legal-body dl{ margin: 0 0 12px; }
.legal-body dt{ margin-top: 12px; color: var(--fg-mute); font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.legal-body dd{ margin: 2px 0 0; overflow-wrap: anywhere; }
@media (min-width: 860px){
  /* pas de lignes HUD sur cette page : seule la largeur des griffes de la colonne est à réserver */
  .section.legal{ padding-right: calc(100% - var(--spine-x) + var(--spine-w) * .36); }
}
.legal-body a{ border-bottom: 1px solid var(--fg-mute); transition: color .2s ease, border-color .2s ease; }
.legal-body a:hover{ color: var(--accent); border-color: var(--accent); }
.legal-date{ margin-top: 30px; color: var(--fg-mute); }
.todo{ color: var(--accent); }
.footer a, .cat-legal{ color: var(--fg-mute); transition: color .2s ease; }
.footer a:hover, .cat-legal:hover{ color: var(--fg); }
