/*
 * Prestations page, from the Figma frame "GDS_DESKTOP_PAGE2" (1440px wide).
 * Positions in comments are measured under the header, at 1440px.
 */
.plans,
.more-services {
  --wave-height: max(9.86vw, 56px);
}

/* Offers: palm trees, then the brown shore under the two sticker collages. */
.plans {
  --sky-height: max(26.74vw, 200px);
  --overlap: clamp(28px, 3.5vw, 50px);

  position: relative;
  padding: max(15.56vw, 96px) 20px calc(48px + var(--wave-height));
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    var(--color-brown) 45%,
    color-mix(in srgb, var(--color-brown) 60%, var(--color-cream)) 100%
  );
}

.plans__scenery {
  position: absolute;
  inset: 0 0 auto;
}

.plans__palms {
  width: 100%;
  height: calc(var(--sky-height) + 5vw);
  object-fit: cover;
  object-position: 50% 45%;
}

/* The shore path is 1616 wide in Figma and starts 170px left of the frame. */
.plans__shore {
  position: absolute;
  top: var(--sky-height);
  left: -11.8%;
  width: 112.2%;
  max-width: none;
  height: max(8.33vw, 32px);
  fill: var(--color-brown);
}

.plans__list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 500px));
  justify-content: center;
  column-gap: clamp(40px, 9.9vw, 143px);
}

.plan {
  display: flex;
  flex-direction: column;
  scroll-margin-top: 24px;
}

/* The collage is a sticker that overlaps the top of its card. */
.plan__collage {
  position: relative;
  z-index: 2;
  width: 106%;
  max-width: none;
  margin: 0 -3% calc(var(--overlap) * -1);
  filter: drop-shadow(0 18px 24px rgb(0 0 0 / 30%));
  transition: transform 300ms var(--ease-out);
}

.plan--glow-signature {
  --plan-bg: var(--color-cream);
  --plan-ink: var(--color-brown);
  --plan-line: rgb(45 22 6 / 16%);
  --plan-accent: var(--color-olive);
  --plan-accent-soft: rgb(54 60 28 / 12%);
  --plan-soft: rgb(54 60 28 / 6%);
}

.plan--glow-business {
  --plan-bg: var(--color-olive-deep);
  --plan-ink: var(--color-cream);
  --plan-line: rgb(248 245 239 / 18%);
  --plan-accent: var(--color-powder);
  --plan-accent-soft: rgb(239 210 204 / 16%);
  --plan-soft: rgb(248 245 239 / 6%);
}

.plan__card {
  --pin-size: clamp(76px, 7.2vw, 104px);

  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: calc(var(--overlap) + clamp(48px, 4.4vw, 64px)) clamp(24px, 3.3vw, 48px) clamp(28px, 2.8vw, 40px);
  border-radius: 18px;
  background-color: var(--plan-bg);
  color: var(--plan-ink);
  box-shadow: 0 30px 60px rgb(0 0 0 / 30%);
  transition:
    transform 300ms var(--ease-out),
    box-shadow 300ms var(--ease-out);
}

/* Content stays above the hover shine. */
.plan__card > :not(.plan__pin) {
  position: relative;
}

/* Satin shine: a light band parked off the left edge, swept across on hover. */
.plan__card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: linear-gradient(
    115deg,
    transparent 40%,
    var(--plan-shine) 50%,
    transparent 60%
  );
  background-size: 250% 100%;
  background-position: 100% 0;
  background-repeat: no-repeat;
  pointer-events: none;
}

.plan--glow-signature .plan__card {
  --plan-shine: rgb(255 255 255 / 70%);
}

.plan--glow-business .plan__card {
  --plan-shine: rgb(255 255 255 / 13%);
}

/*
 * Safety pin from Figma, clamping the top-left corner. At -8.65deg its shaft runs at 45deg,
 * so the offsets (in pin widths) put the middle of the shaft just inside the corner.
 * It sits under the collage stickers, even while the card is scaled on hover.
 */
