/* Elan Fiscal — thème clair blanc et or, mobile d'abord.
   Toutes les couleurs passent par les variables ci-dessous : un thème sombre pourra les redéfinir plus tard. */
:root {
  /* « only » : interdit au navigateur d'assombrir la page automatiquement (thème sombre de Chrome Android). */
  color-scheme: only light;

  /* Fond et surfaces */
  --bg: #fbf8f1;
  --surface: #ffffff;
  --surface-voile: rgba(255, 255, 255, 0.93); /* panneaux posés sur le décor */
  --surface-carte: #fffdf8;
  --surface-survol: #fff8e6;
  --track: #f1eada;
  --line: #eee3c9;
  --line-strong: #e1cf9f;

  /* Texte */
  --text: #26231d;
  --muted: #6b6458;
  --link: #8a6410;

  /* Accents or et vert */
  --or: #e2b33c;
  --or-vif: #f5c842;
  --or-pale: #fcefc4;
  --or-texte: #8a6410;
  --or-grand: #a87a12; /* grands chiffres décoratifs uniquement */
  --vert: #2f8a5b;
  --positive: #1e7f4f;
  --focus: #2f6fd6;

  /* Couleurs des tranches, du rez-de-chaussée (0) au dernier étage (4) :
     teinte vive pour la barre et les pastilles, fond pâle pour les étages de l'immeuble. */
  --tranche-0: #2a9461;
  --tranche-1: #e5b948;
  --tranche-2: #e5893d;
  --tranche-3: #d65f5f;
  --tranche-4: #a8458f;
  --tranche-0-fond: #eaf5ee;
  --tranche-1-fond: #fcf4dc;
  --tranche-2-fond: #fdeee1;
  --tranche-3-fond: #fbe9e9;
  --tranche-4-fond: #f6eaf3;

  /* Décor : lueur du haut, étoiles montantes, trésor du bas */
  --decor-lueur: rgba(255, 216, 120, 0.42);
  --decor-etoile: #ffffff;
  --decor-halo: rgba(214, 160, 40, 0.85);
  --tresor-hauteur: clamp(84px, 19vh, 210px);
  --tresor-opacite: 1;

  --ombre: 0 1px 2px rgba(90, 64, 10, 0.05), 0 10px 30px rgba(120, 88, 20, 0.08);
  --ombre-forte: 0 2px 4px rgba(90, 64, 10, 0.06), 0 16px 40px rgba(120, 88, 20, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

.t0 { --c: var(--tranche-0); --c-fond: var(--tranche-0-fond); }
.t1 { --c: var(--tranche-1); --c-fond: var(--tranche-1-fond); }
.t2 { --c: var(--tranche-2); --c-fond: var(--tranche-2-fond); }
.t3 { --c: var(--tranche-3); --c-fond: var(--tranche-3-fond); }
.t4 { --c: var(--tranche-4); --c-fond: var(--tranche-4-fond); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.12rem);
  line-height: 1.6;
}
img { display: block; max-width: 100%; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.shell { position: relative; z-index: 1; width: 100%; max-width: 960px; margin-inline: auto; padding-inline: 12px; }
.visually-hidden {
  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: absolute; left: 16px; top: -60px; z-index: 10; padding: 10px 16px;
  background: var(--text); color: #fff; border-radius: 10px; font-weight: 700;
}
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.emoji { font-family: var(--emoji); font-weight: 400; letter-spacing: 0; }

/* ——— Décor ——— */
.decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.decor-lueur {
  position: absolute; inset: 0;
  background:
    radial-gradient(55% 40% at 78% -4%, var(--decor-lueur), transparent 72%),
    radial-gradient(40% 30% at 8% 0%, rgba(255, 244, 214, 0.9), transparent 70%);
}
.decor-ciel { position: absolute; inset: 0; }

.etoile {
  position: absolute; top: 0; left: 0;
  width: var(--taille); height: var(--taille);
  offset-rotate: auto;
  offset-distance: 0%;
  opacity: 0;
  animation: decoller var(--duree) cubic-bezier(0.38, 0.12, 0.62, 1) var(--delai) infinite;
}
.etoile-eclat { position: absolute; inset: 0; animation: scintiller var(--scintillement) ease-in-out infinite alternate; }
.etoile-eclat svg {
  display: block; width: 100%; height: 100%; fill: var(--decor-etoile);
  filter: drop-shadow(0 0 1.5px var(--decor-halo)) drop-shadow(0 0 4px var(--decor-halo)) drop-shadow(0 0 10px rgba(255, 200, 80, 0.8));
}
.etoile-trainee {
  position: absolute; top: 50%; right: 50%;
  width: calc(var(--taille) * 8); height: 2.5px; margin-top: -1.25px; border-radius: 2px;
  background: linear-gradient(to left, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.6) 35%, rgba(255, 255, 255, 0));
  filter: drop-shadow(0 0 1.5px var(--decor-halo)) drop-shadow(0 0 4px rgba(226, 179, 60, 0.6));
}
@keyframes decoller {
  0% { offset-distance: 0%; opacity: 0; }
  10% { opacity: 1; }
  82% { opacity: 0.95; }
  100% { offset-distance: 100%; opacity: 0; }
}
@keyframes scintiller {
  from { transform: scale(0.72) rotate(0deg); opacity: 0.7; }
  to { transform: scale(1.18) rotate(18deg); opacity: 1; }
}
.animations-en-pause .etoile,
.animations-en-pause .etoile-eclat { animation-play-state: paused; }

.decor-tresor {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--tresor-hauteur); opacity: var(--tresor-opacite);
  background:
    url("../assets/tresor-gauche.svg") left bottom / auto 100% no-repeat,
    url("../assets/tresor-droite.svg") right bottom / auto 100% no-repeat,
    url("../assets/tresor-bande.svg") left bottom / auto 38% repeat-x;
}
.decor-tresor::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160%;
  background: radial-gradient(65% 55% at 50% 100%, rgba(255, 212, 110, 0.32), transparent 72%);
}

