/* ==========================================================================
   Page d'accueil publique. Chargée uniquement sur `/`, en plus d'app.css dont
   elle reprend les tokens (couleurs, rayons, espacements). Les transparences
   sont dérivées des tokens avec color-mix().
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/public/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/public/fonts/fraunces-latin-wght-italic.woff2") format("woff2");
}

:root {
  --display: "Fraunces", Georgia, "Times New Roman", serif;
}

.home {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dot-ink: color-mix(in srgb, var(--green-900) 13%, transparent);
  --dots: radial-gradient(var(--dot-ink) 1px, transparent 1.3px);
  --shadow-deep: 0 40px 80px -40px color-mix(in srgb, var(--ink) 35%, transparent);
  --on-dark-soft: color-mix(in srgb, var(--ink-inverse) 72%, transparent);
  --on-dark-muted: color-mix(in srgb, var(--ink-inverse) 55%, transparent);
  --on-dark-line: color-mix(in srgb, var(--ink-inverse) 12%, transparent);
  flex: 1;
  width: 100%;
  overflow-x: clip;
}

body:has(.home) .topbar {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom-color: transparent;
  backdrop-filter: saturate(1.4) blur(10px);
}

body:has(.home) .topbar .brand {
  gap: 10px;
}

body:has(.home) .topbar .brand__mark {
  position: relative;
  width: 32px;
  height: 36px;
  place-items: center start;
  padding-left: 8px;
  border-radius: 4px 9px 9px 4px;
  background: var(--green-900);
  box-shadow: inset 4px 0 0 var(--green-800),
    0 6px 14px -6px color-mix(in srgb, var(--green-900) 60%, transparent);
  font-family: var(--display);
  font-style: italic;
  font-size: 19px;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.25s ease;
}

body:has(.home) .topbar .brand__mark::after {
  content: "";
  position: absolute;
  top: -2px;
  bottom: -2px;
  right: 4px;
  width: 3px;
  border-radius: 2px;
  background: var(--lime);
}

body:has(.home) .topbar .brand:hover .brand__mark {
  transform: rotate(-6deg);
}

body:has(.home) .topbar .brand__name {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

body:has(.home) .topbar .brand__de {
  font-style: italic;
  font-weight: 400;
  color: var(--green-600);
}

.h-wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* ------------------------------- Titres --------------------------------- */

.h-display,
.h-title,
.h-final__title {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.035em;
  font-optical-sizing: auto;
}

.h-title em,
.h-display mark,
.h-final__title mark {
  font-style: italic;
}

.h-title {
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.05;
  max-width: 22ch;
}

.h-title em {
  color: var(--green-600);
}

.h-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-600);
}

.h-eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: currentColor;
}

.h-eyebrow--lime {
  color: var(--lime);
}

.h-sub {
  margin-top: var(--space-4);
  max-width: 58ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.h-head {
  margin-bottom: var(--space-7);
}

.h-head--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: var(--space-6);
  align-items: center;
}

.h-head--split .h-sub {
  margin-top: 0;
}

.h-section {
  padding: 72px 0;
}

/* ------------------------------- Boutons -------------------------------- */

.h-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.h-cta--center {
  justify-content: center;
}

.h-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.2;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.h-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.h-btn .wi {
  width: 18px;
  height: 18px;
  vertical-align: 0;
  transition: transform 0.2s ease;
}

.h-btn:hover .wi {
  transform: translateX(3px);
}

.h-btn--primary {
  background: var(--green-900);
  color: var(--ink-inverse);
  box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--green-900) 55%, transparent);
}

.h-btn--primary .wi {
  color: var(--lime);
}

.h-btn--primary:hover {
  background: var(--green-800);
  box-shadow: 0 16px 32px -10px color-mix(in srgb, var(--green-900) 60%, transparent);
}

.h-btn--lime {
  background: var(--lime);
  color: var(--green-900);
  box-shadow: 0 12px 32px -12px color-mix(in srgb, var(--lime) 60%, transparent);
}

.h-btn--lime:hover {
  background: var(--lime-dark);
}

.h-btn--quiet {
  color: var(--ink);
  border-color: var(--border-strong);
}

.h-btn--quiet:hover {
  background: var(--surface);
}

.h-btn--quiet-inverse {
  color: var(--ink-inverse);
  border-color: color-mix(in srgb, var(--ink-inverse) 30%, transparent);
}

.h-btn--quiet-inverse:hover {
  background: color-mix(in srgb, var(--ink-inverse) 8%, transparent);
}

/* --------------------------------- Hero --------------------------------- */

.h-hero {
  position: relative;
  padding: 56px 0 40px;
}

.h-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--dots);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent);
  mask-image: linear-gradient(to bottom, black 40%, transparent);
  pointer-events: none;
}

.h-hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: calc(var(--space-7) + var(--space-5));
  align-items: center;
}

.h-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-5);
  padding: 6px 14px 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--green-800);
}

.h-kicker__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-600);
}

.h-kicker__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--green-600);
  opacity: 0;
  animation: h-ping 2.4s 0.6s ease-out;
}

.h-display {
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.98;
  color: var(--ink);
}

.h-display mark,
.h-final__title mark {
  color: inherit;
  padding: 0 0.06em;
  margin: 0 -0.06em;
  background: linear-gradient(
      100deg,
      transparent 0.2em,
      var(--lime) 0.2em,
      var(--lime) calc(100% - 0.1em),
      transparent calc(100% - 0.1em)
    )
    0 0.58em / 100% 0.42em no-repeat;
  animation: h-highlight 0.9s 0.5s cubic-bezier(0.6, 0, 0.2, 1) backwards;
}

/* Hero : en plus du surlignage, « ne dit pas » est souligné d'un trait lime
   tracé à la main (SVG en ligne dans le <mark>), dessiné de gauche à droite
   une fois le surlignage en place. */
.h-display mark {
  position: relative;
  white-space: nowrap;
}

