/* ==========================================================
   Maxime Boullet, portfolio
   Bleu nuit, accent bleu pervenche et menthe. Police : Schibsted Grotesk.
   ========================================================== */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../assets/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c111d;
  --surface: rgba(22, 30, 48, 0.72);
  --surface-solid: #151d2f;
  --line: rgba(148, 166, 210, 0.14);
  --line-strong: rgba(148, 166, 210, 0.28);
  --text: #e9edf6;
  --soft: #c3cbdb;
  --muted: #8f9ab2;
  --accent: #7c9cff;
  --accent-2: #5fe0c8;
  --accent-soft: rgba(124, 156, 255, 0.14);
  --grad: linear-gradient(120deg, var(--accent) 0%, #9d8cff 45%, var(--accent-2) 100%);

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

::selection { background: rgba(124, 156, 255, .35); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--accent); color: var(--bg); padding: 10px 14px;
  border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Barres de défilement ---------- */

html { scrollbar-width: thin; scrollbar-color: rgba(124, 156, 255, .35) var(--bg); }
.chat-log { scrollbar-width: thin; scrollbar-color: rgba(148, 166, 210, .25) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(124, 156, 255, .3);
  border-radius: 999px; border: 3px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(124, 156, 255, .55); }
.chat-log::-webkit-scrollbar { width: 8px; }
.chat-log::-webkit-scrollbar-thumb { background-color: rgba(148, 166, 210, .25); }

/* ---------- En-tête ---------- */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(12, 17, 29, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
  transition: height .3s var(--ease);
}
.is-scrolled .header-inner { height: 60px; }

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; font-weight: 600;
}
.brand-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px; padding: 3px;
  background: var(--bg); border: 1px solid var(--line-strong);
  transition: transform .4s var(--ease), border-color .3s;
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); border-color: rgba(124, 156, 255, .5); }

.site-nav { position: relative; }
.site-nav ul { display: flex; gap: 2px; align-items: center; position: relative; z-index: 1; }
.site-nav a {
  display: block; padding: 8px 14px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: 0.95rem;
  transition: color .2s;
}
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--text); }
.nav-indicator {
  position: absolute; top: 0; left: 0; height: 100%;
  border-radius: 999px; background: rgba(124, 156, 255, .12);
  border: 1px solid rgba(124, 156, 255, .22);
  opacity: 0;
  transition: transform .45s var(--ease), width .45s var(--ease), opacity .3s;
  pointer-events: none;
}
.site-nav .nav-cv {
  margin-left: 10px;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  transition: border-color .2s, background-color .2s;
}
.site-nav .nav-cv:hover { border-color: var(--accent); background: var(--accent-soft); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface-solid); cursor: pointer; position: relative;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  position: absolute; left: 12px; width: 18px; height: 2px;
  background: var(--text); border-radius: 2px; content: "";
  transition: transform .25s var(--ease), background-color .2s;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { left: 0; top: -6px; }
.nav-toggle-bar::after { left: 0; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Boutons ---------- */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 12px;
  font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s, background-color .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--grad); background-size: 160% 100%; background-position: 0 0;
  color: #0b1020;
  box-shadow: 0 8px 30px -10px rgba(124, 156, 255, .7);
  transition: transform .25s var(--ease), box-shadow .25s, background-position .5s var(--ease);
}
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 12px 40px -10px rgba(95, 224, 200, .6); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: rgba(255, 255, 255, .02); }
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.btn-small {
  min-height: 40px; padding: 0 16px; font-size: 0.92rem; border-radius: 10px;
  background: var(--surface-solid); color: var(--text); border-color: var(--line-strong);
}
.btn-small:hover { border-color: var(--accent); }

/* ---------- Cartes : survol lumineux et inclinaison ---------- */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  isolation: isolate;
}
.spotlight::before {
  content: "";
  position: absolute; inset: -1px; z-index: -1;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(124, 156, 255, .16), transparent 60%);
  opacity: 0; transition: opacity .35s;
  pointer-events: none;
}
.spotlight::after {
  content: "";
  position: absolute; inset: -1px; z-index: -1;
  border-radius: inherit; padding: 1px;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(124, 156, 255, .8), rgba(95, 224, 200, .35) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0; transition: opacity .35s;
  pointer-events: none;
}
.spotlight:hover::before, .spotlight:hover::after { opacity: 1; }

.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0));
  transition: transform .4s var(--ease), border-color .3s;
  will-change: transform;
}
.tilt:hover { --ty: -4px; }
.tilt.is-tilting { transition: transform .08s linear; }

