/* ============================================================
   FICHIER GENERE PAR build-css.py, NE PAS EDITER A LA MAIN.
   Editer les fichiers sources puis relancer : python3 build-css.py
   Genere le 2026-09-19 18:51
   ============================================================ */

/* ----- css/variables.css ----- */
/* ===== CSS Custom Properties ===== */

:root {
  /* Light mode */
  --bg: #f0ece4;
  --bg-card: #f8f5ee;
  --text: #111;
  --text-muted: #666;
  --border: #111;
  --switch-bg: #ddd;
  --switch-dot: #111;
  /* Cards that stay light in dark mode */
  --card-keep-bg: #f8f5ee;
  --card-keep-text: #111;
  --card-keep-muted: #666;
  --card-keep-border: #111;
  --card-keep-shadow: #111;
}

[data-theme="dark"] {
  --bg: #0e0e0e;
  --bg-card: #1a1a1a;
  --text: #f0ece4;
  --text-muted: #999;
  --border: #f0ece4;
  --switch-bg: #333;
  --switch-dot: #f0ece4;
  --card-keep-bg: #f8f5ee;
  --card-keep-text: #111;
  --card-keep-muted: #666;
  --card-keep-border: #111;
  --card-keep-shadow: #111;
}

/* Kill transitions during theme switch to prevent lag */
.theme-switching,
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: none !important;
}

/* ----- css/base.css ----- */
/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }
.skip-link { position: absolute; top: -100%; left: 0; background: var(--bg); color: var(--text); padding: 8px 16px; z-index: 9999; font-size: 14px; }
.skip-link:focus { top: 0; }
button:focus-visible, [role="button"]:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Special Elite', serif;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url('https://pub-43a141f7a8b84a30a90fcc01da2114ca.r2.dev/Texture_landscape.webp') repeat;
  background-size: 600px;
  opacity: 1;
}

a { color: inherit; text-decoration: none; }

.landing, .pile-view, .tech-page, .music-page, .book-view { position: relative; z-index: 1; }

/* ===== Background Slideshow ===== */
.bg-slideshow {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.5s ease;
  will-change: opacity;
  contain: strict;
}

.bg-slideshow img.active {
  opacity: 0.06;
}

/* ===== Back Link ===== */
.back-link {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 999;
  font-family: 'Bangers', sans-serif;
  font-size: 18px;
  letter-spacing: 2px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
  text-decoration: none;
  color: var(--text);
  padding: 10px 18px;
}
.back-link:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 var(--border);
}

/* ===== Legal Link ===== */
.legal-link {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 998;
  font-family: 'Special Elite', serif;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.5;
  text-decoration: none;
  transition: opacity 0.2s;
}
.legal-link:hover {
  opacity: 1;
}

/* ===== Card Logo (shared) ===== */
.card-logo {
  width: 12px;
  height: 12px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 4px;
  mix-blend-mode: multiply;
}

[data-theme="dark"] .card-logo {
  mix-blend-mode: screen;
}

@media (max-width: 600px) {
  .back-link { font-size: 14px; padding: 10px 16px; top: 10px; left: 10px; }
  .legal-link { bottom: 6px; right: 6px; font-size: 9px; }
}

/* ----- css/components/theme-toggle.css ----- */
/* ===== Theme Switch ===== */
.theme-toggle {
  all: unset;
  box-sizing: border-box;
  position: fixed;
  top: 20px;
  right: 20px;
  left: auto;
  z-index: 999;
  cursor: pointer;
  width: 52px;
  height: 28px;
  background: var(--switch-bg);
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 2px;
  transition: background 0.3s;
}