.h-scribble {
  position: absolute;
  left: -0.04em;
  bottom: -0.16em;
  width: calc(100% + 0.08em);
  height: 0.34em;
  overflow: visible;
  pointer-events: none;
}

.h-scribble path {
  fill: none;
  stroke: var(--lime);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.h-scribble__main {
  stroke-width: 5;
  animation: h-scribble 0.6s 1.2s cubic-bezier(0.6, 0, 0.2, 1) backwards;
}

.h-scribble__redo {
  stroke-width: 3;
  animation: h-scribble 0.4s 1.7s cubic-bezier(0.6, 0, 0.2, 1) backwards;
}

.h-lead {
  margin: var(--space-5) 0;
  max-width: 52ch;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.h-hero__copy .h-lead {
  max-width: none;
  text-align: justify;
  hyphens: auto;
}

.h-lead strong {
  color: var(--ink);
}

/* Quatre bénéfices du hero : deux colonnes (gauche puis droite, remplissage
   vertical). Ordre dans le markup = colonne gauche, puis colonne droite. */
.h-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-6);
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
}

.h-point:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.h-point:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.h-point:nth-child(3) {
  grid-column: 2;
  grid-row: 1;
}

.h-point:nth-child(4) {
  grid-column: 2;
  grid-row: 2;
}

.h-point {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
}

.h-point__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--green-900);
  color: var(--lime);
}

.h-point__icon .wi {
  width: 20px;
  height: 20px;
  vertical-align: 0;
}

.h-point__body {
  display: grid;
}

.h-point__title {
  font-size: 16px;
  color: var(--ink);
}

.h-reassure {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.h-reassure li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.h-reassure .wi {
  color: var(--green-600);
}

.h-sites {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin: 56px 0 0;
  padding: var(--space-5) 0 0;
  border-top: 1px solid var(--border);
  color: var(--ink-soft);
}

.h-sites__lead {
  flex: none;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Défilement lent et continu : la piste contient trois fois la même liste et
   glisse d'une liste (un tiers) avant de reprendre, sans à-coup. Les bords
   s'estompent par un masque. Pause au survol. */
.h-sites__viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
  mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}

.h-sites__marquee {
  display: flex;
  width: max-content;
  animation: h-sites-scroll 60s linear infinite;
  will-change: transform;
}

.h-sites__viewport:hover .h-sites__marquee {
  animation-play-state: paused;
}

.h-sites__list {
  display: flex;
  flex: none;
  align-items: center;
  gap: calc(var(--space-7) + var(--space-4));
  margin: 0;
  padding: 0 calc(var(--space-7) + var(--space-4)) 0 0;
  list-style: none;
}

.h-sites__name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  opacity: 0.8;
}

