/* ============================================================
   ILHAN TURAN — portfolio
   Univers : sombre, étoilé, rêveur. Les œuvres restent les vedettes.
   ============================================================ */

:root {
  --bg: #080909;
  --bg2: #0D0F10;
  --panel: #111315;
  --border: rgba(255,255,255,0.10);
  --border-hover: rgba(255,255,255,0.30);
  --text: #F1F1ED;
  --text2: rgba(241,241,237,0.62);
  --text3: rgba(241,241,237,0.38);
  --accent: #5163E8;
  --magenta: #E85AC8;
  --mint: #4FE0A0;
  --amber: #E8B655;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Ciel étoilé (canvas fixe derrière tout) ---------- */
#sky {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
}
main, header, footer { position: relative; z-index: 1; }

/* ---------- Transition de page : saut en hyperespace ----------
   Au clic : la page plonge (zoom arrière + flou + fondu) pendant que
   les étoiles du fond passent en vitesse lumière (traînées verticales).
   À l'arrivée : la page émerge du flou, les éléments entrent en cascade. */
@view-transition { navigation: auto; }

#veil { display: none; }

/* départ : plongée 3D dans le panneau cliqué.
   transform-origin (posé en JS au centre de l'élément) sert de point de fuite :
   la page avance en translateZ vers la caméra, légèrement inclinée selon la
   position du panneau. `animation: none` est CRUCIAL : sans lui, pageIn
   (fill-mode both) fige main et bloque toute transformation de sortie. */
/* la caméra avance et TRAVERSE le panneau : la page grandit vers la caméra
   (point de fuite = panneau cliqué) et passe de 100 -> 0 en la traversant */
/* sortie 1,4x plus rapide que l'entrée — courbe douce au départ, pic à la fin */
html.warping main {
  animation: none;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 0.32s cubic-bezier(0.55, 0, 0.85, 0.4),
              transform 0.32s cubic-bezier(0.55, 0, 0.85, 0.4);
}
html.warping header,
html.warping #toTop {
  opacity: 0;
  transition: opacity 0.28s cubic-bezier(0.55, 0, 0.85, 0.4);
}

/* ...et la nouvelle page grandit vers sa taille : scale out propre */
main { animation: pageIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes pageIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}
/* entrée en cascade des éléments d'interface */
@keyframes childIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
.page-hero .kicker, .home-hero .kicker { animation: childIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both; }
.page-hero h1, .home-hero h1 { animation: childIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both; }
.page-hero .sub, .home-hero .sub { animation: childIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both; }
.home-hero .currently { animation: childIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.26s both; }
header { animation: headerIn 0.45s ease 0.1s both; }
@keyframes headerIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  main, header,
  .page-hero .kicker, .home-hero .kicker,
  .page-hero h1, .home-hero h1,
  .page-hero .sub, .home-hero .sub,
  .home-hero .currently { animation: none; }
  html.warping main, html.warping header { transition: none; opacity: 1; transform: none; filter: none; }
}

/* ---------- Technical Breakdown : sections par logiciel ---------- */
.tech-block { margin-top: 56px; }
.tech-block:first-of-type { margin-top: 0; }
.tech-sub {
  display: flex; align-items: center; gap: 12px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  letter-spacing: 0.18em; color: var(--text2);
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tech-sub img { width: 22px; height: 22px; object-fit: contain; }
.tech-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tech-grid figure {
  position: relative; overflow: hidden;
  aspect-ratio: 16/10;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border); border-radius: 10px;
}

