/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0b0b0b;
  --text:      #efefef;
  --dim:       #666;
  --border:    #1c1c1c;
  --accent:    #ffffff;
  --easing:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
  cursor: none;
  overflow-x: hidden;
}

/* ─── Custom Cursor ──────────────────────────────────── */
.cursor {
  position: fixed;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  will-change: left, top;
}

.cursor-ring {
  position: fixed;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width .2s var(--easing), height .2s var(--easing), border-color .2s;
  will-change: left, top;
}

body.cursor-hover .cursor-ring {
  width: 26px;
  height: 26px;
  border-color: rgba(255,255,255,.7);
}

/* ─── Nav dropdown ───────────────────────────────────── */
.nav-dropdown-wrap {
  position: relative;
  display: flex;
  align-items: center; /* aligne "Work" avec About et Contact */
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  right: -8px;         /* légèrement décalé à droite pour aligner sous "Work" */
  min-width: 130px;
  padding-top: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.nav-dropdown-wrap:hover .nav-dropdown {
  opacity: 1;
  pointer-events: all;
}

.nav-dropdown-inner {
  display: flex;
  flex-direction: column;
}

.nav-dropdown a {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
  transition: color .15s ease, letter-spacing .15s ease;
  display: block;
  text-align: right;
}
.nav-dropdown a:first-child { border-top: 1px solid rgba(255,255,255,.07); }
.nav-dropdown a:hover {
  color: #fff;
  letter-spacing: .16em;
}

/* ─── Navigation ─────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 26px 40px;
  transition: padding .4s var(--easing);
}

nav.scrolled {
  padding: 18px 40px;
  background: linear-gradient(to bottom, rgba(11,11,11,.85), transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  opacity: .85;
  transition: opacity .2s;
}
.nav-name:hover { opacity: 1; }

.nav-links {
  display: flex;
  gap: 36px;
}
.nav-links a {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  opacity: .55;
  transition: opacity .2s;
}
.nav-links a:hover { opacity: 1; }

/* ─── Hero ───────────────────────────────────────────── */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

.hero-video-wrap {
  position: absolute;
  /* oversized to ensure 16:9 covers all viewport ratios */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max(100%, calc(100vh * 16 / 9));
  height: max(100%, calc(100vw * 9 / 16));
  pointer-events: none;
}
.hero-video-wrap iframe {
  width: 100%;
  height: 100%;
}

.hero-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 100px 40px 40px;
  pointer-events: none;
  /* subtle vignette */
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.5) 100%);
}

.hero-reel-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  align-self: flex-end;
}

.hero-scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  align-self: center;
  opacity: .5;
}
.hero-scroll-hint span {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.scroll-line {
  width: 1px;
  height: 44px;
  background: white;
  transform-origin: top;
  animation: scrollPulse 2.2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: .5; }
  50%       { transform: scaleY(.4); opacity: 1; }
}

/* ─── Work Section (home) ────────────────────────────── */
#work {
  padding: 80px 0 0;
}

.work-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 40px 28px;
}

.view-all-link {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  transition: color .2s;
}
.view-all-link:hover { color: var(--accent); }

/* ─── Filter tabs (work page) ────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 28px;
}
.filter-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--dim);
  background: none;
  border: none;
  cursor: none;
  padding: 0;
  transition: color .2s;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active { color: var(--accent); }

/* ─── Project item (shared) ──────────────────────────── */
.project-item {
  position: relative;
  overflow: hidden;
  cursor: none;
  background: #111;
}
.project-item::before {
  content: '';
  display: block;
  padding-bottom: 56.25%; /* 16:9 default */
}

.project-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter .4s, opacity .3s;
  filter: brightness(.82);
}
.project-item:hover .project-thumb {
  filter: brightness(.82);
}
/* Thumbnail s'efface quand la vidéo preview est active */
.project-item.previewing .project-thumb {
  opacity: 0;
}

.project-thumb-placeholder {
  position: absolute;
  inset: 0;
  background: #161616;
}