/* ---------- Intro ---------- */

.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px 0 96px;
  overflow: hidden;
}

/* Fond fixe sur toute la page : grille de points révélée autour de la souris et halos lents */
.page-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.page-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(148, 166, 210, .22) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask: radial-gradient(520px circle at var(--hx, 70%) var(--hy, 40%), #000 0%, rgba(0,0,0,.35) 45%, transparent 75%);
          mask: radial-gradient(520px circle at var(--hx, 70%) var(--hy, 40%), #000 0%, rgba(0,0,0,.35) 45%, transparent 75%);
}
.blob {
  position: absolute; border-radius: 50%; opacity: .5;
  will-change: transform;
}
.blob-1 {
  width: 760px; height: 760px; top: -260px; right: -220px;
  background: radial-gradient(circle, rgba(124, 156, 255, .45), rgba(124, 156, 255, .12) 40%, transparent 68%);
  animation: drift-1 18s ease-in-out infinite alternate;
}
.blob-2 {
  width: 640px; height: 640px; bottom: -260px; left: -240px;
  background: radial-gradient(circle, rgba(95, 224, 200, .3), rgba(95, 224, 200, .08) 40%, transparent 68%);
  animation: drift-2 22s ease-in-out infinite alternate;
}
@keyframes drift-1 { to { transform: translate(-120px, 90px) scale(1.15); } }
@keyframes drift-2 { to { transform: translate(140px, -60px) scale(1.1); } }

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  width: 100%;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--soft); font-size: 0.9rem; font-weight: 500;
}
.badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(95, 224, 200, .6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(95, 224, 200, .55); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(95, 224, 200, 0); }
}

.hero-name {
  margin-top: 22px;
  font-size: clamp(3.4rem, 10.5vw, 8.4rem);
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: -0.045em;
}
.name-line { display: block; color: #fff; }
.char { display: inline-block; }

.hero-role {
  margin-top: 24px;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 500;
  color: var(--soft);
  display: flex; flex-wrap: wrap; gap: 0 .35em; align-items: baseline;
}
.rotator {
  position: relative; display: inline-grid;
  color: var(--text); font-weight: 700;
}
.rotator-word {
  grid-area: 1 / 1;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(60%); filter: blur(4px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), filter .5s;
  white-space: nowrap;
}
.rotator-word.is-active { opacity: 1; transform: none; filter: none; }
.rotator-word.is-leaving { opacity: 0; transform: translateY(-60%); filter: blur(4px); }

.hero-pitch {
  margin-top: 18px;
  color: var(--muted);
  max-width: 54ch;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.now { padding: 26px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.now-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.now-title::before {
  content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--grad);
}
.now-list { margin-top: 18px; display: grid; gap: 14px; }
.now-list dt { color: var(--muted); font-size: 0.85rem; }
.now-list dd { font-weight: 500; line-height: 1.4; }
.now-links {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.now-links a {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); text-decoration: none;
  font-size: 0.9rem; font-weight: 500;
  transition: border-color .2s, background-color .2s, transform .2s var(--ease);
}
.now-links a:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }

/* Entrée de l'intro */
.js .hero-badge, .js .hero-role, .js .hero-pitch, .js .hero-actions, .js .now {
  opacity: 0; transform: translateY(18px);
}
.js .hero .char { opacity: 0; transform: translateY(70%) rotate(6deg); }
.is-loaded .hero-badge, .is-loaded .hero-role, .is-loaded .hero-pitch, .is-loaded .hero-actions, .is-loaded .now,
.is-loaded .hero .char {
  opacity: 1; transform: none;
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.is-loaded .hero .char { transition-delay: calc(var(--i) * 35ms + 120ms); }
.is-loaded .hero-role { transition-delay: .55s; }
.is-loaded .hero-pitch { transition-delay: .65s; }
.is-loaded .hero-actions { transition-delay: .75s; }
.is-loaded .now { transition-delay: .85s; }
.is-loaded .now.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0));
  transition: opacity .8s var(--ease) .85s, transform .4s var(--ease);
}
.is-loaded .now.tilt.is-tilting { transition: opacity .8s var(--ease) .85s, transform .08s linear; }

/* ---------- Sections ---------- */

.section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }

.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section-title {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.section-sub { color: var(--muted); max-width: 46ch; }

/* Apparition au défilement */
.js [data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.js [data-reveal].is-settled { transition: transform .4s var(--ease), border-color .3s, opacity .3s; transition-delay: 0ms; }
.js .tilt[data-reveal].is-settled.is-tilting { transition: transform .08s linear; }
.js .tilt[data-reveal].is-visible { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0)); }