.theme-toggle .dot {
  width: 20px;
  height: 20px;
  background: var(--switch-dot);
  border-radius: 2px;
  transition: transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

[data-theme="dark"] .theme-toggle .dot {
  transform: translateX(24px);
}

@media (max-width: 600px) {
  .theme-toggle { top: 12px; right: 12px; width: 48px; height: 28px; }
  .theme-toggle .dot { width: 20px; height: 20px; }
  [data-theme="dark"] .theme-toggle .dot { transform: translateX(20px); }
}

/* ----- css/components/cards.css ----- */
/* ===== CV Card ===== */
.cv-card {
  position: fixed;
  top: -90px;
  left: 30px;
  z-index: 998;
  width: 140px;
  height: 170px;
  background: var(--bg-card);
  border: 3px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  box-shadow: 4px 4px 0 0 var(--border);
  transition: transform 0.3s, box-shadow 0.3s;
  transform: rotate(-3deg);
}

.cv-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: rgba(0,0,0,0.3);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  display: none;
}

.cv-overlay.open {
  display: flex;
}

.cv-overlay canvas {
  display: block;
  height: 72vh;
  width: auto;
  border: 3px solid var(--border);
  box-shadow: 8px 8px 0 0 var(--border);
  background: #fff;
}

.cv-download {
  font-family: 'Bangers', sans-serif;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--bg);
  background: var(--border);
  border: 2px solid var(--border);
  padding: 6px 16px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.cv-download:hover {
  opacity: 0.8;
}

.cv-card:hover {
  transform: rotate(0deg) translateY(10px);
  box-shadow: 6px 6px 0 0 var(--border);
}

.cv-label {
  font-family: 'Bangers', sans-serif;
  font-size: 36px;
  letter-spacing: 3px;
  color: var(--text);
}

/* ===== Contact Card ===== */
.contact-card {
  all: unset;
  box-sizing: border-box;
  position: fixed;
  top: 50%;
  right: -210px;
  transform: translateY(-50%) rotate(-2deg);
  z-index: 998;
  width: 300px;
  background: var(--bg-card);
  border: 3px solid var(--border);
  box-shadow: -4px 4px 0 0 var(--border);
  cursor: pointer;
  transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.4s;
}

.contact-card:hover {
  right: -200px;
}

.contact-card.open {
  right: 0;
  transform: translateY(-50%) rotate(0deg);
}

.contact-card-label {
  font-family: 'Bangers', sans-serif;
  font-size: 28px;
  letter-spacing: 4px;
  text-align: center;
  padding: 14px;
  border-bottom: 3px solid var(--border);
}

.contact-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.contact-item {
  font-family: 'Special Elite', serif;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

a.contact-item:hover {
  color: var(--text-muted);
}

/* ===== Tools Card ===== */
.tools-card {
  all: unset;
  box-sizing: border-box;
  position: fixed;
  bottom: 20px;
  right: -180px;
  z-index: 998;
  width: 240px;
  background: var(--bg-card);
  border: 3px solid var(--border);
  box-shadow: -4px 4px 0 0 var(--border);
  cursor: pointer;
  transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.4s;
  transform: rotate(-2deg);
}

.tools-card:hover {
  right: -170px;
}

.tools-card.open {
  right: 0;
  transform: rotate(0deg);
}

.tools-card-label {
  font-family: 'Bangers', sans-serif;
  font-size: 20px;
  letter-spacing: 3px;
  text-align: center;
  padding: 10px;
  border-bottom: 2px solid var(--border);
}

.tools-card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
}

.tools-item {
  font-family: 'Special Elite', serif;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--text);
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

.tools-item:last-child {
  border-bottom: none;
}

