/* ============================================================
   Tintine - portfolio
   Fond clair, typographie Minecraft, un seul rouge.
   ============================================================ */

@font-face { font-family: 'MCTen';      src: url('assets/fonts/MinecraftTen.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'MCTenLower'; src: url('assets/fonts/MCTenLowercaseAlt.woff2') format('woff2'),
                                             url('assets/fonts/MCTenLowercaseAlt.woff') format('woff'); font-display: swap; }
@font-face { font-family: 'MCia';       src: url('assets/fonts/Minecraftia.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Micro5';     src: url('assets/fonts/Micro5.ttf') format('truetype'); font-display: swap; }

:root {
  --papier:  #fbfaf9;   /* fond */
  --blanc:   #ffffff;   /* cartes, panneaux */
  --creux:   #f1eeec;   /* blocs en retrait */

  --encre:   #17110f;   /* texte */
  --gris:    rgba(23, 17, 15, .54);
  --trait:   rgba(23, 17, 15, .14);

  --rouge:     #c0142b;   /* LA couleur */
  --rouge-vif: #ff4b57;   /* survols, aplats vifs */

  --display: 'MCTen', 'Minecraft Ten', 'Arial Black', sans-serif;
  --minus:   'MCTenLower', 'MCTen', 'Minecraft Ten', sans-serif;
  --corps:   'MCia', 'Minecraftia 2.0', ui-monospace, 'Courier New', monospace;
  --chiffre: 'Micro5', 'MCTen', monospace;

  --gout: clamp(20px, 5vw, 64px);
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--corps);
  font-size: 15px;
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
h1, h2, h3, b, strong { font-weight: normal; }
::selection { background: var(--rouge); color: var(--blanc); }
:focus-visible { outline: 3px solid var(--rouge); outline-offset: 3px; }

.filtres { position: absolute; width: 0; height: 0; }

.visuellement-cache {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 999;
  padding: 10px 16px; background: var(--rouge); color: var(--blanc);
  font-family: var(--display); transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- barre du haut ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 16px var(--gout);
  background: rgba(251, 250, 249, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--trait);
}
.nav__nom {
  font-family: var(--display); font-size: 1.2rem; letter-spacing: .04em;
  opacity: 0; transform: translateY(6px);
  transition: opacity .35s ease, transform .35s ease;
}
.nav.est-fixe .nav__nom { opacity: 1; transform: none; }

.nav__liens { display: flex; gap: clamp(14px, 3vw, 34px); margin-left: auto; }
.nav__liens a {
  position: relative;
  font-family: var(--minus); font-size: 1.05rem; white-space: nowrap;
  color: var(--gris); transition: color .25s ease;
}
.nav__liens a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -3px;
  height: 2px; background: var(--rouge); transition: right .3s ease;
}
.nav__liens a:hover { color: var(--encre); }
.nav__liens a:hover::after { right: 0; }

.nav__mail {
  font-family: var(--display); font-size: 12px;
  padding: 9px 16px; border: 2px solid var(--encre);
  transition: background .22s ease, color .22s ease, border-color .22s ease;
}
.nav__mail:hover { background: var(--rouge); border-color: var(--rouge); color: var(--blanc); }

.xp { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; overflow: hidden; }
.xp__jauge { display: block; width: 100%; height: 100%; background: var(--rouge); transform: scaleX(0); transform-origin: 0 50%; }

/* ---------- 01. ouverture ---------- */
.ouverture {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(60px, 12vh, 130px) var(--gout) clamp(40px, 7vh, 80px);
  min-height: 88vh;
  display: flex; flex-direction: column; justify-content: center;
}
.ouverture__sur {
  margin: 0 0 clamp(16px, 3vw, 30px);
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--gris);
}
.ouverture__nom {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.4rem, 14vw, 11rem);
  line-height: .84; letter-spacing: -.01em;
}

/* le fondu en goutte : le seuillage sur l'extérieur, le flou sur
   l'intérieur. Les deux sur le même élément ne donneraient qu'un
   flou, car les filtres CSS s'appliquent de gauche à droite. */