/* ---------- Profil ---------- */

.profile-lead {
  font-size: clamp(1.3rem, 2.6vw, 1.85rem);
  line-height: 1.4; font-weight: 500;
  letter-spacing: -0.01em;
  max-width: 34ch;
}
.profile-cols {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 48px; margin-top: 32px; color: var(--soft);
  max-width: 980px;
}
.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; margin-top: 48px;
}
.fact { padding: 24px; display: flex; flex-direction: column; gap: 4px; }
.fact-num {
  font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 800; line-height: 1;
  letter-spacing: -0.04em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.fact-label { color: var(--muted); }

/* ---------- Parcours ---------- */

.filters {
  display: inline-flex; padding: 4px; gap: 4px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface);
}
.filter {
  border: 0; background: transparent; cursor: pointer;
  padding: 8px 16px; border-radius: 999px;
  color: var(--muted); font-size: 0.92rem; font-weight: 500;
  transition: color .2s, background-color .25s;
}
.filter:hover { color: var(--text); }
.filter.is-active { background: var(--text); color: var(--bg); }

/* Frise : par défaut une colonne (mobile) ; sur grand écran, js/timeline.js passe en
   « .is-scaled » : hauteur proportionnelle à la durée, périodes simultanées côte à côte. */
.timeline { position: relative; --line-x: 6px; }
.timeline::before {
  content: ""; position: absolute; left: var(--line-x); top: 8px; bottom: 8px;
  width: 2px; border-radius: 2px; background: var(--line);
}

.tl-item { position: relative; padding: 0 0 20px 32px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute; left: calc(var(--line-x) - 6px); top: 22px; z-index: 1;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--muted);
  transition: border-color .3s, background-color .3s, box-shadow .3s;
}
.tl-item.is-key::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-item:hover::before { border-color: var(--accent-2); box-shadow: 0 0 0 6px rgba(95, 224, 200, .15); }

.tl-item.is-hidden { display: none; }

.tl-date {
  color: var(--muted); font-size: 0.85rem; line-height: 1.4;
  font-variant-numeric: tabular-nums; margin-bottom: 6px;
}
.tl-card { padding: 20px 24px; transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
.tl-card:hover { transform: translateX(4px); }

/* Version proportionnelle (grand écran) */
.timeline.is-scaled {
  --line-x: 91px;
  display: grid; column-gap: 14px;
  grid-template-columns: 84px minmax(0, 1fr);
}
.timeline.is-scaled::before { top: 0; bottom: 0; }
.timeline.has-heads::before { top: 34px; }
.is-scaled .tl-item { padding: 0 0 10px; display: flex; flex-direction: column; min-width: 0; }
.is-scaled .tl-item::before { display: none; }
.timeline .tl-item.is-hidden { display: none; }
.is-scaled .tl-card {
  flex: 1; padding: 16px 20px;
  border-left: 3px solid var(--accent);
}
.is-scaled .tl-item[data-kind="formation"] .tl-card { border-left-color: var(--accent-2); }
.is-scaled .tl-card:hover { transform: translateY(-2px); }
.is-scaled .tl-overlap { display: none; }
.is-scaled .tl-item.is-narrow .tl-title { font-size: 1.08rem; }
.is-scaled .tl-item.is-narrow .tl-points { font-size: .92rem; gap: 4px; margin-top: 10px; }

/* Éléments de l'axe, ajoutés par le script */
.tl-lane-head {
  align-self: end; padding: 0 0 12px 4px;
  font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.tl-lane-head::before { content: ""; width: 10px; height: 3px; border-radius: 2px; background: var(--accent); }
.tl-lane-head[data-kind="formation"]::before { background: var(--accent-2); }
.tl-year, .tl-now {
  position: relative; align-self: end; z-index: 2; pointer-events: none;
  font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--muted);
  transform: translateY(50%); line-height: 1; white-space: nowrap;
}
.tl-year span { display: inline-block; padding: 3px 0; background: var(--bg); }
.tl-year::after, .tl-now::after {
  content: ""; position: absolute; top: 50%; left: calc(var(--line-x) - 4px); width: 8px; height: 1px;
  background: var(--line-strong);
}
.tl-now { color: var(--accent-2); font-weight: 600; z-index: 0; }
.is-scaled .tl-item { position: relative; z-index: 1; }
.tl-now::after {
  left: 98px; right: 0; width: auto; height: 0; background: none;
  border-top: 1px dashed rgba(95, 224, 200, .6);
}
.tl-gap { position: relative; pointer-events: none; }
.tl-gap::before {
  content: ""; position: absolute; top: 6px; bottom: 6px; left: calc(var(--line-x) - 2px); width: 6px; z-index: 1;
  background: radial-gradient(circle, var(--muted) 1.2px, transparent 1.6px) center top / 6px 8px repeat-y, var(--bg);
}
/* Période à venir : hachures discrètes au-dessus du repère « aujourd'hui » */
.tl-future {
  pointer-events: none; z-index: 0; margin-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 8px, transparent 8px 16px);
}
.tl-future span {
  position: absolute; left: 0; top: 0; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.is-scaled .tl-item.is-dim .tl-card { opacity: .55; }

.tl-title { font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.tl-org { font-weight: 500; color: var(--accent); margin-left: 4px; }
.tl-meta {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px; color: var(--muted); font-size: 0.92rem;
}
.tag {
  display: inline-block; padding: 1px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--soft);
  font-size: 0.8rem; font-weight: 500;
}
.tag-accent { border-color: rgba(124, 156, 255, .5); color: var(--accent); background: var(--accent-soft); }

.tl-points { margin-top: 12px; display: grid; gap: 6px; max-width: 70ch; }
.tl-points li { position: relative; padding-left: 18px; color: var(--soft); }
.tl-points li::before {
  content: ""; position: absolute; left: 0; top: 0.68em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong);
}

