/* Les gestes des écrans connectés (spec 2026-11-18-disposition-apple,
   section 3.2), menés par gestes.js. Ressorts : amorti 1 (sans dépassement) partout, 0,8 seulement après un
   geste qui portait de l'élan. Les courbes `linear()` ci-dessous sont des
   ressorts échantillonnés (amorti 1, réponse 0,4 s ; amorti 0,8, réponse 0,4 s). */

:root {
  --ressort: linear(0, 0.0596, 0.186, 0.3294, 0.4656, 0.584, 0.6819, 0.7601, 0.821, 0.8677, 0.9029, 0.9292, 0.9487, 0.963, 0.9734, 0.9809, 0.9864, 0.9903, 0.9931, 0.9951, 0.9966, 0.9976, 0.9983, 0.9988, 1);
  --ressort-duree: 600ms;
  --ressort-elan: linear(0, 0.0624, 0.2017, 0.3663, 0.5257, 0.6644, 0.7763, 0.8613, 0.9223, 0.9637, 0.9898, 1.0049, 1.0124, 1.015, 1.0147, 1.0129, 1.0105, 1.008, 1.0057, 1.0039, 1.0025, 1.0014, 1.0007, 1.0003, 1, 0.9998, 0.9998, 0.9998, 1);
}

/* 1. Transitions entre pages : la vignette devient la galerie de la fiche,
   et la galerie revient se poser dans sa vignette au retour. */
@view-transition { navigation: auto; }
::view-transition-group(root) { animation-duration: 180ms; }
::view-transition-group(voiture) { animation-duration: var(--ressort-duree); animation-timing-function: var(--ressort); }
::view-transition-old(voiture), ::view-transition-new(voiture) { height: 100%; object-fit: cover; overflow: hidden; }
::view-transition-old(voiture) { animation: 120ms ease-out both galerie-efface; }
::view-transition-new(voiture) { animation: none; }
@keyframes galerie-efface { to { opacity: 0; } }

/* 2. Réponse à l'appui : tout ce qui se touche descend à l'instant même du
   contact, et remonte sur le ressort. */
html[data-charte] .dashboard-app :is(.vignette, .mast-nav > a, .navigation-plus > summary, .navigation-outils a, .tabs a, .entry, .filet-row) {
  transition: transform var(--ressort-duree) var(--ressort);
}
html[data-charte] .dashboard-app :is(.vignette, .mast-nav > a, .navigation-plus > summary, .navigation-outils a, .entry, .filet-row):active,
html[data-charte] .dashboard-app .appui-en-cours {
  transform: scale(0.97);
  transition-duration: 0ms;
}
html[data-charte] .dashboard-app .tabs a:active { transform: scale(0.94); transition-duration: 0ms; }

/* 3. Matières : la barre du haut devient translucide dès que la page passe
   dessous, et le dock du téléphone laisse voir le contenu qui défile. */
html[data-charte] .dashboard-app .ears {
  position: sticky; top: 0; z-index: var(--z-barre);
  transition: background-color 200ms ease, backdrop-filter 200ms ease, box-shadow 200ms ease;
}
html.page-defile .dashboard-app .ears {
  background: color-mix(in srgb, var(--ground) 72%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent), 0 10px 24px -18px color-mix(in srgb, var(--ink) 40%, transparent);
}
@media (max-width: 720px) {
  html[data-charte] .dashboard-app .mast-nav {
    background: color-mix(in srgb, var(--ground) 80%, transparent);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    backdrop-filter: blur(22px) saturate(180%);
    border-top-color: color-mix(in srgb, var(--ink) 10%, transparent);
  }
  html[data-charte] .dashboard-app .mast-nav { position: relative; z-index: 1; }

  /* 4. Le tiroir « Plus » devient une feuille qu'on tire. */
  html[data-charte] .navigation-outils { will-change: transform; z-index: 2; border-radius: 14px; }
  html[data-charte] .tiroir-poignee {
    grid-column: 1 / -1; justify-self: stretch; height: 22px; margin: -8px -16px 0; display: grid; place-items: center;
    touch-action: none; cursor: grab;
  }
  html[data-charte] .tiroir-poignee::before { content: ""; width: 36px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 22%, transparent); }
  html[data-charte] .tiroir-poignee + .dashboard-nav-label { margin-block: 0; grid-column: 1; }
  html[data-charte] .tiroir-voile {
    position: fixed; inset: 0; z-index: 0; opacity: 0; pointer-events: none;
    background: color-mix(in srgb, #000 38%, transparent);
  }
  html[data-charte] .tiroir-voile.pose { pointer-events: auto; }

  /* 5. Les compartiments de la fiche se feuillettent du doigt. */
  html[data-charte] .dashboard-app [data-onglet] { touch-action: pan-y pinch-zoom; }
}

/* 6. Le segment des onglets glisse d'un onglet à l'autre ; sa forme (pastille
   du contrôle segmenté) est posée par disposition.css. */
html[data-charte] .dashboard-app .tabs { position: relative; }
.onglets-curseur {
  position: absolute; left: 0; top: 0; height: 2px; width: 0; border-radius: 1px;
  background: var(--accent-texte); pointer-events: none; will-change: transform, width;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  html[data-charte] .dashboard-app :is(.vignette, .mast-nav > a, .navigation-plus > summary, .navigation-outils a, .tabs a, .entry, .filet-row):active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  html.page-defile .dashboard-app .ears, html[data-charte] .dashboard-app .mast-nav {
    background: var(--ground); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}