/* onglets de catégories du Technical Breakdown (Houdini / Nuke / ...) */
.tech-tabs { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.tech-tab {
  display: inline-flex; align-items: center; gap: 10px;
  background: none; cursor: pointer;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 20px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  letter-spacing: 0.14em; color: var(--text2);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.tech-tab img { width: 20px; height: 20px; object-fit: contain; }
.tech-tab:hover { color: var(--text); border-color: var(--border-hover); }
.tech-tab.active { color: var(--text); border-color: var(--accent); }
.has-tech-tabs .tech-block { display: none; }
.has-tech-tabs .tech-block.active { display: block; margin-top: 0; }
.has-tech-tabs .tech-block .tech-sub { display: none; }
.tech-grid figure img {
  width: 100%; height: 100%; object-fit: contain;
  cursor: zoom-in;
}
.tech-grid figcaption {
  position: absolute; left: 10px; bottom: 8px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.12em; color: rgba(241,241,237,0.85);
  background: rgba(8,9,9,0.65); padding: 4px 9px;
  border-radius: 5px;
  pointer-events: none;
}
@media (max-width: 900px) {
  .tech-grid { grid-template-columns: 1fr; }
}

/* ---------- Header ---------- */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 48px;
  transition: background 0.4s ease, padding 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
header.scrolled {
  padding: 14px 48px;
  background: rgba(8,9,9,0.72);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}
.logo { font-weight: 600; font-size: 15px; letter-spacing: 0.14em; }
nav { display: flex; align-items: center; gap: 34px; }
nav a.navlink {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; letter-spacing: 0.12em; color: var(--text2);
  position: relative; padding: 4px 0;
  transition: color 0.2s ease;
}
nav a.navlink::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--text);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.22s ease;
}
nav a.navlink:hover { color: var(--text); }
nav a.navlink:hover::after { transform: scaleX(1); }
nav a.navlink.active { color: var(--text); }
nav a.navlink.active::after { transform: scaleX(1); background: var(--accent); }
.lang-toggle {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; letter-spacing: 0.1em;
  color: var(--text3); background: none;
  border: 1px solid var(--border);
  padding: 6px 12px; cursor: pointer;
  white-space: nowrap; flex: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.lang-toggle:hover { color: var(--text); border-color: var(--border-hover); }
.lang-toggle b { color: var(--text); font-weight: 500; }

/* ---------- Structure commune ---------- */
main { max-width: 1680px; margin: 0 auto; padding: 0 48px; }
section { padding-top: 130px; }
section:last-of-type { padding-bottom: 140px; }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 26px; border-top: 1px solid var(--border); margin-bottom: 56px;
}
.sec-title { font-size: clamp(26px, 3vw, 40px); font-weight: 600; letter-spacing: -0.01em; }
.sec-index { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text3); letter-spacing: 0.1em; }

/* ---------- Hero (pages) ---------- */
.page-hero { padding-top: 190px; }
.page-hero .kicker {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  letter-spacing: 0.22em; color: var(--accent); margin-bottom: 22px;
}
.page-hero h1 {
  font-size: clamp(44px, 7vw, 96px);
  font-weight: 600; line-height: 1; letter-spacing: -0.015em;
}
.page-hero .sub {
  margin-top: 22px; max-width: 560px;
  color: var(--text2); font-size: 16px; line-height: 1.7;
}

/* ---------- Accueil : hero voyage ---------- */
.home-hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; padding-bottom: 80px;
}
.hero-visual {
  position: absolute; top: 0; bottom: 0;
  right: calc(-48px - max(0px, (100vw - 1680px) / 2));
  width: calc(64% + max(0px, (100vw - 1680px) / 2));
  min-width: 420px; z-index: 0;
  display: block; cursor: pointer;
  -webkit-mask-image: linear-gradient(110deg, transparent 16%, #000 52%);
  mask-image: linear-gradient(110deg, transparent 16%, #000 52%);
}
.hero-visual img {
  width: 100%; height: 100%; object-fit: cover; object-position: 38% 30%;
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
}
.hero-visual:hover img { filter: brightness(1.18) saturate(1.06); }
.hero-visual::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,9,9,0.2) 0%, rgba(8,9,9,0) 30%, rgba(8,9,9,0) 60%, rgba(8,9,9,0.92) 100%);
}
.home-hero > .hero-fg { position: relative; z-index: 2; pointer-events: none; }
.home-hero > .hero-fg a, .home-hero > .hero-fg button { pointer-events: auto; }
.hero-credit {
  position: absolute; right: 0; bottom: 34px; z-index: 2;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 0.1em; color: var(--text3);
  background: rgba(8,9,9,0.55); padding: 6px 10px;
  transition: color 0.25s ease;
  pointer-events: none;
}
.hero-visual:hover ~ .hero-credit { color: var(--text); }
.home-hero .kicker {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  letter-spacing: 0.26em; color: var(--text3); margin-bottom: 26px;
}
.home-hero h1 {
  font-size: clamp(56px, 10.5vw, 150px);
  font-weight: 600; line-height: 0.96; letter-spacing: -0.02em;
}
.home-hero h1 .dim { color: var(--text3); }
.home-hero .sub {
  margin-top: 26px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px; letter-spacing: 0.22em; color: var(--text2);
}
.home-hero .currently {
  margin-top: 46px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; line-height: 2.1; letter-spacing: 0.08em;
  color: var(--text3);
}
.home-hero .currently .v { color: var(--text2); }
.home-hero .currently .currently-status {
  color: var(--mint);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.12em;
  margin-top: 8px;
}
.hero-scroll {
  position: absolute; left: 0; bottom: 34px;
  display: flex; align-items: center; gap: 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 0.2em; color: var(--text3);
}
.hero-scroll .line { width: 1px; height: 34px; background: var(--text3); overflow: hidden; position: relative; }
.hero-scroll .line::after {
  content: ""; position: absolute; left: 0; top: -100%;
  width: 100%; height: 100%; background: var(--text);
  animation: scrollline 2.6s ease-in-out infinite;
}
@keyframes scrollline { 0% { top: -100%; } 55% { top: 100%; } 100% { top: 100%; } }