/* ─── Corner brackets ────────────────────────────────── */
/* Sur les projets */
.corner {
  position: absolute;
  width: 8px;
  height: 8px;
  z-index: 3;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.corner-tl { top: 10px;    left: 10px;    border-top: 1px solid rgba(255,255,255,.6); border-left:  1px solid rgba(255,255,255,.6); }
.corner-tr { top: 10px;    right: 10px;   border-top: 1px solid rgba(255,255,255,.6); border-right: 1px solid rgba(255,255,255,.6); }
.corner-bl { bottom: 10px; left: 10px;    border-bottom: 1px solid rgba(255,255,255,.6); border-left:  1px solid rgba(255,255,255,.6); }
.corner-br { bottom: 10px; right: 10px;   border-bottom: 1px solid rgba(255,255,255,.6); border-right: 1px solid rgba(255,255,255,.6); }

.project-item:hover .corner,
.project-item.previewing .corner { opacity: 1; }

/* Sur le texte (liens nav, titres, etc.) */
.has-corners {
  position: relative;
  display: inline-block;
}
.has-corners::before,
.has-corners::after,
.has-corners .c-bl,
.has-corners .c-br {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.has-corners::before  { top: -4px;    left: -6px;  border-top: 1px solid rgba(255,255,255,.55); border-left:  1px solid rgba(255,255,255,.55); }
.has-corners::after   { top: -4px;    right: -6px; border-top: 1px solid rgba(255,255,255,.55); border-right: 1px solid rgba(255,255,255,.55); }
.has-corners .c-bl    { bottom: -4px; left: -6px;  border-bottom: 1px solid rgba(255,255,255,.55); border-left:  1px solid rgba(255,255,255,.55); }
.has-corners .c-br    { bottom: -4px; right: -6px; border-bottom: 1px solid rgba(255,255,255,.55); border-right: 1px solid rgba(255,255,255,.55); }

.has-corners:hover::before,
.has-corners:hover::after,
.has-corners:hover .c-bl,
.has-corners:hover .c-br { opacity: 1; }

/* Coins toujours visibles quand la page est active */
.nav-active::before,
.nav-active::after,
.nav-active .c-bl,
.nav-active .c-br { opacity: 1; }

/* Iframe de preview au hover */
/* background noir = masque les pages d'erreur éventuelles */
.project-preview-iframe {
  background: #000;
  position: absolute;
  top: 50%;
  left: 50%;
  /* oversized pour couvrir le container en 16:9 */
  width: max(100%, calc(100% * 16/9 * 9/16 + 1px));
  height: max(100%, calc(100% * 16/9));
  min-width: 100%;
  min-height: 56.25%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
}
.project-item.previewing .project-preview-iframe {
  opacity: 1;
}

.project-overlay {
  position: absolute;
  inset: 0;
  z-index: 2; /* au-dessus de l'iframe preview */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 20px;
  background: linear-gradient(to top, rgba(0,0,0,.68) 0%, transparent 55%);
  opacity: 0;
  transition: opacity .3s ease;
}
.project-item:hover .project-overlay      { opacity: 1; }
.project-item.previewing .project-overlay { opacity: 1; }

.project-overlay-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 5px;
  transform: translateY(6px);
  transition: transform .32s var(--easing);
}
.project-item:hover .project-overlay-title,
.project-item.previewing .project-overlay-title { transform: translateY(0); }

.project-overlay-meta {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(255,255,255,.58);
  transform: translateY(6px);
  transition: transform .32s var(--easing) .04s;
}
.project-item:hover .project-overlay-meta,
.project-item.previewing .project-overlay-meta { transform: translateY(0); }

.project-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.75);
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .3s, transform .3s var(--easing);
  pointer-events: none;
}
.project-play svg { margin-left: 3px; }
.project-item:hover .project-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ─── Home: 3-col grid ───────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

/* ─── Work page: alternating layout ─────────────────── */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.projects-row-small {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

/* Large item override */
.project-item.large::before  { padding-bottom: 52%; }

.project-item.large .project-overlay {
  padding: 28px 32px;
  opacity: 1;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 50%);
}
.project-item.large:hover .project-overlay {
  background: linear-gradient(to top, rgba(0,0,0,.72) 0%, transparent 55%);
}
.project-item.large .project-overlay-title {
  font-size: 28px;
  transform: none;
  transition: none;
}
.project-item.large .project-overlay-meta {
  transform: none;
  transition: none;
  opacity: .65;
}

