/* =========================================================
   DEFI GROUP — socle commun aux trois scènes
   (polices, reset, accessibilité, transitions, révélations)
   ========================================================= */


/* Transitions entre pages natives (Chrome, Edge, Safari 18+) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.35s cubic-bezier(.4, 0, .2, 1) both; }
::view-transition-new(root) { animation: vt-in 0.55s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); filter: blur(2px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; min-height: 100vh; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[role='list'], ol[role='list'] { list-style: none; padding: 0; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 1000; padding: 12px 18px;
  background: #fff; color: #0B111B; font-weight: 600; border-radius: 6px;
  transform: translateY(-160%); transition: transform .2s;
}
.skip-link:focus { transform: none; }

/* Voile de transition (repli pour les navigateurs sans View Transitions) */
.page-veil {
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  background: var(--veil, #0B111B); opacity: 0; transition: opacity .32s ease;
}
html.is-leaving .page-veil { opacity: 1; }

/* Révélations au scroll — uniquement si JS actif */
.js [data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js [data-reveal='left'] { transform: translateX(-32px); }
.js [data-reveal='scale'] { transform: scale(.96); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* Bandeau de scène : retour au choix / changement de version */
.scene-switch {
  position: fixed; z-index: 90; right: 18px; bottom: 18px;
  display: flex; align-items: center; gap: 4px; padding: 5px;
  border-radius: 999px; background: rgba(11, 17, 27, .86); color: #F4F1EC;
  border: 1px solid rgba(170, 179, 192, .22);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-family: 'Archivo', system-ui, sans-serif; font-size: 13px; letter-spacing: .01em;
  transition: transform .4s cubic-bezier(.2, .7, .2, 1), opacity .3s;
}
.scene-switch.is-hidden { transform: translateY(140%); opacity: 0; }
.scene-switch a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px;
  text-decoration: none; white-space: nowrap; transition: background .2s, color .2s;
}
.scene-switch a:hover { background: rgba(244, 241, 236, .1); }
.scene-switch a:focus-visible { outline: 2px solid #FF7900; outline-offset: 2px; }
.scene-switch .is-primary { background: #145BFF; color: #fff; font-weight: 600; }
.scene-switch .is-primary:hover { background: #2f6dff; }
.scene-switch .label-short { display: none; }
.scene-switch svg { width: 14px; height: 14px; flex: none; }
@media (max-width: 560px) {
  .scene-switch { left: 50%; right: auto; bottom: 12px; font-size: 12.5px; transform: translateX(-50%); }
  .scene-switch.is-hidden { transform: translate(-50%, 140%); }
  .scene-switch .label-long { display: none; }
  .scene-switch .label-short { display: inline; }
  .scene-switch a { padding: 9px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; transition-delay: 0ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* Le sélecteur de scène s'efface quand le menu mobile ou un tiroir est ouvert */
body.nav-open .scene-switch, body.has-dialog .scene-switch { opacity: 0; pointer-events: none; }
