/* ═══════════════════════════════════════════════════════════════
   LA SOURCE — style.css v7
   Fond noir, police Mom's Typewriter, textes blancs
   Boutons : voile flou translucide, bords arrondis
   index.html : image visible sans scroll, scroll naturel possible
   explications.html + source.html : scroll libre
═══════════════════════════════════════════════════════════════ */

/* ── Police Mom's Typewriter ──
   Fichier à placer dans le même dossier que index.html :
   Mom®t___.ttf (téléchargeable sur dafont.com)
   Fallback : Courier New, American Typewriter
── */
@font-face {
  font-family: 'MomsTypewriter';
  src: url('Mom®t___.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── Variables ── */
:root {
  --noir:         #000000;
  --blanc:        #ffffff;
  --voile-bg:     rgba(255, 255, 255, 0.08);
  --voile-hover:  rgba(255, 255, 255, 0.16);
  --voile-border: rgba(255, 255, 255, 0.25);
  --font-machine: 'MomsTypewriter', 'Courier New', 'American Typewriter', serif;
}

/* ── Reset & base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--noir);
  color: var(--blanc);
  font-family: var(--font-machine);
}

/* ── En-tête commun aux 3 pages ── */
#header {
  padding: 1.4rem 1rem 0.8rem;
  text-align: center;
  background: transparent;
  position: relative;
  z-index: 10;
}

/* Lien titre — silencieux, aucune animation */
.titre-lien {
  text-decoration: none;
  display: inline-block;
}

.titre-lien:hover,
.titre-lien:focus,
.titre-lien:active {
  text-decoration: none;
  color: inherit;
  outline: none;
}

.titre-site {
  font-family: var(--font-machine);
  font-size: clamp(0.95rem, 3vw, 1.3rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--blanc);
}


/* ══════════════════════════════════════════════════════════════
   PAGE INDEX — image source.jpeg en fond
   L'image est entièrement visible sans scroll sur mobile portrait.
   Le scroll naturel reste possible mais ne révèle rien de plus.
══════════════════════════════════════════════════════════════ */

body.page-index {
  min-height: 100vh;
  /* Pas d'overflow:hidden — le scroll reste naturellement possible */
}

body.page-index #header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
}

/* Conteneur image — occupe exactement 100vh (toute la hauteur visible) */
#image-fond {
  position: relative;
  width: 100%;
  height: 100vh;
  /* Image source.jpeg en fond */
  /* Format 2:3 vertical — la photo s'adapte à la hauteur de l'écran */
  background-image: url('source.jpeg');
  background-size: contain;        /* image entière visible, pas de recadrage */
  background-position: center top; /* centrée horizontalement, alignée en haut */
  background-repeat: no-repeat;
  background-color: var(--noir);   /* fond noir si l'image ne couvre pas les bords */
}

/* Fondu haut — fond noir vers transparent */
#fondu-haut {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 18%;
  background: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Fondu bas */
#fondu-bas {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 18%;
  background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Fondu gauche */
#fondu-gauche {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 12%;
  background: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Fondu droit */
#fondu-droite {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 12%;
  background: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Bouton Explications — positionné en bas du conteneur image */
#btn-index-row {
  position: absolute;
  bottom: clamp(1.5rem, 5vh, 3rem);
  left: 0;
  right: 0;
  z-index: 20;
}


/* ══════════════════════════════════════════════════════════════
   PAGE EXPLICATIONS — scroll libre
══════════════════════════════════════════════════════════════ */

body.page-explications {
  min-height: 100vh;
}

#contenu-explications {
  padding-bottom: 2rem;
}

/* Tracé source — coin supérieur droit du texte */
#trace-source-container {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(28px, 7vw, 50px);
  opacity: 0.72;
}

#trace-source-svg {
  width: 100%;
  height: auto;
}

/* Texte narratif */
#texte-explications {
  font-family: var(--font-machine);
  font-size: clamp(0.68rem, 2vw, 0.88rem);
  line-height: 1.9;
  color: var(--blanc);
  letter-spacing: 0.03em;
  padding-right: clamp(35px, 9vw, 60px);
  padding-top: 0.5rem;
}

#texte-explications p {
  margin-bottom: 0.3rem;
}


/* ══════════════════════════════════════════════════════════════
   PAGE SOURCE — scroll libre
══════════════════════════════════════════════════════════════ */

