/* AI Camouflage — studio site */

/* Polices auto-hébergées (IBM Plex, subset latin) — aucun appel à Google Fonts. */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/ibm-plex-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('fonts/ibm-plex-sans-700.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/ibm-plex-mono-400.woff2') format('woff2');
}

/* Le motif hachuré (.brand-mark, .hatch) est l'identité de la marque : camouflage /
   pixellisation assumés. L'exception détecteur vit dans index.html. Voir DESIGN.md. */

/* ============================================================
   Design tokens — IBM Plex Sans (titres + texte) / IBM Plex Mono
   (données), palette monochrome teintée froide. Voir DESIGN.md.
   ============================================================ */

:root {
  /* Familles */
  --fallback-sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-display: 'IBM Plex Sans', var(--fallback-sans);
  --font-text: 'IBM Plex Sans', var(--fallback-sans);

  /* Rampe de neutres, teintée froide (slate) — corrige les gris purs.
     Luminance calée sur l'ancienne rampe : pas de régression de contraste. */
  --bg:       #ffffff;
  --ink:      hsl(222 13% 9%);    /* titres, texte principal   (ex #111) */
  --text:     hsl(222 11% 21%);   /* hero-lead                 (ex #333) */
  --text-2:   hsl(222 10% 27%);   /* données compare           (ex #444) */
  --muted:    hsl(222  9% 40%);   /* survol de lien            (ex #666) */
  --muted-2:  hsl(222  8% 47%);   /* nav, contact              (ex #777) */
  --faint:    hsl(222 12% 39%);   /* badges, breadcrumb, colophon, placeholder — AA sur blanc + fill */
  --faint-2:  hsl(222 11% 44%);   /* source vidéo — AA sur blanc */
  --faint-3:  hsl(222 11% 43%);   /* label de nav — AA sur blanc */
  --line-2:   hsl(222 13% 80%);   /* cercle accent             (ex #ccc) */
  --hair:     hsl(222 14% 84%);   /* pointillé placeholder     (ex #d6d6d6) */
  --line:     hsl(222 16% 91%);   /* bordures sidebar          (ex #e8e8e8) */
  --fill:     hsl(222 24% 97%);   /* fond placeholder          (ex #f5f5f5) */

  /* Accent : en palette "mono" il vaut l'encre → tout reste monochrome. */
  --accent: var(--ink);

  /* Rayons */
  --r-xs: 3px;
  --r-sm: 4px;
  --r-md: 12px;

  /* Rythme */
  --pad-x: 48px;
}

/* ============================================================
   Base
   ============================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
}

a { color: var(--ink); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--muted); }
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}

.layout {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
  width: 232px;
  flex: none;
  border-right: 1px solid var(--line);
  padding: 30px 28px 26px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }

.brand-mark {
  display: inline-block;
  width: 13px;
  height: 13px;
  background:
    repeating-linear-gradient(43deg, var(--ink) 0 2.5px, transparent 2.5px 5.5px),
    repeating-linear-gradient(47deg, var(--ink) 0 2.5px, transparent 2.5px 5.5px);
}

.nav-section { margin-top: 34px; }
.nav-section:first-of-type { margin-top: 30px; }

/* Libellé de section : simple panneau indicateur, très en retrait. */
.nav-label {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--faint-3);
  margin-bottom: 14px;
}

/* Feuilles de navigation (Présentation + projets) : le contenu, plus présent que les
   libellés. Chaque item porte le petit motif hachuré de la marque comme repère. */
.nav-link,
.proj-name {
  padding-left: 17px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
}
.nav-link { display: block; padding-top: 4px; padding-bottom: 4px; }
/* Marqueur inline (solidaire du texte) : aligné quel que soit le padding, indentation
   conservée si le nom passe à la ligne. */
.nav-link::before,
.proj-name::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: -17px;
  margin-right: 10px;
  vertical-align: 0.08em;
  background: repeating-linear-gradient(45deg, var(--line-2) 0 1.5px, transparent 1.5px 3.5px);
}
.nav-link:hover { color: var(--ink); text-decoration: underline; }
.nav-link:hover::before,
.nav-link.active::before {
  background: repeating-linear-gradient(45deg, var(--ink) 0 1.5px, transparent 1.5px 3.5px);
}
.nav-link.active { color: var(--ink); }

/* Projet à venir : nom + micro-statut discret (sans gélule). */
.proj-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 8px;
  padding: 5px 0;
}
.proj-tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 64px;
}

.contact-link { font-size: 13.5px; color: var(--muted-2); }
.contact-link:hover { color: var(--ink); text-decoration: underline; }

/* Drapeaux sous la marque : la langue inactive reste un peu en retrait (camouflage). */
.lang-switch {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.lang-switch button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  filter: grayscale(0.55);
  opacity: 0.6;
  transition: opacity 0.15s ease, filter 0.15s ease;
}
.lang-switch button:hover { opacity: 0.9; filter: grayscale(0); }
.lang-switch button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}
.lang-switch button.active {
  filter: none;
  opacity: 1;
}

/* ---------- Content ---------- */

.content { flex: 1; min-width: 0; }

/* Accueil / Présentation */

.page[data-page="accueil"] { padding: 0 0 80px; }

.hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 80px;
  align-items: center;
  padding: 72px var(--pad-x) 80px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 5vw, 80px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
}

.hero-lead {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
  max-width: 560px;
  margin: 32px 0 0;
}

/* Prose en colonnes de lecture : justifiée avec césure automatique (langue via <html lang>). */
.hero-lead,
.section p,
.value p {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.brand-tag {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  padding: 1px 9px 3px;
  border-radius: var(--r-xs);
  white-space: nowrap;
}

.hero > * { min-width: 0; }

.hero-videos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 22px;
  align-items: start;
}

