/* =========================================================
   KIRITO_KMA — hero plein écran, sidebar-rail par défaut,
   espacements modernes + animations, skins 3D (skinview3d)
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Hanken+Grotesk:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-void: #0f0e1c;
  --bg-panel: #17162a;
  --bg-panel-alt: #1e1c35;
  --ink: #efedf7;
  --ink-dim: #a49fbb;
  --ink-faint: #6b6689;
  --accent-violet: #977dff;
  --accent-violet-soft: rgba(151,125,255,0.14);
  --accent-moon: #7cc0d6;
  --line: #2a2748;
  --line-bright: #423d6b;
  --online: #6fcf8f;
  --discord: #5865f2;

  --f-display: 'Space Grotesk', sans-serif;
  --f-body: 'Hanken Grotesk', sans-serif;
  --f-mono: 'JetBrains Mono', monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 224px;
  --sidebar-w-min: 68px;
  --topbar-h: 58px;
  --maxw: 1120px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --aurora-op: 1;
}
/* Thème clair — "grimoire de jour" : lavande/parchemin, garde l'âme mystique */
[data-theme="light"] {
  --bg-void: #eae6f6;
  --bg-panel: #fbfaff;
  --bg-panel-alt: #f1eefb;
  --ink: #241f3a;
  --ink-dim: #5b5578;
  --ink-faint: #938da8;
  --accent-violet: #6d4bd6;
  --accent-violet-soft: rgba(109,75,214,0.12);
  --accent-moon: #3f8ea6;
  --line: #ddd6f0;
  --line-bright: #cabfe6;
  --online: #3fae6f;
  --aurora-op: .55;
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--line-bright) transparent; }
/* scrollbar globale discrète (WebKit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-violet); background-clip: padding-box; }
body {
  margin: 0; background: var(--bg-void); color: var(--ink);
  font-family: var(--f-body); line-height: 1.6; -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease, padding-left .22s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { font-family: var(--f-display); font-weight: 600; letter-spacing: -.01em; margin: 0; }
svg { display: block; }
.mono-tag { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* =========================================================
   TOPBAR (mobile) / OVERLAY / SIDEBAR
   ========================================================= */
body { padding-top: var(--topbar-h); }

.nav-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; padding: 0 1rem;
  background: rgba(15,14,28,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
[data-theme="light"] .nav-topbar { background: rgba(251,250,255,.92); }
.nav-topbar .brand-name { font-family: var(--f-display); font-weight: 700; font-size: .95rem; }
.nav-topbar .brand-name .accent { color: var(--accent-violet); }
.hamburger { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: none; border: 1px solid var(--line-bright); border-radius: var(--radius-sm); color: var(--ink); cursor: pointer; }
.hamburger span, .hamburger span::before, .hamburger span::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.hamburger span { position: relative; }
.hamburger span::before, .hamburger span::after { content: ''; position: absolute; left: 0; }
.hamburger span::before { top: -6px; } .hamburger span::after { top: 6px; }

.nav-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; z-index: 65; }
.nav-overlay.is-open { opacity: 1; visibility: visible; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 70;
  width: min(80vw, 280px); display: flex; flex-direction: column; gap: .9rem;
  padding: 1.4rem .9rem; background: var(--bg-panel); border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform .28s var(--ease);
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar { width: 0; height: 0; }
.sidebar.is-open { transform: translateX(0); }

.collapse-btn { display: none; position: absolute; top: 1.1rem; right: .7rem; width: 26px; height: 26px; align-items: center; justify-content: center; background: var(--bg-panel-alt); border: 1px solid var(--line); border-radius: 6px; color: var(--ink-dim); cursor: pointer; transition: color .15s, border-color .15s; }
.collapse-btn:hover { color: var(--accent-violet); border-color: var(--accent-violet); }
.collapse-btn svg { width: 16px; height: 16px; }

.brand { display: flex; align-items: center; gap: .65rem; padding: .2rem .4rem; min-height: 40px; }
.brand-avatar { width: 38px; height: 38px; flex: none; border-radius: 9px; border: 1px solid var(--line-bright); overflow: hidden; background: var(--bg-panel-alt); }
.brand-avatar img { width: 100%; height: 100%; object-fit: cover; }
.brand .brand-name { font-family: var(--f-display); font-weight: 700; font-size: .98rem; line-height: 1.1; white-space: nowrap; }
.brand .brand-name .accent { color: var(--accent-violet); }

.nav-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.nav-links a { display: flex; align-items: center; gap: .75rem; padding: .62rem .7rem; border-radius: var(--radius-sm); color: var(--ink-dim); font-size: .9rem; white-space: nowrap; transition: background .15s, color .15s; }
.nav-ico { width: 22px; height: 22px; flex: none; display: flex; align-items: center; justify-content: center; color: inherit; }
.nav-ico svg { width: 20px; height: 20px; }
.nav-links a:hover { color: var(--ink); background: var(--bg-panel-alt); }
.nav-links a.is-active { color: var(--ink); background: var(--accent-violet-soft); }
.nav-links a.is-active .nav-ico { color: var(--accent-violet); }

.nav-discord { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .62rem .8rem; border-radius: var(--radius-sm); background: var(--discord); color: #fff; font-family: var(--f-mono); font-size: .76rem; white-space: nowrap; transition: filter .15s; }
.nav-discord:hover { filter: brightness(1.12); }
.nav-discord .nav-ico svg { width: 18px; height: 18px; }

.nav-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: .5rem .4rem 0; border-top: 1px solid var(--line); }
.nav-socials { display: flex; gap: .3rem; }
.nav-socials a, .nav-socials button, .theme-toggle { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--ink-faint); background: none; border: none; cursor: pointer; transition: color .15s, background .15s; }
.nav-socials a svg, .nav-socials button svg, .theme-toggle svg { width: 18px; height: 18px; }
.nav-socials a:hover, .nav-socials button:hover, .theme-toggle:hover { color: var(--accent-violet); background: var(--bg-panel-alt); }
.social-logo img { width: 22px; height: 22px; object-fit: contain; }

