/* ===========================================================
   MyPictures — Design system + animations
   =========================================================== */

:root {
  --bg: #0a0a0a;
  --fg: #fafafa;
  --muted: #71717a;
  --line: #27272a;
  --accent: #fafafa;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  --font-display: "Instrument Serif", Georgia, serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 200ms;
  --dur-base: 400ms;
  --dur-slow: 800ms;

  color-scheme: dark;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("https://fonts.gstatic.com/s/instrumentserif/v6/jVyV7nvyB2HL8iZyDk4GVvSZ5MtC9g0gOQ.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
  border-radius: 4px;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ===========================================================
   Typography
   =========================================================== */
.font-display { font-family: var(--font-display); }
.text-muted { color: var(--muted); }
.eyebrow { font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.05; }

/* ===========================================================
   Header / Nav
   =========================================================== */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding: 18px 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-base) var(--ease-soft),
              backdrop-filter var(--dur-base) var(--ease-soft),
              border-color var(--dur-base) var(--ease-soft);
}
.header.scrolled {
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
}

/* ===========================================================
   Logo animé : appareil photo SVG + morph texte au hover
   =========================================================== */
.logo {
  font-family: var(--font-display);
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  position: relative;
  line-height: 1;
}

/* --- Camera SVG --- */
.logo-camera {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 26px;
  flex-shrink: 0;
  transform-origin: center;
  animation: cameraIn 1s var(--ease-out) 0.1s both;
}
.logo-camera svg { display: block; overflow: visible; }

/* Stroke draw au load */
.logo-camera-body,
.logo-camera-hump,
.logo-camera-lens-outer,
.logo-camera-lens-inner {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: drawStroke 1.4s var(--ease-out) 0.2s forwards;
}
.logo-camera-hump        { animation-delay: 0.35s; }
.logo-camera-lens-outer  { animation-delay: 0.5s; }
.logo-camera-lens-inner  { animation-delay: 0.7s; }
.logo-camera-led         { opacity: 0; animation: ledIn 0.6s var(--ease-out) 0.95s forwards; }

