/* ═══════════════════════════════════════════════════════════════════════════
   theDevsite v4 — direction "Molten Gold" issue de la veille (NOTES-VEILLE.md)
   Base near-black à cast bleu-violet, or unique #E9C15C, une famille grotesque
   (General Sans, self-hostée), mono système pour les micro-labels.
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'General Sans';
  src: url('../fonts/general-sans-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/general-sans-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/general-sans-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #0B0B0E;
  --surface: #131317;
  --paper: #ECE6DB;
  --ink: #131313;
  --text: #F4F1E8;
  --text-2: #96959D;
  --gold: #E9C15C;
  --gold-bright: #FFD700;
  --hairline: rgba(244, 241, 232, 0.08);
  --hairline-ink: rgba(19, 19, 19, 0.12);
  --sans: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', Menlo, monospace;
  --pad: clamp(20px, 4vw, 64px);
}

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

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Micro-labels mono ALL-CAPS — l'affordance "studio" repérée partout */
.micro {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-2);
}

.hairline { display: block; width: 100%; height: 1px; background: var(--hairline); }

.dot-gold {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  margin-left: 8px;
  vertical-align: middle;
}

/* ─── Grain ────────────────────────────────────────────────────────────── */

.grain {
  position: fixed;
  inset: -50%;
  z-index: 80;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─── Preloader ────────────────────────────────────────────────────────── */

#preloader {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--pad);
}

#preloader .counter {
  font-size: clamp(72px, 14vw, 200px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

body.no-preloader #preloader { display: none; }

/* ─── Curtains ─────────────────────────────────────────────────────────── */

.curtain {
  position: fixed;
  inset: 0;
  z-index: 250;
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.curtain-a { background: var(--surface); }
.curtain-b { background: var(--bg); }
.curtain-label { color: var(--text); font-size: 14px; }

/* ─── Curseur ──────────────────────────────────────────────────────────── */

.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  pointer-events: none;
  z-index: 260;
  opacity: 0;
  transition: opacity 0.3s, width 0.25s, height 0.25s;
}
.cursor.on { opacity: 1; }
.cursor.small { width: 4px; height: 4px; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ─── Nav ──────────────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 90;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 26px var(--pad);
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav.hidden { transform: translateY(-110%); }

.wordmark { font-weight: 600; font-size: 15px; overflow: hidden; display: block; height: 1.45em; }
.wm-flip { display: block; transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1); }
.wm-flip span { display: block; height: 1.45em; line-height: 1.45em; }
.wordmark:hover .wm-flip { transform: translateY(-1.45em); }
.wm-flip span:last-child { color: var(--gold); }

.nav-links { display: flex; gap: clamp(18px, 3vw, 40px); }

.nav-link {
  position: relative;
  font-size: 15px;
  font-weight: 500;
  padding-bottom: 8px;
}

.nav-dot {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
  transform: translateX(-50%) scale(0);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-link:hover .nav-dot, .nav-link.active .nav-dot { transform: translateX(-50%) scale(1); }

/* ─── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  height: 100svh;
  overflow: clip;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--pad) 150px;
}

#webgl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Poster fallback si WebGL indisponible */
.hero-poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  background:
    radial-gradient(38vmin 38vmin at 68% 42%, rgba(233, 193, 92, 0.55), rgba(185, 135, 47, 0.22) 55%, transparent 72%),
    radial-gradient(60vmin 60vmin at 68% 42%, rgba(233, 193, 92, 0.12), transparent 70%);
}
body.no-webgl #webgl { display: none; }
body.no-webgl .hero-poster { display: block; }

.hero-top {
  position: absolute;
  top: 110px;
  left: var(--pad);
  right: var(--pad);
  z-index: 2;
}
.hero-eyebrow { margin-bottom: 14px; color: var(--text); }

.hero-title {
  position: relative;
  z-index: 2;
  font-size: clamp(56px, 10vw, 168px);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* État caché posé par gsap.set (pas ici) : si le JS meurt, le titre reste lisible */
.ht-line { display: block; overflow: hidden; }
.ht-line > span { display: inline-block; }

.hero-scroll {
  position: absolute;
  right: var(--pad);
  bottom: 170px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}
.scroll-line { display: inline-block; width: 44px; height: 1px; background: var(--gold); transform-origin: left; }

.hero-marquee {
  position: absolute;
  left: 0; right: 0; bottom: 18px;
  z-index: 2;
  overflow: clip;
  white-space: nowrap;
  pointer-events: none;
}
.marquee-inner { display: inline-block; will-change: transform; }
.marquee-inner span {
  font-size: 7.5vw;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(244, 241, 232, 0.22);
}

/* ─── Sections communes ────────────────────────────────────────────────── */

main { position: relative; z-index: 2; background: var(--bg); }

.section-label { margin-bottom: clamp(36px, 6vh, 64px); }

.work, .gallery { padding: clamp(90px, 14vh, 160px) var(--pad); }

/* ─── Work rows ────────────────────────────────────────────────────────── */

.work-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: clamp(34px, 5.5vh, 56px) 4px;
  border-top: 1px solid var(--hairline);
  position: relative;
}
.work-row:last-of-type { border-bottom: 1px solid var(--hairline); }

.wr-title {
  font-size: clamp(28px, 3.5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s;
}
.wr-title::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gold);
  transform: scale(0);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.work-row:hover .wr-title { transform: translateX(10px); }
.work-row:hover .wr-title::before { transform: scale(1); }

.wr-meta { display: flex; align-items: center; gap: 10px; }
.wr-year { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-2); margin-left: 10px; }