.h-sites__name--bienici {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.h-sites__name--bd {
  font-family: var(--display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ------------------------- Hélice de biens (hero) ----------------------- */

/* Chaque carte est placée sur une hélice verticale : `--rel` (posé par
   home.js) est sa distance à la carte de face, en nombre de cartes. */
/* Tailles proportionnelles à la largeur de l'hélice (conteneur) pour qu'elle
   tienne dans sa colonne à toute largeur. Plafonnées pour l'affichage en une
   colonne. Chaque carte porte sa propre perspective (voir .helix__item). */
.helix {
  --helix-card: min(43cqi, 232px);
  --helix-radius: min(49cqi, 262px);
  --helix-pitch: min(9.5cqi, 50px);
  --helix-perspective: min(340cqi, 1800px);
  --helix-step: 30deg;
  container-type: inline-size;
  /* Les z-index des cartes restent dans l'hélice (sinon elles passent au-dessus
     de la barre du haut au défilement). */
  isolation: isolate;
  position: relative;
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.helix__eyebrow {
  justify-self: center;
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 19px;
  font-weight: 500;
  color: var(--green-800);
}

.helix__stage {
  position: relative;
  height: 500px;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}

.helix__stage.is-dragging {
  cursor: grabbing;
}

/* Pas de `preserve-3d` : des cartes en 3D imbriquée se découpent quand elles
   se croisent (bandes blanches). Chaque carte est projetée seule, et son
   empilement suit sa profondeur (cos de l'angle) via z-index. */
.helix__track {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.helix__item {
  --angle: calc(var(--rel) * var(--helix-step));
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--helix-card);
  transform: translate(-50%, -50%) perspective(var(--helix-perspective))
    translateY(calc(var(--rel) * var(--helix-pitch)))
    rotateY(var(--angle)) translateZ(var(--helix-radius));
  z-index: round(nearest, calc(cos(var(--angle)) * 100));
  opacity: clamp(0, calc((cos(var(--angle)) - 0.08) * 2.4), 1);
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.helix__item.is-hidden {
  pointer-events: none;
}

.helix-card {
  display: grid;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--ink) 45%, transparent);
  overflow: hidden;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.helix__stage.is-dragging .helix-card {
  cursor: grabbing;
}

.helix-card:hover {
  transform: translateY(-4px);
}

.helix-card:focus-visible {
  outline: 3px solid var(--green-600);
  outline-offset: 3px;
}

.helix__item.is-front .helix-card {
  box-shadow: 0 0 0 3px var(--lime),
    0 24px 48px -18px color-mix(in srgb, var(--green-900) 55%, transparent);
}

.helix-card__photo {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  background: var(--surface-sunken);
}

.helix-card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.helix-card .grade-stamp {
  position: absolute;
  top: 12px;
  right: 12px;
}

.helix-card__body {
  display: grid;
  gap: 3px;
  padding: 14px 18px 16px;
}

.helix-card__city {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.helix-card__meta {
  overflow: hidden;
  font-size: 13px;
  color: var(--ink-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.helix-card__price {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 17px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.helix__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.helix__nav {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.helix__nav:hover {
  border-color: var(--green-900);
  transform: translateY(-1px);
}

.helix__nav:focus-visible {
  outline: 3px solid var(--green-600);
  outline-offset: 2px;
}

.helix__nav .wi {
  width: 18px;
  height: 18px;
  vertical-align: 0;
}

.helix__hint {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

/* --------------------------- Note de prix A–F --------------------------- */

.grade-stamp {
  --grade-color: var(--grade-d);
  --grade-ink: var(--ink);
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--grade-color);
  color: var(--grade-ink);
  box-shadow: 0 0 0 3px var(--surface),
    0 8px 16px -6px color-mix(in srgb, var(--ink) 50%, transparent);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  transform: rotate(-8deg);
}

.grade-stamp--lg {
  width: 60px;
  height: 60px;
  font-size: 32px;
}

.grade-stamp--a { --grade-color: var(--grade-a); --grade-ink: var(--surface); }
.grade-stamp--b { --grade-color: var(--grade-b); --grade-ink: var(--surface); }
.grade-stamp--c { --grade-color: var(--grade-c); --grade-ink: var(--ink); }
.grade-stamp--d { --grade-color: var(--grade-d); --grade-ink: var(--ink); }
.grade-stamp--e { --grade-color: var(--grade-e); --grade-ink: var(--ink); }
.grade-stamp--f { --grade-color: var(--grade-f); --grade-ink: var(--surface); }

.grade-scale {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
}

.grade-scale__seg {
  display: grid;
  place-items: center;
  height: 30px;
  background: var(--seg);
  color: var(--seg-ink);
  font-size: 13px;
  font-weight: 800;
  opacity: 0.3;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.grade-scale__seg:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.grade-scale__seg:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.grade-scale__seg.is-active {
  opacity: 1;
  transform: scaleY(1.3);
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--ink) 55%, transparent);
}

.grade-scale__seg.is-works {
  opacity: 0.75;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 5px,
    color-mix(in srgb, var(--surface) 45%, transparent) 5px 8px
  );
}

.grade-scale__seg--a { --seg: var(--grade-a); --seg-ink: var(--surface); }
.grade-scale__seg--b { --seg: var(--grade-b); --seg-ink: var(--surface); }
.grade-scale__seg--c { --seg: var(--grade-c); --seg-ink: var(--ink); }
.grade-scale__seg--d { --seg: var(--grade-d); --seg-ink: var(--ink); }
.grade-scale__seg--e { --seg: var(--grade-e); --seg-ink: var(--ink); }
.grade-scale__seg--f { --seg: var(--grade-f); --seg-ink: var(--surface); }

/* --------------------------- Sur l'annonce (démo) ----------------------- */

.h-onpage {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.h-onpage__head .h-title {
  max-width: none;
}

.h-onpage__intro {
  margin: var(--space-5) 0 0;
  max-width: none;
  font-size: clamp(18px, 1.85vw, 21px);
  line-height: 1.65;
  color: var(--ink);
  text-wrap: balance;
}

.demo {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr) 28px;
  /* Première ligne = hauteur de la barre du navigateur : le panneau démarre
     au niveau de la fiche et finit à son niveau. */
  grid-template-rows: 48px auto auto;
}

.demo__browser {
  position: relative;
  grid-column: 1 / 3;
  grid-row: 1 / 3;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-deep), var(--shadow-card);
  overflow: hidden;
}

.demo__chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}

.demo__dots {
  display: flex;
  gap: 6px;
}

.demo__dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}

.demo__url {
  flex: 1;
  min-width: 0;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo__ext {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--green-900);
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 60%, transparent);
}

.demo__listing {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 49%;
  padding: 16px;
}

/* Le ratio 16/11 est un minimum : la photo grandit si le panneau est plus
   haut, pour que les deux blocs finissent à la même hauteur. */
.demo__photo {
  flex: 1 0 auto;
  aspect-ratio: 16 / 11;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-sunken);
}

.demo__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo__info {
  padding-top: 14px;
}

.demo__info p {
  margin: 0;
}

.demo__price {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.demo__info .demo__title {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
}

.demo__place {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.demo__info .demo__blurb {
  margin-top: 10px;
  font-family: var(--display);
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.demo__panel {
  grid-column: 2 / 4;
  grid-row: 2 / 3;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-deep), var(--shadow-card);
}

/* En-tête en bandeau vert profond, pleine largeur du panneau. */
.demo__panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -14px -14px 12px;
  padding: 12px 14px;
  border-radius: 15px 15px 0 0;
  background: var(--green-900);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-inverse);
}

.demo__mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--lime);
  color: var(--green-900);
  font-size: 12px;
  font-weight: 800;
}

.demo__status {
  position: relative;
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
}

.demo__status-run {
  position: absolute;
  right: 0;
  white-space: nowrap;
  color: color-mix(in srgb, var(--ink-inverse) 70%, transparent);
  opacity: 0;
}

.demo__status-done {
  color: var(--lime);
}

.demo__rows {
  flex: 1;
  display: grid;
  grid-auto-rows: 1fr;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.demo__row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon label value"
    "icon tag tag";
  align-items: center;
  column-gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-muted);
}

.demo__row-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--green-900);
  color: var(--lime);
}

.demo__row-icon .wi {
  width: 16px;
  height: 16px;
  vertical-align: 0;
}

.demo__row-label {
  grid-area: label;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.demo__row-value {
  grid-area: value;
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--green-900);
}

.demo__tag {
  grid-area: tag;
  justify-self: start;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
}

.demo__tag--warn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--danger);
}

.demo__tag--warn .wi {
  width: 12px;
  height: 12px;
  flex: none;
  vertical-align: 0;
}

.demo__tag--lime,
.demo__tag--ok {
  color: var(--green-800);
}

.demo__tag--muted {
  color: var(--ink-muted);
}

/* Fenêtre de l'extension, ouverte sous son icône. Hauteurs fixes : le curseur
   vise le bouton « Sauvegarder » par un déplacement calculé (h-cursor). */
.demo__popup {
  position: absolute;
  top: 44px;
  right: 10px;
  z-index: 2;
  display: grid;
  gap: 8px;
  width: 236px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-deep), var(--shadow-card);
  font-size: 12px;
  transform-origin: calc(100% - 15px) 0;
  opacity: 0;
}