/* ---------- Compétences (bento) ---------- */

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.bento-item { padding: 28px; }
.bento-lang { grid-column: span 7; }
.bento-tech { grid-column: span 5; }
.bento-know { grid-column: span 6; }
.bento-langs { grid-column: span 6; }
.block-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }

.levels { display: grid; gap: 18px; }
.levels li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name label" "where where" "bar bar";
  gap: 8px 16px; align-items: baseline;
}
.lv-name { grid-area: name; font-weight: 600; }
.lv-label { grid-area: label; color: var(--muted); font-size: 0.88rem; }
.lv-where { grid-area: where; color: var(--muted); font-size: 0.82rem; margin-top: -6px; }
.lv-bar {
  grid-area: bar; position: relative; display: block;
  height: 6px; border-radius: 999px; background: rgba(148, 166, 210, .12);
  overflow: hidden;
}
.lv-bar > span {
  position: absolute; inset: 0;
  width: calc(var(--lv) * 20%);
  border-radius: inherit; background: var(--grad);
  transform-origin: left; transform: scaleX(0);
  transition: transform 1.2s var(--ease) .2s;
}
.is-visible .lv-bar > span, html:not(.js) .lv-bar > span { transform: scaleX(1); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 7px 14px; border-radius: 10px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line-strong);
  font-size: 0.94rem; font-weight: 500;
  transition: transform .25s var(--ease), border-color .25s, background-color .25s;
}
.chips li:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--accent-soft); }
.chips-sm li { padding: 3px 10px; font-size: 0.82rem; color: var(--soft); border-radius: 8px; }
.chips-sm li:hover { transform: none; }

.know-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.know-list li {
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .025); border: 1px solid var(--line);
  font-size: 0.95rem; line-height: 1.35;
  transition: border-color .25s, background-color .25s;
}
.know-list li:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .05); }

/* ---------- Projets ---------- */

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.project { padding: 26px; display: flex; flex-direction: column; }
.project-top { display: flex; align-items: center; gap: 14px; }
.project-logo {
  width: 56px; height: 56px; flex: none; object-fit: contain;
  background: #f4f5f8; border-radius: 14px; padding: 7px;
  transition: transform .4s var(--ease);
}
.project:hover .project-logo { transform: scale(1.06) rotate(-3deg); }
.project-logo-text {
  display: grid; place-items: center; padding: 0;
  background: var(--grad); color: #0b1020; font-weight: 800; font-size: 1.25rem;
}
.project-kind { font-size: 0.92rem; font-weight: 600; line-height: 1.35; }
.project-kind span { color: var(--muted); font-weight: 400; }
.project-title { margin-top: 22px; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.project-desc { margin-top: 12px; color: var(--soft); font-size: 0.98rem; flex: 1; }
.project .chips { margin-top: 18px; }
.project-link {
  margin-top: 16px; align-self: flex-start;
  font-size: 0.92rem; font-weight: 600; color: var(--accent);
  text-decoration: none; position: relative;
}
.project-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(.35); transform-origin: left;
  transition: transform .35s var(--ease);
}
.project-link:hover::after { transform: scaleX(1); }