/* ===== Tools Trigger (mobile only) ===== */
.tools-trigger {
  display: none;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  /* ---- CV card ---- */
  .cv-card {
    width: 54px;
    height: 64px;
    top: -28px;
    left: 10px;
    padding-bottom: 6px;
    border-width: 2px;
  }
  .cv-label { font-size: 14px; }

  /* ---- Contact card mobile : bottom-sheet ---- */
  .contact-card {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    transform: translateY(100%);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 0 0 var(--border);
  }
  .contact-card:hover {
    right: 0;
  }
  .contact-card.open {
    transform: translateY(0);
  }
  .contact-card-label {
    font-size: 18px;
    padding: 12px;
    text-align: center;
  }
  .contact-card-content {
    padding: 16px 20px 24px;
    gap: 0;
  }
  .contact-item {
    font-size: 13px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--text-muted);
    display: block;
  }
  .contact-item:last-child {
    border-bottom: none;
  }

  /* ---- Tools trigger mobile ---- */
  .tools-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 12px;
    left: 12px;
    z-index: 998;
    width: 44px;
    height: 44px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    padding: 0;
  }
  .tools-trigger-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
  }

  /* ---- Tools card mobile : bottom-sheet ---- */
  .tools-card {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    transform: translateY(100%);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 0 0 var(--border);
  }
  .tools-card:hover {
    right: 0;
  }
  .tools-card.open {
    transform: translateY(0);
  }
  .tools-card-label {
    font-size: 18px;
    padding: 12px;
    text-align: center;
  }
  .tools-card-content {
    padding: 16px 20px 24px;
    gap: 0;
  }
  .tools-item {
    font-size: 13px;
    padding: 14px 0;
  }
}

/* ----- css/components/scroll.css ----- */
/* ===== Scroll to Top ===== */
.scroll-top {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 998;
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.2s, box-shadow 0.2s;
}
.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: 4px 4px 0 var(--border);
}

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Pile items: fade-in without overriding custom transforms */
.pile-reveal {
  opacity: 0;
  transition: opacity 0.5s ease;
}
.pile-reveal.visible {
  opacity: 1;
}

@media (max-width: 600px) {
  .scroll-top {
    bottom: 12px;
    left: 64px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}

/* ----- css/components/pile.css ----- */
/* ========================================
   PILE VIEW — Stack of books
   ======================================== */

.pile-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 50px;
}

.pile-header {
  text-align: center;
}

.pile-title {
  font-family: 'Bangers', sans-serif;
  font-size: clamp(48px, 10vw, 80px);
  letter-spacing: 6px;
}

.pile-sub {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-top: 10px;
}

/* ===== Scattered Books ===== */
.pile-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 40px 30px;
  width: 100%;
  max-width: 1100px;
  padding: 0 20px;
  perspective: 800px;
}

/* Paper fold texture — all pile cards */
.pile-book:not(.has-cover)::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('https://pub-43a141f7a8b84a30a90fcc01da2114ca.r2.dev/Paper%20Fold.jpeg') center / cover no-repeat;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

/* Iridescent sheen on pile items */
.pile-book::after,
.pile-folder .folder-body::after,
.pile-film .film-body::after,
.pile-phone::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    rgba(255,255,255,0.25) 0%,
    rgba(255,255,255,0.08) 30%,
    transparent 60%
  );
  mix-blend-mode: overlay;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10;
}
.pile-book:hover::after,
.pile-folder:hover .folder-body::after,
.pile-film:hover .film-body::after,
.pile-phone:hover::after {
  opacity: 1;
}

.pile-book {
  all: unset;
  box-sizing: border-box;
  width: 240px;
  height: 320px;
  border: 3px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
  transform: translate(var(--ox), var(--oy)) rotate(var(--rot));
  box-shadow: 8px 8px 0 0 var(--border);
  transform-style: preserve-3d;
}

/* Size variants */
.pile-sm { width: 200px; height: 270px; }
.pile-sm .pile-book-title { font-size: 20px; }
.pile-sm .pile-book-icon { font-size: 36px; }

.pile-md { width: 240px; height: 320px; }

.pile-lg { width: 280px; height: 380px; }
.pile-lg .pile-book-title { font-size: 30px; }
.pile-lg .pile-book-icon { font-size: 56px; }

.pile-wide { width: 300px; height: 240px; }
.pile-wide .pile-book-icon { font-size: 40px; }

.pile-sq { width: 260px; height: 260px; }

