/* ============================================================
   Finances H2O — Couche visuelle premium
   ------------------------------------------------------------
   Se superpose à tokens.css + main.css. N'écrase jamais les
   tokens : elle les utilise. Tout est GPU-accéléré, sans
   dépendance externe, et dégrade proprement sans JavaScript.

   Respecte prefers-reduced-motion partout.
   ============================================================ */

/* ---------- Réglages de la couche ---------- */

:root {
  --pr-ease: cubic-bezier(.22,.61,.36,1);
  --pr-ease-out: cubic-bezier(.16,1,.3,1);
  --pr-glass: rgba(255,255,255,.72);
  --pr-glass-brd: rgba(255,255,255,.55);
  --pr-glow: rgba(47,111,116,.28);
  --pr-ink: #0f2a2e;
}

/* ============================================================
   1. HERO
   ------------------------------------------------------------
   Plus de canvas anime, plus d'orbes flottantes, plus de grain :
   c'etait la signature visuelle la plus datee du site. Il reste
   un aplat degrade sobre, et le texte porte seul.
   ============================================================ */

.pr-hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7,17,19,.62) 0%, rgba(7,17,19,.26) 45%, rgba(8,20,22,.94) 100%),
    url('../assets/images/panoramas/lac-coucher.webp') center 38% / cover no-repeat,
    linear-gradient(168deg, #0a1c1f 0%, #0f2a2e 55%, #1f4a50 100%);
  isolation: isolate;
}

.pr-hero .container { position: relative; z-index: 4; }

.pr-hero-inner { max-width: 60ch; padding: 6rem 0 7rem; }

.pr-eyebrow {
  display: block;
  font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: #dcbb72;
  padding: 0 0 .7rem;
  margin-bottom: 1.6rem;
  border-bottom: 2px solid rgba(220,187,114,.55);
  width: fit-content;
}

.pr-title {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.015em;
  color: #fff;
  margin: 0 0 1.6rem;
  text-wrap: balance;
}
.pr-title .l { display: block; }
.pr-title .grad {
  /* Un aplat, pas un degrade : le texte en degrade est une signature datee. */
  color: #dcbb72;
  font-style: italic;
}

.pr-lede {
  font-size: clamp(1.05rem, 1.9vw, 1.32rem);
  line-height: 1.62;
  color: #d6dad2;
  max-width: 54ch;
  margin-bottom: 2.4rem;
}

/* Boutons — lueur et relief au survol */
.pr-cta { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }

.pr-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: .65rem;
  padding: 1.05rem 2.1rem;
  border-radius: var(--radius-md);
  font-size: 1rem; font-weight: 600;
  text-decoration: none;
  border: 0; cursor: pointer;
  transition: transform .35s var(--pr-ease-out), box-shadow .35s var(--pr-ease-out);
  overflow: hidden;
  isolation: isolate;
}
.pr-btn svg { transition: transform .35s var(--pr-ease-out); }
.pr-btn:hover svg { transform: translateX(4px); }

.pr-btn-1 {
  background: var(--color-accent-600);
  color: #fff;
}
.pr-btn-1:hover { transform: translateY(-1px);
  background: var(--color-accent-700); }

.pr-btn-2 {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.45);
}
.pr-btn-2:hover { transform: translateY(-1px); background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.45); }

/* Bandeau de chiffres sous le hero */
/* Signal de confiance sous les boutons du hero — le 5e element. */
.pr-preuve {
  display: flex; align-items: center; flex-wrap: wrap; gap: .55rem .7rem;
  margin: 1.6rem 0 0;
  font-size: .95rem; line-height: 1.5;
  color: rgba(238,240,234, .82);
  max-width: 46ch;
}
.pr-preuve-amf {
  flex: none;
  font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding: .3rem .6rem; border-radius: var(--radius-sm);
  color: #ecdcb0;
  background: rgba(138,106,44, .28);
  border: 1px solid rgba(220,187,114, .38);
}

