/* ===== Base ===== */
:root {
  --black: #000;
  --white: #fff;
  --blue: #0000ff;
  --green: #00ff00;   /* couleur des survols */
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--black); color: var(--white); font-family: var(--font); }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ===== Nav en pilules (Work / Contact) ===== */
.pills {
  position: fixed; top: 44px; right: 32px; z-index: 50;
  display: flex; gap: 4px;
}
.pills a {
  font-size: 11px; letter-spacing: .02em; text-transform: uppercase;
  padding: 3px 12px; border: 1px solid var(--white); border-radius: 999px;
  transition: background .2s, border-color .2s;
}
.pills a:hover { background: var(--white); border-color: var(--white); color: var(--black); }
.pills a.active, .pills a.active:hover { background: var(--blue); border-color: var(--blue); color: var(--white); }
/* Menu version téléphone : centré et plus grand */
@media (max-width: 700px) {
  .pills { top: 22px; left: 0; right: 0; justify-content: center; gap: 8px; }
  .pills a { font-size: 18px; padding: 3px 13px; line-height: 1.2; }   /* boutons serrés, texte plus gros */
}

/* ===== HOME ===== */
.home { height: 100vh; height: 100svh; overflow: hidden; position: relative; }
/* Vidéo fixée sur tout l'écran, y compris sous les barres de Safari (iPhone) :
   100lvh = hauteur maximale de l'écran, barres comprises → plus de bandes noires */
.home video, .home .poster {
  position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh;
  object-fit: cover; z-index: 0;
}
.home-name {
  position: absolute; left: max(0.4vw, env(safe-area-inset-left)); bottom: 1.6vw; z-index: 2;
}
.home-name-inner { transform-origin: center; will-change: transform; }
.home-name h1 {
  font-weight: 400; font-size: 10.6vw; line-height: .82;
  letter-spacing: -0.08em; margin-left: -0.05em;
}
.home-name p {
  font-weight: 700; font-size: 2.95vw; letter-spacing: -0.04em;
  line-height: 1; margin-top: -0.5vw; padding-left: 0.3vw;
}
.home-btns {
  position: absolute; right: max(5vw, env(safe-area-inset-right)); bottom: max(2.6vw, env(safe-area-inset-bottom)); z-index: 2;
  display: flex; flex-direction: column; gap: 0.6vw;
}
.home-btns a {
  background: var(--blue); color: var(--white);
  font-size: 2.05vw; text-align: center; min-width: 10.5vw;   /* taille des boutons WORK / CONTACT */
  padding: 0.45vw 0.6vw; line-height: 1.15; transition: background .2s, color .2s;
}
.home-btns a:hover { background: var(--green); color: var(--black); }

/* Accueil version téléphone : boutons empilés au-dessus du nom, "Video Editor" calé à droite */
@media (max-width: 700px) {
  .home { display: flex; flex-direction: column; justify-content: flex-end; padding: 0 4vw 13svh; }
  .home-btns { position: relative; order: -1; right: auto; bottom: auto; gap: 2.2vw; margin: 0 0 2vw 0.5vw; align-items: flex-start; }
  .home-btns a { font-size: 8.4vw; width: 42vw; padding: 1vw 0; line-height: 1.1; }   /* texte qui remplit le bouton */
  .home-name { position: relative; left: auto; bottom: auto; }
  .home-name-inner { display: inline-block; }
  .home-name h1 { font-size: 22vw; line-height: .84; }
  .home-name p { font-size: 7.4vw; text-align: right; margin-top: 0; padding: 0; }
}

/* iPhone (Safari iOS 26) : la page défile très légèrement pour que Safari affiche la vidéo
   sous la barre d'état et sous la barre d'adresse (au lieu d'une bande unie) */