/* ——— En-tête (esprit Actus FR x5 : marque à gauche, onglets soulignés à droite) ——— */
.masthead { position: relative; z-index: 2; }
.masthead-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 68px; border-bottom: 1px solid var(--line-strong);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; box-shadow: var(--ombre); }
.brand-name { display: none; font-family: var(--serif); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.02em; }
.brand-dot { color: var(--or); }
.masthead-actions { display: flex; align-items: center; gap: 6px; }
.tabs { display: flex; gap: 2px; }
.tab {
  position: relative; min-height: 44px; padding: 0 10px; border: 0; background: transparent;
  color: var(--muted); font: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: color 0.2s;
}
.tab::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 2px; border-radius: 2px;
  background: var(--or); transform: scaleX(0); transition: transform 0.25s ease;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.icon-button {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--or-texte);
  cursor: pointer; transition: background-color 0.2s, border-color 0.2s;
}
.icon-button:hover { background: var(--surface-survol); border-color: var(--or); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.icon-button .icon-lecture { fill: currentColor; stroke-width: 1.5; }
.icon-button[aria-pressed="true"] .icon-pause,
.icon-button[aria-pressed="false"] .icon-lecture { display: none; }

/* ——— Typographie ——— */
h1, h2, h3 { margin: 0; line-height: 1.15; font-family: var(--serif); font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.05rem, 1.25rem + 4vw, 3.6rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.55rem, 1.15rem + 1.9vw, 2.35rem); margin-bottom: 0.65em; }
.lead { margin-bottom: 1em; }
.lead:last-child { margin-bottom: 0; }
.kicker {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px;
  color: var(--or-texte); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.kicker-num { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; letter-spacing: 0; color: var(--or-grand); }

/* ——— Accueil ——— */
.panel:not([hidden]) { animation: apparaitre 0.4s ease both; }
@keyframes apparaitre { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hero { padding: clamp(28px, 6vw, 60px) 4px 8px; }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; color: var(--muted); font-size: 0.85rem; }
.eyebrow-tag {
  padding: 2px 10px; border-radius: 999px; background: var(--or-pale); color: var(--or-texte);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.hero h1 { margin-bottom: 0.3em; }
.hero-sub { margin-bottom: 18px; font-family: var(--serif); font-style: italic; font-size: clamp(1.15rem, 1rem + 0.7vw, 1.45rem); color: var(--or-texte); }
.hero .lead { max-width: 46em; }

.sommaire { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 26px; }
.sommaire-carte {
  position: relative; display: grid; gap: 2px; padding: 14px 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  color: var(--text); text-decoration: none; box-shadow: var(--ombre);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.sommaire-carte:hover { transform: translateY(-3px); box-shadow: var(--ombre-forte); border-color: var(--line-strong); }
.sommaire-num { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--or-grand); line-height: 1.1; }
.sommaire-titre { font-weight: 700; line-height: 1.3; }
.sommaire-texte { color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
.sommaire-fleche { position: absolute; top: 12px; right: 14px; color: var(--or); transition: transform 0.2s ease; }
.sommaire-carte:hover .sommaire-fleche { transform: translateX(3px); }

/* ——— Sections : panneaux clairs posés au-dessus du décor ——— */
.section {
  margin-top: clamp(26px, 5vw, 44px); padding: 22px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-xl);
  background: var(--surface); box-shadow: var(--ombre);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .section { background: var(--surface-voile); -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1); }
}
.section-outro { margin-top: 26px; }
.footnote { margin-top: 26px; color: var(--muted); font-size: 0.93em; }

.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-carte); padding: 14px; }
.card-note { margin-top: 14px; color: var(--muted); font-size: 0.93em; }
.source-chip {
  display: inline-block; margin-left: 4px; padding: 1px 10px; border-radius: 999px; background: var(--or-pale);
  color: var(--or-texte); font-size: 0.8em; font-weight: 700; text-decoration: none; vertical-align: 1px;
}
.source-chip:hover { background: #f9e3a0; }

/* ——— Immeuble ——— */
.floors { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.floor { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 15px 16px; border-radius: var(--radius); background: var(--c-fond); border-left: 4px solid var(--c); }
.floor-title { font-weight: 700; font-size: 1.1em; padding-right: 30px; }
.floor-range { margin-top: 0.15em; }
.floor-crown { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; color: var(--or-grand); }
.dot {
  flex: none; width: 1.1em; height: 1.1em; margin-top: 0.3em; border-radius: 50%;
  background: var(--c);
  background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--c) 40%, #fff) 0, var(--c) 55%, color-mix(in srgb, var(--c) 78%, #000) 100%);
}
.floor .dot { width: 1.25em; height: 1.25em; margin-top: 0.22em; }

/* ——— Collègues ——— */
.profiles { display: grid; gap: 34px; }
.profile + .profile { border-top: 1px solid var(--line); padding-top: 34px; }
.profile-head {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); grid-template-areas: "photo name" "photo meta" "story story";
  column-gap: 14px; align-items: start; margin-bottom: 18px;
}
.portrait { grid-area: photo; width: 84px; height: auto; aspect-ratio: 3 / 4; border-radius: 16px; object-fit: cover; background: var(--track); box-shadow: var(--ombre); }
.profile-name { grid-area: name; font-size: clamp(1.3rem, 1rem + 1.5vw, 2rem); }
.profile-meta { grid-area: meta; margin-top: 4px; color: var(--muted); }
.profile-story { grid-area: story; margin-top: 14px; }