@keyframes drawStroke {
  to { stroke-dashoffset: 0; }
}
@keyframes ledIn {
  0%   { opacity: 0; transform: scale(0); }
  60%  { opacity: 1; transform: scale(1.6); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes cameraIn {
  0%   { opacity: 0; transform: translateY(8px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Hover : "shutter" (clignotement objectif) + tilt + LED + glint --- */
.logo:hover .logo-camera {
  transform: rotate(-4deg);
  transition: transform var(--dur-base) var(--ease-out);
}
.logo:hover .logo-camera-lens-inner {
  animation: shutterPulse 0.6s var(--ease-soft);
}
.logo:hover .logo-camera-glint {
  animation: glintIn 0.8s var(--ease-out);
}
.logo:hover .logo-camera-led {
  animation: ledBlink 0.6s ease-in-out infinite;
}
@keyframes shutterPulse {
  0%   { transform-origin: 18px 16.5px; transform: scale(1); opacity: 1; }
  40%  { transform-origin: 18px 16.5px; transform: scale(0.2); opacity: 0.4; }
  100% { transform-origin: 18px 16.5px; transform: scale(1); opacity: 1; }
}
@keyframes glintIn {
  0%   { opacity: 0; transform: scale(0); transform-origin: 16.2px 14.6px; }
  40%  { opacity: 1; transform: scale(1.6); transform-origin: 16.2px 14.6px; }
  100% { opacity: 0.8; transform: scale(1); transform-origin: 16.2px 14.6px; }
}
@keyframes ledBlink {
  0%, 100% { opacity: 1; transform: scale(1); transform-origin: 29px 10.5px; }
  50%      { opacity: 0.3; transform: scale(0.7); transform-origin: 29px 10.5px; }
}

/* --- Texte morph "My Pictures" → "Ingrid et Renaud" --- */
.logo-roll {
  display: inline-block;
  position: relative;
  overflow: hidden;
  vertical-align: top;
  height: 1.15em;
  /* largeur réservée par le spacer (le plus long des deux textes) */
}
.logo-text-spacer {
  display: inline-block;
  white-space: nowrap;
  visibility: hidden;
  pointer-events: none;
}
.logo-text-default,
.logo-text-hover {
  position: absolute;
  inset: 0;
  display: block;
  white-space: nowrap;
  transition: transform var(--dur-base) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}
.logo-text-default { transform: translateY(0); }
.logo-text-hover {
  transform: translateY(110%);
  opacity: 0.6;
}
.logo:hover .logo-text-default { transform: translateY(-110%); opacity: 0; }
.logo:hover .logo-text-hover    { transform: translateY(0); opacity: 1; }

/* Le texte default est splitté par JS pour anim au load (letter stagger) */
.logo-text-default .letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px);
  animation: letterIn 0.6s var(--ease-out) forwards;
}
@keyframes letterIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Nav links */
.nav { display: flex; align-items: center; gap: 40px; }
.nav-link {
  position: relative;
  font-size: 14px;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.nav-link .roll {
  display: inline-block;
  position: relative;
  overflow: hidden;
  line-height: 1.2;
  vertical-align: top;
}
.nav-link .roll-stack {
  display: block;
  transition: transform var(--dur-base) var(--ease-out);
}
.nav-link .roll-stack span { display: inline-block; }
.nav-link .roll-stack:last-child {
  position: absolute; top: 0; left: 0; right: 0;
  transform: translateY(100%);
}
.nav-link:hover .roll-stack:first-child { transform: translateY(-100%); }
.nav-link:hover .roll-stack:last-child { transform: translateY(0); }

.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: center;
  transition: transform var(--dur-fast) var(--ease-soft);
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  background: var(--fg); color: #000;
  font-size: 11px; font-weight: 600;
}

/* Burger mobile */
.burger {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  position: relative; z-index: 60;
}
.burger span {
  display: block; width: 22px; height: 1px; background: currentColor;
  transition: transform var(--dur-fast) var(--ease-soft);
}
.burger.open span:first-child { transform: translateY(3px) rotate(45deg); }
.burger.open span:last-child { transform: translateY(-3px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; background: var(--bg);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 32px; z-index: 55;
  font-family: var(--font-display); font-size: 32px;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-soft);
}
.mobile-menu.open { display: flex; opacity: 1; }
.mobile-menu a { opacity: 0; transform: translateY(20px); }
.mobile-menu.open a { animation: menuIn 0.5s var(--ease-out) forwards; }
.mobile-menu.open a:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu.open a:nth-child(2) { animation-delay: 0.16s; }
.mobile-menu.open a:nth-child(3) { animation-delay: 0.22s; }
@keyframes menuIn { to { opacity: 1; transform: translateY(0); } }

/* ===========================================================
   Animated titles (split letters)
   =========================================================== */
.split { display: inline-block; line-height: 1.15; padding-bottom: 0.18em; }
.split-line {
  display: inline-block;
  /* overflow visible pour ne pas couper les descendantes (p, g, q, j, y) */
  overflow: visible;
  vertical-align: bottom;
  line-height: 1.15;
}
.split-letter {
  display: inline-block;
  transform: translateY(40%);
  opacity: 0;
}
.split.in .split-letter {
  animation: splitIn 0.9s var(--ease-out) forwards;
}

@keyframes splitIn {
  0%   { transform: translateY(40%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Reveal on view */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  text-align: center;
  padding: 0 24px;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.06), transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(255,255,255,0.04), transparent 50%),
              linear-gradient(to bottom, #18181b, #0a0a0a);
}
/* Désactive le gradient de fond quand un slideshow est présent */
.hero.hero-with-bg::before { display: none; }

.hero-content { position: relative; z-index: 2; max-width: 900px; }

/* ============================================================
   Hero slideshow background
   ============================================================ */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
}
.hero-bg-slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1.6s var(--ease-soft);
  will-change: opacity, transform;
}
.hero-bg-slide.is-active {
  opacity: 1;
  /* Ken-burns lent : zoom subtil pendant l'affichage */
  animation: heroKenBurns 9s var(--ease-out) forwards;
}
@keyframes heroKenBurns {
  0%   { transform: scale(1.08) translate(0, 0); }
  100% { transform: scale(1.18) translate(-1.5%, -1%); }
}

/* Overlay : assombrit le bas + vignette pour lisibilité texte */
.hero-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.35) 60%, rgba(0,0,0,0.75) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.25) 35%, rgba(0,0,0,0.6) 100%);
}