/* Deal cards animation on first load */
@keyframes dealCard {
  0% {
    opacity: 0;
    transform: translate(0, 100vh) rotate(15deg);
  }
  100% {
    opacity: 1;
    transform: translate(var(--ox, 0), var(--oy, 0)) rotate(var(--rot, 0deg));
  }
}

.pile-stack > * {
  animation: dealCard 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.pile-stack.no-anim > * {
  animation: none;
}

.pile-stack > *:nth-child(1) { animation-delay: 0.1s; }
.pile-stack > *:nth-child(2) { animation-delay: 0.25s; }
.pile-stack > *:nth-child(3) { animation-delay: 0.4s; }
.pile-stack > *:nth-child(4) { animation-delay: 0.55s; }
.pile-stack > *:nth-child(5) { animation-delay: 0.7s; }
.pile-stack > *:nth-child(6) { animation-delay: 0.85s; }

.pile-book:hover {
  box-shadow: 12px 12px 0 0 var(--border);
  z-index: 100;
}

/* Cards with cover image */
.pile-book.has-cover .pile-book-icon {
  display: none;
}

.pile-book.has-cover .pile-book-title,
.pile-book.has-cover .pile-book-type {
  opacity: 0;
  transition: opacity 0.3s;
}

.pile-book.has-cover:hover .pile-book-title,
.pile-book.has-cover:hover .pile-book-type {
  opacity: 1;
}

/* Hover overlay for cards with covers */
.pile-book.has-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.3s;
  z-index: 1;
}

.pile-book.has-cover:hover::before {
  background: rgba(0,0,0,0.5);
}

.pile-book.has-cover .pile-book-title,
.pile-book.has-cover .pile-book-type {
  position: relative;
  z-index: 2;
  color: var(--bg);
}

.pile-book-icon {
  font-size: 48px;
  line-height: 1;
}

.pile-book-title {
  font-family: 'Bangers', sans-serif;
  font-size: 26px;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  padding: 0 16px;
}

.pile-book-type {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  border: none;
  padding: 4px 12px;
}

/* ===== Graphisme: 2x2 grid ===== */
#graphisme-view .pile-stack {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  flex-wrap: unset !important;
  max-width: 600px !important;
  margin: 0 auto;
}

#graphisme-view .pile-stack > * {
  width: 240px !important;
  height: 300px !important;
}

/* ===== Book View (PDF) ===== */
.book-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 30px;
}

/* ===== Dark mode: keep cards light ===== */
[data-theme="dark"] .pile-book:not(.has-cover) {
  background: var(--card-keep-bg);
  border-color: var(--card-keep-border);
  box-shadow: 8px 8px 0 0 var(--card-keep-shadow);
  color: var(--card-keep-text);
}

[data-theme="dark"] .pile-book:not(.has-cover):hover {
  box-shadow: 12px 12px 0 0 var(--card-keep-shadow);
}

[data-theme="dark"] .pile-book:not(.has-cover) .pile-book-type {
  color: var(--card-keep-muted);
}

