/*
 * Home page sections — ported from src/components/home/*.astro (Hero, ServicesGrid, Intro,
 * Comparison, Advantages, Social, FinalCta). Process and Visit, shared with other pages, are in
 * sections.css, which loads after this file on /.
 */

/* Two-tone headings: font-size is inherited anyway; declaring it keeps Chrome from painting the
 * grey second line at the clamp() minimum of --fs-h2 / --fs-statement in full-page captures of a
 * background tab (seen only with the split stylesheets, never with one bundle). No visual change. */
.t-h2 .tone,
.t-statement .tone {
  font-size: inherit;
}

/* ── Hero « La Galerie » ─────────────────────────────────────────────────
 * A centred column of type, then the car presented on the page itself: the studio backdrop is
 * #f8f8f8 like the page, the photo has no frame and its edges are feathered into the page with
 * masks. */
.hero {
  position: relative;
  overflow: clip;
  padding-top: clamp(2.75rem, 1.5rem + 3.5vh, 4.5rem);
  padding-bottom: clamp(4.5rem, 3rem + 4vw, 7rem);
  background: var(--paper);
  text-align: center;
}

.hero__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.hero__h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__eyebrow {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.hero__title {
  display: block;
  max-width: 13.5em;
  margin-top: 0.875rem;
  font-size: clamp(2.5rem, 1.5rem + 3.4vw, 4.5rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.hero__sub {
  max-width: 36ch;
  margin-top: 1.375rem;
  font-size: clamp(1.1875rem, 1.12rem + 0.28vw, 1.3125rem);
  line-height: 1.38;
  letter-spacing: -0.01em;
  color: var(--stone-600);
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.75rem;
  margin-top: 1.875rem;
}

/* The owner's note under the buttons: requests can also be sent on WhatsApp. A quiet white pill,
 * the WhatsApp green kept for the mark only (the floating button's #1da851). */
.hero__wa {
  margin-top: 1.5rem;
}

.hero__wa a {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.125rem 0.55rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.9375rem;
  line-height: 1.35;
  letter-spacing: -0.006em;
  color: var(--stone-600);
  text-decoration: none;
  transition: border-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.hero__wa .icon {
  flex: none;
  color: #1da851;
}

.hero__wa-num {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.hero__wa a:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

/* — The object ——————————————————————————————————————————— */
.hero__figure {
  /* Eased feather: no straight edge, no visible frame. */
  --fx: 8%;
  --fy-top: 10%;
  --fy-bottom: 18%;
  --mask-x: linear-gradient(
    90deg,
    transparent 0,
    rgb(0 0 0 / 0.12) calc(var(--fx) * 0.2),
    rgb(0 0 0 / 0.42) calc(var(--fx) * 0.45),
    rgb(0 0 0 / 0.8) calc(var(--fx) * 0.72),
    #000 var(--fx),
    #000 calc(100% - var(--fx)),
    rgb(0 0 0 / 0.8) calc(100% - var(--fx) * 0.72),
    rgb(0 0 0 / 0.42) calc(100% - var(--fx) * 0.45),
    rgb(0 0 0 / 0.12) calc(100% - var(--fx) * 0.2),
    transparent 100%
  );
  --mask-y: linear-gradient(
    180deg,
    transparent 0,
    rgb(0 0 0 / 0.5) calc(var(--fy-top) * 0.5),
    #000 var(--fy-top),
    #000 calc(100% - var(--fy-bottom)),
    rgb(0 0 0 / 0.45) calc(100% - var(--fy-bottom) * 0.5),
    transparent 100%
  );
  width: min(80rem, 100%, calc((100svh - 31rem) * 2.84));
  min-width: min(100%, 44rem);
  aspect-ratio: 2.84;
  margin: clamp(1rem, 0.25rem + 1.6vw, 2rem) auto 0;
  -webkit-mask-image: var(--mask-x), var(--mask-y);
  -webkit-mask-composite: source-in;
  mask-image: var(--mask-x), var(--mask-y);
  mask-composite: intersect;
  /* Anything lighter than the page becomes the page: the wall disappears, the car stays. */
  mix-blend-mode: darken;
}

.hero__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
  /* Lift the studio wall (#efefef–#f6f6f6, warm near the tail lights) just above the page tone;
     the figure's darken blend then clamps it to exactly #f8f8f8. */
  filter: brightness(1.045);
}

/* — Spec strip ———————————————————————————————————————————
 * The list selectors are qualified with .hero so they outrank the ul[role='list'] padding reset
 * of base.css, as the scoped rules do in the reference. */
.hero .hero__specs {
  display: flex;
  justify-content: center;
  margin-top: clamp(1rem, 0.5rem + 1vw, 1.5rem);
  padding-inline: var(--gutter);
}

.hero__specs li {
  padding: 0.125rem clamp(1.25rem, 0.5rem + 1.6vw, 2.25rem);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.004em;
  color: var(--ink);
}

.hero__specs li + li {
  border-left: 1px solid var(--stone-200);
}

/* — Small screens: the car may run wider than the column ———— */
@media (max-width: 47.99rem) {
  .hero {
    padding-top: 3rem;
  }

  .hero__links {
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 1.75rem;
  }

  .hero__wa a {
    border-radius: 1.375rem;
    padding: 0.7rem 1.125rem 0.7rem 0.875rem;
    font-size: 0.875rem;
    text-align: left;
  }

  .hero__wa-more {
    display: none;
  }

  .hero__figure {
    --fx: 10%;
    --fy-top: 9%;
    --fy-bottom: 16%;
    width: 114%;
    margin-inline: -7%;
    aspect-ratio: 2.7;
    margin-top: 1.5rem;
  }

  .hero .hero__specs {
    flex-direction: column;
    align-items: center;
    margin-top: 0.75rem;
  }

  .hero__specs li {
    width: min(17rem, 100%);
    padding: 0.8rem 0;
  }

  .hero__specs li + li {
    border-left: 0;
    border-top: 1px solid var(--stone-200);
  }
}

/* — Motion ———————————————————————————————————————————————
 * The headline and the photograph render immediately (they are the LCP
 * candidates); only the secondary elements fade in. */
@media (prefers-reduced-motion: no-preference) {
  .hero__h1 {
    animation: galerie-lift 1s var(--ease-out) both;
  }

  .hero__sub,
  .hero__links,
  .hero__wa {
    animation: galerie-rise 1s var(--ease-out) both;
  }

  .hero__sub {
    animation-delay: 0.12s;
  }

  .hero__links {
    animation-delay: 0.2s;
  }

  .hero__wa {
    animation-delay: 0.28s;
  }

  .hero__specs {
    animation: galerie-fade 1.2s var(--ease-soft) 0.5s both;
  }
}

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

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

@keyframes galerie-lift {
  from {
    transform: translateY(10px);
  }
}

/* ── Services: a strict grid of tiles (4 × 2 on desktop, swipe row on mobile) ── */
.svc__head {
  display: grid;
  justify-items: center;
  gap: 1rem;
  text-align: center;
}

.svc__sub {
  max-width: 40ch;
}

/* Mobile: swipe row, aligned on the container edge. Qualified with .svc (here and below) so the
   padding outranks the ul[role='list'] reset of base.css, as the scoped rule does in the reference. */
.svc .svc__grid {
  --edge: max(var(--gutter), calc((100vw - var(--container)) / 2));
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78vw, 20rem);
  gap: 0.75rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-inline: var(--edge);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--edge);
  scrollbar-width: none;
}

.svc__grid::-webkit-scrollbar {
  display: none;
}

.svc__cell {
  scroll-snap-align: start;
}

.svc__foot {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

@media (min-width: 64rem) {
  .svc .svc__grid {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
    padding-inline: 0;
    overflow: visible;
  }
}

/* ── L’atelier: statement, wide photograph, facts ───────────────────────── */
.intro__head {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  text-align: center;
}

.intro__head h2 {
  max-width: 16em;
}

.intro__lead {
  max-width: 46ch;
}

.intro__figure {
  margin-top: clamp(3rem, 6vw, 5rem);
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: var(--stone-100);
}

.intro__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro__facts {
  display: grid;
  gap: 0;
  margin-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
}

.intro__facts li {
  display: grid;
  gap: 0.25rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.intro__fact-label {
  font-weight: 600;
}

.intro__fact-text {
  font-size: var(--fs-small);
  color: var(--fg-2);
}

@media (max-width: 47.99rem) {
  .intro__figure {
    aspect-ratio: 4 / 3;
  }
}

@media (min-width: 48rem) {
  .intro__facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
  }

  .intro__facts li {
    padding: 1.5rem 1.5rem 1.5rem 0;
    border-bottom: 0;
  }

  .intro__facts li + li {
    padding-left: 1.5rem;
    border-left: 1px solid var(--line);
  }
}

/* ── Comparison: before/after slider once projects exist, photo diagnosis split until then ── */
.compare__head {
  display: grid;
  justify-items: center;
  gap: 1rem;
  text-align: center;
}

.compare__head .lead {
  max-width: 40ch;
}

.compare__stage {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.compare__stage .ba {
  --ba-ratio: 4 / 5;
}

@media (min-width: 48rem) {
  .compare__stage .ba {
    --ba-ratio: 16 / 9;
  }
}

.compare__caption {
  margin-top: 1rem;
  font-size: var(--fs-xs);
  color: var(--fg-2);
  text-align: center;
}

.compare__foot {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.compare__split {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

.compare__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--stone-100);
}

.compare__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare__cta {
  display: grid;
  justify-items: start;
  gap: 1.25rem;
  max-width: 32rem;
}

@media (min-width: 64rem) {
  .compare__split {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: clamp(4rem, 7vw, 7rem);
  }
}

/* ── Advantages: « Ce qui fait la différence » ──────────────────────────── */
.adv__head {
  display: grid;
  justify-items: center;
  gap: 1rem;
  text-align: center;
}

.adv__list {
  display: grid;
  gap: 0 clamp(2rem, 4vw, 3.5rem);
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

.adv__item {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding-block: 1.5rem 2rem;
  border-top: 1px solid var(--line);
}

.adv__item p {
  color: var(--fg-2);
  font-size: var(--fs-small);
  max-width: 40ch;
}

@media (min-width: 40rem) {
  .adv__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .adv__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── Social strip: Instagram and Google reviews ─────────────────────────── */
.social {
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.social__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 2rem;
}

.social__title {
  font-size: var(--fs-h4);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.social__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.75rem;
  font-size: var(--fs-small);
}

.social__ig {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-weight: 600;
  text-decoration: none;
}

.social__ig:hover {
  text-decoration: underline;
}

.social__reviews {
  color: var(--fg-2);
}

.social__reviews a {
  display: inline-block;
  padding-block: 0.4rem;
  color: var(--fg);
}

/* ── Final call to action and photo diptych ─────────────────────────────── */
.final__text {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  text-align: center;
}

.final__text .lead {
  max-width: 42ch;
}

.final__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.75rem;
  margin-top: 0.75rem;
}

.final__diptych {
  display: grid;
  gap: 0.75rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

.final__figure {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--stone-100);
}

.final__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 40rem) {
  .final__diptych {
    grid-template-columns: 1fr 1fr;
  }
}