/* Grain léger pour texture cinéma */
.hero-bg-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* Renforce un peu le titre quand sur photo */
.hero.hero-with-bg .hero-content h1 {
  text-shadow: 0 2px 30px rgba(0,0,0,0.6);
}
.hero.hero-with-bg .hero-content p {
  text-shadow: 0 1px 12px rgba(0,0,0,0.7);
  color: rgba(255,255,255,0.85);
}
.hero h1 {
  font-size: clamp(40px, 7vw, 96px);
  line-height: 1;
  margin: 24px 0 32px;
}

/* Titre hero : 2 lignes forcées sur desktop, équilibrées sur mobile */
.hero-title {
  /* mobile : fluide + équilibre + pas de coupure de mot */
  text-wrap: balance;             /* navigateurs récents : équilibre les lignes */
  -webkit-hyphens: none;
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
}
.hero-title-line {
  display: inline;
  opacity: 0;
  transform: translateY(24px);
  animation: heroLineReveal 0.9s var(--ease-out) 0.2s forwards;
  /* Empêche un mot de la ligne d'être laissé seul sur la ligne suivante */
}
.hero-title-line-2 {
  animation-delay: 0.45s;
}
@keyframes heroLineReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* Desktop : chaque span devient un block sur une ligne (pas de wrap interne) */
@media (min-width: 768px) {
  .hero-title-line {
    display: block;
    white-space: nowrap;
  }
}
.hero p { color: var(--muted); max-width: 480px; margin: 0 auto 40px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  transition: all var(--dur-fast) var(--ease-soft);
  border: 1px solid transparent;
}
.btn-primary { background: var(--fg); color: #000; }
.btn-primary:hover { background: #e4e4e7; }
.btn-primary .arrow { transition: transform var(--dur-fast) var(--ease-soft); }
.btn-primary:hover .arrow { transform: translateX(4px); }
.btn-ghost { border-color: #3f3f46; }
.btn-ghost:hover { border-color: #a1a1aa; background: rgba(255,255,255,0.05); }

.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.scroll-hint {
  position: absolute; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  opacity: 0; animation: fadeIn 0.8s var(--ease-out) 1.2s forwards;
}
.scroll-hint::after {
  content: ""; width: 1px; height: 32px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scrollPulse 1.6s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
@keyframes fadeIn { to { opacity: 1; } }

/* ===========================================================
   Sections
   =========================================================== */
.section { padding: 96px 0; }
.section-header {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 48px;
}
.section-header h2 { font-size: clamp(36px, 5vw, 64px); }

/* ===========================================================
   Slider (Embla)
   =========================================================== */
.slider { position: relative; }
.embla { overflow: hidden; border-radius: 12px; }
.embla__container { display: flex; }
.embla__slide {
  flex: 0 0 100%; min-width: 0;
  position: relative;
  aspect-ratio: 16/9;
  background: #18181b;
}
@media (min-width: 768px) {
  .embla__slide { aspect-ratio: 21/9; }
}
.embla__slide img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.embla__slide:hover img { transform: scale(1.02); }
.embla__slide-overlay {
  position: absolute; inset: 0;
  padding: 32px;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.1) 50%, transparent);
}
.embla__slide-overlay h3 { font-size: clamp(28px, 4vw, 48px); }
.embla__slide-overlay p { margin-top: 8px; max-width: 540px; color: #e4e4e7; font-size: 14px; }

.embla__btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(8px);
  border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  color: white;
  transition: all var(--dur-fast) var(--ease-soft);
  z-index: 2;
}
.embla__btn:hover { background: rgba(0,0,0,0.7); transform: translateY(-50%) scale(1.1); }
.embla__btn--prev { left: 16px; }
.embla__btn--next { right: 16px; }
@media (min-width: 768px) { .embla__btn { display: flex; } }

.embla__dots {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 24px;
}
.embla__dot {
  width: 24px; height: 6px;
  background: #3f3f46;
  border-radius: 999px;
  transition: all var(--dur-base) var(--ease-soft);
  cursor: pointer;
}
.embla__dot:hover { background: #71717a; }
.embla__dot.is-selected { width: 40px; background: var(--fg); }

/* ===========================================================
   Album / photo cards grid
   =========================================================== */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #18181b;
  transition: border-color var(--dur-fast) var(--ease-soft);
  display: block;
}
.card:hover { border-color: #71717a; }
.card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.card:hover img { transform: scale(1.06); }
.card-overlay {
  position: absolute; inset: 0;
  padding: 24px;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.2) 50%, transparent);
}
.card-overlay h3 { font-size: 28px; line-height: 1.05; }
.card-overlay p { font-size: 14px; color: #e4e4e7; margin-top: 8px; opacity: 0.8; transition: opacity var(--dur-fast); }
.card:hover .card-overlay p { opacity: 1; }
.card-arrow {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted); margin-top: 16px;
}
.card:hover .card-arrow span:last-child { transform: translateX(4px); }
.card-arrow span:last-child { transition: transform var(--dur-fast) var(--ease-soft); display: inline-block; }

.thumb {
  position: relative;
  aspect-ratio: 3/4;
  background: #18181b;
  border-radius: 8px;
  overflow: hidden;
  display: block;
}
.thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.thumb:hover img { transform: scale(1.06); }

/* Back-link contextuel */
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition: all var(--dur-fast) var(--ease-soft);
}
.back-link:hover {
  color: var(--fg);
  border-color: #71717a;
  background: rgba(255,255,255,0.03);
}
.back-link-arrow {
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease-soft);
}
.back-link:hover .back-link-arrow { transform: translateX(-3px); }