.plan__pin {
  position: absolute;
  top: calc(var(--pin-size) * -0.13);
  left: calc(var(--pin-size) * -0.29);
  z-index: 1;
  width: var(--pin-size);
  rotate: -8.65deg;
  filter: drop-shadow(0 5px 4px rgb(0 0 0 / 30%));
}

.plan__name {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 3.9vw, 3.5rem);
  font-weight: 600;
  line-height: 1;
}

.plan__tagline {
  margin-top: 12px;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
}

.plan__description {
  margin-top: 12px;
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.88;
}

.plan__features {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--plan-line);
}

.plan__features-title {
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.plan__feature-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.plan__feature {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  font-size: 1rem;
  line-height: 1.45;
}

.plan__feature::before {
  content: "✓" / "";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--plan-accent-soft);
  color: var(--plan-accent);
  font-size: 0.75rem;
  font-weight: 800;
}

.plan--glow-signature .plan__feature::before {
  color: var(--color-olive);
}

.plan__closing {
  margin-block: 28px;
  padding: 18px 20px;
  border-radius: 12px;
  background-color: var(--plan-soft);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.plan__closing-lead {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.plan__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--plan-line);
}

.plan__price-from {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0.75;
}

.plan__price-amount {
  display: block;
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
}

.plan__button {
  min-height: 50px;
  font-size: 1.0625rem;
  font-weight: 700;
}

.plan--glow-signature .plan__button {
  --btn-bg: var(--color-olive);
  --btn-color: var(--color-cream);
  --btn-border: var(--color-olive);
  --btn-focus: var(--color-olive);
}

.plan--glow-business .plan__button {
  --btn-bg: var(--color-powder);
  --btn-color: var(--color-brown);
  --btn-border: var(--color-powder);
  --btn-focus: var(--color-powder);
}

/* The olive wave that opens "Un projet plus ciblé ?" (Figma "Vector 2", rotated -2.77°). */
.plans__wave {
  position: absolute;
  bottom: -1px;
  left: -9.3%;
  width: 118.1%;
  max-width: none;
  height: calc(var(--wave-height) + 1px);
  fill: var(--color-olive);
}

/* Other services: olive, then the monstera leaves behind the four cards. */
.more-services {
  position: relative;
  margin-top: calc(var(--wave-height) * -0.45);
  background-color: var(--color-olive);
  color: var(--color-white);
  text-align: center;
  scroll-margin-top: calc(var(--wave-height) * 0.6);
}

.more-services__intro {
  padding-inline: 20px;
}

.more-services__title {
  font-size: clamp(2.25rem, 6.25vw, 5.625rem);
  font-weight: 700;
  line-height: 1.23;
  text-shadow: 0 4px 4px rgb(0 0 0 / 25%);
}

.more-services__title-initial {
  font-family: var(--font-script);
  font-size: 1.06em;
}

.more-services__subtitle {
  font-size: clamp(1.125rem, 2.22vw, 2rem);
  font-weight: 300;
  line-height: 1.23;
}

.more-services__body {
  position: relative;
  isolation: isolate;
  padding: clamp(48px, 5.6vw, 80px) 20px clamp(56px, 6.5vw, 93px);
}

.more-services__leaves {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.more-services__body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    var(--color-olive) 0%,
    rgb(54 60 28 / 55%) 22%,
    rgb(54 60 28 / 0%) 55%
  );
}

.more-services__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 360px));
  justify-content: center;
  gap: clamp(24px, 5vw, 72px) clamp(24px, 15.6vw, 225px);
}

/* The whole card is clickable through the title link stretched over it. */
.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 296px;
  padding: 32px 32px 28px;
  border-radius: 24px;
  background-color: var(--color-cream);
  color: var(--color-brown);
  box-shadow: 0 16px 36px rgb(0 0 0 / 22%);
  transition:
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 44px rgb(0 0 0 / 30%);
}

.service-card:has(.service-card__link:focus-visible) {
  outline: 3px solid var(--color-cream);
  outline-offset: 4px;
}