/* ---------- Cartes projet ---------- */
.tile { position: relative; }
.tile .media {
  position: relative; overflow: hidden; border-radius: 2px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.tile .media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(0.22,1,0.36,1); }
.tile:hover .media img { transform: scale(1.025); }
.tile .view-tag {
  position: absolute; right: 18px; bottom: 18px; z-index: 2;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.15em;
  color: var(--text); background: rgba(8,9,9,0.65);
  padding: 8px 14px; opacity: 0; transition: opacity 0.3s ease;
}
.tile:hover .view-tag { opacity: 1; }
.tile .meta { display: flex; align-items: baseline; gap: 18px; margin-top: 18px; flex-wrap: wrap; }
.tile .num { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--accent); }
.tile .name { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.tile .tags {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px;
  letter-spacing: 0.1em; color: var(--text3); margin-left: auto;
  display: flex; gap: 16px;
}

/* Featured (projet phare) */
.featured { display: grid; grid-template-columns: 7.5fr 4.5fr; gap: 44px; align-items: end; }
.featured .media { aspect-ratio: 16/9; }
.featured .side { display: flex; flex-direction: column; gap: 16px; padding-bottom: 6px; }
.featured .side .num { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--accent); }
.featured .side .name { font-size: clamp(28px, 3.2vw, 46px); font-weight: 600; line-height: 1.05; letter-spacing: -0.015em; }
.featured .side .desc { color: var(--text2); font-size: 15px; line-height: 1.7; }
.featured .side .tags {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.1em; color: var(--text3);
  display: flex; flex-direction: column; gap: 7px;
}

/* Le projet phare attire l'œil : liseré pulsant + balayage lumineux périodique */
.featured .media::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  border: 1px solid var(--accent); border-radius: 2px;
  animation: featuredPulse 3.2s ease-in-out infinite;
}
.featured .media::after {
  content: ""; position: absolute; top: -25%; bottom: -25%; left: -45%; width: 38%;
  z-index: 2; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(241,241,237,0.12) 45%, rgba(129,146,255,0.16) 55%, transparent);
  transform: skewX(-14deg);
  animation: featuredShine 5s ease-in-out infinite;
}
@keyframes featuredPulse {
  0%, 100% { opacity: 0.2; box-shadow: 0 0 0 rgba(81, 99, 232, 0); }
  50% { opacity: 0.85; box-shadow: 0 0 38px rgba(81, 99, 232, 0.32); }
}
@keyframes featuredShine {
  0%, 55% { transform: skewX(-14deg) translateX(0); }
  90%, 100% { transform: skewX(-14deg) translateX(520%); }
}
.featured .media:hover::before { animation: none; opacity: 1; box-shadow: 0 0 44px rgba(81, 99, 232, 0.4); }
@media (prefers-reduced-motion: reduce) {
  .featured .media::before { animation: none; opacity: 0.5; }
  .featured .media::after { animation: none; display: none; }
}

