.intro > :not(.intro-note) { grid-column: 1; }

/* Note manuscrite, avec une flèche dessinée vers le simulateur, comme sur la galerie. */
.intro-note {
  position: relative;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: end;
  color: var(--green-mint);
}

.intro-note p {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 1.5rem;
  transform: rotate(-4deg);
}

/* La flèche déborde sur la section crème jusqu'au-dessus du simulateur. Elle part du bas de la note, à 56px
   (padding bas de .intro) du bord de la bande sombre : le dégradé de la flèche passe du menthe au vert feuille
   à cet endroit (56 / 250). */
.intro-note svg {
  position: absolute;
  top: 100%;
  left: 24px;
  width: 110px;
  height: 250px;
}

.intro-note-mint { stop-color: var(--green-mint); }
.intro-note-leaf { stop-color: var(--green-leaf); }

/* Même mise en scène que l'intro du logement, puis la note s'écrit et la flèche se dessine vers le simulateur. */
@media (prefers-reduced-motion: no-preference) {
  .intro-note p { animation: intro-note-write 0.9s ease-out 0.9s both; }
  .intro-note svg { animation: intro-arrow-draw 0.7s ease-in-out 1.75s both; }
}

/* Débords verticaux et à gauche pour ne pas couper les jambages et les boucles de Kalam. */
@keyframes intro-note-write {
  from { clip-path: inset(-0.4em 100% -0.4em -8px); }
  to { clip-path: inset(-0.4em -8px -0.4em -8px); }
}

/* La flèche descend : un masque qui se lève de haut en bas la dessine, pointe en dernier. */
@keyframes intro-arrow-draw {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0); }
}

/* Le tarif et le simulateur : l'explication et la carte ticket du simulateur, dans la même section crème. */
.pricing-text p:not(.eyebrow) {
  max-width: 62ch;
  margin: 0 0 20px;
  line-height: 1.7;
  opacity: 0.88;
  text-wrap: pretty;
}

.pricing-text p:last-child { margin-bottom: 0; }

/* Entrée quand la section arrive à l'écran (dès le chargement, elle est dans le premier écran) : le sur-titre et
   le titre glissent depuis la gauche comme le texte de la maison du logement, puis le ticket monte en place avec
   le rebond des polaroids, puis ses trois tarifs apparaissent l'un après l'autre comme les photos de la mosaïque
   de l'accueil, et enfin les deux paragraphes glissent depuis la gauche. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .pricing-text > * {
    animation: slide-from-left 0.7s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--reveal-step) * 0.1s) both paused;
  }

  .pricing-text > :nth-child(1) { --reveal-step: 0; }
  .pricing-text > :nth-child(2) { --reveal-step: 1; }
  .pricing-text > :nth-child(3) { --reveal-step: 10; }
  .pricing-text > :nth-child(4) { --reveal-step: 11; }

  .pricing-body .rates-card { animation: ticket-rise 0.9s cubic-bezier(0.34, 1.4, 0.64, 1) 0.25s both paused; }

  .rates-list div {
    animation: gallery-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) calc(0.75s + var(--reveal-step) * 0.1s) both paused;
  }

  .rates-list div:nth-child(1) { --reveal-step: 0; }
  .rates-list div:nth-child(2) { --reveal-step: 1; }
  .rates-list div:nth-child(3) { --reveal-step: 2; }

  .pricing.is-visible .pricing-text > *,
  .pricing.is-visible .rates-card,
  .pricing.is-visible .rates-list div { animation-play-state: running; }
}

@keyframes slide-from-left { from { opacity: 0; transform: translateX(-32px); } }
@keyframes ticket-rise { from { opacity: 0; transform: translateY(32px); } }
@keyframes gallery-rise { from { opacity: 0; transform: translateY(16px) scale(0.96); } }

/* Simulateur : une carte blanche façon ticket, calculateur en haut, grille des tarifs en bas, séparés par une
   perforation avec une encoche de chaque côté. Les encoches sont de vrais trous, comme sur le ticket de l'intro
   d'avant : chaque partie a un fond blanc fait de deux moitiés en radial-gradient, transparentes à l'endroit des
   encoches (centrées sur la jonction des deux parties). L'ombre est un drop-shadow, qui suit le contour, encoches
   comprises : des ronds crème posés sur la carte laissaient l'ombre filer tout droit derrière eux. */
.rates-card {
  color: var(--green-dark);
  filter: drop-shadow(0 18px 20px rgba(var(--shadow-tint), 0.18)) drop-shadow(0 2px 3px rgba(var(--shadow-tint), 0.08));
}

.rates-calculator,
.rates-list {
  --notch-y: 100%;
  background:
    radial-gradient(circle 14px at 0 var(--notch-y), transparent 13.5px, var(--white) 14px) left / 51% 100% no-repeat,
    radial-gradient(circle 14px at 100% var(--notch-y), transparent 13.5px, var(--white) 14px) right / 51% 100% no-repeat;
}

.rates-calculator {
  padding: 40px 40px 32px;
  border-radius: 8px 8px 0 0;
}

/* Calculateur : total du séjour selon le nombre de voyageurs et de nuits (JS). Sur une ligne : la note, les
   compteurs et le total, qui se partagent la place restante (5 pour 4 ; une somme sous 1 ne la distribuerait
   pas toute), à partir d'une base nulle : la largeur du bloc du total ne dépend pas du montant affiché, sinon
   elle bougeait à chaque clic et décalait les compteurs. Quand la note sur deux lignes ne
   laisse plus la place (fenêtres moyennes), le total passe dessous, en pleine largeur, plutôt que la note ne
   déborde sur les compteurs. */
.rates-calculator {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 48px;
}