/* Groupes de projets : web et logiciel, puis jeu vidéo */
.proj-group-games { margin-top: clamp(72px, 9vw, 112px); }
.group-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px;
  padding-bottom: 16px; margin-bottom: 28px; border-bottom: 1px solid var(--line);
}
.group-title {
  display: flex; align-items: center; gap: 12px;
  font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 800; letter-spacing: -0.02em;
}
.group-title::before { content: ""; width: 14px; height: 4px; border-radius: 2px; background: var(--grad); }
.group-lead { color: var(--muted); }

@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }

/* ---------- Contact ---------- */

.contact {
  overflow: hidden;
  padding: clamp(36px, 6vw, 72px);
  text-align: center;
  background: linear-gradient(180deg, rgba(22, 30, 48, .9), rgba(16, 22, 36, .9));
}
.contact::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .55;
}
.contact-glow {
  position: absolute; z-index: -1; left: 50%; top: -60%;
  width: 640px; height: 640px; margin-left: -320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 156, 255, .28), transparent 60%);
  animation: glow 8s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes glow { to { transform: translateY(60px) scale(1.15); opacity: .7; } }
.contact .section-title { max-width: none; }
.contact-lead { margin: 14px auto 0; color: var(--muted); max-width: 46ch; }
.contact-mail {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 20px;
  margin-top: 30px;
}
.mail-link {
  font-size: clamp(1.3rem, 4.2vw, 2.4rem);
  font-weight: 700; letter-spacing: -0.02em;
  text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(var(--text), var(--text)) left bottom / 100% 2px no-repeat;
  padding-bottom: 4px;
  transition: color .3s;
}
.mail-link:hover {
  background-image: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.copy-btn.is-copied { border-color: var(--accent-2); color: var(--accent-2); }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

/* ---------- Pied de page ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted); font-size: 0.9rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.to-top { color: var(--muted); text-decoration: none; }
.to-top:hover { color: var(--text); }

/* ---------- Responsive ---------- */

@media (max-width: 1020px) {
  .hero-layout { grid-template-columns: 1fr; }
  .now { max-width: 520px; }
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento-lang, .bento-tech, .bento-know, .bento-langs { grid-column: span 12; }
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(12, 17, 29, .96); border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    clip-path: inset(0 0 100% 0); visibility: hidden;
    transition: clip-path .4s var(--ease), visibility 0s .4s;
  }
  .site-nav.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .4s var(--ease); }
  .site-header:has(.site-nav.is-open) { background: rgba(12, 17, 29, .96); }
  .site-nav ul { flex-direction: column; align-items: stretch; padding: 8px var(--gutter) 20px; gap: 2px; }
  .site-nav a { padding: 14px 12px; font-size: 1.1rem; border-radius: 10px; }
  .site-nav .nav-cv { margin: 10px 0 0; text-align: center; }
  .nav-indicator { display: none; }

  .profile-cols { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .fact { flex-direction: row; align-items: baseline; gap: 14px; }
  .know-list { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }

  .section-head { align-items: start; }
}

@media (max-width: 420px) {
  .brand-name { display: none; }
  .hero-actions .btn { flex: 1 1 100%; }
  .filter { padding: 8px 12px; }
}

/* Mouvement réduit : tout s'affiche directement */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal], .js .hero-badge, .js .hero-role, .js .hero-pitch, .js .hero-actions, .js .now, .js .hero .char {
    opacity: 1; transform: none;
  }
  .lv-bar > span { transform: scaleX(1); }
  .rotator-word { filter: none; }
}

/* ---------- Chatbot ---------- */

.chat { position: fixed; right: 20px; bottom: 20px; z-index: 90; }

.chat-launcher {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 20px 0 16px; border-radius: 999px;
  border: 1px solid rgba(124, 156, 255, .45);
  background: rgba(21, 29, 47, .92); color: var(--text);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-weight: 600; cursor: pointer;
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .7), 0 0 0 0 rgba(124, 156, 255, .4);
  transition: transform .3s var(--ease), border-color .2s, opacity .25s;
  animation: launcher-in .7s var(--ease) 1.4s both;
}
@keyframes launcher-in { from { opacity: 0; transform: translateY(20px) scale(.9); } }
.chat-launcher:hover { transform: translateY(-2px); border-color: var(--accent); }
.chat-launcher-icon {
  position: relative; width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad);
}
.chat-launcher-icon::before {
  content: ""; position: absolute; left: 7px; top: 8px; width: 12px; height: 9px;
  border-radius: 3px; background: #0b1020;
}
.chat-launcher-icon::after {
  content: ""; position: absolute; left: 9px; top: 16px;
  border: 3px solid transparent; border-top-color: #0b1020; border-left-color: #0b1020;
}
.chat.is-open .chat-launcher { opacity: 0; pointer-events: none; transform: scale(.85); }