.goutte { filter: url(#seuil); }
.goutte__interne { display: inline-block; }
.goutte .goutte__interne { will-change: filter; }

/* le morph : deux mots superposés, fondus par le filtre de seuillage */
.morph {
  position: relative;
  height: clamp(3rem, 8.5vw, 6.5rem);
  margin-top: clamp(10px, 2vw, 22px);
  filter: url(#seuil) blur(0.7px);
}
.morph__mot {
  position: absolute; left: 0; top: 0; width: 100%;
  font-family: var(--display);
  font-size: clamp(2.4rem, 7.5vw, 5.8rem);
  line-height: 1.05;
  color: var(--rouge);
  user-select: none; white-space: nowrap;
}

.ouverture__bas {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  margin-top: clamp(34px, 6vw, 64px);
  padding-top: 22px;
  border-top: 1px solid var(--trait);
}
.ouverture__defile { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gris); }

.lien-fleche {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--display); font-size: clamp(15px, 1.7vw, 20px);
  transition: gap .25s ease, color .25s ease;
}
.lien-fleche::after {
  content: ""; width: 30px; height: 2px; background: var(--encre);
  transition: width .25s ease, background .25s ease;
}
.lien-fleche:hover { color: var(--rouge); gap: 18px; }
.lien-fleche:hover::after { width: 44px; background: var(--rouge); }

/* ---------- 02. la phrase qui se révèle ---------- */
.manifeste {
  display: flex; align-items: center;
  min-height: 100vh;
  padding: 0 var(--gout);
}
.manifeste__phrase {
  max-width: 20ch;
  margin: 0 auto;
  font-family: var(--display);
  font-size: clamp(1.7rem, 5.2vw, 4rem);
  line-height: 1.22;
}
.manifeste__phrase .mot { transition: color .25s ease; }
.manifeste__phrase.est-anime .mot { color: rgba(23, 17, 15, .13); }
.manifeste__phrase.est-anime .mot.est-lu { color: var(--encre); }
.manifeste__phrase.est-anime .mot.est-lu.est-clef { color: var(--rouge); }

/* ---------- structure commune ---------- */
main { position: relative; z-index: 2; }
.section { max-width: var(--max); margin: 0 auto; padding: clamp(70px, 12vh, 150px) var(--gout) 0; scroll-margin-top: 90px; }

.section__tete { display: flex; align-items: baseline; gap: 18px; margin-bottom: 14px; }
.section__num { font-family: var(--chiffre); font-size: 1.6rem; color: var(--rouge); }
.titre { margin: 0; font-family: var(--display); font-size: clamp(1.9rem, 5vw, 3.2rem); line-height: 1.05; }
.lede { max-width: 52ch; margin: 0 0 clamp(24px, 4vw, 44px); color: var(--gris); font-size: 13px; }

/* ---------- 03. compétences en lignes ---------- */
.comps__groupe + .comps__groupe { margin-top: clamp(34px, 5vw, 60px); }
.comps__niveau {
  margin: 0 0 8px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gris);
}
.comps { border-top: 1px solid var(--trait); }

.comp {
  position: relative;
  display: grid; grid-template-columns: 46px minmax(0, 1fr) minmax(0, 1.15fr) auto;
  gap: 24px; align-items: baseline;
  width: 100%; text-align: left;
  padding: clamp(18px, 2.4vw, 28px) 0;
  border-bottom: 1px solid var(--trait);
  transition: color .25s ease;
}
.comp::before {
  content: ""; position: absolute; left: -12px; right: -12px; top: 0; bottom: 0;
  background: var(--blanc); opacity: 0; transition: opacity .25s ease;
  z-index: -1;
}
button.comp:hover::before { opacity: 1; }

button.comp::after {
  content: ""; position: absolute; left: -12px; top: 50%;
  width: 3px; height: 0;
  background: var(--rouge);
  transform: translateY(-50%);
  transition: height .3s ease;
}
button.comp:hover::after { height: 64%; }
button.comp:hover .comp__nom { color: var(--rouge); }
button.comp:hover .comp__voir { gap: 16px; color: var(--rouge); }

.comp__num { font-family: var(--chiffre); font-size: 1.35rem; color: var(--gris); }
.comp__nom { font-family: var(--display); font-size: clamp(1.05rem, 2vw, 1.5rem); line-height: 1.15; transition: color .25s ease; }
.comp__texte { margin: 0; font-size: 12px; line-height: 1.85; color: var(--gris); }
.comp__voir {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 13px;
  font-family: var(--display); font-size: 12px;
  color: var(--rouge);
  border: 2px solid var(--rouge);
  white-space: nowrap;
  transition: background .22s ease, color .22s ease, transform .22s ease;
}
.comp__compte {
  padding: 0 6px 1px;
  font-family: var(--chiffre); font-size: 1.15rem; line-height: 1.2;
  background: var(--rouge); color: var(--blanc);
  transition: background .22s ease, color .22s ease;
}
button.comp:hover .comp__voir { background: var(--rouge); color: var(--blanc); transform: translateX(-4px); }
button.comp:hover .comp__compte { background: var(--blanc); color: var(--rouge); }
.comp--vide .comp__voir { display: none; }