.rates-calculator-title { flex: 5 0 0; }
.rates-calculator-fields { flex: none; }
.rates-calculator-result { flex: 4 0 0; }

.rates-calculator-title {
  margin: 0;
  white-space: nowrap;
  font-family: var(--font-hand);
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--green-leaf);
}

@media (scripting: none) {
  .rates-calculator-title,
  .rates-calculator-fields,
  .rates-calculator-result { display: none; }
}

.rates-calculator-fields {
  display: flex;
  gap: 32px;
}

.rates-calculator-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  color: rgba(var(--shadow-tint), 0.65);
}

/* Compteur : − chiffre + dans une pilule crème à contour, comme les champs du formulaire de la page contact,
   pour qu'on voie qu'il se règle ; le bouton survolé se soulève en blanc. */
.rates-stepper {
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 999px;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px rgba(var(--shadow-tint), 0.18);
}

/* Le padding bas remonte le − et le + d'un pixel : centrés par la boîte de la police, ils paraissaient bas. */
.rates-stepper button {
  width: 40px;
  height: 40px;
  padding: 0 0 2px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--green-leaf);
  font: 600 1.3rem var(--font-body);
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.rates-stepper button:hover {
  background: var(--white);
  box-shadow: 0 2px 6px rgba(var(--shadow-tint), 0.15);
}

.rates-stepper button:active { transform: scale(0.94); }

.rates-stepper input {
  width: 3ch;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: 1.6rem var(--font-display);
  text-align: center;
  appearance: textfield;
}

.rates-stepper input::-webkit-inner-spin-button,
.rates-stepper input::-webkit-outer-spin-button { appearance: none; }

.rates-stepper input:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--green-mint);
  outline-offset: 2px;
}

.rates-calculator-result {
  display: grid;
  justify-items: end;
  gap: 6px;
  margin: 0;
  padding: 24px 28px;
  border-radius: 8px;
  background: var(--green-dark);
  color: var(--cream);
}

/* Largeur minimale du plus grand total possible (4 voyageurs, 30 nuits : « 453 000 XPF », « 453,000 XPF »),
   les chiffres de DM Serif n'étant pas tous de la même largeur : le bloc ne s'élargit pas quand le montant
   change, même quand il n'a que sa largeur minimale. */
.rates-calculator-total {
  min-width: 5.5em;
  text-align: right;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.rates-calculator-euros {
  font-size: 0.8rem;
  color: rgba(253, 246, 234, 0.6);
  font-variant-numeric: tabular-nums;
}

.rates-calculator-detail {
  font-family: var(--font-hand);
  font-size: 1rem;
  color: var(--green-mint);
}

/* La grille chevauche le calculateur d'un pixel (et ses encoches sont centrées 1px plus bas) : bord à bord, les
   deux fonds laissaient un filet clair à la jonction. La perforation (::before), centrée sur la jonction, s'arrête
   avant les encoches pour ne pas traverser les trous. */
.rates-list {
  --notch-y: 1px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: -1px 0 0;
  padding: 25px 40px 40px;
  border-radius: 0 0 8px 8px;
}

.rates-list::before {
  content: "";
  position: absolute;
  top: 0;
  right: 40px;
  left: 40px;
  border-top: 2px dashed rgba(var(--shadow-tint), 0.22);
}

.rates-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
}

.rates-list div:first-child { padding-left: 0; }
.rates-list div:last-child { padding-right: 0; }
.rates-list div + div { border-left: 1px solid rgba(var(--shadow-tint), 0.12); }

.rates-list dt { font-size: 0.95rem; }

.rates-list dt small {
  display: block;
  font-size: 0.8rem;
  color: rgba(var(--shadow-tint), 0.65);
}

.rates-list dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.rates-list dd span {
  display: block;
  font-family: var(--font-hand);
  font-size: 0.9rem;
  color: var(--green-leaf);
}

/* Le ticket d'abord : titre, ticket en pleine largeur, puis le détail en deux colonnes, comme les conditions
   sous un billet. */
.pricing-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 56px;
}

.pricing-text { display: contents; }
.pricing-text > :not(p:not(.eyebrow)) { grid-column: 1 / -1; }

.pricing-body .rates-card {
  grid-column: 1 / -1;
  order: 1;
  margin: 24px 0 36px;
}

.pricing-text p:not(.eyebrow) {
  order: 2;
  margin: 0;
  font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 860px) {
  .intro-note { display: none; }

  .rates-calculator {
    flex-direction: column;
    align-items: stretch;
    padding: 28px 20px 24px;
  }

  .rates-list::before {
    right: 20px;
    left: 20px;
  }

  .rates-calculator-fields { justify-content: space-between; }

  .rates-list {
    grid-template-columns: 1fr;
    padding: 1px 20px 12px;
  }

  .rates-list div,
  .rates-list div:first-child,
  .rates-list div:last-child { padding: 16px 0; }

  .rates-list div + div {
    border-left: 0;
    border-top: 1px solid rgba(var(--shadow-tint), 0.12);
  }

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

  .pricing-body .rates-card { margin: 24px 0 28px; }
  .pricing-text p:not(.eyebrow) + p { margin-top: 16px; }

  /* Petits téléphones : note, compteurs et total resserrés pour tenir dans la carte. */
  @media (max-width: 374px) {
    .rates-calculator { padding-inline: 16px; }

    .rates-list::before {
      right: 16px;
      left: 16px;
    }

    .rates-list { padding-inline: 16px; }

    .rates-calculator-title { font-size: 1.3rem; }

    .rates-calculator-fields { gap: 12px; }

    .rates-stepper button {
      width: 34px;
      height: 34px;
    }

    .rates-calculator-result { padding-inline: 20px; }
  }
}
