/* ─────────────────────────────────────────────
   NATHAN CARDACI — style.css
   ───────────────────────────────────────────── */

:root {
  --black:   #080808;
  --white:   #f2f0ec;
  --blue:    #0047ff;
  --blue-dim: rgba(0, 71, 255, 0.15);
  --gray:    #555;
  --border:  rgba(255,255,255,0.08);

  --font-display: 'Syne', sans-serif;
  --font-body:    'Inter', sans-serif;

  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}
img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { background: none; border: none; cursor: none; }

/* ── Custom Cursor ── */
@media (hover: none) {
  body, button, .lb-carousel { cursor: auto; }
  .cursor { display: none; }
}
.cursor {
  position: fixed;
  width: 10px; height: 10px;
  background: var(--blue);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s;
  mix-blend-mode: normal;
}
.cursor.hovering {
  width: 50px; height: 50px;
  background: var(--blue-dim);
  border: 1px solid var(--blue);
}

/* mode viseur caméra (survol des cartes projet) */
.cursor-corner {
  position: absolute;
  width: 12px; height: 10px;
  opacity: 0;
  transition: opacity 0.25s var(--ease), transform 0.35s var(--ease-out);
  border: 0 solid var(--white);
}
.c-tl { top: -22px; left: -36px; border-top-width: 1.5px; border-left-width: 1.5px; }
.c-tr { top: -22px; right: -36px; border-top-width: 1.5px; border-right-width: 1.5px; }
.c-bl { bottom: -22px; left: -36px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.c-br { bottom: -22px; right: -36px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

.cursor.viewfinder {
  width: 4px; height: 4px;
  background: var(--blue);
  border: none;
}
.cursor.viewfinder .cursor-corner { opacity: 1; }

.cursor-rec {
  position: absolute;
  top: -44px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.cursor-rec i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #e03131;
  animation: recBlink 1s steps(2, start) infinite;
}
.cursor.viewfinder .cursor-rec { opacity: 1; }

@keyframes recBlink {
  50% { opacity: 0.15; }
}

/* ── Timecode de scroll ── */
.scroll-timecode {
  position: fixed;
  left: 40px;
  bottom: 22px;
  z-index: 80;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.3);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* ── Spot lumière (About) ── */
#about { position: relative; }
.about-spot {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    520px circle at var(--spot-x, 50%) var(--spot-y, 40%),
    rgba(255, 244, 214, 0.08),
    rgba(255, 244, 214, 0.025) 45%,
    transparent 70%
  );
}
.about-text { position: relative; z-index: 1; }

/* ── Navigation ── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 70px;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s;
}
#nav.scrolled {
  background: rgba(8,8,8,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.nav-timecode {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.35);
  font-variant-numeric: tabular-nums;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--white);
  transition: color 0.2s;
}
.nav-logo:hover { color: var(--blue); }
.nav-links {
  display: flex;
  gap: 40px;
}
.nav-links a {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--blue);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { width: 100%; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--white);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
.nav-toggle.open span:first-child { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:last-child  { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Mobile Menu ── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}
.mobile-menu ul { text-align: center; }
.mobile-menu li { overflow: hidden; margin-bottom: 16px; }
.m-link {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  display: block;
  transform: translateY(100%);
  transition: transform 0.5s var(--ease-out), color 0.2s;
}
.mobile-menu.open .m-link {
  transform: translateY(0);
}
.m-link:hover { color: var(--blue); }

/* ── Hero ── */
#hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  padding: 0 40px 60px;
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(8,8,8,0.85) 0%, rgba(8,8,8,0.3) 40%, rgba(8,8,8,0.1) 100%),
    linear-gradient(to bottom, rgba(8,8,8,0.4) 0%, transparent 20%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
}
.hero-tag {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: revealUp 0.8s var(--ease-out) 0.3s forwards;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 11rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
}
.hero-title .word {
  display: block;
  opacity: 0;
  transform: translateY(40px);
}
.hero-title .word:nth-child(1) { animation: revealUp 0.9s var(--ease-out) 0.5s forwards; }
.hero-title .word:nth-child(2) { animation: revealUp 0.9s var(--ease-out) 0.65s forwards; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border: 1px solid rgba(255,255,255,0.3);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
  opacity: 0;
  transform: translateY(20px);
  animation: revealUp 0.8s var(--ease-out) 0.85s forwards;
}
.btn-outline:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn-outline svg { transition: transform 0.3s; }
.btn-outline:hover svg { transform: translateX(4px); }