/* Grille compacte */
.work-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 28px; margin-top: 72px;
}
.work-grid .media { aspect-ratio: 4/3; }

/* Panneau d'attente (médias pas encore importés) */
.pending {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at 25% 20%, rgba(81,99,232,0.14), transparent 55%),
    radial-gradient(ellipse at 75% 80%, rgba(232,90,200,0.10), transparent 55%),
    var(--panel);
}
.pending .corner { position: absolute; width: 16px; height: 16px; border-color: var(--text3); }
.pending .tl { top: 10px; left: 10px; border-top: 1px solid; border-left: 1px solid; }
.pending .tr { top: 10px; right: 10px; border-top: 1px solid; border-right: 1px solid; }
.pending .bl { bottom: 10px; left: 10px; border-bottom: 1px solid; border-left: 1px solid; }
.pending .br { bottom: 10px; right: 10px; border-bottom: 1px solid; border-right: 1px solid; }
.pending span {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px;
  letter-spacing: 0.18em; color: var(--text3); text-align: center; line-height: 2.2;
  padding: 0 16px;
}

/* ---------- YouTube (lecteur au clic — le son fonctionne) ---------- */
.yt {
  position: relative; overflow: hidden; cursor: pointer;
  width: 100%; height: 100%; background: #000;
}
.yt img.poster { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.3s ease, transform 0.7s cubic-bezier(0.22,1,0.36,1); }
.yt:hover img.poster { opacity: 1; }
.yt .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.yt .play .btn {
  width: 62px; height: 62px; border-radius: 50%;
  background: rgba(8,9,9,0.72); border: 1px solid var(--border-hover);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.25s ease, background 0.25s ease;
}
.yt:hover .play .btn { transform: scale(1.08); background: rgba(8,9,9,0.9); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt .sound-note {
  position: absolute; left: 14px; bottom: 12px;
  font-family: 'IBM Plex Mono', monospace; font-size: 9.5px;
  letter-spacing: 0.14em; color: var(--text3);
  background: rgba(8,9,9,0.6); padding: 5px 9px;
}

/* ---------- Page projet ---------- */
.project-hero { margin-top: 40px; }
.project-hero .media { overflow: hidden; border-radius: 2px; border: 1px solid var(--border); }
.project-hero img { width: 100%; height: auto; }
.project-info {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 32px; margin-top: 44px; padding-top: 30px; border-top: 1px solid var(--border);
}
.project-info .cell .k {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px;
  letter-spacing: 0.16em; color: var(--text3); margin-bottom: 10px;
}
.project-info .cell .v { font-size: 14px; color: var(--text2); line-height: 1.7; }
.overview { display: grid; grid-template-columns: 1fr 2fr; gap: 44px; margin-top: 90px; }
.overview .label { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.18em; color: var(--text3); }
.overview .body { max-width: 680px; color: var(--text2); font-size: 16.5px; line-height: 1.8; }
.overview .body p + p { margin-top: 18px; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 90px; }
.gallery.trio { grid-template-columns: repeat(3, 1fr); }
.gallery .full { grid-column: 1 / -1; }
.gallery figure { position: relative; overflow: hidden; border-radius: 2px; border: 1px solid var(--border); }
.gallery figure:not(.full) { aspect-ratio: 3/4; }
.gallery figure:not(.full) img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.gallery figcaption {
  position: absolute; left: 16px; bottom: 13px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.14em; color: rgba(241,241,237,0.85);
  background: rgba(8,9,9,0.55); padding: 5px 10px;
}
.videos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 90px; }
.videos-grid video { width: 100%; height: auto; display: block; border-radius: 2px; border: 1px solid var(--border); background: #000; }
.credits { margin-top: 64px; padding-top: 26px; border-top: 1px solid var(--border); }
.credits p { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text3); line-height: 2.2; letter-spacing: 0.06em; }
.backlink {
  display: inline-flex; gap: 10px; align-items: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  letter-spacing: 0.14em; color: var(--text2); margin-top: 64px;
}
.backlink:hover { color: var(--text); }