[data-theme="dark"] .pile-book.has-cover .pile-book-title,
[data-theme="dark"] .pile-book.has-cover .pile-book-type {
  color: #f0ece4;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .pile-view {
    padding: 56px 16px 30px;
    gap: 16px;
  }
  .pile-title {
    font-size: clamp(32px, 8vw, 80px);
  }
  .pile-sub {
    font-size: 12px;
  }

  /* Pile stack : grille uniforme */
  .pile-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    max-width: 100%;
    padding: 0;
  }

  /* Tous les items : meme taille, pas de rotation */
  .pile-book,
  .pile-sm,
  .pile-md,
  .pile-lg,
  .pile-wide,
  .pile-sq,
  .pile-phone,
  .pile-folder,
  .pile-film {
    width: 100% !important;
    height: 160px !important;
    transform: none !important;
    box-shadow: 3px 3px 0 var(--border);
    border-width: 2px;
  }
  .pile-book:hover,
  .pile-phone:hover,
  .pile-folder:hover,
  .pile-film:hover {
    transform: none !important;
    box-shadow: 3px 3px 0 var(--border);
  }
  .pile-book-title { font-size: 16px; letter-spacing: 2px; }
  .pile-book-icon { font-size: 24px; }
  .pile-book-type { font-size: 9px; }

  /* Graphisme sub-grid */
  #graphisme-view .pile-stack {
    grid-template-columns: repeat(2, 1fr);
  }
  #graphisme-view .pile-stack > * {
    width: 100% !important;
    height: 180px !important;
  }

  /* Covers mobile : overlay sombre + titres visibles */
  .pile-book.has-cover {
    overflow: hidden;
  }
  .pile-book.has-cover::before {
    background: rgba(0,0,0,0.35);
  }
  .pile-book.has-cover .pile-book-title,
  .pile-book.has-cover .pile-book-type {
    opacity: 1;
  }
  .pile-book.has-cover .pile-book-title {
    font-size: 13px;
    padding: 0 6px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  }
  .pile-book.has-cover .pile-book-type {
    font-size: 8px;
    padding: 2px 6px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  }

  /* Book view */
  .book-view {
    padding: 56px 16px 30px;
    gap: 14px;
  }
}

@media (max-width: 400px) {
  .pile-view {
    padding: 52px 10px 24px;
  }
  .pile-stack {
    gap: 10px;
  }
  .pile-book,
  .pile-sm,
  .pile-md,
  .pile-lg,
  .pile-wide,
  .pile-sq,
  .pile-phone,
  .pile-folder,
  .pile-film {
    height: 130px !important;
  }
  .pile-book-title { font-size: 14px; }
  .pile-book-icon { font-size: 20px; }
  .book-view {
    padding: 52px 10px 24px;
  }
}

/* ----- css/components/gallery.css ----- */
/* ========================================
   IMAGE GALLERY
   ======================================== */

.gallery-grid {
  columns: 3;
  column-gap: 16px;
  width: 100%;
  max-width: 960px;
  padding: 0 20px 40px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border: 3px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 4px 4px 0 0 var(--border);
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 8px 8px 0 0 var(--border);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  content-visibility: auto;
}

.gallery-item canvas {
  display: block;
  width: 100%;
  height: auto;
}

.gallery-item-link {
  display: block;
  padding: 6px 10px;
  font-family: 'Special Elite', serif;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  text-decoration: none;
  border-top: 2px solid var(--border);
  transition: color 0.2s;
}
.gallery-item-link:hover {
  color: var(--text);
}

.gallery-pdf {
  position: relative;
}

/* ===== Lightbox ===== */
.gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gallery-lightbox.open {
  display: flex;
}

.gallery-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .gallery-grid {
    columns: 2;
    padding: 0 8px 30px;
  }
  .gallery-item-link {
    padding: 10px 0;
    font-size: 12px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .gallery-grid {
    columns: 1;
    padding: 0 4px 24px;
  }
}

/* ----- css/components/film.css ----- */
/* ===== Film strip card (Animation) ===== */
.pile-film {
  box-sizing: border-box;
  width: 240px;
  height: 320px;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
  transform: translate(var(--ox), var(--oy)) rotate(var(--rot));
  transform-style: preserve-3d;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 6px 6px 0 0 var(--border);
}

.pile-film:hover {
  box-shadow: 10px 10px 0 0 var(--border);
  z-index: 100;
}

.film-strip-top,
.film-strip-bottom {
  height: 28px;
  background: var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  flex-shrink: 0;
}

.film-hole {
  width: 12px;
  height: 10px;
  background: var(--bg);
  border-radius: 2px;
  flex-shrink: 0;
}

.film-body {
  flex: 1;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  gap: 12px;
}

.film-title {
  font-family: 'Bangers', sans-serif;
  font-size: 26px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text);
}

.film-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
}

/* ===== Dark mode: keep film body light ===== */
[data-theme="dark"] .film-body {
  background: var(--card-keep-bg);
}

[data-theme="dark"] .film-title {
  color: var(--card-keep-text);
}