.demo__popup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 22px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-800);
}

.demo__popup-listing {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  height: 40px;
}

.demo__popup-listing img {
  width: 48px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
}

.demo__popup-listing > span {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.demo__popup-listing strong,
.demo__popup-listing span span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.demo__popup-listing span span {
  color: var(--ink-muted);
}

.demo__popup-label {
  height: 14px;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  color: var(--ink-muted);
}

.demo__popup-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  margin-top: -4px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 600;
}

.demo__popup-select .wi {
  width: 14px;
  height: 14px;
  color: var(--ink-muted);
}

.demo__save {
  position: relative;
  display: grid;
  height: 36px;
  border-radius: 10px;
  background: var(--lime);
  color: var(--green-900);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.demo__save > span {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.demo__save-idle {
  opacity: 0;
}

/* Curseur : sa pointe est posée sur l'icône de l'extension (pose de repos). */
.demo__cursor {
  position: absolute;
  top: 22px;
  left: calc(100% - 26px);
  z-index: 3;
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px color-mix(in srgb, var(--ink) 30%, transparent));
  opacity: 0;
  pointer-events: none;
}

.demo__note {
  grid-column: 1 / 2;
  grid-row: 3;
  justify-self: center;
  margin: 18px 0 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 19px;
  font-weight: 500;
  color: var(--green-800);
  transform: rotate(-3deg);
}

.demo__note::after {
  content: " ↗";
  font-style: normal;
  color: var(--green-600);
}

/* Chronologie, lancée par home.js quand la démo entre à l'écran :
   annonce (0,1 s) → clic sur l'extension (1,4 s) → fenêtre de l'extension →
   clic « Sauvegarder » (2,4 s) → fenêtre fermée → fiche du carnet (3,2 s) →
   analyses une à une → « 6 analyses prêtes » (4,8 s).
   Sans animation, seul l'état final reste : annonce et fiche du carnet. */
.demo--animate .demo__browser {
  animation: h-rise 0.7s 0.1s var(--ease-soft) backwards;
}

.demo--animate .demo__cursor {
  animation: h-cursor 2.4s 0.6s cubic-bezier(0.45, 0, 0.25, 1) both;
}

.demo--animate .demo__ext {
  animation: h-ext 1s 1.4s ease-out backwards;
}

.demo--animate .demo__popup {
  animation: h-popup 1.75s 1.5s var(--ease-soft) both;
}

.demo--animate .demo__save {
  animation: h-press 0.3s 2.4s ease;
}

.demo--animate .demo__save-idle {
  animation: h-hold 1.05s 1.5s linear;
}

.demo--animate .demo__save-done {
  animation: h-fade 0.3s 2.55s ease backwards;
}

.demo--animate .demo__panel {
  animation: h-slide 0.7s 3.2s var(--ease-soft) backwards;
}

.demo--animate .demo__status-run {
  animation: h-hold 1.6s 3.2s linear;
}

.demo--animate .demo__status-done {
  animation: h-fade 0.4s 4.8s ease backwards;
}

.demo--animate .demo__row {
  animation: h-row 0.5s calc(3.5s + var(--i) * 0.22s) var(--ease-soft) backwards,
    h-flash 1.2s calc(3.5s + var(--i) * 0.22s) ease-out;
}

.demo--animate .demo__note {
  animation: h-note 0.6s 5.2s var(--ease-soft) backwards;
}

/* ------------------------- Jouez avec le prix --------------------------- */

.h-lab__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  gap: 72px;
  align-items: center;
}

.h-checks {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

.h-checks li {
  display: flex;
  gap: var(--space-3);
  font-size: 16px;
}

.h-checks .wi {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--green-900);
  vertical-align: 0;
}

.h-checks--light .wi {
  background: var(--green-900);
  color: var(--lime);
}

.lab {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-deep), var(--shadow-card);
}

.lab__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}

.lab__kind {
  margin: 0;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lab__place {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.lab__ref {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
  text-align: right;
}

.lab__ref strong {
  font-size: 15px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.lab__verdict {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.lab__letter {
  width: 76px;
  height: 76px;
  font-size: 42px;
  transition: background 0.25s ease, color 0.25s ease;
}

.lab__letter.is-bump {
  animation: h-bump 0.3s var(--ease-out);
}

.lab__label {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lab__index {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.grade-scale--lab .grade-scale__seg {
  height: 34px;
}

.lab__control {
  display: grid;
  gap: var(--space-2);
}

.lab__control-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.lab__control-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.lab__price {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.lab__bounds {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.lab__modes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.lab__modes .pill {
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
}

.lab__market {
  margin: 0;
  padding-top: var(--space-4);
  border-top: 1px dashed var(--border-strong);
  font-size: 14px;
  color: var(--ink-soft);
}

/* Curseur : piste remplie jusqu'à `--fill` (posé par home.js). */
.range {
  --fill: 50%;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    to right,
    var(--green-900) var(--fill),
    var(--surface-sunken) var(--fill)
  );
}

.range::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border: 3px solid var(--green-900);
  border-radius: 50%;
  background: var(--lime);
  box-shadow: var(--shadow-raised);
  transition: transform 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.range::-moz-range-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
}

.range::-moz-range-progress {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--green-900);
}

.range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid var(--green-900);
  border-radius: 50%;
  background: var(--lime);
  box-shadow: var(--shadow-raised);
}

.range:active::-webkit-slider-thumb {
  transform: scale(1.12);
}

.range:focus-visible {
  outline: none;
}

.range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green-600) 35%, transparent);
}

.range:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green-600) 35%, transparent);
}

/* --------------------------- Analyse des photos ------------------------- */

.h-photos {
  background: var(--panel);
  color: var(--ink-inverse);
}

.h-photos__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 72px;
  align-items: center;
}

.h-photos .h-title em {
  color: var(--lime);
}

.h-photos .h-sub {
  color: var(--on-dark-soft);
}

