/* ============================================================
   BLADE PRODUCTION — design system
   Sombre & cinéma : noir, plein écran, typographie éditoriale
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --bg-soft: #111111;
  --ink: #f4f2ec;
  --muted: rgba(244, 242, 236, 0.58);
  --faint: rgba(244, 242, 236, 0.34);
  --line: rgba(244, 242, 236, 0.16);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pad: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }

::selection { background: var(--ink); color: var(--bg); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--pad);
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }

.brand { display: block; line-height: 0; }
.brand img { height: 72px; width: auto; display: block; }

.nav { display: flex; gap: clamp(18px, 3.5vw, 40px); }
.nav a {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  transition: color 0.35s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 1px;
  background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

/* scrim top : garde le header (logo + menu) lisible sur la vidéo */
.portfolio-page .site-header { background: linear-gradient(180deg, rgba(10, 10, 10, 0.65), rgba(10, 10, 10, 0.18) 78%, transparent); }

/* ---------- Portfolio (fullscreen scroll) ---------- */
html.is-portfolio {
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
html.is-portfolio::-webkit-scrollbar { display: none; }

.portfolio { position: relative; }

.slide {
  position: relative;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: var(--bg);
}

.slide__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s var(--ease);
}
.slide.is-ready .slide__video { opacity: 1; }

.slide__overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.60) 0%,
    rgba(10, 10, 10, 0.10) 38%,
    rgba(10, 10, 10, 0.10) 62%,
    rgba(10, 10, 10, 0.88) 100%
  );
}

/* texture en tuile (quadrillage) — masque la compression, devant la vidéo, derrière le texte */
.slide__texture {
  position: absolute; inset: 0;
  background-image: url('../assets/motif.png');
  background-repeat: repeat;
  pointer-events: none;
}

.slide__content {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: clamp(48px, 10vh, 120px);
  max-width: 820px;
}

.slide__label {
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(14px, 2.5vh, 26px);
}

.slide__title {
  display: inline-block;
  text-align: left;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.8rem, 8.5vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
  transition: opacity 0.4s var(--ease);
}
.slide__title:hover { opacity: 0.72; }

.slide__resume {
  margin-top: clamp(14px, 2.5vh, 24px);
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  font-weight: 300;
  color: var(--muted);
  max-width: 56ch;
  text-wrap: pretty;
}

.slide__meta {
  margin-top: clamp(10px, 1.8vh, 18px);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--faint);
}

/* crédits : bloc en bas à droite, apparaît après quelques secondes de pause */
.slide__credits {
  position: absolute;
  right: var(--pad);
  bottom: clamp(48px, 10vh, 120px);
  transform: translateX(14px);
  max-width: 320px;
  text-align: right;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--muted);
  white-space: pre-line;
  opacity: 0;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  pointer-events: none;
  z-index: 5;
}
.slide__credits.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.slide__watch {
  margin-top: clamp(18px, 3.5vh, 34px);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
}
.slide__watch .dot {
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid; place-items: center;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), color 0.35s var(--ease);
}
.slide__watch .dot svg { width: 10px; height: 10px; }
.slide__watch:hover .dot { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* counter + scroll hint (fixed chrome) */
.counter {
  position: fixed;
  right: var(--pad);
  bottom: 26px;
  z-index: 55;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.counter b { color: var(--ink); font-weight: 500; }

.scrolldown {
  position: fixed;
  left: var(--pad);
  bottom: 26px;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
}
.scrolldown .line {
  width: 1px; height: 40px;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}
.scrolldown .line::after {
  content: "";
  position: absolute; left: 0; top: -100%;
  width: 100%; height: 100%;
  background: var(--ink);
  animation: drip 2.4s var(--ease) infinite;
}
@keyframes drip {
  0% { top: -100%; }
  60%, 100% { top: 100%; }
}

/* ---------- Empty state ---------- */
.empty-state {
  min-height: 100vh; min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
  padding: var(--pad);
}
.empty-state h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  letter-spacing: 0.02em;
}
.empty-state p { color: var(--muted); max-width: 44ch; }
.empty-state .cta {
  margin-top: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 14px 30px;
  border: 1px solid var(--line);
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.empty-state .cta:hover { border-color: var(--ink); background: var(--ink); color: var(--bg); }

/* ---------- Modal (full film) ---------- */
.modal {
  position: fixed; inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}
.modal.is-open { opacity: 1; visibility: visible; }

.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 4, 4, 0.92);
  backdrop-filter: blur(6px);
}