.hero-scroll-hint {
  position: absolute;
  right: 40px;
  bottom: 60px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeIn 1s var(--ease) 1.2s forwards;
}
.hero-scroll-hint span {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  writing-mode: vertical-rl;
}
.scroll-bar {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, var(--blue), transparent);
  animation: scrollPulse 2s ease-in-out 1.5s infinite;
}

/* ── Section Common ── */
section { padding: 120px 40px; max-width: 1400px; margin: 0 auto; }
#hero { max-width: none; padding: 0; }

.label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 20px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 60px;
}

/* ── Work Grid ── */
#work { padding-top: 140px; }
.section-head { margin-bottom: 60px; }
.section-head .section-title { margin-bottom: 0; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: auto;
  gap: 16px;
}

.card { position: relative; overflow: hidden; }
.card--large { grid-column: 1 / -1; }

.card-link { display: block; position: relative; }

.card-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
}
.card--large .card-media { aspect-ratio: 21 / 9; }

.card-media img {
  transition: transform 0.8s var(--ease-out), filter 0.5s;
  filter: brightness(0.85);
}
.card:hover .card-media img {
  transform: scale(1.04);
  filter: brightness(0.6);
}

.card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 28px;
  background: linear-gradient(to top, rgba(8,8,8,0.9) 0%, transparent 100%);
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.card-cat {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid rgba(0,71,255,0.3);
  padding: 4px 10px;
  transition: opacity 0.3s;
}
.card-name {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  font-weight: 700;
  flex: 1;
  line-height: 1.1;
  transform: translateY(6px);
  transition: transform 0.4s var(--ease-out);
}
.card:hover .card-name { transform: translateY(0); }
.card-year {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.08em;
  align-self: flex-end;
}

/* ── About ── */
#about { border-top: 1px solid var(--border); }
.about-text { max-width: 860px; }
.about-body {
  color: rgba(255,255,255,0.55);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 50px;
}
.about-body p + p { margin-top: 16px; }
.about-subtitle {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 40px 0 16px;
}

/* ── About : carrousel piloté par le scroll ── */
.about-carousel-zone { position: relative; }
.about-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.about-track {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 40px;
  will-change: transform;
}
/* mou noir en fin de carrousel pour adoucir la transition */
.about-spacer {
  flex: 0 0 45vw;
  height: 1px;
}
.about-track img {
  height: min(62vh, 640px);
  width: auto;
  max-width: none;
  object-fit: contain;
  flex: 0 0 auto;
  transform: scale(var(--about-scale, 1));
  transition: transform 0.05s linear;
  user-select: none;
  -webkit-user-select: none;
}
.about-stats {
  display: flex;
  gap: 50px;
}
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-n {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}
.stat-l {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray);
}
/* ── Contact ── */
#contact {
  border-top: 1px solid var(--border);
  text-align: center;
}
.contact-inner { max-width: 800px; margin: 0 auto; }
.contact-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 20px 0 50px;
}
.contact-title em {
  font-style: normal;
  color: var(--blue);
}
.contact-email {
  display: inline-block;
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding-bottom: 4px;
  margin-bottom: 40px;
  transition: color 0.2s, border-color 0.2s;
}
.contact-email:hover { color: var(--white); border-color: var(--blue); }
.contact-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.contact-socials a {
  color: rgba(255,255,255,0.35);
  transition: color 0.2s;
}
.contact-socials a:hover { color: var(--white); }

/* ── Footer ── */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 40px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  max-width: none;
}