/* les secondaires, plus discrètes */
.comps--faible .comp { padding: clamp(12px, 1.6vw, 18px) 0; }
.comps--faible .comp__nom { font-size: clamp(.95rem, 1.5vw, 1.15rem); color: var(--gris); }

/* ---------- 04. la piste des projets ---------- */
.reel { position: relative; }
.reel__cadre {
  display: flex; flex-direction: column; justify-content: center; gap: clamp(24px, 4vw, 40px);
  min-height: 100vh;
  padding: clamp(70px, 10vh, 120px) 0 clamp(40px, 7vh, 80px);
  overflow: hidden;
}
.reel__entete { max-width: var(--max); width: 100%; margin: 0 auto; padding: 0 var(--gout); }
.reel__barre { display: block; width: min(300px, 55%); height: 2px; background: var(--trait); }
.reel__jauge { display: block; width: 100%; height: 100%; background: var(--rouge); transform: scaleX(0); transform-origin: 0 50%; }

.reel__piste {
  display: flex; gap: clamp(16px, 2vw, 26px);
  padding: 0 var(--gout);
  overflow-x: auto; scrollbar-width: none;
  will-change: transform;
}
.reel__piste::-webkit-scrollbar { display: none; }
.reel--pilote .reel__piste { overflow: visible; }
.reel__piste .carte { flex: 0 0 clamp(280px, 26vw, 370px); }

/* ---------- les cartes ---------- */
.carte {
  position: relative;
  display: flex; flex-direction: column; align-items: stretch;
  padding: 0; text-align: left;
  background: var(--blanc);
  border: 1px solid var(--trait);
  transition: border-color .25s ease, transform .3s ease, box-shadow .3s ease;
}
.carte:hover { border-color: var(--rouge); box-shadow: 0 18px 40px rgba(23, 17, 15, .1); }

.carte__vue { position: relative; flex: none; aspect-ratio: 16 / 9; overflow: hidden; background: var(--creux); }
.carte__vue img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.carte:hover .carte__vue img { transform: scale(1.04); }

.carte__voir {
  position: absolute; right: 0; bottom: 0;
  padding: 7px 13px;
  font-family: var(--display); font-size: 11px;
  background: var(--rouge); color: var(--blanc);
  opacity: 0; transform: translateY(100%);
  transition: opacity .25s ease, transform .25s ease;
}
.carte:hover .carte__voir, .carte:focus-visible .carte__voir { opacity: 1; transform: none; }

.carte__corps { flex: 1; padding: 20px 22px 24px; }
.carte__soustitre { margin: 0 0 6px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--gris); }
.carte__titre { font-family: var(--display); font-size: 1.15rem; line-height: 1.2; margin: 0 0 14px; }
.carte__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.carte__tags li {
  padding: 3px 9px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--trait); color: var(--gris);
}

/* ---------- 05. fin de page, sur fond sombre ---------- */
.final {
  margin-top: clamp(70px, 12vh, 150px);
  padding: clamp(60px, 10vh, 120px) 0;
  background: var(--encre);
  color: var(--papier);
  scroll-margin-top: 90px;
}
.final__inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gout);
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(34px, 6vw, 80px); align-items: start;
}
.final .section__num { color: var(--rouge-vif); }
.final__texte p { max-width: 50ch; font-size: 13px; color: rgba(251, 250, 249, .74); }

.conditions { margin-top: 34px; display: grid; gap: 22px; }
.condition { padding-top: 18px; border-top: 1px solid rgba(251, 250, 249, .16); }
.condition h3 { margin: 0 0 8px; font-family: var(--display); font-size: 1rem; color: var(--rouge-vif); }
.condition p { margin: 0 !important; font-size: 12px; color: rgba(251, 250, 249, .6) !important; }

.final__contact { padding-top: 8px; }
.contact__titre { margin: 0 0 22px; font-family: var(--display); font-size: 1.3rem; }
.contact__ligne { display: flex; flex-direction: column; margin-bottom: 18px; }
.contact__ligne[hidden] { display: none; }
.contact__quoi { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(251, 250, 249, .5); }
.contact__quoi b { color: var(--rouge-vif); }
.contact__valeur {
  align-self: flex-start; padding: 0; text-align: left;
  font-family: var(--display); font-size: 1.05rem; color: var(--papier);
  border-bottom: 2px solid transparent; word-break: break-all;
  transition: border-color .25s ease, color .25s ease;
}
.contact__valeur:hover { color: var(--rouge-vif); border-color: var(--rouge-vif); }
.contact__valeur.est-copie { color: var(--rouge-vif); }