/* ===========================================================
   Lightbox + sélection multi
   =========================================================== */
.thumb { cursor: zoom-in; }

/* Checkbox de sélection en haut-gauche du thumb */
.thumb-check {
  position: absolute;
  top: 10px; left: 10px;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  color: white; border-radius: 50%;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity var(--dur-fast), transform var(--dur-fast), background var(--dur-fast);
  cursor: pointer;
  z-index: 3;
  border: 1.5px solid rgba(255,255,255,0.3);
}
.thumb-check svg { opacity: 0; transition: opacity var(--dur-fast); }
.thumb:hover .thumb-check,
.thumb.is-selected .thumb-check { opacity: 1; transform: scale(1); }
.thumb.is-selected .thumb-check { background: var(--fg); color: #000; border-color: var(--fg); }
.thumb.is-selected .thumb-check svg { opacity: 1; }
.thumb.is-selected { outline: 2px solid var(--fg); outline-offset: -2px; }
.thumb.is-selected::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.4), transparent 40%);
  pointer-events: none;
}

/* Barre de sélection flottante en bas — plus large et aérée */
.selection-bar {
  position: fixed;
  left: 50%; bottom: -100px;
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(20, 20, 22, 0.95);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px 12px 32px;
  display: flex; align-items: center; gap: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transition: bottom var(--dur-base) var(--ease-out), opacity var(--dur-base);
  opacity: 0;
  width: min(960px, calc(100vw - 32px));
  font-size: 14px;
  white-space: nowrap;
}
.selection-bar.is-active { bottom: 24px; opacity: 1; }
.selection-bar-count {
  font-weight: 500;
  display: inline-flex; align-items: baseline; gap: 6px;
  flex-shrink: 0;
}
.selection-bar-count strong { font-size: 20px; }
.selection-bar-kinds {
  display: flex; gap: 4px;
  background: rgba(0,0,0,0.4);
  padding: 4px;
  border-radius: 999px;
  flex: 1;
  justify-content: center;
}
.selection-bar-kinds label {
  display: inline-flex; align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--dur-fast);
  white-space: nowrap;
}
.selection-bar-kinds input { display: none; }
.selection-bar-kinds label:hover { background: rgba(255,255,255,0.05); }
.selection-bar-kinds label:has(input:checked) { background: var(--fg); color: #000; }
.selection-bar-clear {
  font-size: 13px; color: var(--muted);
  padding: 8px 14px;
  transition: color var(--dur-fast);
  flex-shrink: 0;
}
.selection-bar-clear:hover { color: var(--fg); }
.selection-bar-submit {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--fg); color: #000;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  transition: opacity var(--dur-fast);
  white-space: nowrap;
  flex-shrink: 0;
}
.selection-bar-submit:hover { opacity: 0.9; }
.selection-bar-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* Tablette : on enlève le centrage flex sur les kinds pour récupérer de la place */
@media (max-width: 1024px) {
  .selection-bar { gap: 16px; padding-left: 24px; }
  .selection-bar-kinds { flex: initial; justify-content: flex-start; }
  .selection-bar-kinds label { padding: 6px 12px; font-size: 12px; }
}

