/* --- FONT CUSTOM 23:59 --- */
@font-face {
  font-family: '2359';
  src: url('data/font_digi.TTF') format('truetype');
  font-display: swap;
}

/* --- GOOGLE FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&family=Roboto:ital,wght@1,900&display=swap');

/* =========================
   RESET / BASE
   ========================= */
:root {
  --header-h: 64px;
  --s-1: 0.75rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: #000;
  color: #fff;
  font-family: "Inter", Arial, sans-serif;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }

/* =========================
   HEADER
   ========================= */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  /* iOS notch */
  padding-top: env(safe-area-inset-top, 0);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  overflow: visible;
  padding: 0.75rem 0;
  gap: 0.5rem;
}

/* Logo responsive */
.brand {
  font-family: "Roboto", Arial, sans-serif;
  font-weight: 900;
  font-style: normal;
  font-size: clamp(1.1rem, 6vw, 1.8rem);
  letter-spacing: clamp(0.01em, 0.4vw, 0.05em);
  line-height: 1;
  flex-shrink: 1;
}

/* Liens adaptatifs */
nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 1;
  flex-wrap: nowrap;
  gap: clamp(0.5rem, 3vw, 1.5rem);
  min-width: 0;
}
nav a {
  color: #ccc;
  font-size: clamp(0.72rem, 2.6vw, 0.9rem);
  white-space: nowrap;
  transition: color 0.2s ease;
}
nav a:hover { color: #fff; }

/* Ultra-petits écrans */
@media (max-width: 360px) {
  header .container { padding: 0.5rem 0; }
  .brand { font-size: clamp(1rem, 5.5vw, 1.3rem); }
  nav { gap: clamp(0.35rem, 2.2vw, 0.75rem); }
  nav a { font-size: clamp(0.68rem, 2.3vw, 0.8rem); }
}

/* =========================
   TITRES
   ========================= */
h1, h2, h3 {
  font-family: "Roboto", Arial, sans-serif;
  font-weight: 900;
  font-style: normal;
  letter-spacing: 0.03em;
  line-height: 1.2;
  color: #fff;
  margin-top: 0;
  margin-bottom: var(--s-2);
}
section > h2 { margin-bottom: var(--s-3); }
h3 + * { margin-top: var(--s-2); }

/* =========================
   HERO
   ========================= */
#hero {
  position: relative;
  overflow: hidden;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  /* élimine le fin “trou” sous le header */
  margin-top: -1px;
}

#hero h1 {
  font-family: '2359', sans-serif;
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 1;
  margin-bottom: 1rem;
  animation: blink 0.7s steps(100, start) infinite;
}

@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0.1; }
}

.video-bg {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.video-bg video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  filter: brightness(0.5);
  z-index: -1;
}
.video-bg .overlay {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 0 1rem;
}
.video-bg p {
  color: #ccc;
  margin-bottom: 2rem;
  font-size: 1rem;
}
.video-bg .buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.video-bg .buttons .btn {
  min-width: 200px;
  text-align: center;
}

/* =========================
   BOUTONS
   ========================= */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 500;
  transition: 0.3s;
}
.btn.primary { background: #fff; color: #000; }
.btn.secondary { border: 1px solid #555; }
.btn:hover { opacity: 0.8; }

/* =========================
   SECTIONS
   ========================= */
section {
  padding: 4rem 0;
  scroll-margin-top: calc(var(--header-h) + 8px);
}
:target::before {
  content: "";
  display: block;
  height: calc(var(--header-h) + 8px);
  margin-top: calc(var(--header-h) * -1 - 8px);
}

/* =========================
   GRILLES & WORKS
   ========================= */
.grid { display: grid; gap: 1.5rem; }
.grid.services { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.work { display: block; overflow: hidden; border-radius: 10px; }
.work iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 10px;
  background: #000;
}
.work .info {
  margin-top: var(--s-1);
  font-size: 0.9rem;
  color: #aaa;
}

/* PHOTOS dans les .work */
.work img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  background: #000;
}

/* =========================
   CAROUSEL
   ========================= */
.hcarousel {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem;
  --speed: 28s;
}
.htrack {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  animation: slide var(--speed) linear infinite;
  will-change: transform;
}
@keyframes slide {
  from { transform: translate3d(0,0,0); }
  to   { transform: translate3d(var(--loop,-50%),0,0); }
}
.htrack .work { flex: 0 0 clamp(260px, 38vw, 520px); }

#projets { padding-bottom: 2rem; }
#backstage { padding-top: 1rem; }
#projets h3, #backstage h3 { margin-bottom: 1rem; }
.hcarousel { margin-top: var(--s-2); }

/* =========================
   SERVICES — effet glassy
   ========================= */
.service-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.4s ease;
}
.service-item:hover {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px) saturate(120%);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}
.service-item h3 {
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  text-align: center;
  margin-bottom: var(--s-1);
  padding-bottom: var(--s-1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.service-item p {
  color: #ddd;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-top: var(--s-2);
  text-align: center;
}

/* =========================
   CONTACT
   ========================= */
.contact-links {
  text-align: center;
  font-size: 1rem;
  color: #ccc;
}
.contact-links p { margin: var(--s-1) 0 0; }
.contact-links p:first-child { margin-top: 0; }
.contact-links a {
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.contact-links a:hover { opacity: 0.7; }

.socials {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin-top: 1.5rem;
}
.social-icon svg {
  width: 30px;
  height: 30px;
  color: #fff;
  opacity: 0.75;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.social-icon:hover svg { opacity: 1; transform: scale(1.15); }

/* =========================
   DIVISEURS & FOOTER
   ========================= */
#services, #contact { border-top: 1px solid rgba(255, 255, 255, 0.1); }
footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #777;
}

/* =========================
   RESPONSIVE (largeur)
   ========================= */
@media (max-width: 768px) {
  :root { --header-h: 72px; }
  .video-bg .buttons { flex-direction: column; }
  .video-bg .buttons .btn { min-width: auto; width: 100%; }
  .htrack { gap: 0.75rem; }

  /* Tasse l'espace entre Services et Photos */
  #services { padding-bottom: 0.75rem; }
  #photos   { padding-top: 0.5rem; }
}

/* =========================
   MODE TACTILE (uniforme pour tous les carrousels)
   ========================= */
@media (hover: none), (pointer: coarse) {
  .hcarousel {
    padding: 0 !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;

    /* NEW: activer le scroll-snap horizontal */
    scroll-snap-type: x mandatory;
  }

  .htrack {
    animation: none !important;
    width: max-content;
    gap: 0.75rem;                /* l’espace entre cartes */
    padding: 0 !important;
  }

  .htrack .work {
    flex: 0 0 80vw;              /* on garde 80vw */
    scroll-snap-align: start;    /* les cartes “début” */
  }

  .htrack .work:last-child {
    margin-right: 0;             /* pas d’espace en rab */
    scroll-snap-align: end;      /* NEW: la dernière “colle” à droite */
  }

  /* si jamais des clones restaient, on les masque */
  .htrack [data-clone="1"] { display: none !important; }

  /* optionnel: enlever la fine ligne sous le header */
  header { border-bottom-color: transparent; }
}

/* =========================
   SPACING FINETUNING SECTIONS
   ========================= */
#services { padding-bottom: 1rem; }
#photos   { padding-top: 0.75rem; }
#photos .hcarousel { margin-top: 0.5rem; }