@media (max-width: 700px) {
  html { overflow-y: scroll; background: #000; }
  .home { height: auto; min-height: 100svh; margin-top: 70px; overflow: visible; }
  .home video {
    position: absolute; top: -70px; left: 0; width: 100%;
    height: calc(100vh + 70px + 160px); height: calc(100lvh + 70px + 160px);   /* déborde aussi sous la barre d'adresse */
  }
}

/* ===== WORK ===== */
.work { padding: 120px 6% 80px; }
.grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  max-width: 1340px; margin: 0 auto;
}
.tile {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  cursor: pointer; background: #111; border: 0; padding: 0;
}
/* Survol : couleurs inversées (effet "Invert" de Wix), en 0,6 s */
.tile img { width: 100%; height: 100%; object-fit: cover; transition: filter .6s ease; }
.tile:hover img, .tile:focus-visible img { filter: invert(1); }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .work { padding: 90px 16px 40px; }
  .grid { grid-template-columns: 1fr; }
  }

/* ===== Lightbox ===== */
.lb {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(0,0,0,.88); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 60px 5vw;
}
.lb.open { display: flex; }
.lb-inner { display: flex; gap: 32px; width: 100%; max-width: 1400px; align-items: flex-start; }
.lb-video { flex: 1 1 auto; aspect-ratio: 16 / 9; background: #000; }
.lb-video iframe, .lb-video video, .lb-video img { width: 100%; height: 100%; border: 0; display: block; object-fit: contain; background: #000; }
.grid-msg { grid-column: 1 / -1; text-align: center; color: #888; font-size: 14px; padding: 60px 0; }
.lb-info { flex: 0 0 300px; max-height: 70vh; overflow-y: auto; }
.lb-info h2 { font-size: 28px; font-weight: 400; line-height: 1.15; margin-bottom: 14px; }
.lb-info p { font-size: 13px; line-height: 1.45; white-space: pre-line; color: #ddd; }
.lb-info p a:hover { text-decoration: underline; }
.lb button {
  position: absolute; background: none; border: 0; color: var(--white);
  cursor: pointer; font: inherit; line-height: 1; padding: 10px;
}
.lb .lb-close { top: 18px; right: 22px; font-size: 34px; font-weight: 200; }
.lb .lb-prev, .lb .lb-next { top: 50%; transform: translateY(-50%); font-size: 40px; font-weight: 200; }
.lb .lb-prev { left: 1vw; } .lb .lb-next { right: 1vw; }
.lb button:hover { opacity: .6; }
@media (max-width: 900px) {
  .lb { padding: 60px 16px; align-items: flex-start; overflow-y: auto; }
  .lb-inner { flex-direction: column; gap: 18px; }
  .lb-video { width: 100%; }
  .lb-info { flex: none; max-height: none; }
  .lb .lb-prev, .lb .lb-next { top: auto; bottom: 10px; transform: none; }
}

/* ===== CONTACT ===== */
.contact { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; padding: 150px 0.5% 40px 0.5%; }
.contact h1 {
  font-size: 10.2vw; font-weight: 700; line-height: .8; letter-spacing: -0.09em;
}
.contact .sub {
  display: block; align-self: flex-start; width: 46vw; white-space: nowrap;   /* largeur du cadre Wix : donne l'effet penché */
  font-size: max(15px, 1.72vw); letter-spacing: -0.1em; margin: 4px 0 0 0.9vw;
  animation: fold 1.6s linear infinite;   /* effet "Fold" de Wix, en boucle */
}
@keyframes fold {
  0%   { transform: translateY(-50%) perspective(800px) rotateX(0deg)   translateY(50%); animation-timing-function: cubic-bezier(.215,.61,.355,1); }
  25%  { transform: translateY(-50%) perspective(800px) rotateX(40deg)  translateY(50%); animation-timing-function: cubic-bezier(.645,.045,.355,1); }
  75%  { transform: translateY(-50%) perspective(800px) rotateX(-40deg) translateY(50%); animation-timing-function: cubic-bezier(.55,.055,.675,.19); }
  100% { transform: translateY(-50%) perspective(800px) rotateX(0deg)   translateY(50%); }
}
@media (prefers-reduced-motion: reduce) { .contact .sub { animation: none; } }
.contact-row {
  display: flex; justify-content: space-between; gap: 30px;
  margin-top: 70px; padding: 0 0.6%; font-size: max(17px, 1.35vw); letter-spacing: -0.03em;   /* taille des textes e-mail / phone / socials */
}
.contact-row dl { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 2px 8px; align-content: start; line-height: 1.25; }
.contact-row dt { text-decoration: underline; }
/* socials : collé à droite, texte aligné à droite ; IG sur la ligne de l'e-mail, vimeo sur celle du téléphone */
.contact-row .socials { position: relative; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; line-height: 1.25; }
.contact-row .socials h3 { position: absolute; right: 0; bottom: 100%; margin-bottom: 6px; font-weight: 400; text-decoration: underline; font-size: inherit; line-height: 1.25; }
.contact-row a { transition: color .15s; }
.contact-row a:hover { color: var(--green); }
.contact-name { margin-top: auto; padding-top: 60px; padding-left: 0.6%; align-self: flex-start; }
.contact-name h2 { font-size: 5.4vw; font-weight: 400; line-height: .85; letter-spacing: -0.08em; }
/* "Video Editor" : taille ajustée automatiquement (contact.html) pour tenir entre le "g" et la fin de "Mangeard" */
.contact-name p { font-size: 2.2vw; letter-spacing: -0.04em; line-height: 1; text-align: right; margin-top: -0.15em; white-space: nowrap; }
@media (max-width: 700px) {
  .contact { padding: 110px 16px 30px; }
  .contact h1 { font-size: 18vw; }
  .contact .sub { font-size: 4.2vw; width: 92vw; }
  .contact-row { flex-direction: column; margin-top: 50px; }
  .contact-row .socials { text-align: left; align-items: flex-start; }
  .contact-row .socials h3 { position: static; margin-bottom: 6px; }
  .contact-name { margin-top: 90px; padding-top: 0; }   /* nom remonté sous vimeo */
  .contact-name h2 { font-size: 13vw; }
  .contact-name p { font-size: 4.8vw; }
}

/* ===== Lien "Video Editor" (Contact) ===== */
.contact-name p a { transition: color .15s; }
.contact-name p a:hover { color: var(--green); }

/* ===== EDITING TOOLBOX ===== */
/* GO BACK : taille fixe (ne rétrécit jamais), couleurs des boutons de l'accueil */
.btn-back {
  display: inline-block; background: var(--blue); color: var(--white);
  font-size: 32px; text-align: center; min-width: 163px;
  padding: 7px 9px; line-height: 1.15; white-space: nowrap;
  transition: background .2s, color .2s;
}
.btn-back:hover { background: var(--green); color: var(--black); }
.toolbox { padding: 0 0 60px; }
/* GO BACK posé sur la ligne de base du titre (bas des //) */
.toolbox-head h1 { display: inline; }
.toolbox-head .btn-back { overflow: hidden; vertical-align: baseline; margin-left: 24px; }
/* Plus la place à côté du titre → GO BACK passe au-dessus, centré (classe ajoutée par le script de la page) */
.toolbox-head.stacked { display: flex; flex-direction: column; padding-top: 16px; }
.toolbox-head.stacked .btn-back { order: -1; align-self: center; margin: 0 0 22px; }
.toolbox-head.stacked h1 { display: block; }
.toolbox h1 {
  font-weight: 300; font-size: 100px; letter-spacing: -0.08em; line-height: 1.05;
}
.toolbox ul { list-style: none; margin-top: 70px; display: flex; flex-direction: column; gap: 18px; }
/* Chaque ligne reste sur une seule ligne : la taille se réduit si besoin (script dans editing-toolbox.html) */
.toolbox ul { font-size: 24px; }
.toolbox li { font-size: 1em; letter-spacing: -0.06em; display: flex; align-items: baseline; gap: 0.58em; flex-wrap: nowrap; white-space: nowrap; }
.toolbox li a:hover { text-decoration: underline; }
.toolbox li .dl { font-size: 0.667em; text-decoration: underline; }
.toolbox li .dl:hover { opacity: .6; }
@media (max-width: 700px) {
  .toolbox { padding: 16px 16px 60px; }
  .toolbox-head.stacked { padding-top: 0; }
  .toolbox h1 { font-size: 15vw; }
  .toolbox ul { margin-top: 40px; }
  .toolbox ul { font-size: 20px; }
  /* Téléphone : "// download offline version" passe sous "_Aspect Ratio…", lignes bien espacées */
  .toolbox ul { gap: 1.3em; }
  .toolbox li { flex-wrap: wrap; row-gap: 0.45em; }
  .toolbox li .dl { flex-basis: 100%; }
}

/* Fenêtre « SUKR Scripts » : explorateur de fichiers (mise en page inspirée de Blender,
   style des panneaux de l'outil Aspect Ratio : gris foncés, bords fins, pas de vert) */
.pop[hidden] { display: none; }
.pop { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.8); display: flex; align-items: center; justify-content: center; padding: 16px; }
.fb {
  --panel: #0d0d0d; --line: #262626; --field: #1a1a1a; --field-line: #2c2c2c; --muted: #a3a3a3;
  --row-alt: #181818; --hover: #222;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  width: min(940px, 100%); height: min(580px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 3px;
  display: grid; grid-template-columns: 210px 1fr; grid-template-rows: auto 1fr auto;
  font-size: 14px; overflow: hidden; -webkit-font-smoothing: antialiased;
}
.fb button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.fb svg { width: 16px; height: 16px; flex: none; }
/* Barre du haut */
.fb-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.fb-nav { display: flex; gap: 6px; flex: none; }
.fb-nav button { width: 34px; height: 32px; border: 1px solid #3a3a3a; border-radius: 3px; font-size: 16px; line-height: 1; }
.fb-nav button:hover:not(:disabled) { border-color: var(--white); }
.fb-nav button:disabled { color: #444; border-color: var(--line); cursor: default; }
.fb-path { flex: 1; min-width: 0; height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: var(--field); border: 1px solid var(--field-line); border-radius: 3px; white-space: nowrap; overflow: hidden; color: var(--muted); }
.fb-path button:hover, .fb-path button:last-child { color: var(--white); }
.fb-sep { color: #555; }
.fb-search { width: 180px; height: 32px; padding: 0 12px; background: var(--field); border: 1px solid var(--field-line); border-radius: 3px; color: var(--white); font: inherit; outline: none; -webkit-appearance: none; }
.fb-search::placeholder { color: #666; }
.fb-search:focus { border-color: #666; }
.fb-close { font-size: 28px !important; font-weight: 200; line-height: 1; padding: 0 4px; flex: none; color: var(--muted) !important; }
.fb-close:hover { color: var(--white) !important; }
/* Barre latérale */
.fb-side { border-right: 1px solid var(--line); padding: 12px 8px; overflow-y: auto; }
.fb-side h3 { font-weight: 400; font-size: 11px; color: var(--muted); margin: 0 6px 8px; }
.fb-side ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.fb-side button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 8px; text-align: left; border-radius: 3px; }
.fb-side button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-side button:hover { background: var(--hover); }
.fb-side button.on { background: var(--blue); color: var(--white); }
.fb-side button.child { padding-left: 14px; }
.fb-tree { font-style: normal; color: #666; margin-right: -2px; }
.fb-side button.on .fb-tree { color: inherit; }
/* Liste */
.fb-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: #000; }
.fb-row { display: grid; grid-template-columns: 1fr 80px 90px; align-items: center; gap: 10px; width: 100%; padding: 0 14px; text-align: left; }
.fb-row > span { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-row > span:nth-child(2), .fb-row > span:nth-child(3) { color: var(--muted); justify-content: flex-end; }
.fb-row em { font-style: normal; color: var(--muted); }
.fb-row em.fb-where { margin-left: 4px; font-size: 11px; }
.fb-row em.fb-where::before { content: "— "; }
.fb-head { height: 32px; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--panel); flex: none; }
#fb-list { list-style: none; overflow-y: auto; flex: 1; user-select: none; -webkit-user-select: none; }
#fb-list li:nth-child(even) .fb-row { background: var(--row-alt); }
#fb-list .fb-row { height: 36px; }
#fb-list li .fb-row:hover { background: var(--hover); }
#fb-list li .fb-row.sel { background: var(--blue); }
#fb-list .fb-row.sel, #fb-list .fb-row.sel span, #fb-list .fb-row.sel em { color: var(--white); }
.fb-empty { padding: 16px 14px; color: var(--muted); }
.fb-marquee { position: absolute; z-index: 2; pointer-events: none; border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.07); border-radius: 2px; }
body.fb-dragging, body.fb-dragging * { cursor: default !important; }
/* Barre du bas */
.fb-bottom { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.fb-info { flex: 1; min-width: 0; height: 32px; display: flex; align-items: center; padding: 0 12px; background: var(--field); border: 1px solid var(--field-line); border-radius: 3px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-btn { height: 32px; padding: 0 18px; border: 1px solid #3a3a3a !important; border-radius: 3px; flex: none; font-weight: 500 !important; }
.fb-btn:hover { border-color: var(--white) !important; }
.fb-primary { background: var(--white) !important; border-color: var(--white) !important; color: var(--black) !important; font-weight: 600 !important; }
.fb-primary:hover:not(:disabled) { background: #ddd !important; border-color: #ddd !important; }
.fb-primary:disabled { opacity: .3; cursor: default; }
/* Téléphone : plein écran, sans barre latérale ni colonne taille */
@media (max-width: 700px) {
  .pop { padding: 0; }
  .fb { width: 100%; height: 100%; height: 100svh; border: 0; border-radius: 0; grid-template-columns: 1fr; font-size: 15px; }
  .fb-side { display: none; }
  .fb-top { flex-wrap: wrap; padding-top: max(12px, env(safe-area-inset-top)); }
  .fb-path { order: 3; flex-basis: 100%; }
  .fb-search { flex: 1; width: auto; min-width: 0; }
  .fb-row { grid-template-columns: 1fr 72px; }
  .fb-row > span:nth-child(3) { display: none; }
  #fb-list .fb-row { height: 46px; }
  .fb-bottom { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .fb-info { display: none; }
  .fb-btn { flex: 1; height: 44px; }
}

/* ===== PAGE 404 ===== */
.e404 { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.e404-title { display: inline-block; }
.e404 h1 { font-size: 116px; font-weight: 700; letter-spacing: -0.08em; line-height: .8; }
.e404 p { font-size: 64px; font-weight: 300; font-style: italic; letter-spacing: -0.07em; line-height: 1; margin-top: 4px; }
.e404-btns { display: inline-flex; flex-direction: column; gap: 17px; margin-top: 34px; }
.e404-btns a {
  background: var(--blue); color: var(--white); font-size: 22px; letter-spacing: -0.04em;
  text-align: center; padding: 2px 10px; line-height: 1.2; transition: background .2s, color .2s;
}
.e404-btns a:hover { background: var(--green); color: var(--black); }

/* ===== SURPRISE (Snake) ===== */
.snake { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 30px 16px; gap: 22px; }
.snake .play {
  background: none; color: var(--white); border: 1px solid var(--white); border-radius: 6px;
  font: 13px var(--font); padding: 10px 26px; cursor: pointer; text-transform: uppercase;
}
.snake .play:hover { background: var(--white); color: var(--black); }
.snake canvas { border: 1px solid var(--white); width: min(360px, 90vw); aspect-ratio: 1; image-rendering: pixelated; }
.snake .score { font-size: 13px; letter-spacing: .02em; min-height: 1em; margin-top: -10px; }
.pad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 64px); gap: 8px; }
.pad button {
  background: none; color: var(--white); border: 1px solid var(--white); border-radius: 10px;
  font-size: 28px; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.pad button:active { background: var(--white); color: var(--black); }
.pad .up { grid-column: 2; grid-row: 1; }
.pad .left { grid-column: 1; grid-row: 2; }
.pad .down { grid-column: 2; grid-row: 2; }
.pad .right { grid-column: 3; grid-row: 2; }