.pr-stats {
  display: flex; gap: 3.4rem; flex-wrap: wrap;
  margin-top: 2.6rem; padding-top: 1.8rem;
  border-top: 1px solid rgba(255,255,255,.12);
}
.pr-stat b {
  display: block;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 700; letter-spacing: -.03em; line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.pr-stat span { font-size: .82rem; color: #96a19b; margin-top: .35rem; display: block; }


/* ============================================================
   2. RÉVÉLATIONS AU DÉFILEMENT
   ============================================================ */

/* Sans JS, tout reste visible : la classe n'est posée que par le script */
.pr-js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .85s var(--pr-ease-out), transform .85s var(--pr-ease-out);
}
.pr-js [data-reveal].pr-in { opacity: 1; transform: none; }

/* ============================================================
   3. BARRE DE PROGRESSION DE LECTURE
   ============================================================ */

.pr-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--color-accent-600);
  z-index: 999; transition: width .12s linear;
}

/* ============================================================
   4. GRILLE DE CALCULATEURS — cartes de verre
   ============================================================ */

.pr-tools-section {
  position: relative;
  background: var(--color-neutral-100);
  overflow: hidden;
}

.pr-filtres {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-bottom: 2.4rem;
}
.pr-chip {
  appearance: none; cursor: pointer; font: inherit;
  font-size: .87rem; font-weight: 500;
  padding: .5rem 1.15rem;
  border-radius: 999px;
  border: 1.5px solid var(--color-neutral-200);
  background: var(--color-neutral-50);
  color: var(--color-neutral-700);
  transition: all .28s var(--pr-ease-out);
}
.pr-chip:hover { border-color: var(--color-primary-500); color: var(--color-primary-700);
  transform: translateY(-1px); }
.pr-chip[aria-pressed="true"] {
  background: var(--color-primary-900); border-color: var(--color-primary-900);
  color: #fff; font-weight: 600;
}
.pr-chip:focus-visible { outline: 2px solid var(--color-accent-600); outline-offset: 2px; }

.pr-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.4rem;
}

.pr-tool {
  position: relative;
  display: flex; flex-direction: column; gap: .8rem;
  padding: 1.9rem 1.7rem 1.6rem;
  border-radius: var(--radius-xl);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--color-neutral-200);
  border-top: 3px solid var(--tone-solid, var(--color-primary-500));
  box-shadow: 0 1px 2px rgba(15,42,46,.05), 0 12px 34px -18px rgba(15,42,46,.28);
  overflow: hidden;
  isolation: isolate;
  transition: transform .45s var(--pr-ease-out), box-shadow .45s var(--pr-ease-out);
}
.pr-tool:hover { transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(15,42,46,.06), 0 26px 54px -22px rgba(15,42,46,.42); }
.pr-tool:focus-visible { outline: 2px solid var(--color-accent-600); outline-offset: 3px; }

.pr-tool h3 {
  font-size: 1.12rem; font-weight: 700; line-height: 1.3;
  color: var(--color-primary-900); margin: 0;
}
.pr-tool p {
  font-size: .92rem; color: var(--color-neutral-700); line-height: 1.55; margin: 0;
  flex: 1;
}
.pr-tool-go {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .87rem; font-weight: 600; color: var(--color-primary-500);
  margin-top: .3rem;
}
.pr-tool-go svg { transition: transform .4s var(--pr-ease-out); }
.pr-tool:hover .pr-tool-go svg { transform: translateX(5px); }

.pr-tool.pr-soon { opacity: .62; pointer-events: none; }
.pr-tool-badge {
  position: absolute; top: 1.1rem; right: 1.1rem;
  font-size: .64rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: .22rem .6rem; border-radius: var(--radius-sm);
  background: var(--color-neutral-200); color: var(--color-neutral-700);
}
.pr-tool-badge.neuf { background: var(--color-accent-600); color: #fff;
  box-shadow: 0 6px 16px -6px rgba(138,106,44,.7); }

/* ============================================================
   5. SÉLECTEUR DE PROFIL
   ============================================================ */