.chat-panel {
  position: absolute; right: 0; bottom: 0;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 110px));
  display: flex; flex-direction: column;
  background: rgba(17, 24, 39, .97);
  border: 1px solid var(--line-strong); border-radius: 20px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  transform-origin: bottom right;
  opacity: 0; transform: translateY(12px) scale(.96);
  transition: opacity .25s var(--ease), transform .3s var(--ease);
}
.chat.is-open .chat-panel { opacity: 1; transform: none; }
.chat-panel[hidden] { display: none; }

.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px 16px; border-bottom: 1px solid var(--line);
}
.chat-avatar {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 12px; padding: 3px;
  background: var(--bg); border: 1px solid var(--line-strong);
}
.chat-head-text { flex: 1; min-width: 0; }
.chat-title { font-size: 1rem; font-weight: 700; line-height: 1.2; }
.chat-subtitle { font-size: .8rem; color: var(--muted); }
.chat-close {
  position: relative; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; cursor: pointer;
}
.chat-close:hover { background: rgba(255, 255, 255, .06); }
.chat-close span::before, .chat-close span::after {
  content: ""; position: absolute; left: 11px; top: 17px; width: 14px; height: 2px;
  border-radius: 2px; background: var(--soft);
}
.chat-close span::before { transform: rotate(45deg); }
.chat-close span::after { transform: rotate(-45deg); }

.chat-log {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth; overscroll-behavior: contain;
}
.msg { max-width: 88%; animation: msg-in .3s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg p {
  padding: 10px 14px; border-radius: 16px;
  font-size: .95rem; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere;
}
.msg a { color: var(--accent); }
.msg-bot { align-self: flex-start; }
.msg-bot p { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg-user { align-self: flex-end; }
.msg-user p { background: var(--grad); color: #0b1020; font-weight: 500; border-bottom-right-radius: 6px; }
.msg-error p { border-color: rgba(255, 140, 140, .35); color: #ffd2d2; }
.msg-info p { border-color: rgba(124, 156, 255, .35); }

.msg-typing {
  display: inline-flex; gap: 5px; padding: 14px 16px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  border-radius: 16px; border-bottom-left-radius: 6px;
}
.msg-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: typing 1.2s infinite ease-in-out;
}
.msg-typing span:nth-child(2) { animation-delay: .15s; }
.msg-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Suggestions : une seule ligne qui défile horizontalement, au-dessus de la saisie */
.chat-suggestions {
  display: flex; gap: 6px; flex: none;
  padding: 2px 12px 10px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 28px), transparent 100%);
          mask: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 28px), transparent 100%);
}
.chat-suggestions::-webkit-scrollbar { display: none; }
.chat-chip {
  flex: none; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent;
  font-size: .84rem; color: var(--soft); cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.chat-chip:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.chat-chip:disabled { opacity: .5; cursor: default; }

.chat-form {
  display: flex; align-items: flex-end; gap: 8px;
  margin: 0 12px; padding: 6px 6px 6px 14px;
  border: 1px solid var(--line-strong); border-radius: 16px;
  background: rgba(255, 255, 255, .03);
  transition: border-color .2s;
}
.chat-form:focus-within { border-color: var(--accent); }
.chat-input {
  flex: 1; resize: none; border: 0; outline: none; background: transparent;
  color: var(--text); font: inherit; font-size: .95rem; line-height: 1.45;
  padding: 7px 0; max-height: 120px;
}
.chat-input::placeholder { color: var(--muted); }
.chat-send {
  position: relative; flex: none; width: 36px; height: 36px; border-radius: 11px;
  border: 0; background: var(--grad); cursor: pointer;
  transition: transform .2s var(--ease), opacity .2s;
}
.chat-send:hover { transform: scale(1.06); }
.chat-send:disabled { opacity: .5; cursor: default; transform: none; }
.chat-send span::before {
  content: ""; position: absolute; left: 50%; top: 50%; margin: -6px 0 0 -4px;
  border-left: 10px solid #0b1020; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.chat-note { padding: 8px 16px 12px; font-size: .74rem; color: var(--muted); line-height: 1.4; }

@media (max-width: 520px) {
  .chat { right: 12px; bottom: 12px; }
  .chat-launcher-label { display: none; }
  .chat-launcher { width: 54px; height: 54px; padding: 0; justify-content: center; }
  .chat-panel { position: fixed; inset: auto 0 0 0; width: 100%; height: min(86vh, 640px); border-radius: 20px 20px 0 0; }
}

/* Le chat reste derrière la fenêtre de jeu */

/* ---------- Consommation de l'IA en direct ---------- */

.ai-stats { padding: 24px; margin-bottom: 28px; color: var(--text); font-size: 1rem; }
.ai-stats-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; align-items: baseline; }
.ai-stats-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 700; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2);
  animation: pulse 2.4s ease-out infinite;
}
.ai-stats-sub { color: var(--muted); font-size: .88rem; }
.ai-stats-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-top: 18px;
}
.ai-stat {
  padding: 16px; border-radius: 12px;
  background: rgba(255, 255, 255, .025); border: 1px solid var(--line);
}
.ai-stat dt { color: var(--muted); font-size: .84rem; }
.ai-stat dd {
  margin-top: 4px; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.15;
  transition: color .4s;
}
.ai-stat dd small { font-size: .85rem; font-weight: 600; color: var(--accent-2); letter-spacing: 0; }
.ai-stat dd.is-bumped { color: var(--accent-2); }
.ai-stat-detail { margin-top: 4px; color: var(--muted); font-size: .8rem; }
.quota-bar { margin-top: 10px; height: 6px; border-radius: 999px; background: rgba(148, 166, 210, .14); overflow: hidden; }
.quota-bar span {
  display: block; height: 100%; width: var(--q, 0%); min-width: 2px;
  border-radius: inherit; background: var(--grad);
  transition: width .8s var(--ease);
}
.ai-stats-foot { margin-top: 14px; color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }

/* Détail de consommation sous chaque réponse du chat */
.msg-meta { margin: 4px 0 0 6px; font-size: .72rem; color: var(--muted); }
.site-footer { padding-bottom: 96px; }

@media (max-width: 820px) {
  .ai-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .ai-stat dd { font-size: 1.3rem; }
}

/* Projet personnel mis en avant */
.feature {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 0 32px; align-items: center;
  padding: 26px; margin-bottom: 20px;
}
.feature-media {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  background: #0a0e18;
}
.feature-media img {
  width: 100%; height: auto; aspect-ratio: 504 / 280; image-rendering: pixelated;
  transition: transform .6s var(--ease);
}
.feature:hover .feature-media img { transform: scale(1.03); }
.feature .project-title { margin-top: 14px; }
.feature .chips { margin-top: 16px; }

@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; gap: 0; padding: 20px; }
  .feature-media { margin-bottom: 20px; }
}
.feature-reverse .feature-media { order: 2; }
.feature-media-app {
  display: grid; place-items: center; align-content: center; gap: 14px;
  aspect-ratio: 504 / 280;
  background:
    radial-gradient(circle at 30% 20%, rgba(124, 156, 255, .35), transparent 60%),
    radial-gradient(circle at 80% 90%, rgba(95, 224, 200, .2), transparent 55%),
    #0e1424;
}
.feature-media-app img {
  width: 104px; height: 104px; aspect-ratio: 1; image-rendering: auto;
  border-radius: 24px; box-shadow: 0 18px 40px -12px rgba(76, 102, 230, .7);
}
.feature-media-label { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; }
.feature:hover .feature-media-app img { transform: translateY(-4px) scale(1.04); }
@media (max-width: 820px) {
  .feature-reverse .feature-media { order: 0; }
}
.feature-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 18px; }
.feature-actions .project-link { margin-top: 0; }

/* Technologies classées par domaine */
.tech-groups { display: grid; gap: 14px; }
.tech-group { display: grid; gap: 8px; }
.tech-group dt { color: var(--muted); font-size: .84rem; font-weight: 600; }
.tech-group + .tech-group { padding-top: 14px; border-top: 1px solid var(--line); }
.tech-group .chips li { padding: 5px 12px; font-size: .9rem; }


/* Mention « en parallèle » dans les cartes et mise en avant au survol */
.tl-overlap {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 8px; padding: 3px 10px; border-radius: 999px;
  background: rgba(95, 224, 200, .1); border: 1px solid rgba(95, 224, 200, .3);
  color: var(--accent-2); font-size: .8rem; font-weight: 600;
}
.tl-overlap::before {
  content: ""; width: 12px; height: 8px; flex: none;
  background: linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
              linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
}
.tl-item.is-overlap .tl-card { border-color: rgba(95, 224, 200, .55); box-shadow: 0 0 0 3px rgba(95, 224, 200, .12); }
.tl-item.is-current .tl-card { border-color: rgba(124, 156, 255, .6); }
.tl-item.is-flash .tl-card { animation: flash 1.4s var(--ease); }
@keyframes flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px rgba(124, 156, 255, .35); } }