.pa-shot {
  margin: 0;
}

.pa-shot__frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 40px 80px -30px color-mix(in srgb, var(--ink) 80%, transparent);
  transform: rotate(-1.2deg);
}

.pa-shot__frame img {
  display: block;
  width: 100%;
  height: auto;
}

.pa-shot__scan {
  position: absolute;
  inset: 0 0 auto;
  height: 30%;
  background: linear-gradient(
    to bottom,
    transparent,
    color-mix(in srgb, var(--lime) 40%, transparent) 85%,
    var(--lime)
  );
  opacity: 0;
  pointer-events: none;
}

.pa-shot__spots {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pa-spot {
  position: absolute;
  top: var(--y);
  left: var(--x);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transform-origin: 0 0;
  transition: opacity 0.3s calc(1.5s + var(--d) * 0.25s) ease,
    transform 0.45s calc(1.5s + var(--d) * 0.25s) var(--ease-out);
}

.pa-spot--left {
  flex-direction: row-reverse;
  transform-origin: 100% 0;
  left: auto;
  right: calc(100% - var(--x));
}

.pa-spot__dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -14px -14px 0;
  border-radius: 50%;
  background: var(--lime);
  color: var(--green-900);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 35%, transparent);
  font-size: 13px;
  font-weight: 800;
}

.pa-spot__label {
  margin-top: -14px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--ink-inverse);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.pa-shot__caption {
  margin-top: var(--space-4);
  font-size: 12.5px;
  color: var(--on-dark-muted);
}

.pa-plan__list {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

.pa-plan__item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-3);
  row-gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.pa-plan__icon {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--lime) 12%, transparent);
  color: var(--lime);
}

.pa-plan__icon .wi {
  width: 18px;
  height: 18px;
  vertical-align: 0;
}

.pa-plan__label {
  font-size: 14px;
  font-weight: 600;
}

.pa-plan__range {
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pa-plan__bar {
  grid-column: 2 / 4;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--on-dark-line);
  overflow: hidden;
}

.pa-plan__bar span {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  transition: width 0.9s calc(0.3s + var(--d) * 0.15s) var(--ease-soft);
}

.pa-plan__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  padding: var(--space-3) 12px 0;
  border-top: 1px dashed var(--on-dark-line);
  font-size: 14px;
  color: var(--on-dark-soft);
}

.pa-plan__total strong {
  font-size: 18px;
  color: var(--ink-inverse);
  font-variant-numeric: tabular-nums;
}

.pa-shift {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--on-dark-line);
  border-radius: var(--radius-md);
}

.pa-shift .grade-stamp {
  box-shadow: 0 0 0 3px var(--panel);
}

.pa-shift__arrow {
  color: var(--lime);
}

.pa-shift__arrow .wi {
  width: 20px;
  height: 20px;
  vertical-align: 0;
}

.pa-shift__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--on-dark-soft);
}

.pa-shift__text strong {
  color: var(--ink-inverse);
}

/* ------------------------------- Décodeur ------------------------------- */

.h-decoder {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* Six cartes : la formule d'agence barrée en haut, la réponse chiffrée du
   carnet en bas sur vert profond. Le trait barre la formule à l'apparition. */
.decoder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.decoder__card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-muted);
  box-shadow: var(--shadow-card);
}

.decoder__claim {
  padding: var(--space-5) var(--space-5) var(--space-4);
}

.decoder__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.decoder__label .wi {
  width: 14px;
  height: 14px;
  vertical-align: 0;
}

.decoder__quote {
  justify-self: start;
  width: fit-content;
  margin: var(--space-2) 0 0;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(21px, 2vw, 25px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink-muted);
  background: linear-gradient(var(--danger), var(--danger)) 0 58% / 100% 2px no-repeat;
  transition: background-size 0.6s calc(var(--d, 0) * 90ms + 0.35s)
    cubic-bezier(0.6, 0, 0.2, 1);
}

.decoder__answer {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--space-5);
  background: var(--green-900);
  color: var(--ink-inverse);
}

.decoder__label--answer {
  color: var(--lime);
}

.decoder__figure {
  margin: var(--space-3) 0 var(--space-1);
  font-family: var(--display);
  font-size: clamp(30px, 3vw, 38px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--lime);
}

.decoder__fact {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink-inverse);
}

.decoder__detail {
  flex: 1;
  margin: var(--space-2) 0 var(--space-4);
  font-size: 14px;
  line-height: 1.5;
  color: color-mix(in srgb, var(--ink-inverse) 72%, transparent);
}

.decoder__source {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid color-mix(in srgb, var(--ink-inverse) 16%, transparent);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--ink-inverse) 8%, transparent);
  font-size: 11.5px;
  font-weight: 600;
  color: color-mix(in srgb, var(--ink-inverse) 85%, transparent);
}

/* --------------------------- Adresse précise ---------------------------- */

.h-address {
  position: relative;
  background: var(--green-900);
  color: var(--ink-inverse);
  overflow: hidden;
}

.h-address::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    color-mix(in srgb, var(--lime) 12%, transparent) 1px,
    transparent 1.3px
  );
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 80% 50%, black, transparent 70%);
  mask-image: radial-gradient(circle at 80% 50%, black, transparent 70%);
}

.h-address__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 72px;
  align-items: center;
}

.h-address .h-title em {
  color: var(--lime);
}

.h-address .h-sub {
  color: color-mix(in srgb, var(--ink-inverse) 78%, transparent);
}

.finder {
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: 0 40px 80px -30px color-mix(in srgb, var(--ink) 50%, transparent);
  transform: rotate(1.2deg);
}

.finder__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
}

.finder__title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.finder__meta {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.finder__criteria {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--space-4) 0 var(--space-5);
  padding: 0;
  list-style: none;
}

.finder__criteria li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 5px;
  border-radius: var(--radius-pill);
  background: var(--green-100);
  color: var(--green-900);
  font-size: 12px;
  font-weight: 600;
}