/* ---------- Lab ---------- */
.lab-rows { margin-top: 10px; }
.lab-row {
  display: grid; grid-template-columns: 90px 160px 1fr auto;
  gap: 24px; align-items: baseline;
  padding: 26px 0; border-bottom: 1px solid var(--border);
  transition: border-color 0.25s ease;
}
.lab-row:first-child { border-top: 1px solid var(--border); }
.lab-row:hover { border-color: var(--border-hover); }
.lab-row .id { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--accent); }
.lab-row .cat { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.1em; color: var(--text3); }
.lab-row .name { font-size: 18px; font-weight: 600; }
.lab-row .desc { font-size: 13px; color: var(--text3); margin-top: 6px; }
.lab-row .status { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.12em; color: var(--amber); }
/* ---------- Page Outils : recherche, filtre latéral, bandes par catégorie ---------- */
.tools-bar { margin-bottom: 34px; }
#toolSearch {
  width: 100%; background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: 'IBM Plex Mono', monospace;
  font-size: 13px; letter-spacing: 0.1em;
  padding: 15px 18px; outline: none;
  transition: border-color 0.25s ease;
}
#toolSearch::placeholder { color: var(--text3); letter-spacing: 0.14em; }
#toolSearch:focus { border-color: var(--accent); }

.tools-layout { display: grid; grid-template-columns: 200px 1fr; gap: 48px; align-items: start; }
.tools-side { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 2px; }
.tool-navlink {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer; text-align: left;
  background: none; border: 0; border-left: 2px solid transparent;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.14em; color: var(--text3);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.tool-navlink:hover { color: var(--text2); }
.tool-navlink.active { color: var(--text); border-left-color: var(--accent); }
.tool-navlink .ico { width: 16px; height: 16px; object-fit: contain; opacity: 0.9; }
.tool-navlink .lbl { flex: 1; }
.tool-navlink .n { color: var(--text3); font-size: 10px; }

.tool-cat + .tool-cat { margin-top: 54px; }
.tool-cat-title {
  display: flex; align-items: center; gap: 12px;
  font-family: 'IBM Plex Mono', monospace; font-size: 13px;
  letter-spacing: 0.22em; color: var(--accent);
  margin-bottom: 4px;
}
.tool-cat-title .cat-logo { width: 24px; height: 24px; object-fit: contain; }
.tool-cat-count {
  margin-left: auto; font-size: 10px;
  letter-spacing: 0.14em; color: var(--text3);
}
.tools-empty {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  letter-spacing: 0.14em; color: var(--text3);
  padding: 40px 0;
}
/* bouton de téléchargement, à droite de la ligne */
.dl-btn {
  display: inline-block; white-space: nowrap;
  border: 1px solid var(--accent); border-radius: 6px;
  padding: 9px 16px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.14em; color: var(--text);
  transition: background 0.22s ease, transform 0.22s ease;
}
.dl-btn:hover { background: rgba(81, 99, 232, 0.18); transform: translateY(-2px); }
.lab-rows.grouped .lab-row {
  grid-template-columns: 92px 1fr auto auto;
  gap: 20px; align-items: center;
  padding: 24px 0;
}
.lab-rows.grouped .lab-row .cat { display: none; }
.lab-rows.grouped .lab-row:first-child { border-top: none; }
.lab-rows.grouped .lab-row:last-child { border-bottom: none; }
.lab-rows.grouped .lab-row .name { font-size: 20px; transition: color 0.25s ease; }
.lab-rows.grouped .lab-row .desc { max-width: 62ch; line-height: 1.75; margin-top: 9px; }
a.lab-row:hover .name { color: var(--accent); }
.lab-rows.grouped .lab-row .status {
  border: 1px solid rgba(255,255,255,0.14); border-radius: 4px;
  padding: 5px 10px; white-space: nowrap;
}
@media (max-width: 900px) {
  .tools-layout { grid-template-columns: 1fr; gap: 26px; }
  .tools-side {
    position: static; flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; gap: 6px; padding-bottom: 6px;
  }
  .tool-navlink {
    border-left: 0; border-bottom: 2px solid transparent;
    padding: 8px 10px; flex: none;
  }
  .tool-navlink.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .lab-rows.grouped .lab-row {
    grid-template-columns: 1fr auto;
    row-gap: 10px; align-items: start;
  }
  .lab-rows.grouped .lab-row .id { grid-column: 1; }
  .lab-rows.grouped .lab-row .status { grid-column: 2; justify-self: end; }
  .lab-rows.grouped .lab-row .name-wrap { grid-column: 1 / -1; }
  .lab-rows.grouped .lab-row .get { grid-column: 1 / -1; }
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 60px; margin-top: 40px; align-items: start; }
.photo-slot {
  aspect-ratio: 4/5; position: relative;
  border: 1px solid var(--border); border-radius: 2px;
  background:
    radial-gradient(ellipse at 30% 25%, rgba(81,99,232,0.12), transparent 60%),
    var(--panel);
  display: flex; align-items: center; justify-content: center;
}
.photo-slot span { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.18em; color: var(--text3); text-align: center; line-height: 2.2; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; object-position: 72% 22%; }
.about-text p { color: var(--text2); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.75; }
.about-text p + p { margin-top: 18px; }
.software { margin-top: 100px; }
.software-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  margin-top: 40px;
}
.software-cell {
  background: var(--bg); padding: 26px 18px;
  display: flex; flex-direction: column-reverse; align-items: center; gap: 14px;
  transition: background 0.25s ease;
}
.software-cell:hover { background: var(--bg2); }
.software-cell img { width: 34px; height: 34px; object-fit: contain; opacity: 0.85; }
.software-cell span { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.14em; color: var(--text3); }