/* ---- desktop : sidebar fixe, rétractable (rail par défaut) ---- */
@media (min-width: 900px) {
  body { padding-top: 0; padding-left: var(--sidebar-w); }
  .nav-topbar, .nav-overlay { display: none; }
  .sidebar { width: var(--sidebar-w); transform: none; transition: width .22s var(--ease); }
  .sidebar .brand { margin-top: 1.6rem; margin-bottom: .6rem; }
  .collapse-btn { display: flex; }

  html[data-sidebar="collapsed"] body { padding-left: var(--sidebar-w-min); }
  html[data-sidebar="collapsed"] .sidebar { width: var(--sidebar-w-min); padding: 1.1rem .5rem; align-items: center; gap: .5rem; }
  html[data-sidebar="collapsed"] .collapse-btn { right: 50%; transform: translateX(50%); top: .6rem; }
  html[data-sidebar="collapsed"] .brand { justify-content: center; margin-top: 1.8rem; margin-bottom: .3rem; padding: 0; }
  html[data-sidebar="collapsed"] .brand-avatar { width: 34px; height: 34px; }
  html[data-sidebar="collapsed"] .lbl { display: none; }
  html[data-sidebar="collapsed"] .nav-links { width: 100%; gap: .1rem; }
  html[data-sidebar="collapsed"] .nav-links a { justify-content: center; padding: .5rem 0; }
  html[data-sidebar="collapsed"] .nav-discord { width: 40px; height: 40px; padding: 0; border-radius: 50%; margin: .15rem auto; }
  html[data-sidebar="collapsed"] .nav-foot { flex-direction: column; gap: .25rem; padding: .5rem 0 0; }
  html[data-sidebar="collapsed"] .nav-socials { flex-direction: column; gap: .15rem; }
}

/* =========================================================
   HERO — plein écran
   ========================================================= */