.contact__liens { margin: 26px 0 0; padding: 22px 0 0; list-style: none; border-top: 1px solid rgba(251, 250, 249, .16); }
.contact__liens li + li { margin-top: 14px; }
.contact__liens a {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--papier);
  transition: gap .22s ease, color .22s ease;
}
.contact__liens a::after { content: ""; width: 18px; height: 1px; background: var(--rouge-vif); }
.contact__liens a:hover { color: var(--rouge-vif); gap: 16px; }
.contact__liens small { display: block; font-size: 11px; line-height: 1.6; color: rgba(251, 250, 249, .5); }

/* ---------- pied ---------- */
.pied {
  display: flex; flex-wrap: wrap; gap: 12px 30px; justify-content: space-between;
  max-width: var(--max); margin: 0 auto;
  padding: 26px var(--gout) 40px;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(251, 250, 249, .45);
  background: var(--encre);
}
.pied { max-width: none; }
.pied p { margin: 0 auto; max-width: 76ch; }
.pied a:hover { color: var(--rouge-vif); }

/* ---------- boutons ---------- */
.btn {
  display: inline-block; padding: 13px 24px;
  font-family: var(--display); font-size: 14px;
  border: 2px solid currentColor;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn--plein { background: var(--rouge); border-color: var(--rouge); color: var(--blanc); }
.btn--plein:hover { background: var(--encre); border-color: var(--encre); }

/* ---------- fiche ---------- */
.fiche {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(23, 17, 15, .82);
  backdrop-filter: blur(5px);
  animation: apparait .2s ease;
}
.fiche[hidden] { display: none; }
@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }

.fiche__boite {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  width: 100%; max-width: 1160px; max-height: 92vh; overflow: auto;
  background: var(--papier);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .4);
}
.fiche__fermer {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px;
  background: var(--papier); border: 1px solid var(--trait);
  transition: background .2s ease, color .2s ease;
}
.fiche__fermer:hover { background: var(--rouge); border-color: var(--rouge); color: var(--blanc); }

.fiche__media { padding: clamp(14px, 2vw, 24px); position: relative; }
.fiche__ecran { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--creux); border: 1px solid var(--trait); }
.fiche__img { width: 100%; height: 100%; object-fit: cover; }

/* Flèches de navigation */
.fiche__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(23, 17, 15, 0.75); color: var(--blanc);
  font-family: system-ui, sans-serif; font-size: 18px;
  border: 2px solid transparent;
  transition: background 0.2s, transform 0.2s;
}
.fiche__nav:hover { background: var(--rouge); transform: translateY(-50%) scale(1.1); }
.fiche__nav--prev { left: 12px; }
.fiche__nav--next { right: 12px; }
.fiche__nav[hidden] { display: none; }

.fiche__charge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 8px 14px; background: var(--papier);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--rouge);
}
.fiche__charge[hidden] { display: none; }

.fiche__legende { margin: 12px 0 0; font-size: 12px; color: var(--gris); min-height: 2.2em; text-align: center; }

.fiche__infos { padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; }
.fiche__soustitre { margin: 0 0 6px; padding-right: 48px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--gris); }
.fiche__titre { margin: 0 0 18px; padding-right: 48px; font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.12; }
.fiche__tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 20px; padding: 0; list-style: none; }
.fiche__tags li { padding: 4px 10px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--trait); color: var(--gris); }
.fiche__texte { margin: 0 0 26px; font-size: 13px; color: var(--gris); }
.fiche__video { align-self: flex-start; margin-top: auto; }
.fiche__video[hidden] { display: none; }

/* ---------- écrans étroits ---------- */
@media (max-width: 900px) {
  .final__inner { grid-template-columns: 1fr; }
  .fiche__boite { grid-template-columns: 1fr; }
  .fiche__video { margin-top: 0; }

  .comp { grid-template-columns: 34px minmax(0, 1fr); gap: 14px 16px; }
  .comp__texte { grid-column: 2; }
  .comp__voir { grid-column: 2; justify-self: start; }

  .reel__cadre { min-height: 0; overflow: visible; }
  .reel__piste { display: grid; grid-template-columns: 1fr; transform: none !important; }
  .reel__piste .carte { flex: none; }
  .reel__barre { display: none; }

  .manifeste { min-height: 78vh; }
  .manifeste__phrase { max-width: 100%; }
}

@media (max-width: 700px) {
  body { font-size: 14px; }
  .nav { gap: 12px; padding: 12px 18px; }
  .nav__mail { display: none; }
  .nav__liens { gap: 12px; }
  .nav__liens a { font-size: .78rem; }
  .ouverture__bas { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ---------- animation réduite ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .morph { filter: none; }
  .morph__mot:last-child { display: none; }
  * { transition-duration: .01ms !important; }
}