/* Transitions fluides entre les pages (Chrome/Edge/Safari 18.2+) :
   empêche la nav de "clignoter/recharger" au clic sur un lien.
   Les navigateurs non compatibles (ex: Firefox) ignorent cette règle
   sans aucun risque, la navigation reste normale. */
@view-transition {
  navigation: auto;
}

html {
  scrollbar-gutter: stable;
  overflow-y: scroll;
}

html,
body {
  overflow-x: clip;
}

/* Fix saut de texte EN -> FR : on cache uniquement le texte traduit le temps
   qu'il soit dans la bonne langue, pas toute la page (pour ne pas gêner
   les animations d'apparition existantes) */
html.i18n-loading [data-i18n],
html.i18n-loading [data-i18n-attr],
html.i18n-loading [data-i18n-html] {
  visibility: hidden;
}

html.i18n-ready [data-i18n],
html.i18n-ready [data-i18n-attr],
html.i18n-ready [data-i18n-html] {
  visibility: visible;
}

/* La barre de navigation reste toujours visible et stable, sans aucun clignotement */
nav [data-i18n],
nav [data-i18n-attr],
nav [data-i18n-html] {
  visibility: visible !important;
}

/* Language switcher — visible on all pages */
.lang-btn {
  background: transparent;
  border: 1px solid rgba(250, 246, 239, 0.35);
  color: rgba(250, 246, 239, 0.65);
  font-family: 'Arial', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.lang-btn:focus,
.lang-btn:active {
  outline: none;
  box-shadow: none;
}

.lang-btn:hover {
  color: #faf6ef;
  border-color: #c1693c;
}

.lang-btn.active {
  background: #c1693c;
  border-color: #c1693c;
  color: #fff;
}

.lang-sep {
  display: none;
}

/* ========================================================
   APPARITION AU SCROLL (reveal.js)
   Sûreté : le masquage initial (opacity: 0, translateY) ne
   s'applique QUE si le script reveal.js a marqué html.js-ready.
   Si JS est désactivé ou si IntersectionObserver est absent,
   le contenu reste visible sans accroc.
   ======================================================== */
html.js-ready .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(30px);
}

/* Sûreté : les en-têtes et héros directement visibles au chargement ne subissent aucun décalage */
html.js-ready .hero,
html.js-ready .actions-hero,
html.js-ready .process-hero,
html.js-ready .contact-intro,
html.js-ready .about-text {
  transform: none !important;
}

html.js-ready .reveal {
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

html.js-ready .reveal.is-visible {
  opacity: 1;
  transform: none !important;
  will-change: auto !important;
}

/* Sections contenant un titre souligné terracotta : apparition en fondu uniquement.
   Le glissement (translateY) + will-change plaçait la section sur une couche GPU
   à position fractionnaire pendant l'animation, ce qui affinait le trait de 2px
   avant qu'il ne retrouve sa vraie épaisseur. */
html.js-ready .reveal:has(.section-title),
html.js-ready .reveal:has(.recommendation-title) {
  transform: none !important;
  transition: opacity 0.8s ease !important;
  will-change: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  html.js-ready .reveal:not(.is-visible),
  html.js-ready .reveal,
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}