/* =====================
   VARIABLES & RESET
   ===================== */
:root {
  /* Dark mode par défaut */
  --bg: #0D0D0D;
  --text: #EFEEEA;
  --text-muted: #8C8A85;
  --border: rgba(239,238,234,0.12);
  --font-display: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Light mode */
:root[data-theme="light"] {
  --bg: #EFEEEA;
  --text: #0D0D0D;
  --text-muted: #777570;
  --border: rgba(13,13,13,0.12);
}

body, .content, .marquee__item {
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { font-size:16px; scroll-behavior:smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

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

/* =====================
   CURSEUR 3D
   ===================== */
.cursor {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  perspective: 120px;
  perspective-origin: center;
}

/* Dot par défaut */
.cursor__dot {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  transition: opacity 0.25s, transform 0.25s;
}

/* Ring 3D — visible uniquement sur carte */
.cursor__ring {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0;
  transform-style: preserve-3d;
  transform: scale(0.4);
  transition: opacity 0.3s, transform 0.3s var(--ease);
}

/* Sur showreel : blanc */
body.on-showreel .cursor { color: #fff; }

/* Sur carte : dot disparaît, ring tourne en 3D */
body.cursor-on-card .cursor__dot {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
}

body.cursor-on-card .cursor__ring {
  opacity: 1;
  transform: scale(1);
  animation: spin3d 1.6s linear infinite;
}

@keyframes spin3d {
  from { transform: scale(1) rotateY(0deg); }
  to   { transform: scale(1) rotateY(360deg); }
}

/* Animation périodique du dot (hors carte) */
@keyframes dotSpin {
  0%   { width: 8px;  height: 8px;  border-radius: 50%; }
  25%  { width: 2px;  height: 10px; border-radius: 2px; }
  50%  { width: 16px; height: 16px; border-radius: 50%; background: transparent; outline: 1.5px solid currentColor; }
  75%  { width: 2px;  height: 10px; border-radius: 2px; outline: none; }
  100% { width: 8px;  height: 8px;  border-radius: 50%; }
}

/* =====================
   HEADER
   ===================== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  pointer-events: none;
}

/* Gradient sous le header — visible uniquement sur le contenu (pas showreel) */
.header-gradient {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 140px;
  z-index: 95;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

body:not(.on-showreel) .header-gradient { opacity: 1; }

/* Brand */
.header__brand {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.header__name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  transition: opacity 0.3s;
}

.header__role {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  line-height: 1;
  color: var(--text-muted);
}

/* Nav */
.header__nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.header__link {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 0;
  position: relative;
  transition: opacity 0.3s;
}

.header__link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.3s var(--ease);
}

.header__link:hover::after { width: 100%; }

/* Séparateur vertical */
.header__sep {
  display: block;
  width: 1px;
  height: 14px;
  background: currentColor;
  opacity: 0.2;
}

/* Liens sociaux */
.header__social {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  opacity: 0.55;
  transition: opacity 0.3s;
}

.header__social:hover { opacity: 1; }

.header__social--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
}

.header__social--icon svg { display: block; }

/* Lang toggle FR / EN */
.lang-toggle {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 400;
  margin-left: 4px;
  color: currentColor;
}

.lang-toggle [data-lang-btn] {
  opacity: 0.45;
  transition: opacity 0.3s;
}

.lang-toggle [data-lang-btn]:hover { opacity: 0.85; }

.lang-toggle__sep { opacity: 0.3; }

:root[data-lang="fr"] .lang-toggle [data-lang-btn="fr"],
:root:not([data-lang]) .lang-toggle [data-lang-btn="fr"] {
  opacity: 1;
}
:root[data-lang="en"] .lang-toggle [data-lang-btn="en"] {
  opacity: 1;
}

/* Theme toggle */
.theme-toggle {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: currentColor;
  opacity: 0.85;
  transition: opacity 0.3s, transform 0.4s var(--ease);
  margin-left: 8px;
}

.theme-toggle:hover {
  opacity: 1;
  transform: rotate(20deg);
}

.theme-toggle__icon {
  position: absolute;
  transition: opacity 0.3s, transform 0.4s var(--ease);
}

/* Dark par défaut → on voit la lune */
.theme-toggle__icon--moon { opacity: 1; transform: rotate(0deg) scale(1); }
.theme-toggle__icon--sun  { opacity: 0; transform: rotate(90deg) scale(0.5); }

/* Light mode → on voit le soleil */
:root[data-theme="light"] .theme-toggle__icon--sun  { opacity: 1; transform: rotate(0deg) scale(1); }
:root[data-theme="light"] .theme-toggle__icon--moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }

/* Couleur header sur showreel */
body.on-showreel .header { color: #fff; }

/* =====================
   SHOWREEL
   ===================== */
.showreel {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 50;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}

.showreel.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.showreel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 220px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
  z-index: 2; pointer-events: none;
}

.showreel::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 160px;
  background: linear-gradient(to top, rgba(0,0,0,0.45), transparent);
  z-index: 2; pointer-events: none;
}

.showreel__video {
  position: absolute;
  inset: 0; overflow: hidden; z-index: 1;
}

.showreel__video iframe {
  position: absolute;
  top: 50%; left: 50%;
  width: max(100vw, 177.78vh);
  height: max(100vh, 56.25vw);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Indicateur "scroll" en bas du showreel */
.showreel-hint {
  position: fixed;
  bottom: 36px; left: 50%;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #fff;
  pointer-events: none;
  opacity: 0.75;
  transform: translateX(-50%);
  animation: hintBob 2.4s ease-in-out infinite;
  transition: opacity 0.6s;
}

.showreel-hint__label {
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

body:not(.on-showreel) .showreel-hint {
  opacity: 0;
}

@keyframes hintBob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 6px); }
}