/* ---------- Présentation des projets en diaporama ---------- */

.feature { cursor: pointer; }
.showcase[hidden] { display: none; }
.showcase-toggle { gap: 10px; }
.toggle-icon {
  width: 0; height: 0;
  border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}

.slides {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0; border: 1px solid var(--line-strong); border-radius: 18px;
  background: var(--surface-solid); color: var(--text);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .75);
  overflow: hidden;
}
.slides[open] { display: flex; flex-direction: column; animation: pop .35s var(--ease); }
/* Fond assombri sans flou : un flou plein écran est recalculé à chaque image et fait chuter la fluidité */
.slides::backdrop { background: rgba(5, 8, 15, .88); }

.slides-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line);
}
.slides-title { font-size: 1.05rem; font-weight: 700; flex: 1; min-width: 0; }
.slides-count { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.slides-close {
  position: relative; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; cursor: pointer;
}
.slides-close:hover { background: rgba(255, 255, 255, .06); }
.slides-close span::before, .slides-close span::after {
  content: ""; position: absolute; left: 11px; top: 18px; width: 16px; height: 2px;
  border-radius: 2px; background: var(--soft);
}
.slides-close span::before { transform: rotate(45deg); }
.slides-close span::after { transform: rotate(-45deg); }

.slides-viewport { position: relative; overflow: hidden; background: #0b101c; flex: none; touch-action: pan-y; }
.slides-track { display: flex; transition: transform .5s var(--ease); }
.slides-track.is-dragging { transition: none; }
.slide { flex: 0 0 100%; margin: 0; }
.slide img {
  display: block; width: 100%; height: auto; aspect-ratio: 1200 / 750;
  max-height: calc(100vh - 290px); object-fit: contain;
  user-select: none; -webkit-user-drag: none;
}

.slides-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: rgba(12, 17, 29, .78);
  backdrop-filter: blur(6px); cursor: pointer;
  transition: background-color .2s, border-color .2s, opacity .2s;
}
.slides-nav:hover { border-color: var(--accent); background: rgba(124, 156, 255, .2); }
.slides-nav:disabled { opacity: 0; pointer-events: none; }
.slides-prev { left: 14px; }
.slides-next { right: 14px; }
.slides-nav span {
  position: absolute; top: 50%; left: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--text); border-bottom: 2px solid var(--text);
}
.slides-prev span { transform: translate(-30%, -50%) rotate(135deg); }
.slides-next span { transform: translate(-70%, -50%) rotate(-45deg); }

.slides-caption { padding: 18px 22px 4px; min-height: 108px; }
.slides-caption-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.slides-caption-text { margin-top: 8px; color: var(--soft); max-width: 72ch; }
.slides-caption.is-changing { animation: caption-in .4s var(--ease); }
@keyframes caption-in { from { opacity: 0; transform: translateY(6px); } }

.slides-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 12px 22px 18px;
}
.slides-dots { display: flex; gap: 8px; }
.slides-dot {
  width: 10px; height: 10px; padding: 0; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(148, 166, 210, .3);
  transition: width .35s var(--ease), background-color .3s;
}
.slides-dot:hover { background: rgba(148, 166, 210, .55); }
.slides-dot[aria-current="true"] { width: 28px; background: var(--grad); }
.slides-note { color: var(--muted); font-size: .8rem; }

@media (max-width: 600px) {
  .slides-nav { width: 38px; height: 38px; }
  .slides-prev { left: 8px; }
  .slides-next { right: 8px; }
  .slides-caption { padding: 16px 16px 4px; min-height: 0; }
  .slides-foot { padding: 12px 16px 16px; }
}

/* Statistiques du Steam Workshop en bas de la carte de Tianic's Custom Races */
.steam-stats {
  grid-column: 1 / -1; order: 3;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line);
}
.steam-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  color: var(--muted); font-size: .88rem;
}
.steam-head [data-steam="status"] { color: var(--accent-2); }
.steam-head .project-link { margin: 0 0 0 auto; }
.steam-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px;
  margin: 14px 0 0;
}
.steam-grid > div {
  display: flex; flex-direction: column-reverse; justify-content: flex-end;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line);
}
.steam-grid dt { color: var(--muted); font-size: .8rem; line-height: 1.35; margin-top: 2px; }
.steam-grid dd { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.steam-main dd { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.steam-note { white-space: nowrap; }
@media (max-width: 1060px) { .steam-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .steam-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