.hero {
  position: relative; width: 100%; min-height: 100dvh;
  display: flex; align-items: center; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(92deg, #0b0a17 2%, rgba(11,10,23,.84) 36%, rgba(11,10,23,.40) 72%, rgba(11,10,23,.12) 100%),
    url('../img/galerie/hero-bg.jpg');
  background-size: cover, cover; background-position: center, center 24%;
}

.hero-inner { position: relative; z-index: 1; max-width: 640px; padding: clamp(2rem,5vw,4rem) clamp(1.25rem,5vw,4.5rem); }
.hero-eyebrow { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-violet); margin-bottom: 1.1rem; }
.hero h1 { font-size: clamp(2.8rem,8vw,5.5rem); line-height: .95; color: #fff; }
.hero-title { cursor: pointer; }
.hero-title .hero-tag-ref { font-family: var(--f-mono); font-size: .26em; font-weight: 500; color: rgba(255,255,255,.45); vertical-align: super; letter-spacing: .02em; margin-left: .1em; transition: color .15s; }
.hero-title:hover .hero-tag-ref { color: var(--accent-violet); }
.hero-tagline { margin-top: 1.2rem; font-size: clamp(1rem,1.4vw,1.15rem); color: #d5d1e6; max-width: 44ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }

/* entrée animée du hero */
.hero-inner > * { opacity: 0; transform: translateY(22px); animation: heroIn .8s var(--ease) forwards; }
.hero-inner > *:nth-child(1){ animation-delay:.15s } .hero-inner > *:nth-child(2){ animation-delay:.28s }
.hero-inner > *:nth-child(3){ animation-delay:.41s } .hero-inner > *:nth-child(4){ animation-delay:.54s }
.hero-inner > *:nth-child(5){ animation-delay:.67s }
@keyframes heroIn { to { opacity: 1; transform: none; } }

.btn { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--f-mono); font-size: .8rem; letter-spacing: .02em; padding: .78rem 1.25rem; border-radius: 999px; border: 1px solid var(--line-bright); background: rgba(20,18,40,.5); color: var(--ink); cursor: pointer; transition: border-color .18s, background .18s, transform .12s; }
.btn svg { width: 15px; height: 15px; transition: transform .18s; }
.btn:hover { border-color: var(--accent-violet); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn.is-primary { background: var(--accent-violet); color: #14102b; border-color: var(--accent-violet); font-weight: 500; }
.btn.is-primary:hover { background: #a486ff; }

/* conteneur 3D du hero (modèle .glb ou cube CSS de repli) */
.hero3d { position: absolute; top: 8vh; right: 6vw; width: 130px; height: 130px; z-index: 1; pointer-events: auto; }
.hero3d canvas { width: 100% !important; height: 100% !important; display: block; }
.hero3d .cube3d-wrap { position: static; width: 100%; height: 100%; perspective: 620px; }
.hero3d .cube3d { width: 92px; height: 92px; margin: auto; position: relative; top: 50%; transform: translateY(-50%); }
@media (max-width: 680px){ .hero3d { width: 84px; height: 84px; top: 6vh; right: 8vw; } }

/* cube 3D signature (repli CSS) */
.cube3d-wrap { position: absolute; top: 8vh; right: 6vw; width: 92px; height: 92px; perspective: 620px; pointer-events: none; z-index: 1; }
.cube3d { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; animation: cube-spin 20s linear infinite; }
.cube3d .face { position: absolute; width: 92px; height: 92px; border: 1px solid var(--accent-violet); background: rgba(139,108,240,.07); box-shadow: inset 0 0 24px rgba(139,108,240,.20); }
.cube3d .face:nth-child(1){transform:translateZ(46px)}.cube3d .face:nth-child(2){transform:rotateY(180deg) translateZ(46px)}.cube3d .face:nth-child(3){transform:rotateY(90deg) translateZ(46px)}.cube3d .face:nth-child(4){transform:rotateY(-90deg) translateZ(46px)}.cube3d .face:nth-child(5){transform:rotateX(90deg) translateZ(46px)}.cube3d .face:nth-child(6){transform:rotateX(-90deg) translateZ(46px)}
@keyframes cube-spin { from { transform: rotateX(-22deg) rotateY(0);} to { transform: rotateX(-22deg) rotateY(360deg);} }
@media (max-width: 680px){ .cube3d-wrap { width: 56px; height: 56px; top: 6vh; right: 8vw; } .cube3d .face { width: 56px; height: 56px; } .cube3d .face:nth-child(1){transform:translateZ(28px)}.cube3d .face:nth-child(2){transform:rotateY(180deg) translateZ(28px)}.cube3d .face:nth-child(3){transform:rotateY(90deg) translateZ(28px)}.cube3d .face:nth-child(4){transform:rotateY(-90deg) translateZ(28px)}.cube3d .face:nth-child(5){transform:rotateX(90deg) translateZ(28px)}.cube3d .face:nth-child(6){transform:rotateX(-90deg) translateZ(28px)} }

/* stats */
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 2.2rem; padding: 1rem 1.1rem; background: rgba(16,16,26,.86); border: 1px solid var(--line); border-radius: var(--radius-sm); max-width: 520px; }
.stat-item { display: flex; align-items: center; gap: .65rem; }
.stat-item + .stat-item { border-left: 1px solid var(--line); padding-left: .9rem; }
.s-ico { width: 34px; height: 34px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--accent-violet-soft); color: var(--accent-violet); }
.s-ico svg { width: 18px; height: 18px; }
.s-txt { display: flex; flex-direction: column; line-height: 1.15; }
.s-label { font-family: var(--f-mono); font-size: .56rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-dim); }
.s-num { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; }
@media (max-width: 460px){ .hero-stats { grid-template-columns: 1fr; } .stat-item + .stat-item { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: .6rem; } }

/* indicateur scroll */
.scroll-cue { position: absolute; z-index: 1; left: clamp(1.25rem,5vw,4.5rem); bottom: 2rem; display: flex; align-items: center; gap: .6rem; font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.scroll-cue .line { width: 34px; height: 1px; background: var(--ink-faint); position: relative; overflow: hidden; }
.scroll-cue .line::after { content: ''; position: absolute; left: -34px; top: 0; width: 34px; height: 1px; background: var(--accent-violet); animation: cueSlide 1.8s ease-in-out infinite; }
@keyframes cueSlide { 0%{ transform: translateX(0);} 60%,100%{ transform: translateX(68px);} }

/* =========================================================
   STACK + WRAP + blocks + animations d'apparition
   ========================================================= */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.25rem,5vw,2.5rem); }