body.page-source {
  min-height: 100vh;
}

/* Zone principale */
#zone-principale {
  margin-top: 0.5rem;
}

/* Colonne conteneur vidéo — marge sur les côtés
   pour que la barre son/km et la vidéo ne soient pas coupées par les bords */
.video-col {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

/* Barre au-dessus de la vidéo :
   bouton son à gauche, compteur km à droite,
   même ligne horizontale, alignés avec les bords de la vidéo */
#barre-dessus-video {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  width: 100%;
}

/* Bouton son */
.btn-son {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.btn-son:hover {
  opacity: 0.75;
}

/* Icônes son SVG */
.icone-son {
  width: clamp(22px, 6vw, 32px);
  height: auto;
}

/* Zone vidéo — pleine largeur */
#video-wrapper {
  width: 100%;
}

#player {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Fondu standard (0.3s) */
#player.fondu-standard {
  animation: fonduStandard 0.3s ease forwards;
}

/* Fondu lent — vidéos spéciales (2s minimum) */
#player.fondu-lent {
  animation: fonduLent 2.2s ease forwards;
}

@keyframes fonduStandard {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fonduLent {
  0%   { opacity: 0; }
  45%  { opacity: 0; }
  100% { opacity: 1; }
}

/* Compteur km — horizontal, aligné à droite au-dessus de la vidéo */
#compteur-km {
  font-family: var(--font-machine);
  font-size: clamp(0.72rem, 2.5vw, 0.9rem);
  color: var(--blanc);
  white-space: nowrap;
  letter-spacing: 0.06em;
  text-align: right;
  flex-shrink: 0;
}

#valeur-km {
  font-size: clamp(0.8rem, 3vw, 1rem);
}

#label-km {
  font-size: clamp(0.72rem, 2.5vw, 0.9rem);
}

/* Zone boutons Avancer */
#btn-row {
  margin-top: 1.2rem;
}

/* Écriteaux */
.ecriteau {
  font-family: var(--font-machine);
  font-size: clamp(0.68rem, 2vw, 0.88rem);
  line-height: 1.95;
  color: var(--blanc);
  text-align: center;
  letter-spacing: 0.04em;
  margin-top: 1.2rem;
  opacity: 0;
  animation: apparitionEcriteau 1s ease forwards;
}

.ecriteau p {
  margin-bottom: 0.4rem;
}

@keyframes apparitionEcriteau {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* Écran de fin */
#fin-row {
  margin-top: 1.2rem;
}

#fin-texte {
  font-family: var(--font-machine);
  font-size: clamp(0.68rem, 2vw, 0.88rem);
  line-height: 1.95;
  color: var(--blanc);
  text-align: center;
  letter-spacing: 0.04em;
  opacity: 0;
  animation: apparitionFin 2.8s ease forwards;
}

@keyframes apparitionFin {
  0%   { opacity: 0; transform: translateY(8px); }
  35%  { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0);   }
}

.fin-titre {
  font-size: clamp(0.82rem, 2.8vw, 1.02rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}


/* ══════════════════════════════════════════════════════════════
   BOUTONS VOILE FLOU — communs à toutes les pages
   backdrop-filter: blur + translucide + bords arrondis généreux
══════════════════════════════════════════════════════════════ */

.btn-voile {
  display: inline-block;
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: var(--font-machine);
  font-size: clamp(0.68rem, 2.5vw, 0.9rem);
  letter-spacing: 0.18em;
  color: var(--blanc);
  text-decoration: none;
  background: var(--voile-bg);
  border: 1px solid var(--voile-border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  text-align: center;
  transition:
    background   0.22s ease,
    border-color 0.22s ease,
    transform    0.1s  ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-voile:hover {
  background: var(--voile-hover);
  border-color: rgba(255, 255, 255, 0.45);
  color: var(--blanc);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-voile:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.2);
}


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — mobile portrait (prioritaire)
══════════════════════════════════════════════════════════════ */

@media (max-width: 575px) {
  .titre-site {
    letter-spacing: 0.2em;
  }

  .btn-voile {
    padding: 0.6rem 0.4rem;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    border-radius: 11px;
  }

  #texte-explications {
    font-size: 0.68rem;
  }

  .ecriteau,
  #fin-texte {
    font-size: 0.66rem;
  }
}