.no-projects {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 60px 40px;
}

/* ─── Contact (homepage) ─────────────────────────────── */
#contact {
  padding: 80px 40px 60px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.contact-simple {
  max-width: 500px;
}

.section-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 36px;
}

.about-body p {
  font-size: 15px;
  line-height: 1.85;
  color: rgba(239,239,239,.65);
  font-weight: 300;
  max-width: 520px;
}
.about-body p + p { margin-top: 18px; }

/* Contact */
.contact-links {
  display: flex;
  flex-direction: column;
}
.contact-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: padding-left .25s var(--easing), color .2s;
}
.contact-link:first-child { border-top: 1px solid var(--border); }
.contact-link:hover { padding-left: 10px; color: var(--accent); }

.contact-link span:first-child {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}
.contact-link span:last-child {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .05em;
}

/* ─── Footer ─────────────────────────────────────────── */
footer {
  padding: 28px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}
footer span {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ─── Modal ──────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.modal.open {
  opacity: 1;
  pointer-events: all;
}

.modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.94);
}

.modal-inner {
  position: relative;
  z-index: 1;
  width: 92%;
  max-width: 1100px;
}

.modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  cursor: none;
  padding: 4px;
  transition: color .2s, transform .2s;
}
.modal-close:hover {
  color: #fff;
  transform: rotate(90deg);
}

.modal-video-wrap {
  position: relative;
  padding-bottom: 56.25%;
}
.modal-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Overlay cliquable pour pause/play */
.modal-video-overlay {
  position: absolute;
  inset: 0;
  cursor: none;
  z-index: 2;
}

/* Icône pause/play au centre au clic */
.modal-video-overlay::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 64px;
  height: 64px;
  border: 1.5px solid rgba(255,255,255,.7);
  border-radius: 50%;
  background: rgba(0,0,0,.3);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.modal-video-overlay.show-icon::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Contrôles */
.modal-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 0;
  gap: 16px;
}

.modal-controls-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}

.modal-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.modal-meta {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}

.modal-production {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}
.modal-production:not(:empty)::before { content: '— Produced by '; }

/* Galerie de stills */
.modal-stills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 2px;
}
.modal-stills:empty { display: none; }

.modal-still {
  position: relative;
  overflow: hidden;
}
.modal-still::before {
  content: '';
  display: block;
  padding-bottom: 62%;
}
.modal-still img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--easing);
}
.modal-still:hover img { transform: scale(1.03); }

.modal-controls-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.modal-ctrl-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  cursor: none;
  padding: 4px;
  display: flex;
  align-items: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  transition: color .2s;
}
.modal-ctrl-btn:hover { color: #fff; }

/* Bouton sortie plein écran — visible uniquement en fullscreen */
.modal-fs-exit {
  display: none;
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  background: none;
  border: none;
  cursor: none;
  opacity: .6;
  transition: opacity .2s;
}
.modal-fs-exit:hover { opacity: 1; }

/* Quand on est en fullscreen */
:fullscreen .modal-fs-exit,
:-webkit-full-screen .modal-fs-exit { display: block; }
:fullscreen .modal-close,
:-webkit-full-screen .modal-close { display: none; }

/* Curseur natif en plein écran (le curseur custom n'est pas dans l'élément fullscreen) */
:fullscreen,
:fullscreen *,
:-webkit-full-screen,
:-webkit-full-screen * { cursor: auto !important; }

/* ─── Page fade-in ───────────────────────────────────── */
body { opacity: 0; transition: opacity .6s ease; }
body.loaded { opacity: 1; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 960px) {
  .projects-row-small { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 60px; }
  nav { padding: 20px 24px; }
  nav.scrolled { padding: 14px 24px; }
  .work-header, #about, footer { padding-left: 24px; padding-right: 24px; }
  .hero-ui { padding: 80px 24px 32px; }
  .project-item.large .project-overlay-title { font-size: 20px; }
}

@media (max-width: 540px) {
  .projects-row-small { grid-template-columns: 1fr; }
  .filter-tabs { gap: 18px; flex-wrap: wrap; }
  .nav-links { gap: 18px; }
  .about-grid { gap: 48px; }
  .project-item.large .project-overlay-title { font-size: 16px; }
}
