/* =========================================================================
   BlindSp0t — feuille de style (reproduction fidèle du site Cargo d'origine)
   Tokens repris de l'ancien thème : fond noir, IBM Plex Mono, Space Mono,
   base 62.5% (1rem = 10px), grille de vignettes, typographie monospace.
   ========================================================================= */

:root {
  --bg: #000000;
  --fg: rgba(255, 255, 255, 1);
  --fg-dim: rgba(255, 255, 255, 0.6);
  --fg-faint: rgba(255, 255, 255, 0.4);
  --rule: rgba(127, 127, 127, 0.2);
  --pad: 4.9rem;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --mono-alt: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

/* Base typographique reprise exactement du site d'origine (Cargo réglait
   font-size: 90.63% en inline ≈ 14.5px). Tous les rem en découlent. */
html { font-size: 90.63%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--fg); text-decoration: none; }
a:active { opacity: 0.7; }
img { max-width: 100%; border: 0; display: block; }

h1 {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 2.4rem;
  line-height: 1.1;
  margin: 0;
  color: var(--fg);
}
h2 { font-family: var(--mono); font-weight: 400; font-size: 3rem; line-height: 1.2; margin: 0; }

hr { background: var(--rule); border: 0; height: 1px; display: block; margin: 1.6rem 0; }

/* ----------------------------------------------------------------- Nav */
/* Nav dans le flux du document (comme l'original) : sur l'accueil elle se
   trouve juste après le hero plein écran, donc découverte au scroll ; en mode
   sticky elle se fige ensuite en haut et reste accessible. Fond sombre
   translucide pour rester lisible par-dessus les images. */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.6rem 6%;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 1.1rem;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
}
.topnav a { color: var(--fg); }
.nav-links { display: flex; gap: 1.2rem; align-items: center; }
.nav-links a:hover, .nav-links a.active { text-decoration: underline; text-underline-offset: 3px; }
.nav-logo { display: flex; align-items: center; flex: 0 0 auto; }
.nav-logo img { height: 1.5rem; width: auto; display: block; }

/* --------------------------------------------------------------- Hero */
/* Logo animé (système de particules p5.js) chargé en iframe plein écran.
   L'image logo-fallback reste dessous (placeholder tant que l'iframe charge,
   et repli si le JS/iframe échoue). */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  background: #000;
  overflow: hidden;
}
.hero .logo-anim {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.hero .logo-fallback {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(60vw, 720px);
  height: auto;
}

/* ------------------------------------------------- Indice de scroll */
.scroll-hint {
  position: fixed;
  right: 3rem;
  bottom: 2.6rem;
  z-index: 60;
  width: 2.2rem;
  height: 2.2rem;
  color: #fff;
  opacity: 0.85;
  transition: opacity 0.4s ease;
  animation: scroll-bob 1.8s ease-in-out infinite;
}
.scroll-hint svg { width: 100%; height: 100%; display: block; }
.scroll-hint:hover { opacity: 1; }
.scroll-hint.hidden { opacity: 0; pointer-events: none; }
@keyframes scroll-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(0.5rem); }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-hint { animation: none; }
}
@media (max-width: 600px) {
  .scroll-hint { right: 1.6rem; bottom: 1.6rem; }
}

/* --------------------------------------------------------- Thumbnails */
.thumbs-wrap { width: 88%; margin: 0 auto; padding: var(--pad) 0 6rem; }
.thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem 1.1rem;
  align-items: start;
}
.thumb { display: block; }
.thumb a.cover { display: block; }
/* Vignettes recadrées en 16:9 pour une grille régulière */
.thumb .cover-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #0a0a0a;
}
.thumb .title {
  margin-top: 2rem;
  margin-bottom: 0.3rem;
  font-family: var(--mono-alt);
  font-size: 1.0rem;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--fg);
}
.thumb .tags {
  font-family: var(--mono-alt);
  font-size: 0.7rem;
  line-height: 1.2;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.thumb .tags span::after { content: ", "; }
.thumb .tags span:last-child::after { content: ""; }

/* ------------------------------------------------------- Project page */
.page { width: 80%; max-width: 1100px; margin: 0 auto; padding: var(--pad) 0 8rem; }
.page h1.project-title { margin-bottom: 2rem; }
.block { margin: 2rem 0; }
.block.text {
  max-width: 65rem;
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: 0.02rem;
}
.block.text a { border-bottom: 1px solid var(--fg-faint); }
.block.image img { width: 100%; height: auto; margin-bottom: 0.5em; }

/* Bloc 2 colonnes FR/EN des pages projet — grille 5 / 2 (gap) / 5 comme l'original */
.block.columns {
  display: grid;
  grid-template-columns: 5fr 2fr 5fr;
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: 0.02rem;
}
.block.columns .col:nth-child(1) { grid-column: 1; }
.block.columns .col:nth-child(2) { grid-column: 3; }
.block.columns .col a { border-bottom: 1px solid var(--fg-faint); }

/* Vidéo (embed responsive 16:9) */
.block.video .frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}
.block.video iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
}