/* Mobile : empilage */
@media (max-width: 768px) {
  .selection-bar {
    flex-wrap: wrap;
    padding: 16px 20px;
    border-radius: 20px;
    gap: 12px;
    width: calc(100vw - 24px);
    white-space: normal;
  }
  .selection-bar-count { width: 100%; justify-content: center; text-align: center; }
  .selection-bar-kinds { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .selection-bar-clear { width: 100%; text-align: center; }
  .selection-bar-submit { width: 100%; justify-content: center; padding: 14px; }
}

/* Lightbox plein écran */
.lightbox {
  position: fixed; inset: 0;
  z-index: 100;
  display: none;
  pointer-events: none;
}
.lightbox.is-open { display: block; pointer-events: auto; }
.lightbox-backdrop {
  position: absolute; inset: 0;
  background: #000;
  opacity: 0; animation: lbFade 0.3s var(--ease-out) forwards;
}
@keyframes lbFade { to { opacity: 1; } }

.lightbox-stage {
  position: absolute;
  inset: 80px 24px 100px 24px;
  pointer-events: none;
}
.lightbox-stage .lightbox-caption {
  position: absolute;
  left: 0; right: 0; bottom: -50px;
  text-align: center;
  pointer-events: none;
}
/* ===========================================================
   Lightbox image transitions (2 layers swap A/B)
   -----------------------------------------------------------
   Règles :
   - Les deux <img> sont superposés (position absolute)
   - État par défaut : opacity 0, hors écran
   - .is-visible = visible et centrée
   - .is-exiting-left/right = en train de sortir
   - .is-entering-right/left = position de départ avant entrée
   =========================================================== */

.lightbox-img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  pointer-events: none; /* seul l'image visible reçoit les events */
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  will-change: transform, opacity, filter;

  /* État par défaut = invisible, légèrement à droite (par convention) */
  opacity: 0;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
  transition:
    opacity 0.45s cubic-bezier(0.55, 0, 0.55, 0.2),
    transform 0.45s cubic-bezier(0.55, 0, 0.55, 0.2),
    filter 0.45s cubic-bezier(0.55, 0, 0.55, 0.2);
}

/* État stable visible — au centre, opaque */
.lightbox-img.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
  pointer-events: auto;
  /* Easing plus doux pour l'entrée */
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* États d'entrée : position de départ AVANT l'application de .is-visible */
.lightbox-img.is-entering-right {
  opacity: 0;
  transform: translate3d(60%, 0, 0);
  filter: blur(8px);
  transition: none; /* on saute instantanément à cette position */
}
.lightbox-img.is-entering-left {
  opacity: 0;
  transform: translate3d(-60%, 0, 0);
  filter: blur(8px);
  transition: none;
}

/* États de sortie : transition depuis is-visible vers ces états */
.lightbox-img.is-exiting-left {
  opacity: 0;
  transform: translate3d(-60%, 0, 0);
  filter: blur(8px);
  pointer-events: none;
}
.lightbox-img.is-exiting-right {
  opacity: 0;
  transform: translate3d(60%, 0, 0);
  filter: blur(8px);
  pointer-events: none;
}

/* Backdrop reste opaque en permanence — pas de flash qui révèle la page derrière */

.lightbox-caption {
  margin-top: 16px;
  display: flex; gap: 16px; align-items: baseline;
  font-size: 14px; color: #d4d4d8;
}
.lightbox-counter { color: var(--muted); font-size: 12px; letter-spacing: 0.1em; }

.lightbox-close,
.lightbox-nav,
.lightbox-action {
  pointer-events: auto;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: white;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast), transform var(--dur-fast);
  z-index: 2; /* au-dessus de l'image (stage) */
}
.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(255,255,255,0.18); transform: scale(1.05); }
.lightbox-close {
  position: absolute; top: 24px; right: 24px;
  width: 44px; height: 44px;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  display: inline-flex; /* toujours visible, mobile inclus */
}
.lightbox-nav:hover { transform: translateY(-50%) scale(1.05); }
.lightbox-nav--prev { left: 24px; }
.lightbox-nav--next { right: 24px; }

/* Sur mobile : flèches plus petites + collées aux bords pour ne pas masquer l'image */
@media (max-width: 768px) {
  .lightbox-nav {
    width: 40px; height: 40px;
    background: rgba(0, 0, 0, 0.55);
  }
  .lightbox-nav--prev { left: 8px; }
  .lightbox-nav--next { right: 8px; }
}

