/*
 * Home section "Ici, tes idées prennent vie". Measurements from the Figma frame
 * "2_LES 3 CARTES" (1440px wide): cards 336 × 222, radius 19, icons in a 66px band.
 */
.values {
  --reveal-distance: 64px;
  --reveal-duration: 800ms;

  overflow-x: clip;
  padding: 40px clamp(20px, 7.5vw, 108px) 47px;
}

.values__title {
  color: var(--color-black);
  font-size: clamp(2rem, 3.87vw, 3.5rem);
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}

.values__title-script {
  margin-left: 0.08em;
  font-family: var(--font-script);
  font-size: 1.3em;
  font-weight: 700;
  line-height: 0;
}

.values__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 336px));
  justify-content: space-between;
  gap: 24px;
  max-width: 1226px;
  margin: 50px auto 0;
}

.values__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 222px;
  padding: 16px 14px 24px;
  border-radius: 19px;
  background-color: var(--color-brown);
  color: var(--color-white);
  text-align: center;
  transition:
    transform var(--duration-base) var(--ease-out),
    opacity var(--reveal-duration) var(--ease-out) var(--reveal-delay, 0ms),
    translate var(--reveal-duration) var(--ease-out) var(--reveal-delay, 0ms);
}

/*
 * Scroll reveal on desktop (reveal_controller.js). The entrance uses `translate` so it
 * never fights with the hover `transform: scale()`. Cards are only hidden once JS is ready.
 */
.values__card--from-left {
  --reveal-from: calc(var(--reveal-distance) * -1) 0;
}

.values__card--from-bottom {
  --reveal-from: 0 calc(var(--reveal-distance) * 0.6);
  --reveal-delay: 150ms;
}

.values__card--from-right {
  --reveal-from: var(--reveal-distance) 0;
  --reveal-delay: 300ms;
}

@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .values.is-reveal-ready .values__card:not(.is-revealed) {
    opacity: 0;
    translate: var(--reveal-from);
  }
}

.values__icon {
  --icon-height: 54px;

  width: auto;
  height: var(--icon-height);
  margin-block: calc((66px - var(--icon-height)) / 2);
}

.values__icon--sur-mesure {
  --icon-height: 65px;
}

.values__card-title {
  margin-top: 6px;
  font-size: 1.485rem;
  font-weight: 800;
  line-height: 1.35;
}

.values__card-text {
  max-width: 310px;
  margin-top: 15px;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 19px;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .values__card:hover {
    transform: scale(1.05);
  }
}

.values__dots {
  display: none;
}

/* Below 900px: stacked cards without JS, a looping carousel (carousel_controller.js) with JS. */
@media (max-width: 899.98px) {
  .values {
    padding-top: 48px;
    padding-bottom: 56px;
  }

  .values__list {
    grid-template-columns: minmax(0, 400px);
    justify-content: center;
    gap: 20px;
    margin-top: 32px;
  }

  .values__card-text {
    line-height: 1.4;
  }

  .values.is-carousel .values__viewport {
    max-width: 400px;
    margin: 32px auto 0;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
  }

  .values.is-carousel .values__list {
    position: relative;
    display: flex;
    gap: 16px;
    max-width: none;
    margin: 0;
    padding: 0;
    list-style: none;
    transition: transform 700ms cubic-bezier(0.65, 0, 0.35, 1);
    will-change: transform;
  }

  .values.is-carousel .values__card {
    flex: 0 0 100%;
  }

  .values.is-carousel .values__dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
  }

  .values__dot {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--color-brown);
    cursor: pointer;
  }

  .values__dot::before {
    content: "";
    width: 10px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    transition: background-color var(--duration-base) var(--ease-out);
  }

  .values__dot[aria-current="true"]::before {
    background-color: currentColor;
  }

  .values__dot:focus-visible {
    outline-offset: 0;
    border-radius: 50%;
  }
}