.pr-profils-section {
  position: relative;
  background: linear-gradient(180deg, var(--color-primary-900), #1f4a50);
  color: #fff;
  overflow: hidden;
}
.pr-profils-section .section-title { color: #fff; }
.pr-profils-section .section-description { color: #b7bfb8; }
/* Meme correction que sur le hero du blogue : pastille transparente sur fond sombre. */
.pr-profils-section .section-eyebrow {
  color: #dcbb72;
  background-color: rgba(255,255,255, .10);
  border: 1px solid rgba(220,187,114, .32);
}

.pr-profils {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
  margin-top: 2.4rem;
}
.pr-profil {
  position: relative;
  appearance: none; cursor: pointer; font: inherit; text-align: left;
  padding: 1.7rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--color-primary-800);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  display: flex; flex-direction: column; gap: .55rem;
  transition: all .42s var(--pr-ease-out);
  overflow: hidden;
}
.pr-profil:hover { transform: translateY(-1px); background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.32); }
.pr-profil[aria-pressed="true"] {
  background: linear-gradient(140deg, rgba(138,106,44,.28), rgba(138,106,44,.14));
  border-color: var(--color-accent-500);
  box-shadow: 0 16px 40px -16px rgba(138,106,44,.6);
}
.pr-profil:focus-visible { outline: 2px solid var(--color-accent-500); outline-offset: 3px; }
.pr-profil .ic { font-size: 1.9rem; line-height: 1; }
.pr-profil .nm { font-weight: 700; font-size: 1.08rem; }
.pr-profil .ds { font-size: .84rem; color: #b7bfb8; line-height: 1.45; }

.pr-profil-out {
  margin-top: 2.2rem;
  border-radius: var(--radius-lg);
  background: var(--color-primary-800);
  border: 1px solid rgba(255,255,255,.13);
  padding: 2rem 1.8rem;
  animation: prFade .55s var(--pr-ease-out);
}
.pr-profil-out:empty { display: none; }
@keyframes prFade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.pr-profil-out .angle {
  border-left: 3px solid var(--color-accent-500);
  padding-left: 1rem; margin-bottom: 1.3rem;
}
.pr-profil-out .angle b {
  display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--color-accent-500); margin-bottom: .35rem;
}
.pr-profil-out .angle p { color: #d6dad2; font-size: .95rem; line-height: 1.6; }

.pr-profil-out .pr-tools { margin-top: 1.5rem; }
.pr-profil-out .pr-tool {
  background: var(--color-primary-700);
  border-color: rgba(255,255,255,.14);
}
.pr-profil-out .pr-tool h3 { color: #fff; }
.pr-profil-out .pr-tool p { color: #b7bfb8; }
.pr-profil-out .pr-tool-go { color: var(--color-accent-500); }

/* Mise en évidence des étapes selon le profil */
.step-card { transition: all .5s var(--pr-ease-out); }
.step-card.pr-dim { opacity: .34; filter: saturate(.4); }
.step-card.pr-hot {
  box-shadow: 0 0 0 3px var(--color-accent-600), 0 20px 44px -18px rgba(138,106,44,.7);
  transform: translateY(-1px);
}
.pr-rank {
  position: absolute; top: 10px; right: 12px;
  font-size: .66rem; font-weight: 800; letter-spacing: .04em;
  color: #fff; background: var(--color-accent-600);
  border-radius: var(--radius-sm); padding: .18rem .55rem;
  box-shadow: 0 4px 12px -3px rgba(138,106,44,.8);
}

/* ============================================================
   6. VAGUE DE SÉPARATION — clin d'œil à H2O
   ============================================================ */


/* ============================================================
   7. ADAPTATIONS
   ============================================================ */

@media (max-width: 720px) {
  .pr-hero-inner { padding: 5rem 0 6rem; }
  .pr-stats { gap: 1.6rem; }
  .pr-cta .pr-btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .pr-js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none; }
  .pr-tool, .pr-profil, .pr-btn { transition: none !important; }
}

/* Thème sombre : les cartes de verre doivent rester lisibles */


@media print {
  .pr-hero { min-height: auto; background: #fff; }
  .pr-progress { display: none !important; }
  .pr-title, .pr-lede, .pr-stat b, .pr-stat span { color: #0f2a2e !important; }
  .pr-tool { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}

/* ============================================================
   8. ANIMATIONS ENRICHIES — ajout du 26 août
   ============================================================ */

/* --- Entrée en cascade des grilles ------------------------- */
/* Chaque carte arrive légèrement après la précédente. Le délai
   est porté par une variable pour rester réglable d'un endroit. */

.pr-js .pr-tools > *,
.pr-js .en-suites > * {
  opacity: 0;
  transform: translateY(22px) scale(.985);
  animation: prEntree .72s var(--pr-ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes prEntree { to { opacity: 1; transform: none; } }

/* --- Inclinaison 3D des cartes au survol ------------------- */

.pr-tool {
  transform-style: preserve-3d;
  will-change: transform;
}
.pr-tool:hover {
  transform: translateY(-1px) perspective(900px)
             rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

/* --- Titres de section : révélation par masque ------------- */

.pr-js .section-title { overflow: hidden; }
.pr-js [data-reveal] .section-title,
.pr-js .section-title[data-reveal] { display: block; }
.pr-js .en-parcours-titre,
.pr-js .section-title {
  animation: none;
}
.pr-js [data-reveal]:not(.pr-in) .section-title {
  clip-path: inset(0 0 100% 0);
}
.pr-js [data-reveal].pr-in .section-title {
  clip-path: inset(0 0 -10% 0);
  transition: clip-path .95s var(--pr-ease-out) .12s;
}

/* --- Parallaxe douce du contenu du hero -------------------- */

.pr-hero-inner { will-change: transform; }

/* --- Soulignement qui balaie les liens du menu ------------- */

.nav-desktop a { position: relative; }
.nav-desktop a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -3px;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-accent-600));
  transform: scaleX(0); transform-origin: right;
  transition: transform .42s var(--pr-ease-out);
}
.nav-desktop a:hover::after { transform: scaleX(1); transform-origin: left; }

/* --- Pictogrammes d'outil : rebond au survol --------------- */

.pr-tool:hover @keyframes prRebond {
  0%   { transform: scale(1) rotate(0); }
  35%  { transform: scale(1.14) rotate(-7deg); }
  65%  { transform: scale(1.02) rotate(3deg); }
  100% { transform: scale(1.08) rotate(-4deg); }
}

/* --- Chiffre-héros des calculateurs : apparition ----------- */

.h2o-hero-val {
  animation: prChiffre .68s var(--pr-ease-out);
}
@keyframes prChiffre {
  from { opacity: 0; transform: translateY(14px) scale(.94); letter-spacing: -.06em; }
  to   { opacity: 1; transform: none; }
}

/* --- Barres comparatives : remplissage animé --------------- */

.h2o-bar-fill {
  animation: prBarre .95s var(--pr-ease-out);
  transform-origin: left;
}
@keyframes prBarre { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* --- Aires du graphique : dessin progressif ---------------- */

.h2o-chart path { animation: prAire 1.1s var(--pr-ease-out); }
@keyframes prAire { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; } }

/* --- Étapes de vie : lueur pulsée quand prioritaires ------- */

.step-card.pr-hot::after {
  content: '';
  position: absolute; inset: -3px;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(138,106,44,.55);
  animation: prHalo 2.6s ease-out infinite;
  pointer-events: none;
}
@keyframes prHalo {
  70%  { box-shadow: 0 0 0 14px rgba(138,106,44,0); }
  100% { box-shadow: 0 0 0 0 rgba(138,106,44,0); }
}

/* --- Boutons : effet magnétique ---------------------------- */

.pr-btn { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .pr-js .pr-tools > *, .pr-js .en-suites > *,
  .h2o-hero-val, .h2o-bar-fill, .h2o-chart path,
  .step-card.pr-hot::after { opacity: 1; }
  .pr-js [data-reveal]:not(.pr-in) .section-title { clip-path: none; }
  .nav-desktop a::after { transition: none; }
}

/* --- Photo d'ambiance sur les cartes de calculateurs --- */
.pr-tool-img {
  display: block;
  margin: -1.9rem -1.7rem 0;
  order: -1;
}
.pr-tool-img img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
}

/* Hero : les deux chemins sous le bouton Épargne */
.pr-chemins { margin: 1rem 0 0; font-size: .95rem; color: rgba(255,255,255,.78); display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; }
.pr-chemins a { color: #fff; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255,255,255,.45); }
.pr-chemins a:hover { text-decoration-color: #fff; }
.pr-lede, .pr-chemins { text-shadow: 0 1px 16px rgba(5,15,18,.65); }