[data-theme="dark"] .film-sub {
  color: var(--card-keep-muted);
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .pile-film {
    border-radius: 0;
    width: 100% !important;
  }
  .film-strip-top,
  .film-strip-bottom {
    height: 18px;
    padding: 0 8px;
    justify-content: space-between;
    gap: 0;
  }
  .film-hole {
    width: 8px;
    height: 6px;
    flex-shrink: 1;
  }
  .film-title { font-size: 16px; letter-spacing: 2px; }
  .film-sub { font-size: 9px; }
}

@media (max-width: 400px) {
  .film-title { font-size: 14px; }
}

/* ----- css/components/anim.css ----- */
/* ========================================
   CINEMA — Animation viewer
   ======================================== */

.cinema {
  width: 100%;
  max-width: 900px;
  padding: 0 20px 40px;
}

.cinema-screen {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 3px solid var(--border);
  box-shadow: 6px 6px 0 0 var(--border);
  background: #000;
  overflow: hidden;
  position: relative;
}

.cinema-screen iframe,
.cinema-screen video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.cinema-placeholder {
  width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
}

.cinema-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cinema-label {
  background: var(--border);
  color: var(--bg);
  font-family: 'Bangers', sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  text-align: center;
  padding: 8px;
  border: 3px solid var(--border);
  border-top: none;
  box-shadow: 6px 6px 0 0 var(--border);
}

/* ===== Navigation ===== */
.cinema-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.cinema-arrow {
  all: unset;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cinema-arrow:hover {
  transform: translateY(-2px);
  box-shadow: 3px 3px 0 var(--border);
}

.cinema-counter {
  font-family: 'Bangers', sans-serif;
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--text-muted);
  min-width: 60px;
  text-align: center;
}

/* ===== Filmstrip thumbnails ===== */
.cinema-strip {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.cinema-strip::-webkit-scrollbar {
  display: none;
}

.cinema-thumb {
  flex: 0 0 140px;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  opacity: 0.6;
}

.cinema-thumb:hover {
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 4px 4px 0 var(--border);
}

.cinema-thumb.active {
  opacity: 1;
  border-width: 3px;
  box-shadow: 4px 4px 0 var(--border);
}

.cinema-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cinema-thumb-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: var(--border);
  color: var(--bg);
  font-family: 'Bangers', sans-serif;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 2px 6px;
}

/* ===== Play button (shared) ===== */
.anim-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: var(--border);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  padding-left: 4px;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.cinema-placeholder:hover .anim-play,
.anim-card:hover .anim-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

/* ===== Motion design (standalone card) ===== */
.anim-card {
  border: 3px solid var(--border);
  box-shadow: 6px 6px 0 0 var(--border);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.anim-card:hover {
  transform: translateY(-4px);
  box-shadow: 8px 8px 0 0 var(--border);
}
.anim-card img,
.anim-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.anim-card iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
}

.anim-label {
  background: var(--border);
  color: var(--bg);
  font-family: 'Bangers', sans-serif;
  font-size: 14px;
  letter-spacing: 2px;
  text-align: center;
  padding: 6px;
}