/* --------------------------------------------------------- Slideshow */
.gallery { position: relative; width: 100%; user-select: none; }
/* Conteneur à hauteur constante (aspect-ratio défini en inline sur .slides
   selon la 1re image) : les diapos ne changent plus la hauteur de la page. */
.gallery .slides { position: relative; width: 100%; overflow: hidden; }
.gallery .slide {
  position: absolute;
  inset: 0;
  display: none;
}
.gallery .slide.active { display: block; }
.gallery .slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery .cap {
  margin-top: 1.2rem;
  font-size: 1.1rem;
  color: var(--fg-dim);
  font-family: var(--mono);
}
.gallery .arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25); color: #fff; font-size: 20px; line-height: 1;
  z-index: 3; border: 0;
}
.gallery .arrow:hover { background: rgba(0,0,0,0.5); }
.gallery .arrow.left { left: 10px; }
.gallery .arrow.right { right: 10px; }
.gallery .dots { display: flex; gap: 6px; justify-content: center; margin-top: 1rem; }
.gallery .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-faint); cursor: pointer; }
.gallery .dot.active { background: var(--fg); }

/* Galerie non-diaporama (freeform / columns) → grille responsive */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.gallery-grid.cols-1 { grid-template-columns: 1fr; }
.gallery-grid img { width: 100%; height: auto; }
@media (max-width: 600px) { .gallery-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ Content */
.prose { max-width: 65rem; }
.prose p { margin: 0 0 1.3em; }
.prose ul { margin: 0 0 1.3em; padding-left: 1.4em; }
.prose a { border-bottom: 1px solid var(--fg-faint); }
.lang-sep { height: 3rem; }

/* About : 2 colonnes FR/EN décalées — grille 3 (offset) / 4 / 1 (gap) / 4 */
.about-cols {
  display: grid;
  grid-template-columns: 3fr 4fr 1fr 4fr;
  margin-top: 2rem;
}
.about-cols .col:nth-child(1) { grid-column: 2; }
.about-cols .col:nth-child(2) { grid-column: 4; }
.about-cols .col p { margin: 0 0 1.3em; }
.about-cols .col ul { margin: 0 0 1.3em; padding-left: 1.4em; }
.about-cols .col a { border-bottom: 1px solid var(--fg-faint); }

@media (max-width: 760px) {
  .block.columns, .about-cols { grid-template-columns: 1fr; row-gap: 2rem; }
  .block.columns .col, .about-cols .col { grid-column: 1 !important; }
}

/* ------------------------------------------------------------- Footer */
.footer {
  width: 88%; margin: 0 auto; padding: 3rem 0 4rem;
  font-family: var(--mono-alt); font-size: 0.9rem; text-transform: uppercase;
  letter-spacing: 0.05rem; color: var(--fg-faint);
  display: flex; flex-wrap: wrap; gap: 1.6rem; justify-content: space-between;
  border-top: 1px solid var(--rule);
}
.footer a { color: var(--fg-dim); }
.footer a:hover { color: var(--fg); }
.footer .socials { display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* --------------------------------------------------------- Contact */
.contact-form { max-width: 46rem; display: flex; flex-direction: column; gap: 1.4rem; margin-top: 2rem; }
.contact-form label { font-size: 1.0rem; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.05rem; }
.contact-form input, .contact-form textarea {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.2);
  color: var(--fg); font-family: var(--mono); font-size: 1.2rem; padding: 1rem 1.2rem; width: 100%;
}
.contact-form textarea { min-height: 14rem; resize: vertical; }
.contact-form button {
  align-self: flex-start; background: rgba(255,255,255,0.15); color: var(--fg);
  border: 1px solid rgba(255,255,255,0.3); font-family: var(--mono-alt); font-size: 1.2rem;
  text-transform: uppercase; letter-spacing: 0.05rem; padding: 1rem 2rem; cursor: pointer;
}
.contact-form button:hover { background: rgba(255,255,255,0.28); }

/* ----------------------------------------------------- Splash intro */
#splash {
  position: fixed; inset: 0; z-index: 1000; background: #000;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s ease;
}
#splash img { width: min(60vw, 720px); height: auto; }
#splash.hide { opacity: 0; pointer-events: none; }

/* ------------------------------------------------------- Responsive */
@media (max-width: 900px) {
  .page, .prose, .block.text { width: 88%; }
}
@media (max-width: 640px) {
  .thumbs { grid-template-columns: repeat(2, 1fr); }
  :root { --pad: 2.4rem; }
  .topnav { padding: 1.2rem 6%; gap: 0.9rem; }
  .hero img, #splash img { width: 78vw; }
}
/* Nav compacte sur téléphone : logo + 3 items doivent tenir sur une ligne */
@media (max-width: 480px) {
  .topnav { padding: 1.1rem 4%; gap: 0.7rem; font-size: 0.95rem; }
  .nav-links { gap: 0.8rem; }
  .topnav a { letter-spacing: 0; }
  .nav-logo img { height: 1.2rem; }
}
@media (max-width: 400px) {
  .thumbs { grid-template-columns: 1fr; }
}