.stack { max-width: var(--maxw); margin: 0 auto; padding: clamp(3rem,7vw,6rem) clamp(1.25rem,5vw,2.5rem) 4rem; display: flex; flex-direction: column; gap: clamp(3.5rem,7vw,6.5rem); }

.block-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.block-head h2 { font-size: clamp(1.2rem,2.6vw,1.7rem); display: flex; align-items: center; gap: .7rem; text-transform: uppercase; letter-spacing: .03em; }
.block-head h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to right, var(--line-bright), transparent); margin-left: .4rem; min-width: 24px; }
.h-ico { color: var(--accent-violet); width: 24px; height: 24px; display: inline-flex; flex: none; }
.h-ico svg { width: 24px; height: 24px; }
.see-all { font-family: var(--f-mono); font-size: .72rem; color: var(--ink-dim); display: inline-flex; align-items: center; gap: .35rem; padding: .42rem .85rem; border: 1px solid var(--line-bright); border-radius: 999px; white-space: nowrap; transition: color .15s, border-color .15s; }
.see-all svg { width: 14px; height: 14px; }
.see-all:hover { color: var(--accent-violet); border-color: var(--accent-violet); }

/* reveal (avec cascade via --d) */
.js-ready .reveal { opacity: 0; transform: translateY(20px) scale(.99); }
.reveal.is-visible { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: var(--d, 0ms); }

/* =========================================================
   PROJETS
   ========================================================= */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; }
.proj-card { background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; transition: border-color .18s, transform .18s, box-shadow .18s; }
.proj-card:hover { border-color: var(--line-bright); transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.proj-card .media { aspect-ratio: 16/10; background: var(--bg-panel-alt); display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-family: var(--f-mono); font-size: .68rem; overflow: hidden; border-bottom: 1px solid var(--line); }
.proj-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.proj-card:hover .media img { transform: scale(1.05); }
.proj-card .body { padding: 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.proj-card h3 { font-size: 1.08rem; }
.proj-card .sub { font-size: .84rem; color: var(--ink-dim); }
.proj-card .tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; padding-top: .8rem; }
.proj-card .tags span { font-family: var(--f-mono); font-size: .62rem; padding: .22rem .5rem; border-radius: 5px; background: var(--bg-panel-alt); color: var(--ink-dim); }

/* =========================================================
   COMPÉTENCES
   ========================================================= */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.skill { display: flex; align-items: center; gap: .85rem; background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; transition: border-color .18s, transform .18s; }
.skill:hover { border-color: var(--line-bright); transform: translateY(-3px); }
.sk-ico { width: 42px; height: 42px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--accent-violet-soft); color: var(--accent-violet); }
.sk-ico svg { width: 22px; height: 22px; }
.skill h3 { font-size: .94rem; }
.sk-sub { font-size: .76rem; color: var(--ink-dim); }

/* =========================================================
   BOUTIQUE
   ========================================================= */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.2rem; }
.shop-card { position: relative; background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; transition: border-color .18s, transform .18s; }
.shop-card:hover { border-color: var(--line-bright); transform: translateY(-3px); }
.shop-card .media { aspect-ratio: 4/3; background: var(--bg-panel-alt); display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-family: var(--f-mono); font-size: .68rem; overflow: hidden; }
.shop-card .media img { width: 100%; height: 100%; object-fit: cover; }
.shop-card .body { padding: 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.shop-card h3 { font-size: 1.02rem; }
.shop-card .desc { font-size: .82rem; color: var(--ink-dim); flex: 1; }
.shop-card .row { display: flex; align-items: center; justify-content: space-between; margin-top: .6rem; }
.shop-card .price { font-family: var(--f-display); font-weight: 700; font-size: 1.08rem; }
.shop-card .add { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line-bright); background: none; color: var(--ink-faint); display: flex; align-items: center; justify-content: center; cursor: not-allowed; }
.shop-card .add svg { width: 16px; height: 16px; }
.shop-soon { position: absolute; top: .6rem; right: .6rem; font-family: var(--f-mono); font-size: .56rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-violet); background: var(--bg-void); border: 1px solid var(--accent-violet); border-radius: 999px; padding: .12rem .5rem; }