.modal__dialog {
  position: relative;
  width: min(1200px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: #0c0c0c;
  border: 1px solid var(--line);
  transform: translateY(14px);
  transition: transform 0.45s var(--ease);
}
.modal.is-open .modal__dialog { transform: translateY(0); }

.modal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal__bar .titles { min-width: 0; }
.modal__bar h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.modal__bar .sub { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

.modal__close {
  flex: 0 0 auto;
  margin-left: 20px;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 0.9rem;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.modal__close:hover { border-color: var(--ink); background: var(--ink); color: var(--bg); }

.modal__player { aspect-ratio: 16 / 9; background: #000; }
.modal__player video { width: 100%; height: 100%; object-fit: contain; background: #000; }

.modal__versions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}
.modal__versions[hidden] { display: none; }
.modal__version {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 7px 12px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.modal__version:hover { color: var(--ink); border-color: var(--ink); }
.modal__version.is-active { color: var(--bg); background: var(--ink); border-color: var(--ink); }



/* ---------- Editorial pages (à propos / contact) ---------- */
.editorial { padding: clamp(110px, 16vh, 170px) var(--pad) clamp(80px, 12vh, 140px); }
.editorial .inner { max-width: 820px; margin: 0 auto; }
.editorial h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  line-height: 1.02;
  margin-bottom: clamp(28px, 5vh, 48px);
}
.editorial .lead { font-size: clamp(1.1rem, 1.8vw, 1.4rem); line-height: 1.6; color: var(--muted); max-width: 60ch; }
.editorial h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  margin: clamp(40px, 8vh, 70px) 0 18px;
}
.editorial p { color: var(--muted); max-width: 60ch; margin-bottom: 18px; }
.editorial .note {
  margin-top: 30px; padding: 16px 20px;
  border: 1px dashed var(--line);
  color: var(--faint);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.contact-list { list-style: none; margin-top: 8px; }
.contact-list li {
  display: flex; gap: 24px; align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.contact-list li:last-child { border-bottom: 1px solid var(--line); }
.contact-list .k { font-size: 0.7rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--faint); width: 120px; flex: 0 0 auto; }
.contact-list .v { font-family: var(--serif); font-size: clamp(1.2rem, 2.4vw, 1.7rem); font-weight: 300; }
.contact-list .v a { border-bottom: 1px solid transparent; transition: border-color 0.3s var(--ease); }
.contact-list .v a:hover { border-color: var(--ink); }

.footer {
  padding: 30px var(--pad) 40px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px 32px;
  align-items: center; justify-content: space-between;
  font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint);
}
.footer a:hover { color: var(--ink); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .slide__video { opacity: 1; }
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .site-header { padding: 16px var(--pad); }
  .brand img { height: 42px; }
  .nav { gap: 14px; }
  .nav a { font-size: 0.64rem; letter-spacing: 0.13em; padding: 8px 0; }
  .nav a::after { bottom: 4px; }

  .slide__title { font-size: clamp(2.1rem, 9.5vw, 3rem); }
  .slide__label { font-size: 0.66rem; letter-spacing: 0.28em; }
  .slide__resume { font-size: 0.95rem; }
  .slide__meta { font-size: 0.72rem; }
  .slide__watch { margin-top: 14px; }
  .slide__watch .dot { width: 30px; height: 30px; }

  /* crédits : en haut à droite sur mobile (évite de chevaucher le titre en bas) */
  .slide__credits {
    bottom: auto;
    top: clamp(64px, 13vh, 90px);
    max-width: 200px;
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .counter { font-size: 0.66rem; bottom: 18px; }
  .scrolldown { display: none; }

  .modal { padding: 12px; }
  .modal__bar { padding: 12px 14px; }
  .modal__bar h2 { font-size: 1.25rem; }
  .modal__bar .sub { font-size: 0.66rem; }
  .modal__close { width: 44px; height: 44px; margin-left: 12px; }

  .editorial { padding-top: clamp(96px, 16vh, 130px); }
  .editorial h1 { font-size: clamp(2.3rem, 11vw, 3.4rem); }
  .editorial .lead { font-size: 1.05rem; }

  .contact-list li { flex-direction: column; gap: 6px; }
  .contact-list .k { width: auto; }
  .footer { flex-direction: column; gap: 8px; align-items: flex-start; }
}
