/* Thème sombre, inspiré d'Apple. Les couleurs principales sont ici. */
:root {
  --bg: #000;
  --surface: #161617;
  --surface-2: #1d1d1f;
  --text: #f5f5f7;
  --muted: #86868b;
  --line: rgba(255, 255, 255, .12);
  --accent: #2997ff;
  --accent-hover: #0a84ff;
  --radius: 28px;
  --nav-h: 52px;
  --ease: cubic-bezier(.28, .11, .32, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 17px; line-height: 1.47; letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 999px; z-index: 200; }
.skip:focus { left: 8px; }
.ico { width: 1.1em; height: 1.1em; flex: none; }

.container { width: min(1120px, 100% - 48px); margin-inline: auto; }
.container.wide { width: min(1240px, 100% - 32px); }
.container.narrow { width: min(760px, 100% - 48px); }

/* ---------- Navigation sticky translucide ---------- */
.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  background: rgba(22, 22, 23, .72);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent; transition: border-color .3s var(--ease), background .3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); background: rgba(22, 22, 23, .82); }
.nav-inner { height: 100%; width: min(1120px, 100% - 32px); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-brand { color: var(--text); font-weight: 600; font-size: 19px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-brand:hover { text-decoration: none; opacity: .8; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { display: block; padding: 8px 14px; border-radius: 999px; color: rgba(245, 245, 247, .8); font-size: 14px; transition: color .2s, background .2s; }
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, .1); text-decoration: none; }

/* Sous-barre produit (page projet) */
.subnav {
  position: sticky; top: var(--nav-h); z-index: 90; height: 0; overflow: hidden;
  background: rgba(29, 29, 31, .78); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line); opacity: 0; transition: height .35s var(--ease), opacity .35s var(--ease);
}
.subnav.show { height: 52px; opacity: 1; }
.subnav-inner { height: 52px; width: min(1120px, 100% - 32px); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.subnav strong { font-size: 17px; font-weight: 600; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px;
  border-radius: 999px; font: inherit; font-size: 17px; font-weight: 500; border: 0; cursor: pointer; text-decoration: none !important;
  transition: background .25s var(--ease), transform .25s var(--ease), color .25s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: rgba(255, 255, 255, .12); color: var(--text); }
.btn-secondary:hover { background: rgba(255, 255, 255, .2); }
.btn-lg { min-height: 52px; padding: 0 30px; font-size: 19px; }
.btn-sm { min-height: 32px; padding: 0 16px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.actions.center { justify-content: center; }
.hint { margin-top: 14px; color: var(--muted); font-size: 14px; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: clamp(72px, 14vw, 160px) 0 clamp(48px, 8vw, 96px); }
.display { font-size: clamp(44px, 9vw, 96px); line-height: 1.04; font-weight: 700; letter-spacing: -.035em; background: linear-gradient(180deg, #fff 30%, #a1a1a6 120%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 22px auto 0; max-width: 680px; font-size: clamp(19px, 2.6vw, 28px); line-height: 1.25; color: var(--muted); font-weight: 500; letter-spacing: -.015em; }
.hero .btn-lg { margin-top: 36px; }
.hero-project { padding-bottom: 0; }
.hero-project .actions { justify-content: center; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 28px; font-size: 15px; }
.back .ico { width: 1em; height: 1em; }
.cover { margin: clamp(40px, 7vw, 80px) 0 0; border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); border: 1px solid var(--line); }
.cover img { width: 100%; }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 9vw, 112px) 0; }
.section-head { text-align: center; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(32px, 5.5vw, 56px); line-height: 1.08; font-weight: 700; letter-spacing: -.03em; }
.section-head p { margin-top: 12px; color: var(--muted); font-size: clamp(17px, 2vw, 21px); }

/* ---------- Grille de cartes ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { display: flex; flex-direction: column; height: 100%; background: var(--surface-2); border-radius: var(--radius); overflow: hidden; color: var(--text); text-decoration: none !important; border: 1px solid transparent; transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease); }
.card:hover { transform: translateY(-6px) scale(1.012); box-shadow: 0 24px 60px rgba(0, 0, 0, .55); border-color: var(--line); }
.card-media { aspect-ratio: 16/10; overflow: hidden; background: var(--surface); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card:hover .card-media img { transform: scale(1.06); }
.card-body { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 24px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
.card p { color: var(--muted); font-size: 16px; line-height: 1.4; }
.card-more { margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 17px; }
.card-more .ico { transition: transform .3s var(--ease); width: 1em; height: 1em; }
.card:hover .card-more .ico { transform: translateX(4px); }

/* ---------- Page projet ---------- */
.prose { font-size: clamp(19px, 2.2vw, 24px); line-height: 1.4; color: #d2d2d7; letter-spacing: -.015em; }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 1em; }
.prose strong { color: #fff; font-weight: 600; }
.prose ul { padding-left: 1.2em; list-style: disc; }
.prose-section { padding-bottom: 0; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.feature { background: var(--surface-2); border-radius: 24px; padding: 32px 28px; }
.feature h3 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 10px; }
.feature p { color: var(--muted); font-size: 17px; line-height: 1.4; }

/* Aperçu intégré */
.embed { border-radius: 20px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.embed-bar { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; background: #2a2a2c; }
.embed-bar span { width: 12px; height: 12px; border-radius: 50%; background: #5a5a5e; }
.embed-bar span:nth-child(1) { background: #ff5f57; } .embed-bar span:nth-child(2) { background: #febc2e; } .embed-bar span:nth-child(3) { background: #28c840; } 
.embed-bar a { margin-left: auto; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.embed-stage { position: relative; width: 100%; height: min(85vh, 850px); min-height: 500px; display: grid; place-items: center; overflow: auto; background: radial-gradient(circle at 30% 20%, #26262a, #121214); }
.embed-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }

/* Galerie */
.gallery-wrap { position: relative; }
.gallery { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 0 max(24px, calc((100vw - 1120px) / 2)); scroll-padding: 0 max(24px, calc((100vw - 1120px) / 2)); -webkit-overflow-scrolling: touch; }
.gallery::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 min(900px, 84vw); margin: 0; scroll-snap-align: start; }
.slide-btn { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); cursor: zoom-in; transition: transform .5s var(--ease); }
.slide-btn:hover { transform: scale(1.01); }
.slide img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.slide figcaption { margin-top: 12px; color: var(--muted); font-size: 14px; padding-inline: 8px; }
.gallery-ctrl { display: flex; justify-content: center; gap: 12px; margin-top: 28px; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: var(--text); cursor: pointer; display: grid; place-items: center; transition: background .25s, opacity .25s; }
.round:hover { background: rgba(255, 255, 255, .22); }
.round:disabled { opacity: .3; cursor: default; }

.cta { text-align: center; padding-top: 24px; }
.cta h2 { font-size: clamp(32px, 5vw, 48px); font-weight: 700; letter-spacing: -.03em; }
.cta .actions { margin-top: 28px; }

.pager { border-top: 1px solid var(--line); }
.pager-inner { display: flex; justify-content: space-between; gap: 16px; padding: 28px 0; }
.pager a { display: block; color: var(--text); padding: 8px 0; max-width: 48%; }
.pager a:hover { text-decoration: none; color: var(--accent); }
.pager small { display: block; color: var(--muted); font-size: 13px; }
.pager span { font-size: clamp(17px, 2.4vw, 24px); font-weight: 600; letter-spacing: -.02em; }
.pager .r { text-align: right; margin-left: auto; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, .92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); display: flex; align-items: center; justify-content: center; padding: 56px 16px; animation: fade .25s var(--ease); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1400px, 100%); max-height: 100%; border-radius: 16px; }
.lb-close, .lb-nav { position: absolute; background: rgba(255, 255, 255, .14); border: 0; color: #fff; cursor: pointer; border-radius: 50%; width: 44px; height: 44px; font-size: 28px; line-height: 1; display: grid; place-items: center; }
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .26); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
@keyframes fade { from { opacity: 0; } }

/* Pied de page */
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 28px 0 36px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }

/* Animations d'apparition (uniquement si JS actif) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease) var(--d, 0ms), transform .9s var(--ease) var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
.hero .display, .hero .lead, .hero .btn-lg, .hero .actions, .hero .back, .hero .hint { animation: rise 1s var(--ease) both; }
.hero .lead { animation-delay: .1s; } .hero .btn-lg, .hero .actions, .hero .hint { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: 1fr; gap: 18px; }
  .container, .container.narrow { width: calc(100% - 32px); }
  .card-body { padding: 20px 20px 24px; }
  .btn { flex: 1 1 auto; }
  .actions { gap: 10px; }
  .lb-nav { display: none; }
  .nav-links a { padding: 8px 10px; }
  .gallery { padding: 0 16px; scroll-padding: 0 16px; gap: 14px; }
  .gallery-ctrl { display: none; }
  .pager span { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
/* Images et vidéos de la galerie : elles ne dépassent jamais et gardent leurs proportions */
.gallery .slide img,
.gallery .slide video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* La vidéo reste entière, sans être coupée ni déformée */
.gallery .slide video {
  aspect-ratio: 16 / 10;   /* même proportion que tes images 1600 × 1000 */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
