/* ═══ Thèmes : clair (par défaut) et sombre adouci ═══
   Le thème est posé sur <html data-theme="light|dark"> par un petit script en <head>
   (préférence système, puis choix mémorisé). Sombre : anthracite bleuté, jamais de noir
   franc ni de blanc pur. Les couleurs vives du site ne changent pas. */
:root {
  --bg: #fff;
  --bg-rgb: 255, 255, 255;
  --fg: #000;
  --fg-rgb: 0, 0, 0;
  --ink: #111;          /* texte fort */
  --ink-2: #333;        /* texte de récit */
  --txt: #444;          /* texte courant */
  --gris: #6b6b6b;      /* légendes, secondaire */
  --muted: #777;
  --soft: #999;         /* labels, mentions discrètes */
  --line-c: #ddd;       /* filets de boutons */
  --surface: #f2f2f2;   /* encadrés, fonds de vignettes */
  --case: #ebebeb;      /* case en attente d'image */
  --case-pre: #f4f4f4;  /* case du preloader */
  --bg-salle: #000;     /* la salle noire de Redstone */
  --cadre: rgba(0, 0, 0, 0.42);   /* filet autour des visuels des pages projet : gris moyen */
  color-scheme: light;
}

html[data-theme="dark"] {
  --cadre: rgba(233, 230, 223, 0.38);   /* gris clair sur anthracite */
  --bg: #24272d;
  --bg-rgb: 36, 39, 45;
  --fg: #e9e6df;
  --fg-rgb: 233, 230, 223;
  --ink: #e9e6df;
  --ink-2: #d4d1ca;
  --txt: #c4c1ba;
  --gris: #a3a8b0;
  --muted: #a3a8b0;
  --soft: #9298a1;
  --line-c: #3d424b;
  --surface: #2c3037;
  --case: #2c3037;
  --case-pre: #2a2d34;
  --bg-salle: #17191d;
  color-scheme: dark;
}

/* --c-ui (posée sur body.projet) : couleur du projet pour traits et filets.
   Bleu, magenta et rouge profonds manquent de contraste en trait sur l'anthracite : versions éclaircies */
html[data-theme="dark"] body.p4 { --c-ui: #6c95f0; }
html[data-theme="dark"] body.p7 { --c-ui: #e0509f; }
html[data-theme="dark"] body.p2 { --c-ui: #e8625f; }

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--fg);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: none !important;
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  background: var(--fg);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  will-change: transform;
  opacity: 0;
  transition: width 0.25s ease, height 0.25s ease, background 0.25s ease, border 0.25s ease, opacity 0.2s ease;
}

/* Visible seulement après le premier mouvement de souris (sinon un quart de
   disque reste au coin haut gauche), jamais sur écran tactile */
.cursor.vu {
  opacity: 1;
}


.cursor.hover-nav {
  width: 52px;
  height: 52px;
  background: transparent;
  border: 1.5px solid var(--fg);
}

header {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  padding: 28px 48px 40px 60px;
  pointer-events: all;
}

nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

nav a {
  text-decoration: none;
  color: var(--fg);
  font-family: monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-right: -0.08em;
  text-transform: uppercase;
  opacity: 1;
  transition: transform 0.2s ease;
  display: inline-block;
}

nav a:hover {
  transform: scale(1.12);
}

nav a.active {
  font-size: 52px;
  margin-right: calc(-0.08em - 16px);
}

/* ── Bascule clair / sombre : un symbole en haut à gauche (lune en clair, soleil en sombre) ──
   Calque propre (.theme-nav), fixe comme le header ; le menu est à droite, lui à gauche, même
   marge (trait du symbole à 48px du bord). Trait épais (2,75) et bouts ronds : même graisse
   que le menu en gras, en plus petit (24px). Zone de clic de 44px (padding 10px). */
.theme-nav {
  position: fixed;
  top: 18px;                   /* centre du symbole à la hauteur de la première ligne du menu */
  left: 38px;
  z-index: 100;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  line-height: 0;
  cursor: pointer;
  opacity: 1;
  transition: transform 0.2s ease, color 1.2s cubic-bezier(.16, 1, .3, 1);
}

.theme-toggle svg { display: block; }
.theme-toggle .icone-soleil { display: none; }
html[data-theme="dark"] .theme-toggle .icone-lune { display: none; }
html[data-theme="dark"] .theme-toggle .icone-soleil { display: block; }

.theme-toggle:hover {
  transform: scale(1.12);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: -4px;
}

/* Pendant le compteur du preloader, le menu n'est pas encore là */
body.is-loading .theme-toggle,
body.menu-en-cours .theme-toggle {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}

/* ── Composant contact (About + bloc contact des pages projet) ── */
.contact-label {
  font-family: monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
}

.contact-value {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink);
}