/* ---------- Contact ---------- */
.contact-big {
  font-size: clamp(52px, 9.5vw, 140px);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1.02;
  transition: color 0.3s ease;
}
.contact-big:hover { color: var(--accent); }
.contact-links { display: flex; gap: 34px; margin-top: 48px; flex-wrap: wrap; }
.contact-links a {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  letter-spacing: 0.15em; color: var(--text2);
  transition: color 0.2s ease;
}
.contact-links img { width: 18px; height: 18px; object-fit: contain; opacity: 0.9; }
.contact-links a:hover { color: var(--text); }

/* ---------- Groupes de contact rangés (page Contact) ---------- */
.contact-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.18em; color: var(--text3); margin: 0 0 14px;
}
.contact-chips { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-chips a, .contact-chips > span {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); padding: 12px 18px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  letter-spacing: 0.12em; color: var(--text2);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.contact-chips a:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }
.contact-chips img { width: 18px; height: 18px; object-fit: contain; opacity: 0.9; }
.contact-chips > span { color: var(--text3); }
/* gros bouton CV sous le titre Contact - même appel visuel que le projet phare */
.cv-big {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 16px;
  margin-top: 36px;
  padding: 20px 34px;
  border: 1px solid var(--accent);
  font-family: 'IBM Plex Mono', monospace; font-size: 15px;
  letter-spacing: 0.14em; color: var(--text);
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  animation: cvPulse 3.2s ease-in-out infinite;
}
.cv-big::after {
  content: ""; position: absolute; top: -30%; bottom: -30%; left: -60%; width: 40%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(241,241,237,0.14) 45%, rgba(129,146,255,0.18) 55%, transparent);
  transform: skewX(-14deg);
  animation: featuredShine 5s ease-in-out infinite;
}
@keyframes cvPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(81, 99, 232, 0); }
  50% { box-shadow: 0 0 28px rgba(81, 99, 232, 0.3); }
}
.cv-big img { width: 34px; height: 34px; object-fit: contain; }
.cv-big:hover {
  animation: none;
  background: rgba(81, 99, 232, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(81, 99, 232, 0.28);
}
@media (prefers-reduced-motion: reduce) {
  .cv-big { animation: none; }
  .cv-big::after { display: none; }
}

/* rangée principale : CV, mail, téléphone, LinkedIn — plus imposants */
.contact-chips.big a {
  padding: 18px 26px;
  font-size: 14px;
  color: var(--text);
}
.contact-chips.big img { width: 27px; height: 27px; }

.about-cta {
  display: inline-block; margin-top: 40px;
  font-size: clamp(30px, 4.5vw, 54px);
  font-weight: 600; letter-spacing: -0.02em;
  transition: color 0.3s ease;
}
.about-cta:hover { color: var(--accent); }

/* ---------- CTA bas de page ---------- */
.cta-strip { text-align: left; }
.cta-strip a.big {
  display: inline-block;
  font-size: clamp(40px, 6.5vw, 96px);
  font-weight: 600; letter-spacing: -0.02em;
  transition: color 0.3s ease;
}
.cta-strip a.big:hover { color: var(--accent); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 34px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.12em; color: var(--text3);
  flex-wrap: wrap;
}

/* ---------- Viewer horizontal des pages PDF ---------- */
.pdf-strip {
  display: flex; gap: 14px;
  overflow-x: auto; padding-bottom: 16px;
  scroll-snap-type: x proximity;
}
.pdf-strip img {
  height: 320px; width: auto; flex: none;
  scroll-snap-align: start;
  border: 1px solid var(--border); border-radius: 2px;
  cursor: zoom-in;
  transition: border-color 0.25s ease, transform 0.4s ease;
}
.pdf-strip img:hover { border-color: var(--border-hover); transform: translateY(-4px); }
.pdf-strip::-webkit-scrollbar { height: 8px; }
.pdf-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 4px; }
.pdf-strip::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
.pdf-hint {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px;
  letter-spacing: 0.14em; color: var(--text3); margin-top: 10px;
}