.lightbox-actions {
  position: absolute; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 12px;
  pointer-events: auto;
}
.lightbox-action {
  padding: 10px 18px;
  font-size: 13px; gap: 8px;
}
.lightbox-action-toggle.is-selected {
  background: var(--fg); color: #000;
}
.lightbox-action-detail {
  background: var(--fg); color: #000;
}
.lightbox-action-detail:hover { background: #e4e4e7; }

/* Bouton "télécharger" qui apparaît en hover sur thumb (album privé déverrouillé) */
.thumb-download {
  position: absolute;
  top: 8px; right: 8px;
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: white;
  border-radius: 50%;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur-fast) var(--ease-soft),
              transform var(--dur-fast) var(--ease-soft),
              background var(--dur-fast) var(--ease-soft);
  z-index: 2;
}
.thumb:hover .thumb-download,
.thumb-download:focus-visible { opacity: 1; transform: translateY(0); }
.thumb-download:hover { background: rgba(0, 0, 0, 0.85); transform: translateY(0) scale(1.08); }

/* Badge cadenas sur les cards d'album privé (liste publique) */
.card-lock {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: white;
  border-radius: 50%;
  z-index: 3;
}

/* ===========================================================
   Photo detail — animations renforcées
   =========================================================== */
.photo-detail {
  display: grid; gap: 48px;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .photo-detail { grid-template-columns: 1fr 360px; }
}

/* --- Image principale : clip-reveal + zoom + corners --- */
.photo-main {
  position: relative;
  background: #18181b;
  border-radius: 12px;
  overflow: hidden;
  /* Centre l'image dans le card (utile sur desktop quand l'aside droit est plus grand) */
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}
.photo-main img { width: 100%; height: auto; display: block; }
.photo-main-frame {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-main-animated .photo-main-frame {
  overflow: hidden;
  border-radius: 12px;
  /* Clip reveal de bas en haut */
  clip-path: inset(100% 0 0 0);
  animation: photoClipIn 1.2s var(--ease-out) 0.2s forwards;
}
.photo-main-animated .photo-main-frame img {
  /* Léger zoom-out qui se résorbe (effet "Ken Burns" inversé court) */
  transform: scale(1.15);
  filter: blur(8px);
  animation: photoZoomIn 1.6s var(--ease-out) 0.2s forwards;
  transition: transform 1.5s var(--ease-out), filter 0.5s var(--ease-out);
}
.photo-main-animated:hover .photo-main-frame img {
  transform: scale(1.04);
}
@keyframes photoClipIn {
  0%   { clip-path: inset(100% 0 0 0); }
  100% { clip-path: inset(0% 0 0 0); }
}
@keyframes photoZoomIn {
  0%   { transform: scale(1.15); filter: blur(8px); }
  60%  { filter: blur(0); }
  100% { transform: scale(1); filter: blur(0); }
}

/* Coins décoratifs animés (apparaissent après l'image), aux 4 coins du card */
.photo-main-corner {
  position: absolute;
  width: 18px; height: 18px;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
  animation: cornerIn 0.5s var(--ease-out) 1.2s forwards;
}
.photo-main-corner::before,
.photo-main-corner::after {
  content: ""; position: absolute; background: rgba(255,255,255,0.6);
}
.photo-main-corner--tl { top: 12px; left: 12px; }
.photo-main-corner--tr { top: 12px; right: 12px; }
.photo-main-corner--bl { bottom: 12px; left: 12px; }
.photo-main-corner--br { bottom: 12px; right: 12px; }
.photo-main-corner--tl::before { top: 0; left: 0; width: 18px; height: 1px; }
.photo-main-corner--tl::after  { top: 0; left: 0; width: 1px; height: 18px; }
.photo-main-corner--tr::before { top: 0; right: 0; width: 18px; height: 1px; }
.photo-main-corner--tr::after  { top: 0; right: 0; width: 1px; height: 18px; }
.photo-main-corner--bl::before { bottom: 0; left: 0; width: 18px; height: 1px; }
.photo-main-corner--bl::after  { bottom: 0; left: 0; width: 1px; height: 18px; }
.photo-main-corner--br::before { bottom: 0; right: 0; width: 18px; height: 1px; }
.photo-main-corner--br::after  { bottom: 0; right: 0; width: 1px; height: 18px; }
@keyframes cornerIn { to { opacity: 1; } }

/* --- Panneau latéral : glisse depuis la droite avec stagger --- */
.photo-side { display: flex; flex-direction: column; gap: 24px; }
.photo-side h1 { font-size: clamp(28px, 4vw, 40px); }

.photo-side-animated .photo-side-block {
  opacity: 0;
  transform: translateX(40px);
  animation: panelSlideIn 0.8s var(--ease-out) calc(0.5s + var(--i, 0) * 0.12s) forwards;
}
@keyframes panelSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.photo-eyebrow {
  display: inline-block;
  position: relative;
  padding-bottom: 4px;
}
.photo-eyebrow::after {
  content: ""; position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--muted);
  animation: eyebrowLine 0.8s var(--ease-out) 0.7s forwards;
}
@keyframes eyebrowLine { to { width: 100%; } }