.video-tile { margin: 0; min-width: 0; }

.video-tile .frame { position: relative; }

.video-tile video {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border-radius: var(--r-md);
}

/* Collage : formes, rotations, placement */

.t-facial { grid-column: 1; grid-row: 1; transform: translateX(-18px); }
.t-facial video { aspect-ratio: 1 / 1; border-radius: 50%; }
.t-facial figcaption { justify-content: center; text-align: center; }

.t-b {
  grid-column: 2;
  grid-row: 1;
  margin-top: 64px;
  transform: rotate(2deg);
}

.t-c {
  grid-column: 1;
  grid-row: 2;
  margin: 2px 0 0 36px;
  transform: rotate(-2deg);
}
.t-c video { aspect-ratio: 4 / 3; }

/* Accents des cadres */

.ring .frame::before {
  content: '';
  position: absolute;
  inset: -9px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  pointer-events: none;
}

.bracket .frame::after {
  content: '';
  position: absolute;
  top: -13px;
  right: -13px;
  width: 48px;
  height: 48px;
  border-top: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
  border-top-right-radius: var(--r-sm);
}

.hatch .frame::before {
  content: '';
  position: absolute;
  bottom: -13px;
  left: -13px;
  width: 56px;
  height: 56px;
  background: repeating-linear-gradient(45deg, var(--ink) 0 2px, transparent 2px 6.5px);
  z-index: -1;
}

.video-tile figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  margin-top: 12px;
}

.video-title {
  font-weight: 700;
  font-size: 13px;
}

.video-source {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint-2);
  white-space: nowrap;
}
.video-source:hover { color: var(--ink); text-decoration: underline; }

.section { padding: 84px var(--pad-x) 0; }

.section h2 {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}

.section p {
  font-size: 15px;
  line-height: 1.85;
  max-width: 720px;
  margin: 0 0 18px;
}
.section p:last-child { margin-bottom: 0; }

/* Méthode : texte à gauche, figure de l'exemple adversarial à droite (image nue, sans cadre). */
.section.method h2 { margin-bottom: 14px; }
.section.method .method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.method-text p { max-width: none; }
.method-media { margin: 0; }
.method-media img {
  display: block;
  width: 100%;
  height: auto;
}
/* Aligné sur le début réel du dessin (l'image a ~10,9 % de blanc à gauche). */
.method-credit { margin-top: 12px; margin-left: 10.9%; }
.method-source {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint-2);
}
.method-source:hover { color: var(--ink); text-decoration: underline; }

.values-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px 56px;
}

.value {
  border-top: 1px solid var(--accent);
  padding-top: 18px;
}

.value h3 {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

.value p {
  font-size: 14.5px;
  line-height: 1.8;
  margin: 0;
}

.text-link { text-decoration: underline; }
.text-link:hover { color: var(--accent); }

/* Project pages */

.project { padding: 64px var(--pad-x) 72px; }

.breadcrumb { font-size: 12px; color: var(--faint); }
.breadcrumb a { color: var(--faint); }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 20px;
  max-width: 920px;
  gap: 16px;
  flex-wrap: wrap;
}

.project-header h1 {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  margin: 0;
}

.project-badge {
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: var(--faint);
  white-space: nowrap;
}

.media {
  margin: 30px 0 0;
  aspect-ratio: 16 / 9;
  max-width: 920px;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--r-md);
}

.media-placeholder {
  width: 100%;
  height: 100%;
  background: var(--fill);
  border: 1px dashed var(--hair);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  color: var(--faint);
  text-align: center;
  padding: 16px;
}

.project-body {
  font-size: 15px;
  line-height: 1.8;
  max-width: 640px;
  margin: 32px 0 0;
}

.project-compare {
  margin-top: 30px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 2.1;
  color: var(--text-2);
  white-space: pre;
}

/* ---------- Motion ---------- */
/* Fondu à l'apparition d'une page (le routeur bascule l'attribut hidden). */

@media (prefers-reduced-motion: no-preference) {
  .page:not([hidden]) {
    animation: page-in 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
  .hero { gap: 48px; }
  .hero-title { font-size: clamp(34px, 4.5vw, 60px); }
}

/* Largeur intermédiaire : le collage manque d'air à côté du texte → hero
   en une colonne bien avant que la sidebar ne passe en tête (760px). */
@media (min-width: 761px) and (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 44px; }
  .section.method .method-grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 760px) {
  :root { --pad-x: 24px; }

  .layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 24px 24px 20px;
  }

  .sidebar-footer { padding-top: 32px; }

  /* Cibles tactiles plus confortables au pouce */
  .nav-link { padding: 5px 0 5px 17px; }
  .contact-link { display: inline-block; padding: 6px 0; }
  .lang-switch button { padding: 6px 5px; }

  .hero { grid-template-columns: 1fr; gap: 48px; padding: 56px 24px 0; }
  .hero-videos { grid-template-columns: 1fr; }
  .t-facial, .t-b, .t-c { grid-column: 1; grid-row: auto; }
  .t-facial { transform: none; }
  .t-b { margin-top: 12px; }
  .t-c { margin-left: 0; }
  .section { padding: 56px 24px 0; }
  .section.method .method-grid { grid-template-columns: 1fr; gap: 28px; }
  .values-grid { grid-template-columns: 1fr; gap: 32px; }
  .project { padding: 48px 24px 56px; }

  .project-header h1 { font-size: 30px; }
}