/* variante verticale : toutes les pages déjà alignées et collées, dans le flux de la page */
.pdf-strip.vertical {
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  padding-bottom: 0;
  border: 1px solid var(--border); border-radius: 10px;
  scroll-snap-type: none;
}
.pdf-strip.vertical img {
  width: 100%; height: auto;
  /* réserve la hauteur avant chargement : sinon le conteneur s'effondre
     et les images en loading="lazy" ne se chargent jamais */
  aspect-ratio: 1843 / 783;
  border: none; border-radius: 0;
}
.pdf-strip.vertical img:hover { transform: none; }
@media (max-width: 900px) {
  .pdf-strip img { height: 220px; }
}

/* ---------- Lightbox (visualiseur plein écran) ---------- */
.lightboxable, .gallery figure, .project-hero .media img, video[data-loop] { cursor: zoom-in; }
#lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: center; justify-content: center;
  background: rgba(5,6,6,0.94);
  backdrop-filter: blur(6px);
}
#lightbox.open { display: flex; animation: lbIn 0.25s ease; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
#lightbox .lb-stage {
  max-width: 92vw; max-height: 86vh;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  position: relative; z-index: 1;
}
#lightbox .lb-stage img, #lightbox .lb-stage video {
  max-width: 92vw; max-height: 78vh;
  width: auto; height: auto;
  border: 1px solid var(--border);
  background: #000;
  cursor: default;
}
#lightbox .lb-stage .zoomable {
  cursor: zoom-in;
  transform-origin: 0 0;
  touch-action: none;
}
#lightbox .lb-caption {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.14em; color: var(--text3); text-align: center;
}
#lightbox .lb-split {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px;
  align-items: center; max-width: 92vw;
}
#lightbox .lb-split img { max-height: 78vh; }
#lightbox .lb-panel { max-width: 420px; }
#lightbox .lb-panel .lb-kicker {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.2em; color: var(--accent); margin-bottom: 16px;
}
#lightbox .lb-panel h3 {
  font-size: 28px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 20px;
}
#lightbox .lb-panel p {
  font-size: 14.5px; line-height: 1.7; color: var(--text2); margin-bottom: 14px;
}
@media (max-width: 900px) {
  #lightbox .lb-split { grid-template-columns: 1fr; gap: 20px; overflow-y: auto; max-height: 86vh; }
  #lightbox .lb-split img { max-height: 48vh; }
}
#lightbox .lb-close {
  position: absolute; top: 22px; right: 26px; z-index: 10;
  background: none; border: 1px solid var(--border); color: var(--text2);
  font-family: 'IBM Plex Mono', monospace; font-size: 13px;
  padding: 10px 14px; cursor: pointer; letter-spacing: 0.1em;
  transition: color 0.2s ease, border-color 0.2s ease;
}
#lightbox .lb-close:hover { color: var(--text); border-color: var(--border-hover); }
#lightbox .lb-prev, #lightbox .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
  background: rgba(8,9,9,0.6); border: 1px solid var(--border); color: var(--text2);
  font-size: 20px; width: 48px; height: 48px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s ease, border-color 0.2s ease;
}
#lightbox .lb-prev { left: 22px; }
#lightbox .lb-next { right: 22px; }
#lightbox .lb-prev:hover, #lightbox .lb-next:hover { color: var(--text); border-color: var(--border-hover); }
#lightbox .lb-controls {
  display: flex; align-items: center; gap: 10px;
}
#lightbox .lb-controls button {
  background: rgba(8,9,9,0.7); border: 1px solid var(--border); color: var(--text2);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  padding: 9px 14px; cursor: pointer; letter-spacing: 0.08em;
  transition: color 0.2s ease, border-color 0.2s ease;
}
#lightbox .lb-controls button:hover { color: var(--text); border-color: var(--border-hover); }
#lightbox .lb-frame {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  letter-spacing: 0.1em; color: var(--text3); min-width: 150px; text-align: center;
}
#lightbox .lb-hint {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 10;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.14em; color: var(--text3);
}