.photo-author { overflow: hidden; }
.photo-author-name {
  color: var(--fg);
  display: inline-block;
  position: relative;
}
.photo-author-name::before {
  content: ""; position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: linear-gradient(to right, var(--fg) 0%, transparent 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.photo-author:hover .photo-author-name::before { transform: scaleX(1); }

/* --- Format options : apparaissent en stagger --- */
.format-picker .format-option {
  opacity: 0;
  transform: translateY(12px);
  animation: optionIn 0.5s var(--ease-out) calc(0.9s + var(--i, 0) * 0.07s) forwards;
}
@keyframes optionIn {
  to { opacity: 1; transform: translateY(0); }
}
.format-option {
  position: relative;
  overflow: hidden;
}
/* Sweep highlight au hover */
.format-option:not(.selected)::after {
  content: ""; position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.06) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.7s var(--ease-out);
  pointer-events: none;
}
.format-option:not(.selected):hover::after { transform: translateX(100%); }

/* --- Bouton "Ajouter au panier" : icône + flèche animée --- */
.btn-cart {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-cart-icon,
.btn-cart-arrow {
  display: inline-block;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-fast);
}
.btn-cart-icon { transform: translateX(0); }
.btn-cart-arrow { opacity: 0; transform: translateX(-8px); }
.btn-cart:hover .btn-cart-icon  { transform: translateX(-4px) rotate(-8deg); }
.btn-cart:hover .btn-cart-arrow { opacity: 1; transform: translateX(0); }
.btn-cart::before {
  content: ""; position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease-out);
}
.btn-cart:hover::before { transform: translateX(100%); }