/* ── Reveal Animations ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }
.delay-1 { transition-delay: 0.12s; }
.delay-2 { transition-delay: 0.24s; }
.delay-3 { transition-delay: 0.36s; }

@keyframes revealUp {
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  to { opacity: 1; }
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(0.6); opacity: 0.4; }
}

/* ── Card hover video ── */
.card-media { position: relative; }
.card-video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
}
.card.playing .card-video { opacity: 1; }
.card.playing .card-media img { filter: brightness(0.6); }

/* ── Lightbox projet ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 8, 8, 0.985);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease);
}
.lightbox.open {
  opacity: 1;
  pointer-events: all;
}
.lb-close {
  position: fixed;
  top: 22px; right: 32px;
  z-index: 210;
  color: rgba(255,255,255,0.6);
  padding: 12px;
  transition: color 0.2s, transform 0.3s var(--ease);
}
.lb-close:hover { color: var(--blue); transform: rotate(90deg); }

.lb-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.lb-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 90px 40px 30px;
  max-width: 1400px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
}
.lightbox.open .lb-head {
  animation: revealUp 0.7s var(--ease-out) 0.15s forwards;
}
.lb-cat {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid rgba(0,71,255,0.3);
  padding: 4px 10px;
  white-space: nowrap;
}
.lb-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.lb-year {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.08em;
}

.lb-carousel-wrap {
  position: relative;
  opacity: 0;
  transform: translateY(30px);
}
.lightbox.open .lb-carousel-wrap {
  animation: revealUp 0.8s var(--ease-out) 0.3s forwards;
}
.lb-carousel {
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 40px 20px;
  scrollbar-width: none;
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
}
.lb-carousel::-webkit-scrollbar { display: none; }
.lb-carousel.dragging { scroll-behavior: auto; }

.lb-slide {
  flex: 0 0 auto;
  height: min(62vh, 640px);
  transform: scale(var(--slide-scale, 1));
  transition: transform 0.05s linear;
  transform-origin: center center;
}
.lb-slide img {
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
  display: block;
}
.lb-slide--video {
  aspect-ratio: 16 / 9;
  background: #000;
}
.lb-slide--video iframe,
.lb-slide--video video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.lb-hint {
  text-align: center;
  padding: 8px 0 0;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
}

.lb-info {
  max-width: 1000px;
  margin: 0 auto;
  padding: 60px 40px 120px;
}
.lb-synopsis p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.65);
  max-width: 720px;
  margin-bottom: 50px;
}
.lb-credits-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 60px;
  align-items: start;
}
.lb-credits h3,
.lb-cast h3 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 24px;
}
.lb-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.lb-role { color: rgba(255,255,255,0.45); }
.lb-names { text-align: right; color: var(--white); }

/* ── Responsive ── */
@media (max-width: 900px) {
  #nav { padding: 0 24px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  #hero { padding: 0; }
  .hero-content { padding: 0 24px 60px; }
  .hero-scroll-hint { right: 24px; }

  section { padding: 80px 24px; }

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card--large { grid-column: auto; }
  .card--large .card-media { aspect-ratio: 16/9; }

  .about-track { padding: 0 24px; gap: 10px; }
  .about-track img { height: 45vh; }
  .scroll-timecode { display: none; }

  footer { padding: 24px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: clamp(2.2rem, 11vw, 4rem); }
  .section-title { font-size: clamp(2rem, 9vw, 2.8rem); }
  .contact-title { font-size: clamp(2.4rem, 11vw, 4rem); }
  .contact-email { word-break: break-all; }
  .about-stats { gap: 32px; flex-wrap: wrap; }
  .card-overlay { padding: 16px; }
  footer { flex-direction: column; gap: 6px; }
}

@media (max-width: 900px) {
  .lb-head { padding: 80px 24px 20px; flex-wrap: wrap; gap: 12px; }
  .lb-carousel { padding: 10px 24px 16px; gap: 10px; }
  .lb-slide { height: 42vh; }
  .lb-info { padding: 40px 24px 90px; }
  .lb-credits-grid { grid-template-columns: 1fr; gap: 40px; }
  .lb-close { top: 14px; right: 16px; }
}