/* Bouton retour vers le showreel (sur la page contenu) */
.showreel-return {
  position: fixed;
  top: 22px; left: 50%;
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 0.4s var(--ease) 0.15s, transform 0.4s var(--ease) 0.15s, background 0.3s, color 0.3s;
}

body:not(.on-showreel) .showreel-return {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.showreel-return:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* Speaker */
.speaker {
  position: fixed;
  bottom: 32px; right: 40px;
  z-index: 60;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.08);
  transition: background 0.3s, border-color 0.3s, opacity 0.6s;
}

.speaker:hover { background: rgba(255,255,255,0.2); border-color: #fff; }
.speaker.is-hidden { opacity: 0; pointer-events: none; }

.speaker__icon--on  { display: none; }
.speaker__icon--off { display: block; }
.speaker.is-on .speaker__icon--on  { display: block; }
.speaker.is-on .speaker__icon--off { display: none; }

/* =====================
   CONTENT
   ===================== */
.content {
  position: relative;
  z-index: 10;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease) 0.15s;
}

.content.is-visible {
  opacity: 1;
  visibility: visible;
}

.section { padding: 0; position: relative; }
.section + .section { border-top: 1px solid var(--border); }

/* Canvas dessin */
.pencil-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Sur about/contact : canvas au-dessus du texte avec blend "difference"
   → le trait apparaît normalement sur le fond, et inversé sur le texte */
#about .pencil-canvas,
#contact .pencil-canvas {
  z-index: 3;
  mix-blend-mode: difference;
}

/* Sections avec dessin : texte non sélectionnable, contenu au-dessus du canvas */
#about, #contact, #work {
  user-select: none;
  -webkit-user-select: none;
}

#about .section__inner,
#contact .section__inner {
  position: relative;
  z-index: 1;
}

/* Marquee au-dessus du canvas dans #work */
#work .marquee {
  position: relative;
  z-index: 1;
}


.section__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 130px 40px 90px;
}

.section__inner--narrow { max-width: 800px; }

.section__header-block {
  max-width: 1280px;
  margin: 0 auto;
  padding: 130px 40px 40px;
}