.bar { display: flex; height: 34px; border-radius: 999px; overflow: hidden; background: var(--track); }
.bar-large { height: 50px; margin-top: 22px; }
.seg { display: block; flex: none; width: 0; height: 100%; background: var(--c); transition: width 0.25s ease-out; }
.seg + .seg { box-shadow: inset 2px 0 0 var(--surface-carte); }

.rows { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 11px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row-label { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.row .dot { margin-top: 0; }
.swatch { flex: none; width: 18px; height: 18px; border-radius: 5px; background: var(--c); }

.totals { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.total-final > span:first-child { font-weight: 700; font-size: 1.1em; }
.total-note { margin-top: 6px; color: var(--muted); }
/* Montants en police droite : chiffres alignés et bien lisibles (Georgia dessine des chiffres « elzéviriens »). */
.big { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.7rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.positive { color: var(--positive); }

/* ——— Simulateur ——— */
.simulator { border-color: var(--line-strong); background: var(--surface); box-shadow: 0 12px 34px rgba(201, 151, 28, 0.12); }
.sim-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 4px 16px; }
.sim-label { display: block; font-weight: 700; font-size: 1.1em; }
.sim-head .muted { margin-top: 2px; }
.sim-amount { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.1rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }

.range-wrap { margin: 18px 0 16px; padding: 4px; border-radius: 999px; background: var(--track); box-shadow: inset 0 1px 3px rgba(120, 88, 20, 0.12); }
.range {
  display: block; width: 100%; height: 44px; margin: 0; padding: 0;
  background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.range:focus { outline: none; }
.range::-webkit-slider-runnable-track { height: 44px; background: transparent; border: 0; }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 44px; height: 44px; border: 3px solid var(--or); border-radius: 50%;
  background: #fff; box-shadow: 0 2px 8px rgba(120, 88, 20, 0.3); transition: transform 0.15s;
}
.range:active::-webkit-slider-thumb { transform: scale(1.06); }
.range::-moz-range-track { height: 44px; background: transparent; border: 0; }
.range::-moz-range-thumb { width: 38px; height: 38px; border: 3px solid var(--or); border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(120, 88, 20, 0.3); }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--focus); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--focus); }

