:root {
  --text-color: #1a1a1a; 
  --muted: #555; 
  --accent: #007bff; 
  /* Tailles de police stylées */
  --font-size-base: 1.3em; 
  --font-size-lead: 1.7em;
  --font-size-h3: 3.2em;
  --font-size-h4: 2.4em;
}

/* 1. Animation Typewriter pour les titres */
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}
/* Déplace le "curseur" qui simule l'écriture */
@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--accent); }
}

/* Styles généraux */
* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  font-family: 'Cinzel', serif; 
  background: #f0f8ff;
  color: var(--text-color);
  line-height: 1.7;
}

/* FOND CIEL UNIFIÉ */
body {
  background-image: url('img/ciel.jpg'); 
  background-size: cover;
  background-attachment: fixed; 
  background-position: center top;
}

/* En-tête fixe */
.site-header {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.95); 
  backdrop-filter: blur(8px);
  z-index: 99;
  border-bottom: 1px solid #ddd;
  color: var(--text-color);
}
.site-header nav a {
  color: var(--accent);
  text-decoration: none;
  margin-left: 15px;
  font-size: var(--font-size-base);
  font-weight: bold;
}

/* Hero Section (Introduction) */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: 60px;
  position: relative;
  --opacity-factor: 1; 
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('img/truman.jpg');
    background-size: cover;
    background-position: center;
    opacity: var(--opacity-factor);
    transition: opacity 0.1s linear; 
}
.hero.truman-intro .wrap {
  background: rgba(0, 0, 0, 0.5); 
  padding: 30px 40px;
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  max-width: 80%;
  position: relative; 
}
.hero .main-title {
  font-size: 8vmax;
  color: white;
  text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.9);
}
.hero .lead {
  font-size: var(--font-size-lead);
  color: white;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.9);
}

/* Sections de Contenu */
.panel {
  min-height: 70vh;
  padding: 60px 6vw;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.85); 
  z-index: 10; 
  position: relative;
}
.wrap {
  max-width: 900px;
  margin: 0 auto; 
}

/* Styles des titres et texte */
.panel h3, .panel h4 {
  overflow: hidden; 
  white-space: nowrap; 
  width: 0;
  border-right: 2px solid transparent; 
  display: inline-block;
}
.panel h3 {
  font-size: var(--font-size-h3);
  color: var(--accent);
  margin-bottom: 25px;
  padding-bottom: 10px;
}
.panel h4 {
  font-size: var(--font-size-h4);
  color: var(--text-color);
  margin-top: 35px;
  margin-bottom: 15px;
}
.panel p, .panel li {
    font-size: var(--font-size-base);
}

/* Activation de l'animation Typewriter */
.reveal.visible .typing-h3 {
  animation: typing 1s steps(40, end) forwards, blink-caret 0.5s step-end infinite alternate;
  animation-delay: var(--typing-delay, 0s); 
  width: 100%;
  white-space: normal;
}
.reveal.visible .typing-h4 {
  animation: typing 0.8s steps(30, end) forwards, blink-caret 0.5s step-end infinite alternate;
  animation-delay: var(--typing-delay, 0s);
  width: 100%;
  white-space: normal;
}

/* Styles des visuels (STATIQUE) */
.visuel-container {
  /* Retrait des marges et floats qui interfèrent avec Flexbox */
  margin: 0;
  width: 100%; /* Sera défini par son parent */
  max-width: none;
  position: relative;
  will-change: auto;
  transition: none; 
  opacity: 1; 
  transform: none; 
}
.visuel-container.left-align {
  float: left;
  padding-right: 25px;
}
.visuel-container.right-align {
  float: right;
  padding-left: 25px;
}
.visuel-anime {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: block;
}

/* Révélation du texte */
.reveal h3, .reveal h4, .reveal p, .reveal ul,
.reveal .text-container {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible h3, .reveal.visible h4, .reveal.visible p, .reveal.visible ul,
.reveal.visible .text-container {
    opacity: 1;
    transform: translateY(0);
}
/* Surcharge pour le Typewriter: */
.reveal h3, .reveal h4 {
    opacity: 1; 
    transform: none;
    border-right: 2px solid var(--accent);
}
.reveal.visible h3, .reveal.visible h4 {
    border-color: transparent; 
}

/* --- NOUVEAUX STYLES : Sticky Scene pour #analyse --- */

#analyse .wrap {
    /* Utiliser Flexbox dans le wrap pour positionner l'image et le texte */
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#analyse h3 {
    width: 100%; /* Le titre prend toute la largeur */
    flex-basis: 100%;
}

.sticky-element {
    /* L'élément devient "collant" (sticky) */
    position: sticky;
    top: 100px; /* Distance du haut de l'écran où il doit coller */
    width: 40%;
    margin-top: 50px;
    z-index: 5;
    /* Annulation du float qui a été mis en place pour les autres visuels */
    float: none;
    padding: 0;
}

/* Le conteneur de texte pour le défilement */
#analyse .content-scroll {
    width: 55%; /* Laisse de la place à l'élément sticky */
    position: relative; /* Assure le bon empilement */
    /* Marge pour séparer du titre */
    margin-top: 50px; 
}

/* Zone d'espace vide pour prolonger le défilement */
.padding-scroll {
    height: 100vh; /* Ajoute l'équivalent d'un écran de défilement */
    pointer-events: none; /* Ne doit pas bloquer les interactions */
}

/* Ordre Flexbox pour assurer que le titre est bien au-dessus */
#analyse .visuel-container.sticky-element {
    order: 2; /* Place l'image à droite */
}
#analyse .content-scroll {
    order: 1; /* Place le contenu à gauche */
}


/* Footer */
.site-footer {
  text-align: center;
  padding: 30px;
  color: var(--muted);
  font-size: 0.9em;
  margin-top: 50px;
  background-color: rgba(255, 255, 255, 0.7);
  border-top: 1px solid #eee;
}

/* Responsive : MIS À JOUR pour gérer la sticky scene */
@media (max-width: 900px) {
  .visuel-container {
    float: none;
    width: 80%;
    margin: 30px auto;
    padding: 0;
  }
  .visuel-container.left-align, .visuel-container.right-align {
    float: none;
    padding: 0;
    transform: none !important;
  }

  /* Sticky Scene redevient statique sur mobile */
  #analyse .wrap {
      flex-direction: column;
      align-items: center;
  }
  .sticky-element {
    position: relative; /* Désactive sticky */
    top: auto;
    width: 80%;
    margin: 30px auto;
  }
  #analyse .content-scroll {
    width: 100%;
    margin-top: 0;
  }
  /* Cache le padding pour le scroll sur mobile */
  .padding-scroll {
      height: 0;
  }
}