.service-card__name {
  font-size: clamp(1.875rem, 2.73vw, 2.4375rem);
  font-weight: 600;
  line-height: 1.23;
}

.service-card__link {
  text-decoration: none;
}

.service-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.service-card__link:focus-visible {
  outline: none;
}

.service-card__description {
  margin-top: 14px;
  color: var(--color-black);
  font-size: clamp(1.0625rem, 1.37vw, 1.25rem);
  font-weight: 300;
  line-height: 1.35;
}

.service-card__price {
  margin-top: auto;
  padding-top: 16px;
  color: var(--color-black);
  font-size: clamp(1.0625rem, 1.37vw, 1.25rem);
  font-weight: 600;
}

.service-card__cta {
  margin-top: 12px;
  padding: 4px 40px;
  border-radius: var(--radius-pill);
  background-color: var(--color-olive);
  color: var(--color-white);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  transition: background-color var(--duration-base) var(--ease-out);
}

.service-card:hover .service-card__cta {
  background-color: var(--color-olive-ink);
}

/* Closing words on cream, right before the footer. */
.services-outro {
  padding: clamp(28px, 2.4vw, 35px) 20px clamp(56px, 6vw, 87px);
  color: var(--color-black);
  font-size: clamp(1.5rem, 2.78vw, 2.5rem);
  line-height: 1.23;
  text-align: center;
  text-wrap: balance;
}

.services-outro__title {
  font-size: inherit;
  font-weight: 600;
}

.services-outro__text {
  margin-top: 0.45em;
  font-weight: 200;
}

/* Reveal: hidden only once JS is ready and motion is allowed, see reveal_controller.js. */
.plans [data-reveal-target="item"],
.more-services [data-reveal-target="item"] {
  transition:
    opacity 800ms var(--ease-out) var(--reveal-delay, 0ms),
    translate 800ms var(--ease-out) var(--reveal-delay, 0ms),
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.plan + .plan,
.more-services__subtitle,
.service-card:nth-child(even) {
  --reveal-delay: 150ms;
}

@media (max-width: 899.98px) {
  .plans__list {
    grid-template-columns: minmax(0, 560px);
    row-gap: 72px;
  }

  .plan__collage {
    width: 100%;
    margin-inline: 0;
  }
}

@media (max-width: 639.98px) {
  .more-services__list {
    grid-template-columns: minmax(0, 360px);
  }

  .service-card {
    min-height: 0;
  }

  .plan__footer {
    align-items: center;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .plans.is-reveal-ready [data-reveal-target="item"]:not(.is-revealed),
  .more-services.is-reveal-ready [data-reveal-target="item"]:not(.is-revealed) {
    opacity: 0;
    translate: 0 24px;
  }

  /* The collage drops in a touch after its card, then settles. */
  .plans.is-reveal-ready .plan .plan__collage {
    opacity: 0;
  }

  .plans.is-reveal-ready .plan.is-revealed .plan__collage {
    opacity: 1;
    animation: plan-collage-settle 1400ms var(--ease-out) calc(var(--reveal-delay, 0ms) + 200ms) both;
  }
}

@keyframes plan-collage-settle {
  0% {
    opacity: 0;
    translate: 0 -18px;
    rotate: -1.5deg;
    scale: 0.97;
  }

  55% {
    opacity: 1;
    translate: 0 4px;
    rotate: 0.4deg;
    scale: 1.005;
  }

  80% {
    translate: 0 -1px;
    rotate: -0.1deg;
    scale: 1;
  }

  100% {
    opacity: 1;
    translate: 0 0;
    rotate: 0deg;
    scale: 1;
  }
}

/* Hover only where a real pointer can hover: lift the card, sweep the shine once. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .plan:hover .plan__card {
    transform: scale(1.02);
    box-shadow: 0 38px 72px rgb(0 0 0 / 36%);
  }

  .plan:hover .plan__collage {
    transform: translateY(-6px);
  }

  .plan:hover .plan__card::before {
    background-position: 0 0;
    transition: background-position 750ms var(--ease-out);
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-card:hover {
    transform: none;
  }
}