.finder__criteria .wi {
  width: 13px;
  height: 13px;
  vertical-align: 0;
  color: var(--green-600);
}

.finder__list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.finder__item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.finder__item.is-best {
  border-color: var(--green-900);
  background: color-mix(in srgb, var(--lime) 14%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 60%, transparent);
}

.finder__rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-sunken);
  font-size: 12px;
  font-weight: 700;
}

.is-best .finder__rank {
  background: var(--green-900);
  color: var(--lime);
}

.finder__address {
  font-weight: 650;
}

.finder__score {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.finder__bar {
  grid-column: 2 / 4;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  overflow: hidden;
}

.finder__bar span {
  display: block;
  width: var(--score);
  height: 100%;
  border-radius: inherit;
  background: var(--border-strong);
  transition: width 1.1s calc(var(--d, 0) * 160ms + 0.3s) var(--ease-soft);
}

.is-best .finder__bar span {
  background: var(--green-600);
}

/* ------------------------- De l'annonce à l'offre ----------------------- */

/* Bandeau vert profond : la section se détache du hero (beige) au-dessus et de
   la démo (blanche) en dessous, comme la section « adresse ». */
.h-journey {
  position: relative;
  background: var(--green-900);
  color: var(--ink-inverse);
  overflow: hidden;
}

.h-journey::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    color-mix(in srgb, var(--lime) 12%, transparent) 1px,
    transparent 1.3px
  );
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 85% 0%, black, transparent 60%);
  mask-image: radial-gradient(circle at 85% 0%, black, transparent 60%);
  pointer-events: none;
}

.h-journey .h-wrap {
  position: relative;
}

.h-journey .h-title em {
  color: var(--lime);
}

.h-journey .h-sub {
  max-width: none;
  text-wrap: balance;
  color: color-mix(in srgb, var(--ink-inverse) 78%, transparent);
}

.journey-wrap {
  position: relative;
}

/* Rail qui se remplit au défilement (animation-timeline), sinon à l'apparition. */
.journey__rail {
  position: absolute;
  top: 27px;
  left: 28px;
  right: 28px;
  height: 2px;
  background: color-mix(in srgb, var(--ink-inverse) 22%, transparent);
}

.journey__rail span {
  display: block;
  height: 100%;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left center;
}

@supports (animation-timeline: view()) {
  .journey__rail span {
    animation: h-rail linear both;
    animation-timeline: view();
    animation-range: entry 60% cover 55%;
  }
}

@supports not (animation-timeline: view()) {
  .journey__rail span {
    transform: none;
  }
}

.journey {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey__step {
  display: grid;
  align-content: start;
  gap: var(--space-2);
}

.journey__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-3);
  border: 2px solid var(--lime);
  border-radius: 50%;
  background: var(--green-900);
  color: var(--lime);
}

.journey__step:first-child .journey__icon {
  background: var(--lime);
  color: var(--green-900);
}

.journey__icon .wi {
  width: 24px;
  height: 24px;
  vertical-align: 0;
}

/* Survol d'une icône : le rond se remplit de lime comme la première étape et monte
   un peu ; le dessin mime l'étape (micro-interaction d'icône du design
   system : une fois, 0,5 à 0,6 s, pose finale conservée tant que dure le survol). */
.journey__icon {
  cursor: default;
  transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}

.journey__icon:hover {
  transform: translateY(-3px);
  background: var(--lime);
  color: var(--green-900);
}

.journey__icon .wi {
  transform-origin: 50% 50%;
}

.journey__icon--pin .wi {
  transform-origin: 50% 90%;
}

.journey__icon--clipboard .wi {
  transform-origin: 50% 20%;
}

.journey__icon--pin:hover .wi {
  animation: journey-pin 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.journey__icon--camera:hover .wi {
  animation: journey-camera 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.journey__icon--clipboard:hover .wi {
  animation: journey-clipboard 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.journey__icon--coins:hover .wi {
  animation: journey-coins 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.journey__icon--key-round:hover .wi {
  animation: journey-key 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes journey-pin {
  0% {
    transform: translateY(0) scale(1);
  }
  30% {
    transform: translateY(-5px) scale(1.1);
  }
  60% {
    transform: translateY(0) scale(0.92);
  }
  100% {
    transform: translateY(0) scale(1.06);
  }
}

@keyframes journey-camera {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(0.9);
  }
  55% {
    transform: scale(1.22);
  }
  100% {
    transform: scale(1.06);
  }
}

@keyframes journey-clipboard {
  0% {
    transform: rotate(0) scale(1);
  }
  30% {
    transform: rotate(-14deg) scale(1.06);
  }
  60% {
    transform: rotate(8deg) scale(1.06);
  }
  100% {
    transform: rotate(0) scale(1.06);
  }
}

@keyframes journey-coins {
  0% {
    transform: translateY(0) rotate(0) scale(1);
  }
  35% {
    transform: translateY(-4px) rotate(-12deg) scale(1.1);
  }
  65% {
    transform: translateY(1px) rotate(6deg) scale(1);
  }
  100% {
    transform: translateY(0) rotate(0) scale(1.06);
  }
}

@keyframes journey-key {
  0% {
    transform: rotate(0) scale(1);
  }
  45% {
    transform: rotate(-22deg) scale(1.12);
  }
  100% {
    transform: rotate(-10deg) scale(1.06);
  }
}

.journey__num {
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  color: var(--lime);
}

.journey__title {
  font-size: 21px;
  letter-spacing: -0.02em;
  color: var(--ink-inverse);
}

.journey__text {
  margin: 0;
  color: color-mix(in srgb, var(--ink-inverse) 78%, transparent);
  font-size: 15px;
}

.journey__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.journey__tags li {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--ink-inverse) 16%, transparent);
  background: color-mix(in srgb, var(--ink-inverse) 8%, transparent);
  color: var(--ink-inverse);
  font-size: 12px;
  font-weight: 600;
}

/* -------------------------------- Final --------------------------------- */

.h-final {
  position: relative;
  padding: 72px 0;
  background: var(--panel);
  color: var(--ink-inverse);
  text-align: center;
  overflow: hidden;
}

.h-final::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    color-mix(in srgb, var(--ink-inverse) 9%, transparent) 1px,
    transparent 1.3px
  );
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at center, black, transparent 70%);
  mask-image: radial-gradient(ellipse at center, black, transparent 70%);
}