/* =========================================================
   PANELS (à propos / contact)
   ========================================================= */
.panel { background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.6rem,3.5vw,2.6rem); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem,3.5vw,2.6rem); align-items: center; }
@media (max-width: 760px){ .panel { grid-template-columns: 1fr; } }
.panel .p-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.panel h2 { font-size: 1.3rem; text-transform: uppercase; letter-spacing: .04em; }
.panel p { color: var(--ink-dim); font-size: .96rem; margin: 0 0 .85rem; }
.panel .signature { font-family: var(--f-display); font-style: italic; color: var(--ink-faint); font-size: 1.4rem; margin: .3rem 0 1.2rem; }
.panel-visual { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/3; }
.panel-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.panel:hover .panel-visual img { transform: scale(1.04); }

/* =========================================================
   States / footer / pages détail / galerie
   ========================================================= */
.state-msg { font-family: var(--f-mono); font-size: .82rem; color: var(--ink-faint); padding: 1.5rem 0; }
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; }
.footer-in { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 2rem; padding: 2.2rem 0 1.6rem; }
.footer-brand .footer-tag { color: var(--ink-dim); font-size: .9rem; margin: .5rem 0 0; }
.footer-cols { display: flex; gap: clamp(2rem, 6vw, 4rem); flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: .5rem; }
.footer-col-title { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .3rem; }
.footer-col a { color: var(--ink-dim); font-size: .9rem; transition: color .15s; }
.footer-col a:hover { color: var(--accent-violet); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 1.2rem 0 2.2rem; border-top: 1px solid var(--line); }
.footer-bottom .mono-tag { text-transform: none; letter-spacing: .04em; }

.page-header { padding: clamp(2.5rem,7vh,4.5rem) 0 clamp(1.5rem,3vh,2.5rem); border-bottom: 1px solid var(--line); }
.page-header .mono-tag { display: block; margin-bottom: .8rem; }
.page-header h1 { font-size: clamp(2rem,5vw,3.2rem); }
.page-header p { color: var(--ink-dim); max-width: 60ch; margin-top: .9rem; }
.page-section { padding: clamp(2rem,4.5vh,3rem) 0 4rem; }

.filter-row { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1.6rem 0 0; }
.filter-row button { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; padding: .48rem .95rem; background: transparent; border: 1px solid var(--line-bright); border-radius: 999px; color: var(--ink-dim); cursor: pointer; transition: color .15s, border-color .15s; }
.filter-row button:hover { color: var(--ink); }
.filter-row button.is-active { border-color: var(--accent-violet); color: var(--accent-violet); }

.gallery-grid { columns: 3 240px; column-gap: 1.1rem; }
.gallery-grid .g-item { break-inside: avoid; margin-bottom: 1.1rem; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--bg-panel-alt); min-height: 120px; display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-family: var(--f-mono); font-size: .7rem; transition: border-color .18s, transform .18s; }
.gallery-grid .g-item:hover { border-color: var(--line-bright); transform: translateY(-3px); }
.gallery-grid .g-item img { width: 100%; display: block; }

/* =========================================================
   PAGES DÉTAIL — enrichies
   ========================================================= */
.page-hero { padding: clamp(2.5rem,7vh,4.5rem) 0 clamp(1.5rem,3vh,2.5rem); }
.page-hero .mono-tag { display: block; margin-bottom: .8rem; }
.page-hero h1 { font-size: clamp(2.2rem,5.5vw,3.6rem); line-height: 1; }
.page-hero .lead { color: var(--ink-dim); max-width: 62ch; margin-top: 1rem; font-size: 1.02rem; }

/* mini-stats en tête de page */
.page-stats { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; }
.page-stat { display: flex; align-items: center; gap: .7rem; padding: .7rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-panel); }
.page-stat .ps-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-violet-soft); color: var(--accent-violet); display: flex; align-items: center; justify-content: center; }
.page-stat .ps-ico svg { width: 17px; height: 17px; }
.page-stat b { font-family: var(--f-display); font-size: 1.05rem; }
.page-stat span { font-family: var(--f-mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-dim); display: block; }

/* carte projet cliquable + tilt souris */
.proj-card { cursor: pointer; }
.proj-card .media { position: relative; }
.proj-card .open-hint { position: absolute; inset: auto .6rem .6rem auto; font-family: var(--f-mono); font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-violet); background: rgba(10,10,20,.7); border: 1px solid var(--accent-violet); border-radius: 999px; padding: .12rem .5rem; opacity: 0; transition: opacity .18s; }
.proj-card:hover .open-hint { opacity: 1; }
.cat-pill { font-family: var(--f-mono); font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-moon); }