.contact-link {
  color: var(--ink);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.contact-link:hover {
  opacity: 0.6;
}

.link-icon {
  width: 12px;
  height: 12px;
  color: var(--soft);
  flex-shrink: 0;
}

.copy-btn {
  font-family: monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line-c);
  border-radius: 2px;
  padding: 3px 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.copy-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* ── Curseur contextuel (motion C.8, direction I.48) ──
   Sur ce qui se clique et porte data-cur : le rond grossit à 92px et porte
   un mot. Seule exception assumée aux propriétés animées : width/height du curseur. */
.cursor {
  display: grid;
  place-items: center;
}

.cursor-mot {
  font-family: 'Archivo Black', sans-serif;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bg);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.cursor.has-mot {
  width: 92px;
  height: 92px;
  background: var(--fg);
  border: 0;
  transition: width 0.35s cubic-bezier(.16, 1, .3, 1), height 0.35s cubic-bezier(.16, 1, .3, 1), background 0.25s ease;
}

.cursor.has-mot .cursor-mot {
  opacity: 1;
  transition-delay: 0.12s;
}

/* Fond noir (salle de Redstone) : header, flèche et curseur passent en blanc */
body.is-dark nav a,
body.is-dark .theme-toggle,
body.is-dark .back-nav a,
body.is-dark .back-nav .arrow-icon {
  color: #fff;
}

body.is-dark .cursor,
body.is-dark .cursor.has-mot {
  background: #fff;
}

body.is-dark .cursor.hover-nav {
  background: transparent;
  border-color: #fff;
}

body.is-dark .cursor-mot {
  color: #000;
}

nav a,
.back-nav a,
.back-nav .arrow-icon {
  transition: transform 0.2s ease, color 1.2s cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-reduced-motion: reduce) {
  .cursor.has-mot,
  .cursor-mot {
    transition: none;
  }
}

/* Zone de clic du header : 5px de plus en haut et en bas, sans changer le dessin
   (audit-ux-final 3). ABOUT et CONTACT (20px de haut, 24 avec l'interligne) passent
   à 44px de haut : 20px de plus, répartis sans chevauchement (cohérence 2026-10-05, point 15). */
header nav a {
  position: relative;
}

header nav a::after {
  content: "";
  position: absolute;
  inset: -5px -8px;
}

header nav a[data-dest="about"]::after {
  inset: -15px -10px -5px;      /* 44px, sans mordre sur la zone de CONTACT (10px d'écart entre les deux) */
}

header nav a[data-dest="contact"]::after {
  inset: -5px -10px -15px;
}

/* Overlay Contact ouvert : CONTACT prend le style actif, la page d'origine redevient normale */
nav a {
  transition: transform 0.2s ease, font-size 0.35s cubic-bezier(.16, 1, .3, 1), margin-right 0.35s cubic-bezier(.16, 1, .3, 1), color 1.2s cubic-bezier(.16, 1, .3, 1);
}
html.contact-ouvert header nav a.active:not([data-dest="contact"]) {
  font-size: 20px;
  margin-right: -0.08em;
}
html.contact-ouvert header nav a[data-dest="contact"] {
  font-size: 52px;
  margin-right: calc(-0.08em - 16px);
}
@media (prefers-reduced-motion: reduce) {
  nav a { transition: none; }
}

/* Focus clavier du header : contour noir 2px, comme les pages projet (audit-ux-final 4) */
nav a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

/* ═══ Passages entre les pages (shared.js, passage.js) ═══ */

/* Calque commun à toutes les transitions : sous le header et la flèche (100),
   qui restent en place et cliquables */
.ov {
  position: fixed;
  inset: 0;
  z-index: 95;
  overflow: hidden;
  pointer-events: none;
}

/* Le mot géant, au cadrage, en bas à gauche à 40px du bord */
.ov-mot {
  position: absolute;
  bottom: 40px;
  font-family: 'Archivo Black', sans-serif;
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Masque du mot : padding pour ne pas couper les jambages ni le bas du O */
.ov-masque {
  display: block;
  overflow: hidden;
  padding: 0.06em 0 0.16em;
  margin-bottom: -0.16em;
}

.ov-masque > span {
  display: block;
}

/* Pendant un passage, le header change de couleur vite (0,2 s) : sinon il reste
   blanc sur la page claire le temps de la transition de 1,2 s (audit-ux-v3, 3) */
html.passage-en-cours header nav a,
html.passage-en-cours .theme-toggle,
html.passage-en-cours .back-nav a {
  transition: transform 0.2s ease, color 0.2s ease !important;
}

/* Header blanc le temps d'un aplat sombre (flèche retour depuis Redstone, Dugos) */
html.passage-sombre header nav a,
html.passage-sombre .theme-toggle,
html.passage-sombre .back-nav a {
  color: #fff !important;
}

html.passage-sombre header,
html.passage-sombre .theme-nav,
html.passage-sombre .back-nav {
  mix-blend-mode: normal !important;
}

/* ═══ Contact : page blanche, une phrase, l'adresse au cadrage ═══ */
/* Spécificité relevée : project-style.css redéclare .ov { pointer-events: none }
   après shared.css, ce qui rendait le panneau sourd aux clics sur les pages projet
   (audit-ux-v3, bloquant 1) */
.ov.ov-contact {
  pointer-events: auto;
  --m: 80px;
  --taille: 60px;
}

.sr-seul {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* La phrase, en haut à gauche, à la marge */
.ov-phrase {
  position: absolute;
  top: 150px;
  left: var(--m);
}

.ov-accroche {
  margin: 0;
  max-width: calc(100vw - 2 * var(--m));
  font-family: 'Archivo Black', sans-serif;
  font-weight: 400;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 0.9;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.ov-appui {
  margin: 20px 0 0;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 20px;
  line-height: 1.5;
  color: var(--txt);
}

/* L'adresse : une ligne dès 900px, trois lignes dessous, jamais coupée ailleurs */
.ov-adresse {
  position: absolute;
  left: var(--m);
  bottom: 120px;
  isolation: isolate;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  font-family: 'Archivo Black', sans-serif;
  font-weight: 400;
  font-size: var(--taille);
  line-height: 1;
  letter-spacing: -0.025em;
  white-space: nowrap;
  user-select: text;
}

.ov-une { display: block; }
.ov-trois { display: none; }

/* Trois lignes seulement si l'écran est assez haut : en paysage mobile (< 560px de haut),
   l'adresse reste sur une ligne, sinon elle sortirait de l'écran */
@media (max-width: 899px) and (min-height: 560px) {
  .ov-une { display: none; }
  .ov-trois { display: block; }
}

/* La bande jaune : un aplat qui se déroule derrière l'adresse, pleine largeur d'écran */
.ov-adresse::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: calc(-1 * var(--m));
  width: 100vw;
  top: -0.28em;
  bottom: -0.34em;
  background: #FFD400;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.45s cubic-bezier(.7, 0, .84, 0);
}

.ov-adresse.vert::before,
.ov-adresse:focus-visible::before {
  transform: scaleX(1);
  transform-origin: 0 50%;
  transition: transform 0.65s cubic-bezier(.16, 1, .3, 1);
}

@media (hover: hover) {
  .ov-adresse:hover::before {
    transform: scaleX(1);
    transform-origin: 0 50%;
    transition: transform 0.65s cubic-bezier(.16, 1, .3, 1);
  }
}

/* La ligne d'actions, en bas */
.ov-bas {
  position: absolute;
  left: var(--m);
  right: var(--m);
  bottom: 40px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.ov-bas a,
.ov-bas button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 0;               /* 44px de zone au toucher, sans changer le dessin */
  margin: -14px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: none;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.ov-bas .link-icon {
  width: 14px;
  height: 14px;
  color: inherit;
}

.ov-bas .ov-fermer {
  margin-left: auto;
}

.ov-contact :focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

/* L'adresse : la bande jaune est son indicateur de focus */
.ov-contact .ov-adresse:focus-visible {
  outline: none;
}

/* Tablette : marges de 48px, phrase à 40px */
@media (max-width: 899px) {
  .ov-accroche { font-size: 40px; }
}

/* Mobile : adresse plus haute pour laisser deux lignes d'actions */
@media (max-width: 767px) {
  .ov-phrase { top: 170px; }
  .ov-accroche { font-size: 34px; }
  .ov-adresse { bottom: 150px; }
  .ov-bas { bottom: 36px; gap: 8px 24px; }
  .ov-bas .ov-fermer { margin-left: 0; }
}

/* Mobile haut mais court (petits téléphones) : accroche plus petite, adresse un peu plus bas */
@media (max-width: 767px) and (min-height: 560px) and (max-height: 739px) {
  .ov-phrase { top: 174px; }
  .ov-accroche { font-size: 26px; }
  .ov-appui { margin-top: 12px; font-size: 18px; }
  .ov-adresse { bottom: 130px; }
}

/* Mobile haut et confortable : l'accroche s'écarte du menu CONTACT */
@media (max-width: 767px) and (min-height: 740px) {
  .ov-phrase { top: 190px; }
}

/* Écran bas (paysage mobile) : tout tient dans la hauteur, adresse sur une ligne */
@media (max-height: 559px) {
  .ov-phrase { top: 96px; }
  .ov-accroche { font-size: 26px; }
  .ov-appui { margin-top: 8px; font-size: 18px; }
  .ov-adresse { bottom: 84px; }
  .ov-bas { bottom: 22px; }
}

/* Mouvement réduit : la bande apparaît en fondu, rien ne se déroule */
@media (prefers-reduced-motion: reduce) {
  .ov-adresse::before {
    transform: none;
    opacity: 0;
    transition: opacity 0.15s linear;
  }
  .ov-adresse.vert::before,
  .ov-adresse:focus-visible::before,
  .ov-adresse:hover::before {
    transform: none;
    opacity: 1;
    transition: opacity 0.15s linear;
  }
}

/* Mouvement réduit : la page d'arrivée apparaît en fondu */
html.passage-fondu body {
  animation: passage-fondu 0.25s linear both;
}

@keyframes passage-fondu {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Écran tactile : jamais de curseur rond. En fin de fichier et en !important,
   pour qu'aucune règle d'affichage du curseur ne l'écrase (audit-ux-final 1) */
@media (hover: none) {
  .cursor {
    display: none !important;
  }
}