.motion-single {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.motion-desc {
  font-family: 'Special Elite', serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 16px 0;
  margin: 0;
}
.motion-card-meta {
  font-family: 'Special Elite', serif;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 16px 10px;
  opacity: 0.7;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .cinema { padding: 0 12px 30px; }
  .cinema-screen { box-shadow: 3px 3px 0 0 var(--border); }
  .cinema-label {
    font-size: 13px;
    padding: 6px;
    box-shadow: 3px 3px 0 0 var(--border);
  }
  .cinema-thumb { flex: 0 0 110px; }
  .anim-label { font-size: 12px; }
  .motion-desc { font-size: 12px; }
  .motion-card-meta { font-size: 11px; }
}

/* ----- css/components/tiktok.css ----- */
/* ===== Phone card (TikTok pile item) ===== */
.pile-phone {
  box-sizing: border-box;
  width: 180px;
  height: 340px;
  border: 3px solid var(--border);
  border-radius: 24px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  justify-self: center;
  position: relative;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
  transform: translate(var(--ox), var(--oy)) rotate(var(--rot));
  transform-style: preserve-3d;
}

.pile-phone:hover {
  box-shadow: 12px 12px 0 0 var(--border);
  z-index: 100;
}

.phone-notch {
  width: 50px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  position: absolute;
  top: 14px;
}

.phone-screen-label {
  font-family: 'Bangers', sans-serif;
  font-size: 28px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.phone-sub-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.phone-home-bar {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  position: absolute;
  bottom: 12px;
}

/* ===== Dark mode: keep phone card light ===== */
[data-theme="dark"] .pile-phone {
  background: var(--card-keep-bg);
  border-color: var(--card-keep-border);
  color: var(--card-keep-text);
}

[data-theme="dark"] .pile-phone:hover {
  box-shadow: 12px 12px 0 0 var(--card-keep-shadow);
}

[data-theme="dark"] .phone-screen-label {
  color: var(--card-keep-text);
}

[data-theme="dark"] .phone-sub-label {
  color: var(--card-keep-muted);
}

[data-theme="dark"] .phone-notch,
[data-theme="dark"] .phone-home-bar {
  background: var(--card-keep-border);
}

/* ========================================
   TIKTOK SCROLL
   ======================================== */

.tiktok-cta {
  font-family: 'Bangers', sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--bg);
  background: var(--border);
  border: 3px solid var(--border);
  padding: 12px 20px;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.2s;
  align-self: center;
}

.tiktok-cta:hover {
  opacity: 0.85;
}

.tiktok-row {
  display: flex;
  align-items: center;
  gap: 24px;
}

.tiktok-phone {
  width: 340px;
  border: 4px solid var(--border);
  border-radius: 36px;
  background: var(--bg-card);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  box-shadow: 8px 8px 0 var(--border);
}

.tiktok-phone-notch {
  width: 80px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin-bottom: 8px;
}

.tiktok-phone-home {
  width: 50px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 10px;
}

.tiktok-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 580px;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: 8px;
  overflow-x: hidden;
}

.tiktok-scroll::-webkit-scrollbar {
  display: none;
}

.tiktok-embed-wrap {
  flex: 0 0 100%;
  width: 100%;
  height: 580px;
  scroll-snap-align: start;
  overflow: hidden;
}

.tiktok-embed-wrap iframe,
.tiktok-embed-wrap video {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
}