/* =========================================================
   MODAL (détail projet / RP)
   ========================================================= */
.modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 1.5rem; opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s ease; }
.modal.is-open { opacity: 1; visibility: visible; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6,6,12,.78); backdrop-filter: blur(4px); }
.modal-card { position: relative; z-index: 1; width: min(720px, 100%); max-height: 88vh; overflow-y: auto; background: var(--bg-panel); border: 1px solid var(--line-bright); border-radius: var(--radius); padding: clamp(1.4rem,3vw,2.2rem); transform: translateY(16px) scale(.98); transition: transform .25s var(--ease); }
.modal.is-open .modal-card { transform: none; }
.modal-close { position: absolute; top: .9rem; right: .9rem; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-bright); background: var(--bg-panel-alt); color: var(--ink-dim); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.modal-close:hover { color: var(--accent-violet); border-color: var(--accent-violet); }
.modal-media { aspect-ratio: 16/9; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--bg-panel-alt); margin-bottom: 1.2rem; display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-family: var(--f-mono); font-size: .72rem; }
.modal-media img { width: 100%; height: 100%; object-fit: cover; }
.modal-media canvas { width: 100% !important; height: 100% !important; cursor: grab; }
.modal-card .cat-pill { margin-bottom: .5rem; display: inline-block; }
.modal-card h3 { font-size: 1.5rem; margin-bottom: .5rem; }
.modal-card p { color: var(--ink-dim); }
.modal-card .tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.modal-card .tags span { font-family: var(--f-mono); font-size: .66rem; padding: .25rem .6rem; border-radius: 6px; background: var(--bg-panel-alt); color: var(--ink-dim); }
.modal-card .modal-actions { margin-top: 1.4rem; display: flex; gap: .6rem; flex-wrap: wrap; }

/* =========================================================
   GALERIE — lightbox
   ========================================================= */
.gallery-grid .g-item { cursor: pointer; position: relative; }
.gallery-grid .g-item .g-cap { position: absolute; inset: auto 0 0 0; padding: .5rem .7rem; background: linear-gradient(to top, rgba(6,6,12,.85), transparent); font-family: var(--f-mono); font-size: .66rem; color: var(--ink); opacity: 0; transition: opacity .18s; }
.gallery-grid .g-item:hover .g-cap { opacity: 1; }
.lightbox { position: fixed; inset: 0; z-index: 130; display: flex; align-items: center; justify-content: center; padding: 2rem; background: rgba(6,6,12,.9); opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s; }
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-sm); border: 1px solid var(--line-bright); }
.lightbox .lb-close { position: absolute; top: 1.2rem; right: 1.4rem; width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line-bright); background: var(--bg-panel); color: var(--ink); cursor: pointer; font-size: 1.2rem; }

/* empty-state stylé */
.empty-cta { border: 1px dashed var(--line-bright); border-radius: var(--radius); padding: 2.5rem; text-align: center; color: var(--ink-dim); }
.empty-cta .ec-ico { color: var(--accent-violet); display: inline-flex; margin-bottom: .8rem; }
.empty-cta .ec-ico svg { width: 30px; height: 30px; }

/* =========================================================
   HISTORIQUE RP — Character Showcase v2
   ========================================================= */
.rp-showcase { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 1.4rem; align-items: start; }
@media (max-width: 860px){ .rp-showcase { grid-template-columns: 1fr; } }

/* --- scène du perso sélectionné --- */
.rp-stage {
  position: sticky; top: 1.5rem;
  background: radial-gradient(circle at 50% 22%, #221d40, var(--bg-panel) 72%);
  border: 1px solid var(--line-bright); border-radius: var(--radius);
  padding: 1.2rem 1.2rem 1.4rem; overflow: hidden;
}
.rp-stage::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 118%, rgba(139,108,240,.22), transparent 60%); pointer-events: none; }
.rp-viewer { position: relative; z-index: 1; width: 100%; aspect-ratio: 3/4; max-height: 360px; display: flex; align-items: center; justify-content: center; }
.rp-viewer canvas { width: 100% !important; height: 100% !important; cursor: grab; }
.rp-viewer canvas:active { cursor: grabbing; }
.rp-viewer .rp-viewer-fallback { width: 46%; image-rendering: pixelated; }
.rp-stage-info { position: relative; z-index: 1; text-align: center; margin-top: .6rem; }
.rp-stage-info .rp-name { font-size: 1.3rem; }
.rp-stage-info .rp-sub { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: .45rem; }
.rp-stage-info .rp-year { font-family: var(--f-mono); font-size: .64rem; color: var(--accent-violet); border: 1px solid var(--accent-violet); border-radius: 5px; padding: .1rem .45rem; }
.rp-stage-info .rp-role { color: var(--ink-dim); font-size: .88rem; margin: .55rem 0 0; }
.rp-stage-info .rp-tags { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: .7rem; }
.rp-stage-info .rp-tags span { font-family: var(--f-mono); font-size: .62rem; padding: .18rem .5rem; border-radius: 5px; background: var(--bg-panel-alt); color: var(--ink-dim); }
.rp-details-btn { margin-top: 1rem; width: 100%; }