.h-final__inner {
  position: relative;
}

.h-final__title {
  font-size: clamp(44px, 7vw, 96px);
  line-height: 1;
}

.h-final__title mark {
  color: var(--green-900);
  background: var(--lime);
  padding: 0 0.12em 0.04em;
  margin: 0;
  border-radius: 0.12em;
  animation: none;
}

.h-final__lead {
  margin: var(--space-5) auto var(--space-6);
  max-width: 50ch;
  font-size: 18px;
  color: var(--on-dark-soft);
}

.h-start {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
  max-width: 980px;
  margin: 72px auto 0;
  padding: var(--space-6) 0 0;
  border-top: 1px solid var(--on-dark-line);
  list-style: none;
  text-align: left;
}

.h-start li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  align-items: start;
  font-size: 14.5px;
  color: var(--on-dark-soft);
}

.h-start strong {
  color: var(--ink-inverse);
}

.h-start__num {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid color-mix(in srgb, var(--lime) 60%, transparent);
  border-radius: 50%;
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  color: var(--lime);
}

.h-start__badge {
  grid-column: 2;
  justify-self: start;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--gold-soft);
  color: var(--gold-ink);
  font-size: 12px;
  font-weight: 700;
}

/* --------------------------- Fiche d'un bien ---------------------------- */

.modal--showcase .modal__dialog--wide {
  max-width: min(880px, 100%);
  max-height: min(92vh, 860px);
  padding: 0;
  overflow: auto;
  text-align: left;
}

.modal--showcase .modal__close {
  z-index: 2;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.showcase__content {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.showcase__photo {
  position: relative;
  margin: 0;
  min-height: 100%;
  background: var(--surface-sunken);
}

.showcase__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase__photo .grade-stamp {
  position: absolute;
  left: var(--space-5);
  bottom: var(--space-5);
}

.showcase__body {
  display: grid;
  align-content: start;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-5) var(--space-5);
}

.showcase__place {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-800);
}

.modal--showcase .showcase__title {
  margin: 0;
  padding-right: 2.25rem;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.showcase__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin: 0;
}

.showcase__price strong {
  font-size: 26px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.showcase__price span {
  font-size: 14px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.showcase-grade {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.showcase-grade__label,
.showcase-grade__works {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.showcase-grade__works {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.showcase-grade__works .wi {
  margin-top: 2px;
  color: var(--green-600);
  vertical-align: 0;
}

.showcase__facts {
  margin: 0;
}

.showcase__facts dt,
.showcase__facts dd {
  margin: 0;
}

.showcase__facts .kv__key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.showcase__facts .kv__key .wi {
  width: 15px;
  height: 15px;
  vertical-align: 0;
}

.showcase__note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
  text-align: right;
}

/* Ouverture : la fiche part de la carte cliquée (variables posées par home.js). */
.showcase.is-flip {
  animation: showcase-in 0.3s var(--ease-out) both;
}

.showcase.is-flip .showcase__body {
  animation: h-fade 0.25s 0.12s ease backwards;
}

/* ------------------------------ Apparitions ----------------------------- */

.home.reveal-on [data-reveal] {
  transition: opacity 0.7s calc(var(--d, 0) * 90ms) ease,
    transform 0.7s calc(var(--d, 0) * 90ms) var(--ease-soft);
}

.home.reveal-on [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(18px);
}

.home.reveal-on .finder[data-reveal]:not(.is-visible) {
  transform: translateY(18px) rotate(1.2deg);
}

.home.reveal-on [data-reveal]:not(.is-visible) .decoder__quote {
  background-size: 0 2px;
}

.home.reveal-on [data-reveal]:not(.is-visible) .finder__bar span,
.home.reveal-on [data-reveal]:not(.is-visible) .pa-plan__bar span {
  width: 0;
}

.home.reveal-on [data-reveal]:not(.is-visible) .pa-spot {
  opacity: 0;
  transform: scale(0.6);
}

.home.reveal-on .pa-shot.is-visible .pa-shot__scan {
  animation: h-scan 1.4s 0.3s ease-in-out;
}

/* ------------------------------ Keyframes ------------------------------- */

@keyframes h-ping {
  0% {
    opacity: 0.7;
    transform: scale(0.6);
  }
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}

@keyframes h-scribble {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes h-highlight {
  from {
    background-size: 0 0.42em;
  }
}

@keyframes h-rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@keyframes h-slide {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.97);
  }
}

@keyframes h-ext {
  from {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--lime) 90%, transparent);
  }
  60% {
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--lime) 0%, transparent);
  }
}

/* Déplacements calculés depuis la pose de repos (pointe sur l'icône de
   l'extension) : bouton « Sauvegarder » de la fenêtre à (−103 px, 191 px). */
@keyframes h-cursor {
  0% {
    opacity: 0;
    transform: translate(-190px, 210px) scale(1);
  }
  8% {
    opacity: 1;
  }
  33% {
    transform: translate(0, 0) scale(1);
  }
  36% {
    transform: translate(0, 0) scale(0.82);
  }
  40%,
  52% {
    transform: translate(0, 0) scale(1);
  }
  73% {
    transform: translate(-103px, 191px) scale(1);
  }
  76% {
    transform: translate(-103px, 191px) scale(0.82);
  }
  80%,
  90% {
    opacity: 1;
    transform: translate(-103px, 191px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-103px, 191px) scale(1);
  }
}

@keyframes h-popup {
  0% {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
  12%,
  88% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

@keyframes h-hold {
  from,
  to {
    opacity: 1;
  }
}

@keyframes h-fade {
  from {
    opacity: 0;
  }
}

@keyframes h-row {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes h-flash {
  0%,
  30% {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--lime) 80%, transparent) inset;
  }
  100% {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--lime) 0%, transparent) inset;
  }
}