.format-picker {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.format-option {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-radius: 8px;
  background: #18181b;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.format-option:hover { background: #27272a; }
.format-option input { display: none; }
.format-option.selected { background: var(--fg); color: #000; }
.format-option-price { font-weight: 500; font-size: 14px; white-space: nowrap; }
.format-option-label { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 1; min-width: 0; }
.format-option-label > span:first-child { white-space: normal; }
.format-option-tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  background: rgba(250, 204, 21, 0.15);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 4px;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
/* Shine animé continu sur le badge LICENCE PRO */
.format-option-tag::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(253, 224, 71, 0.7) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: tagShine 3.5s var(--ease-out) infinite;
}
@keyframes tagShine {
  0%, 70% { transform: translateX(-100%); }
  100%    { transform: translateX(100%); }
}
.format-option.selected .format-option-tag {
  background: rgba(0, 0, 0, 0.08);
  color: #92400e;
  border-color: rgba(0, 0, 0, 0.15);
}

/* Variante verte : "Impression personnelle" */
.format-option-tag-personal {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}
.format-option-tag-personal::after {
  background: linear-gradient(120deg, transparent 30%, rgba(110, 231, 183, 0.7) 50%, transparent 70%);
}
.format-option.selected .format-option-tag-personal {
  background: rgba(0, 100, 50, 0.08);
  color: #065f46;
  border-color: rgba(0, 100, 50, 0.15);
}
.format-option-commercial {
  /* Soulignement subtil pour signifier que c'est haut de gamme */
  position: relative;
}
.format-option-commercial::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, #fde047, #ca8a04);
  border-radius: 8px 0 0 8px;
}
.license-info { padding: 4px 0; }
.license-info summary { color: var(--muted); font-size: 12px; }
.license-info summary:hover { color: var(--fg); }

/* ===========================================================
   Cart
   =========================================================== */
.cart-list { border-top: 1px solid var(--line); }
.cart-item {
  display: flex; gap: 16px; align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item-thumb { width: 80px; height: 80px; border-radius: 8px; overflow: hidden; background: #18181b; flex-shrink: 0; }
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-total {
  display: flex; justify-content: space-between;
  font-size: 18px;
  margin: 24px 0;
}

input.field, textarea.field, select.field {
  width: 100%;
  padding: 12px 16px;
  background: #18181b;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color var(--dur-fast);
}
input.field:focus, textarea.field:focus, select.field:focus { border-color: #71717a; }

.btn-block { width: 100%; justify-content: center; padding: 16px; font-size: 15px; }

/* ===========================================================
   Footer
   =========================================================== */
.footer {
  border-top: 1px solid var(--line);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 96px;
}

/* ===========================================================
   Admin
   =========================================================== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
/* Quand il n'y a pas de sidebar (page login), passe en pleine largeur centrée */
.admin-layout--centered {
  grid-template-columns: 1fr !important;
  place-items: center;
}
@media (max-width: 768px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-sidebar {
  background: #0f0f10;
  border-right: 1px solid var(--line);
  padding: 24px;
}
.admin-sidebar a {
  display: block; padding: 10px 14px; border-radius: 8px;
  font-size: 14px; color: var(--muted);
  transition: all var(--dur-fast);
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: #18181b; color: var(--fg); }
.admin-main { padding: 32px; max-width: 1100px; }
.admin-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}
/* Photo uploader (admin) */
.drop-zone {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
  transition: all var(--dur-fast);
  margin-bottom: 16px;
}
.drop-zone.is-drag {
  border-color: var(--fg);
  background: rgba(255,255,255,0.06);
  color: var(--fg);
}
.drop-zone svg { display: block; margin: 0 auto 12px; opacity: 0.5; }
.drop-zone-text { font-size: 15px; margin-bottom: 8px; }
.drop-zone-text strong { color: var(--fg); }
.drop-zone-link {
  color: var(--fg);
  text-decoration: underline;
  cursor: pointer;
}
.drop-zone-hint { font-size: 12px; color: var(--muted); }

.upload-queue {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 320px; overflow-y: auto;
  margin-bottom: 16px;
}
.upload-row {
  background: #18181b;
  border-left: 3px solid #3f3f46;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  transition: border-color var(--dur-fast);
}
.upload-row--uploading { border-left-color: #3b82f6; }
.upload-row--done      { border-left-color: #10b981; opacity: 0.7; }
.upload-row--error     { border-left-color: #ef4444; }
.upload-row-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 4px;
}
.upload-row-name {
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.upload-row-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }
.upload-row-status { color: var(--fg); }
.upload-row--done .upload-row-status { color: #10b981; }
.upload-row--error .upload-row-status { color: #fca5a5; }
.upload-row-bar {
  height: 3px;
  background: #27272a;
  border-radius: 2px;
  overflow: hidden;
}
.upload-row-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 2px;
  transition: width 200ms ease-out;
}
.upload-row--done .upload-row-bar-fill { background: #10b981; }
.upload-row--error .upload-row-bar-fill { background: #ef4444; }
.upload-row-error {
  font-size: 11px; color: #fca5a5;
  margin-top: 4px;
  word-break: break-word;
}

.upload-summary {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.upload-overall { margin-bottom: 12px; }
.upload-overall-bar {
  height: 8px;
  background: #27272a;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.upload-overall-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #fff, #d4d4d8);
  border-radius: 4px;
  transition: width 300ms ease-out;
  width: 0%;
}
.upload-overall-text { font-size: 12px; color: var(--muted); }
.upload-actions { display: flex; gap: 8px; justify-content: flex-end; }
.upload-actions .btn { padding: 8px 16px; font-size: 13px; }

table.admin-table { width: 100%; font-size: 14px; }
.admin-table th { text-align: left; padding: 12px 8px; color: var(--muted); border-bottom: 1px solid var(--line); font-weight: 500; }
.admin-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #27272a; font-size: 11px; }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 768px) {
  .nav { display: none; }
  .burger { display: flex; }
  .header-inner { padding: 0 20px; }
  .section { padding: 64px 0; }
  .section-header { margin-bottom: 32px; }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .split-letter { opacity: 1; transform: none; }
}