/* ---------- Retour en haut ---------- */
#toTop {
  position: fixed; right: 26px; bottom: 26px; z-index: 150;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,9,9,0.72); backdrop-filter: blur(8px);
  border: 1px solid var(--border); color: var(--text2);
  cursor: pointer;
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease, border-color 0.2s ease;
}
#toTop.show { opacity: 1; transform: none; pointer-events: auto; }
#toTop:hover { color: var(--text); border-color: var(--accent); }
@media (max-width: 900px) {
  #toTop { right: 16px; bottom: 16px; }
}

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.on { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-scroll .line::after { animation: none; }
  html { scroll-behavior: auto; }
  #veil { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  header, header.scrolled { padding-left: 20px; padding-right: 20px; }
  nav { gap: 18px; }
  main { padding: 0 20px; }
  .featured { grid-template-columns: 1fr; gap: 26px; }
  .work-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
  .overview { grid-template-columns: 1fr; gap: 18px; }
  .project-info { grid-template-columns: 1fr 1fr; }
  .gallery, .gallery.trio { grid-template-columns: 1fr; }
  .videos-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .lab-row { grid-template-columns: 70px 1fr; }
  .lab-row .name-wrap { grid-column: 2; }
  .lab-row .status { grid-column: 2; }
  .home-hero .currently { margin-top: 40px; }
  /* pleine largeur + fondu à gauche : sinon l'image se termine par un bord net */
  .hero-visual {
    left: -20px; right: -20px; width: auto; min-width: 0;
    opacity: 0.34; pointer-events: none;
    -webkit-mask-image: linear-gradient(100deg, transparent 2%, #000 44%);
    mask-image: linear-gradient(100deg, transparent 2%, #000 44%);
  }
  .hero-visual::after {
    background: linear-gradient(180deg, rgba(8,9,9,0.4) 0%, rgba(8,9,9,0.55) 55%, rgba(8,9,9,0.95) 100%);
  }
  footer { padding: 28px 20px; }
}
@media (max-width: 640px) {
  .work-grid { grid-template-columns: 1fr; }
  /* le crédit passe au-dessus de l'indicateur de scroll (sinon ils se chevauchent) */
  .hero-credit { bottom: 82px; }
  header, header.scrolled { flex-wrap: wrap; row-gap: 10px; padding-top: 14px; padding-bottom: 12px; }
  nav { width: 100%; justify-content: space-between; gap: 8px; }
  nav a.navlink { font-size: 10.5px; letter-spacing: 0.08em; }
  .lang-toggle { font-size: 10.5px; padding: 6px 10px; }
  .contact-chips a, .contact-chips > span { max-width: 100%; overflow-wrap: anywhere; }
  .contact-chips.big a { font-size: 14px; padding: 12px 14px; }
  .project-info { gap: 14px; }
  #lightbox .lb-close { top: 12px; right: 12px; }
  #lightbox .lb-prev { left: 8px; }
  #lightbox .lb-next { right: 8px; }
}