@keyframes h-press {
  50% {
    transform: scale(0.96);
  }
}

@keyframes h-note {
  from {
    opacity: 0;
    transform: rotate(-3deg) translateY(10px);
  }
}

@keyframes h-bump {
  50% {
    transform: rotate(-8deg) scale(1.12);
  }
}

@keyframes h-scan {
  0% {
    opacity: 0;
    transform: translateY(-100%);
  }
  15%,
  85% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateY(340%);
  }
}

@keyframes h-rail {
  to {
    transform: scaleX(1);
  }
}

@keyframes h-sites-scroll {
  to {
    transform: translateX(-33.3333%);
  }
}

@keyframes showcase-in {
  from {
    opacity: 0.4;
    transform: translate(var(--from-x, 0), var(--from-y, 0)) scale(var(--from-s, 0.9));
  }
}

@media (prefers-reduced-motion: reduce) {
  .home *,
  .home *::before,
  .home *::after {
    animation: none !important;
    transition: none !important;
  }

  .home.reveal-on [data-reveal]:not(.is-visible),
  .home.reveal-on [data-reveal]:not(.is-visible) .pa-spot {
    opacity: 1;
    transform: none;
  }

  .journey__rail span {
    transform: none;
  }

  .journey__icon:hover {
    transform: none;
  }

  .journey__icon:hover .wi {
    transform: scale(1.06);
  }

  /* Sites compatibles : liste fixe, une seule fois, qui peut passer à la ligne. */
  .h-sites {
    flex-wrap: wrap;
  }

  .h-sites__viewport {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .h-sites__marquee {
    width: auto;
    flex-wrap: wrap;
  }

  .h-sites__list {
    flex-wrap: wrap;
    padding: 0;
    gap: var(--space-3) var(--space-6);
  }

  .h-sites__list[aria-hidden="true"] {
    display: none;
  }
}

/* ------------------------------ Responsive ------------------------------ */

@media (max-width: 1040px) {
  .h-hero__grid,
  .h-lab__grid,
  .h-photos__grid,
  .h-address__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
  }

  .h-head--split {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
  }

  .decoder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lab,
  .finder {
    max-width: 560px;
  }

  .journey__rail {
    top: 28px;
    bottom: 28px;
    left: 27px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .journey__rail span {
    width: 100%;
    height: 100%;
    transform: scaleY(0);
    transform-origin: center top;
  }

  @supports (animation-timeline: view()) {
    .journey__rail span {
      animation-name: h-rail-y;
      animation-range: entry 30% cover 75%;
    }
  }

  @supports not (animation-timeline: view()) {
    .journey__rail span {
      transform: none;
    }
  }

  .journey {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
  }

  .journey__step {
    grid-template-columns: 56px minmax(0, 1fr);
    column-gap: var(--space-5);
    row-gap: var(--space-1);
  }

  .journey__icon {
    grid-row: 1 / span 4;
    margin-bottom: 0;
  }
}

@keyframes h-rail-y {
  to {
    transform: scaleY(1);
  }
}

@media (max-width: 720px) {
  .h-section {
    padding: 56px 0;
  }

  .h-final {
    padding: 56px 0;
  }

  .h-hero {
    padding-top: 40px;
  }

  .h-points {
    grid-template-columns: minmax(0, 1fr);
  }

  .h-point:nth-child(n) {
    grid-column: 1;
    grid-row: auto;
  }

  .helix {
    --helix-card: 160px;
    --helix-radius: 290px;
    --helix-pitch: 40px;
  }

  .helix {
    --helix-perspective: 1200px;
  }

  .helix__stage {
    height: 420px;
  }

  .helix__hint {
    font-size: 12px;
  }

  .helix-card__body {
    padding: 12px 12px 14px;
  }

  .helix-card__city {
    font-size: 19px;
  }

  .helix-card__meta {
    font-size: 12px;
  }

  .demo {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .demo__browser,
  .demo__panel {
    grid-column: 1;
    grid-row: auto;
  }

  /* Navigateur trop bas pour la fenêtre de l'extension : elle déborde sur
     l'emplacement de la fiche du carnet, qui n'apparaît qu'après. */
  .demo__browser {
    overflow: visible;
  }

  .demo__chrome {
    border-radius: 17px 17px 0 0;
  }

  .demo__listing {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: var(--space-3);
    width: auto;
  }

  .demo__info {
    padding-top: 0;
  }

  .demo__info .demo__blurb {
    display: none;
  }

  .demo__panel {
    margin: -6px 12px 0;
  }

  .demo__note {
    display: none;
  }

  .lab {
    padding: var(--space-5);
  }

  .lab__letter {
    width: 64px;
    height: 64px;
    font-size: 34px;
  }

  .pa-spot__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .pa-shift {
    grid-template-columns: auto auto auto;
  }

  .pa-shift__text {
    grid-column: 1 / -1;
  }

  .decoder {
    grid-template-columns: minmax(0, 1fr);
  }

  .h-start {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 48px;
  }

  .h-sites {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    margin-top: 40px;
  }

  .h-sites__lead {
    text-align: center;
  }

  .showcase__content {
    grid-template-columns: minmax(0, 1fr);
  }

  .showcase__photo {
    aspect-ratio: 3 / 2;
    min-height: 0;
  }

  .showcase__body {
    padding: var(--space-5);
  }

  .showcase__facts .kv__row {
    flex-wrap: wrap;
  }

  .showcase__facts .kv__value {
    text-align: left;
  }

  body:has(.home) .topbar__inner {
    background: transparent;
  }

  body:has(.home) .topbar--nav-open .topbar__inner {
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
  }
}

/* Le CTA d'inscription du hero est juste en dessous : la barre reste sur une ligne. */
@media (max-width: 480px) {
  body:has(.home) .topbar__account .btn--dark {
    display: none;
  }
}