.shortcuts { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  color: var(--text); font: inherit; font-size: 0.92em; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}
.chip:hover { background: var(--surface-survol); border-color: var(--or); transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--or-pale); border-color: var(--or); font-weight: 700; }

.simulator .total-row > span:first-child { color: var(--muted); }
.simulator .totals .num { font-weight: 600; }
.result {
  margin-top: 18px; padding: 18px; border-radius: 18px;
  background: linear-gradient(135deg, #fff9e6, var(--or-pale)); border: 1px solid #f0dc9f;
}
.result-label { color: var(--or-texte); font-weight: 700; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.1em; }
.result-amount { margin: 4px 0; font-weight: 800; font-size: clamp(2.7rem, 1.8rem + 3.6vw, 4.1rem); line-height: 1.05; letter-spacing: -0.03em; }
.result-rate, .result-extra { color: var(--muted); }
.result-extra { margin-top: 6px; }
.sim-note { margin-top: 16px; color: var(--muted); font-size: 0.93em; }

/* ——— Piège ——— */
.trap-text p { margin-bottom: 1em; }
.trap-no { font-family: var(--serif); font-size: 1.4em; font-weight: 700; color: #b23b3b; }
.compare-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.compare-after { text-align: right; }
.compare-label { font-weight: 700; }
.compare-amount { margin-top: 4px; font-weight: 800; font-size: clamp(1.5rem, 1.15rem + 2vw, 2.4rem); line-height: 1.15; }
.compare-arrow { color: var(--or); font-size: 1.5em; }
.compare-bottom { display: grid; gap: 10px; padding-top: 18px; }
.compare-bottom .total-note { margin-top: 0; font-size: 0.93em; }

/* ——— Sources, À venir, pied de page ——— */
.source-list { margin: 14px 0 0; padding-left: 1.2em; display: grid; gap: 6px; }
.coming-grid { display: grid; gap: 12px; margin-top: 24px; }
.coming-card { display: grid; gap: 4px; padding: 20px; background: var(--surface); box-shadow: var(--ombre); }
.coming-title { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
.site-footer { position: relative; z-index: 1; margin-top: clamp(40px, 7vw, 72px); }
.footer-inner {
  display: grid; gap: 6px; padding-top: 22px; padding-bottom: calc(var(--tresor-hauteur) + 16px);
  border-top: 1px solid var(--line-strong); font-size: 0.92em; text-align: center;
}
.noscript { position: relative; z-index: 1; margin: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

@media (min-width: 480px) {
  .brand-name { display: inline; }
}

@media (min-width: 640px) {
  .shell { padding-inline: 24px; }
  .tab { padding: 0 14px; }
  .tab::after { left: 14px; right: 14px; }
  .masthead-actions { gap: 12px; }
  .section { padding: 34px 36px; }
  .card { padding: 22px; }
  .floor { padding: 18px 22px; }
  .sommaire { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .sommaire-carte { padding: 18px 18px 20px; }
  .profile-head {
    grid-template-columns: 150px minmax(0, 1fr); grid-template-areas: "photo name" "photo meta" "photo story";
    grid-template-rows: auto auto 1fr; column-gap: 26px;
  }
  .portrait { width: 150px; border-radius: 22px; }
  .profile-story { margin-top: 10px; }
  .chip { padding: 0 24px; font-size: 1em; }
  .result { padding: 24px; }
  .coming-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