.tiktok-nav-arrows {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.tiktok-arrow {
  all: unset;
  box-sizing: border-box;
  width: 52px;
  height: 52px;
  border: 3px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: 'Bangers', sans-serif;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tiktok-arrow:hover {
  transform: translateY(-3px);
  box-shadow: 4px 4px 0 var(--border);
}

.tiktok-counter {
  font-family: 'Bangers', sans-serif;
  font-size: 16px;
  color: var(--text-muted);
  letter-spacing: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  /* Phone pile item */
  .pile-phone {
    border-radius: 12px;
  }
  .phone-notch { display: none; }
  .phone-home-bar { display: none; }
  .phone-screen-label { font-size: 16px; }
  .phone-sub-label { font-size: 9px; }

  /* TikTok scroll */
  .tiktok-row {
    flex-direction: column;
    gap: 14px;
  }
  .tiktok-phone {
    width: 280px;
    border-width: 3px;
    border-radius: 28px;
  }
  .tiktok-scroll,
  .tiktok-embed-wrap {
    height: 480px;
  }
  .tiktok-nav-arrows {
    flex-direction: row;
  }
  .tiktok-cta {
    font-size: 14px;
    padding: 12px 16px;
  }
}

@media (max-width: 400px) {
  .phone-screen-label { font-size: 14px; }
  .tiktok-phone { width: 240px; }
  .tiktok-scroll,
  .tiktok-embed-wrap { height: 400px; }
}

/* ----- css/components/art-fiche.css ----- */
/* ===== Fiche projet art (carte laterale gauche) ===== */
.art-fiche {
  position: fixed;
  bottom: 20px;
  left: -270px;
  pointer-events: none;
  z-index: 998;
  width: 260px;
  background: var(--bg-card);
  border: 3px solid var(--border);
  box-shadow: 4px 4px 0 0 var(--border);
  transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.4s;
  transform: rotate(2deg);
}

.art-fiche.open {
  left: 0;
  transform: rotate(0deg);
  pointer-events: auto;
}

.art-fiche-title {
  font-family: 'Bangers', sans-serif;
  font-size: 20px;
  letter-spacing: 3px;
  text-align: center;
  padding: 10px;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}

.art-fiche-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
}

.art-fiche-row {
  font-family: 'Special Elite', serif;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--text);
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

.art-fiche-row:last-child {
  border-bottom: none;
}

.art-fiche-label {
  font-family: 'Bangers', sans-serif;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .art-fiche {
    width: 180px;
    left: -190px;
    bottom: 10px;
    border-width: 2px;
    box-shadow: 3px 3px 0 0 var(--border);
  }
  .art-fiche-title {
    font-size: 14px;
    padding: 8px;
    border-bottom-width: 2px;
  }
  .art-fiche-meta {
    padding: 10px;
    gap: 4px;
  }
  .art-fiche-row { font-size: 10px; }
  .art-fiche-label { font-size: 9px; }
}

/* ----- css/pdf-viewer.css ----- */
/* ===== PDF Book Viewer ===== */
.book-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

.book-loading {
  font-family: 'Special Elite', serif;
  font-size: 16px;
  color: var(--text-muted);
  padding: 60px 0;
  text-align: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ===== Fullscreen PDF Reader ===== */
.pdf-reader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  overflow: hidden;
  cursor: default;
}

.pdf-display {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

/* Page wrapper */
.pdf-page-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Double page spread */
.pdf-spread {
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
  max-width: 90vw;
}

.pdf-spread canvas {
  max-width: 45vw;
  max-height: 85vh;
  display: block;
}

.pdf-spread-single canvas {
  max-width: 90vw;
}

/* Spine line between pages */
.pdf-spine {
  width: 2px;
  background: var(--border);
  align-self: stretch;
  opacity: 0.3;
}

/* Click zones */
.pdf-zone {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 2;
  cursor: pointer;
}

.pdf-zone-left {
  left: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M30 8L14 24L30 40' stroke='%23111' stroke-width='5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M30 8L14 24L30 40' stroke='%23fff' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 24 24, w-resize;
}

.pdf-zone-right {
  right: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M18 8L34 24L18 40' stroke='%23111' stroke-width='5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M18 8L34 24L18 40' stroke='%23fff' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 24 24, e-resize;
}

/* Page counter */
.pdf-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Bangers', sans-serif;
  font-size: 16px;
  color: var(--text-muted);
  letter-spacing: 2px;
  z-index: 51;
  background: var(--bg-card);
  border: 2px solid var(--border);
  padding: 4px 16px;
}

/* ===== Mobile PDF ===== */
@media (max-width: 700px) {
  .pdf-spread canvas {
    max-width: 95vw;
    max-height: 80vh;
  }

  .pdf-spread canvas,
  .pdf-spread-single canvas {
    max-width: 95vw;
  }

  /* Single page on mobile for double spreads */
  .pdf-spread {
    max-width: 95vw;
  }

  .pdf-counter {
    bottom: 10px;
    font-size: 13px;
    padding: 3px 12px;
  }

  /* Hide custom cursors on touch */
  .pdf-zone-left {
    cursor: pointer;
  }

  .pdf-zone-right {
    cursor: pointer;
  }
}

@media (hover: none) {
  /* Touch devices: no custom cursor */
  .pdf-zone-left,
  .pdf-zone-right {
    cursor: default;
  }
}