.pill {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: lowercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}

/* Preview flottante + disque VIEW */

.preview {
  position: fixed;
  top: 0; left: 0;
  width: min(360px, 26vw);
  aspect-ratio: 6 / 5;
  z-index: 60;
  pointer-events: none;
  transform: scale(0);
  border-radius: 10px;
  overflow: hidden;
}
.preview-media {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #241d0e, #131317 55%, #0B0B0E);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.preview-media.active { display: flex; }
.preview-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview-media span { font-size: 30px; font-weight: 600; color: var(--gold); opacity: 0.65; }

.view-disc {
  position: fixed;
  top: 0; left: 0;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--gold);
  color: #131313;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 61;
  pointer-events: none;
  transform: scale(0);
}

@media (hover: none), (pointer: coarse), (max-width: 820px) {
  .preview, .view-disc { display: none; }
}

/* ─── Gallery ──────────────────────────────────────────────────────────── */

.gallery { overflow: clip; }

.g-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  will-change: transform;
}

.g-card {
  position: relative;
  flex: 0 0 clamp(220px, 24vw, 380px);
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(160deg, #1a1712, var(--surface) 60%);
  border: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
}
.g-card img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.55);
  transition: filter 0.4s;
}
.g-card:hover img { filter: saturate(1); }
.g-card span { font-family: var(--mono); font-size: 13px; color: var(--gold); opacity: 0.55; }

/* ─── About (papier) ───────────────────────────────────────────────────── */

.about.paper {
  background: var(--paper);
  color: var(--ink);
  padding: clamp(110px, 16vh, 190px) var(--pad);
  position: relative;
}
.about .micro { color: rgba(19, 19, 19, 0.55); }

.statement {
  font-size: clamp(24px, 2.8vw, 44px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  max-width: 21ch;
  margin-bottom: 26px;
}

.about-sub { color: rgba(19, 19, 19, 0.6); max-width: 46ch; margin-bottom: 48px; }

.round-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 128px; height: 128px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
}

/* ─── Footer reveal ────────────────────────────────────────────────────── */

.footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1;
  background: var(--bg);
  padding: clamp(80px, 12vh, 140px) var(--pad) 34px;
}

.footer-eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; color: var(--text); }
.avatar {
  display: inline-block;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3a3427, var(--surface) 70%);
  border: 1px solid var(--hairline);
}

.footer-title {
  font-size: clamp(48px, 7.5vw, 128px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-bottom: clamp(40px, 7vh, 80px);
}

.footer-rule { position: relative; margin-bottom: 70px; }
.footer-rule .hairline { margin-top: 0; }

.gold-disc {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  width: 132px; height: 132px;
  border-radius: 50%;
  background: var(--gold);
  color: #131313;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  transition: background 0.3s;
}
.gold-disc:hover { background: var(--gold-bright); }

.footer-pills { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: clamp(50px, 8vh, 90px); }
.pill-lg { font-size: 13px; padding: 12px 22px; color: var(--text); text-transform: none; letter-spacing: 0.04em; }
.pill-lg:hover { border-color: var(--gold); color: var(--gold); }
.pill-lg.muted { color: var(--text-2); }

.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--hairline);
  padding-top: 22px;
}
.footer-socials a { margin-left: 18px; }
.footer-socials a:first-child { margin-left: 0; }
.footer-socials a:hover { color: var(--gold); }

/* ─── Reveals ──────────────────────────────────────────────────────────── */

[data-split] { opacity: 1; }
.split-line-mask { display: block; overflow: hidden; }

/* ─── Mobile ───────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .nav { padding: 18px 20px; }
  .nav-link { font-size: 13px; }
  .hero { padding-bottom: 150px; }
  .hero-top { top: 84px; }
  .hero-scroll { bottom: 96px; }
  .work-row { flex-direction: column; align-items: flex-start; gap: 14px; }
  .g-card { flex-basis: 62vw; }
  .statement { max-width: none; }
  .gold-disc { position: static; transform: none; margin-top: 26px; }
  .footer-rule { display: flex; flex-direction: column; align-items: flex-start; }
}

/* ─── Reduced motion ───────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  #preloader { display: none; }
  .ht-line > span { transform: none !important; }
  .cursor { display: none; }
  .marquee-inner { transform: none !important; }
  .g-row { transform: none !important; }
}