.label {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

/* =====================
   MARQUEE WORK — 3 lignes
   ===================== */
.marquee {
  width: 100%;
  overflow: hidden;
  padding-top: 140px;
  padding-bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.marquee__row {
  width: 100%;
  overflow: hidden;
}

.marquee__track {
  display: flex;
  gap: 0;
  width: max-content;
}

/* Ligne droite → gauche */
.marquee__row--left .marquee__track {
  animation: marqueeLeft 60s linear infinite;
}

/* Ligne gauche → droite */
.marquee__row--right .marquee__track {
  animation: marqueeRight 70s linear infinite;
}

@keyframes marqueeLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes marqueeRight {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

.marquee__item {
  position: relative;
  height: 28vh;
  min-height: 200px;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  overflow: hidden;
  background: #ccc;
  outline: 3px solid var(--bg);
}

.marquee__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: transform 0.6s var(--ease), filter 0.4s;
}

.marquee__item:hover img {
  transform: scale(1.04);
}

.marquee__overlay {
  position: absolute; inset: 0;
  background: rgba(13,13,13,0.6);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.marquee__item:hover .marquee__overlay { opacity: 1; }

.marquee__caption {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  text-align: center;
  padding: 0 20px;
}

/* =====================
   ABOUT
   ===================== */
.body-text {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-muted);
  margin-bottom: 22px;
  max-width: 620px;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
}

.tools span {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 100px;
  transition: background 0.3s, color 0.3s;
}

.tools span:hover { background: var(--text); color: var(--bg); }

/* =====================
   WORKFLOW NODES — flottants sur toute la page
   ===================== */
.workflow-anchor {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 40px 200px;
}

.workflow-anchor .label { display: inline-block; margin-bottom: 12px; }

.workflow-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Graph flottant qui couvre tout le contenu — les nodes peuvent être traînés partout */
.node-graph {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.node-graph__edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.node-graph__edges path {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.5;
  opacity: 0.6;
  transition: opacity 0.3s;
}

/* Node */
.node {
  position: absolute;
  z-index: 2;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 150px;
  padding: 12px 18px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-body);
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.25s, border-color 0.25s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.node:hover {
  border-color: var(--text);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.node.is-dragging {
  cursor: grabbing;
  z-index: 10;
  border-color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.node__type {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.node--2d .node__type { color: #C8A97E; }   /* sable */
.node--3d .node__type { color: #8E9B83; }   /* sauge */
.node--comp .node__type { color: #B8A29E; } /* mauve */

.node__label {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Sockets */
.node__socket {
  position: absolute;
  top: 50%;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--text);
  background: var(--bg);
  transform: translateY(-50%);
}

.node__socket--in  { left: -7px; }
.node__socket--out { right: -7px; }

.node--2d .node__socket  { border-color: #C8A97E; }
.node--3d .node__socket  { border-color: #8E9B83; }
.node--comp .node__socket { border-color: #B8A29E; }

/* =====================
   CONTACT
   ===================== */
.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  border-bottom: 1px solid var(--text);
  padding-bottom: 3px;
  margin-bottom: 48px;
  transition: opacity 0.3s;
}

.contact-email:hover { opacity: 0.5; }

.contact-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 80px;
}

.contact-links a {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s;
}

.contact-links a:hover { color: var(--text); }

/* =====================
   FOOTER
   ===================== */
.footer {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  background: var(--bg);
}

.footer span {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* =====================
   MODAL VIDEO
   ===================== */
.modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}

.modal.is-open { pointer-events: auto; opacity: 1; }

.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(13,13,13,0.9);
  backdrop-filter: blur(20px);
  z-index: 0;
}

.modal__video {
  position: relative; z-index: 1;
  width: 100%; max-width: 1200px;
  aspect-ratio: 16/9;
  border-radius: 8px; overflow: hidden;
  background: #000;
  transform: scale(0.95);
  transition: transform 0.5s var(--ease);
}

.modal.is-open .modal__video { transform: scale(1); }

.modal__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

.modal__close {
  position: absolute; top: 24px; right: 24px; z-index: 2;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s;
}

.modal__close:hover { background: rgba(255,255,255,0.2); }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
  .header { padding: 20px 24px; }
  .header__nav { gap: 16px; }
  .header__link { font-size: 0.72rem; }
  .header__social { display: none; }
  .header__sep { display: none; }

  .speaker { bottom: 24px; right: 24px; }

  .section__inner { padding: 100px 24px 70px; }
  .section__header-block { padding: 100px 24px 32px; }

  .marquee__item { height: 30vw; min-height: 180px; }

  .footer { padding: 24px; flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  .header__role { display: none; }
  .marquee__item { height: 56vw; min-height: 180px; }
}

/* =====================
   SCROLLBAR
   ===================== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(13,13,13,0.2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text); }