/* --- roster (images des RP / maps) façon cartes projets --- */
.rp-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1.1rem; align-content: start; }
.rp-pick {
  display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer; color: var(--ink); font-family: inherit;
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.rp-pick:hover { transform: translateY(-3px); border-color: var(--line-bright); }
.rp-pick.is-active { border-color: var(--accent-violet); box-shadow: 0 0 0 1px var(--accent-violet); }
.rp-pick-img { aspect-ratio: 16/10; background: var(--bg-panel-alt); overflow: hidden; position: relative; border-bottom: 1px solid var(--line); }
.rp-pick-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.rp-pick:hover .rp-pick-img img { transform: scale(1.06); }
.rp-pick-img .rp-pick-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-family: var(--f-mono); font-size: .68rem; }
.rp-pick-body { padding: .85rem .9rem; display: flex; flex-direction: column; gap: .25rem; }
.rp-pick-name { font-family: var(--f-display); font-weight: 600; font-size: 1rem; line-height: 1.2; }
.rp-pick-year { font-family: var(--f-mono); font-size: .68rem; color: var(--ink-dim); }
.rp-pick.is-active .rp-pick-year { color: var(--accent-violet); }

/* --- liens (modale RP + contacts) --- */
.link-list { display: flex; flex-direction: column; gap: .5rem; margin-top: 1.2rem; }
.link-btn { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border: 1px solid var(--line-bright); border-radius: var(--radius-sm); color: var(--ink); background: var(--bg-panel); font-family: inherit; text-align: left; width: 100%; cursor: pointer; transition: border-color .15s, background .15s; }
.link-btn:hover { border-color: var(--accent-violet); background: var(--accent-violet-soft); }
.link-btn .lb-ico { width: 30px; height: 30px; flex: none; border-radius: 7px; background: var(--accent-violet-soft); color: var(--accent-violet); display: flex; align-items: center; justify-content: center; }
.link-btn .lb-ico svg { width: 17px; height: 17px; }
.link-btn .lb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.link-btn .lb-label { display: block; font-size: .9rem; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-btn .lb-sub { display: block; font-family: var(--f-mono); font-size: .66rem; color: var(--ink-dim); }
.link-btn .lb-ext { color: var(--ink-faint); }
.link-btn .lb-ext svg { width: 15px; height: 15px; }

/* toast copie */
.toast { position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%) translateY(20px); z-index: 200; background: var(--bg-panel); border: 1px solid var(--accent-violet); color: var(--ink); font-family: var(--f-mono); font-size: .78rem; padding: .6rem 1rem; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   PAGES LÉGALES (prose) + 404
   ========================================================= */
.legal { max-width: 760px; color: var(--ink-dim); font-size: .96rem; line-height: 1.7; }
.legal h2 { font-family: var(--f-display); color: var(--ink); font-size: 1.2rem; margin: 2rem 0 .6rem; text-transform: uppercase; letter-spacing: .03em; }
.legal h2:first-child { margin-top: 0; }
.legal p { margin: 0 0 .8rem; }
.legal a { color: var(--accent-violet); }
.legal ul { margin: 0 0 .8rem; padding-left: 1.2rem; }
.legal .todo { color: var(--accent-moon); font-family: var(--f-mono); font-size: .82rem; }
.legal .updated { font-family: var(--f-mono); font-size: .72rem; color: var(--ink-faint); margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.err404 { position: relative; min-height: calc(100vh - 4rem); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1rem; border-radius: var(--radius); overflow: hidden; margin: 1.5rem 0; padding: 2rem; }
.err404::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(to top, var(--bg-void) 2%, rgba(15,14,28,.55) 45%, rgba(15,14,28,.35) 100%), url('../img/galerie/404-bg.jpg'); background-size: cover; background-position: center; }
[data-theme="light"] .err404::before { background-image: linear-gradient(to top, var(--bg-void) 2%, rgba(234,230,246,.55) 45%, rgba(234,230,246,.30) 100%), url('../img/galerie/404-bg.jpg'); }
.err404 > * { position: relative; z-index: 1; }
.err404 .code { font-family: var(--f-display); font-weight: 700; font-size: clamp(5rem, 20vw, 11rem); line-height: 1; letter-spacing: -.03em; background: linear-gradient(180deg, #fff, var(--accent-violet)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 60px rgba(151,125,255,.4); }
.err404 h1 { color: #fff; font-size: clamp(1.4rem, 3vw, 2rem); }
[data-theme="light"] .err404 h1 { color: var(--ink); }
.err404 p { color: #cfc9e6; max-width: 44ch; }
[data-theme="light"] .err404 p { color: var(--ink-dim); }

/* =========================================================
   FOND ANIMÉ (aurora + étoiles) — GPU-friendly
   ========================================================= */
.bg-fx { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
main, .site-footer { position: relative; z-index: 1; }

.bg-fx .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: calc(.30 * var(--aurora-op)); will-change: transform; }
.bg-fx .b1 { width: 46vw; height: 46vw; left: -8vw; top: -6vw; background: radial-gradient(circle, #977dff, transparent 70%); animation: drift1 34s ease-in-out infinite alternate; }
.bg-fx .b2 { width: 40vw; height: 40vw; right: -6vw; top: 22vh; background: radial-gradient(circle, #7cc0d6, transparent 70%); opacity: calc(.22 * var(--aurora-op)); animation: drift2 40s ease-in-out infinite alternate; }
.bg-fx .b3 { width: 38vw; height: 38vw; left: 24vw; bottom: -12vw; background: radial-gradient(circle, #b15cd6, transparent 70%); opacity: calc(.20 * var(--aurora-op)); animation: drift3 46s ease-in-out infinite alternate; }
@keyframes drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(10vw,8vh) scale(1.15); } }
@keyframes drift2 { from { transform: translate(0,0) scale(1); } to { transform: translate(-8vw,-6vh) scale(1.1); } }
@keyframes drift3 { from { transform: translate(0,0) scale(1); } to { transform: translate(6vw,-10vh) scale(1.12); } }

/* voile d'étoiles (points fixes, léger scintillement global) */
.bg-fx .stars { position: absolute; inset: -20% ; opacity: .5;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,.45), transparent),
    radial-gradient(1px 1px at 55% 45%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 12% 80%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 90% 88%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 33% 15%, rgba(255,255,255,.4), transparent);
  background-repeat: repeat; background-size: 100% 100%;
  animation: twinkle 6s ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity: .35; } 50% { opacity: .6; } }
[data-theme="light"] .bg-fx .stars { display: none; }

@media (prefers-reduced-motion: reduce) {
  .bg-fx .blob, .bg-fx .stars { animation: none !important; }
}

/* =========================================================
   HERO : couleurs fixes (fond toujours sombre) — OK en clair
   ========================================================= */
.hero-eyebrow { color: #a78bff; }
.hero-tagline { color: #d7d2ea; }
.hero .btn { color: #f1eefc; border-color: rgba(255,255,255,.22); background: rgba(18,16,34,.55); }
.hero .btn:hover { border-color: var(--accent-violet); }
.hero .btn.is-primary { color: #14102b; border-color: var(--accent-violet); background: var(--accent-violet); }
.hero-stats { background: rgba(14,13,26,.82); border-color: rgba(255,255,255,.10); }
.hero .stat-item + .stat-item { border-left-color: rgba(255,255,255,.10); }
.hero .s-ico { background: rgba(151,125,255,.18); color: #b9a4ff; }
.hero .s-num { color: #fff; }
.hero .s-label { color: #b8b2cf; }
.scroll-cue { color: #b8b2cf; }
.scroll-cue .line { background: rgba(255,255,255,.35); }

/* =========================================================
   INFO-BULLES (tooltips) custom
   ========================================================= */
.tip {
  position: fixed; z-index: 300; pointer-events: none;
  background: var(--bg-panel); border: 1px solid var(--line-bright); color: var(--ink);
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .02em;
  padding: .38rem .6rem; border-radius: 7px; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); opacity: 0; transform: translateY(2px);
  transition: opacity .14s ease, transform .14s ease;
}
.tip.is-on { opacity: 1; transform: none; }
.tip::before { content: ''; position: absolute; width: 7px; height: 7px; background: var(--bg-panel); border-left: 1px solid var(--line-bright); border-bottom: 1px solid var(--line-bright); }
.tip.tip-right::before { left: -4px; top: 50%; transform: translateY(-50%) rotate(45deg); }
.tip.tip-top::before { bottom: -4px; left: 50%; transform: translateX(-50%) rotate(-45deg); }
