/* ============================================================
   Guarantee (slug: guarantee) — brief/guarantee.md
   Figma: desktop 3446:1013 (1441.5x576) · mobile 3446:2012 (375x576)
   Pattern B-edge: photo band on the section itself, content in the gutter.
   Mobile-first: base = mobile (<768); 768-1023 = desktop composition,
   padding-defined (D-GUAR-5); 1024+ = Figma desktop mechanics.
   Only .guarantee*-scoped rules (GLOBAL-SCOPE LOCK).
   ============================================================ */

.guarantee {
  /* Section-local fluid tokens (brief §2) — mobile band */
  --guarantee-gap: clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 40px);
  --guarantee-text-gap: clamp(13px, calc(15px + (var(--max-vw) - 375px) * 0.015), 20px);
  --guarantee-head-gap: clamp(7px, calc(8px + (var(--max-vw) - 375px) * 0.015), 8px);
  --guarantee-stamp: clamp(69px, calc(81px + (var(--max-vw) - 375px) * 0.015), 81.25px);

  position: relative;
  isolation: isolate;
  overflow: clip;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  margin-top: var(--section-gap);
  /* Mobile: pt = gutter (20), pb = fixed photo zone 314 (D-GUAR-4, not fluid) */
  padding-top: var(--gutter);
  padding-bottom: 314px;
  border-radius: var(--radius-card);
  /* Gradient sampled from the photo, anchored to the bottom 576px band (D-GUAR-4) */
  background: linear-gradient(180deg,
    #E4E6D8 calc(100% - 576px),
    #DEE0D2 calc(100% - 432px),
    #D8DBCA calc(100% - 288px),
    #CFD4BE calc(100% - 144px),
    #C6CBB4 100%);
}

/* Background photo — mobile: drawn size (576 tall), centred, bottom-anchored */
.guarantee__bg {
  position: absolute;
  z-index: -1;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: none;
  pointer-events: none;
}

.guarantee__bg img {
  display: block;
  width: auto;
  height: 576px;
  max-width: none;
}

/* Stamp + text wrapper (M 3446:2013; D = section itemSpacing) */
.guarantee__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--guarantee-gap);
  width: 100%;
}

.guarantee__stamp {
  display: block;
  flex: none;
  width: var(--guarantee-stamp);
  height: var(--guarantee-stamp);
}

.guarantee__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--guarantee-text-gap);
  width: 100%;
}

.guarantee__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--guarantee-head-gap);
}

.guarantee__eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-lead);
  font-weight: 400;
  line-height: var(--lh-lead);
  color: var(--color-text);
}

.guarantee__title {
  font-family: var(--font-display);
  font-variation-settings: var(--fv-display);
  font-size: var(--text-h2);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-heading);
  color: var(--color-heading);
}

.guarantee__body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--lh-ui);
  color: var(--color-text);
}

/* PSEUDO-TABLET 768-1023 — desktop composition, padding-defined height (D-GUAR-5/6) */
@media (min-width: 768px) {
  .guarantee {
    --guarantee-gap: clamp(25.88px, calc(25.88px + (var(--max-vw) - 768px) * 0.025), 40px);
    --guarantee-text-gap: clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 20px);
    --guarantee-head-gap: clamp(8px, calc(8px + (var(--max-vw) - 768px) * 0.025), 8px);
    --guarantee-stamp: clamp(81.25px, calc(81.25px + (var(--max-vw) - 768px) * 0.025), 81.25px);

    padding-top: 109px;
    padding-bottom: 169px;
    background: linear-gradient(180deg, #E4E6D8 0%, #DEE0D2 25%, #D8DBCA 50%, #CFD4BE 75%, #C6CBB4 100%);
  }

  .guarantee__bg {
    inset: 0;
    transform: none;
    width: 100%;
    height: 100%;
  }

  .guarantee__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 56% 50%;
  }

  .guarantee__text {
    width: 55%;
  }
}

/* DESKTOP 1024+ — Figma mechanics: pt 0, pb 60, centred in min-height 576 (aspect 2.5) */
@media (min-width: 1024px) {
  .guarantee {
    --guarantee-gap: clamp(28px, calc(40px * (var(--max-vw) / var(--vw-base))), 53px);
    --guarantee-text-gap: clamp(14px, calc(20px * (var(--max-vw) / var(--vw-base))), 27px);
    --guarantee-head-gap: clamp(6px, calc(8px * (var(--max-vw) / var(--vw-base))), 11px);
    --guarantee-stamp: clamp(58px, calc(81.25px * (var(--max-vw) / var(--vw-base))), 108px);
    --guarantee-text-w: clamp(294px, calc(413px * (var(--max-vw) / var(--vw-base))), 551px);
    --guarantee-pb: clamp(43px, calc(60px * (var(--max-vw) / var(--vw-base))), 80px);
    --guarantee-h: clamp(410px, calc(576px * (var(--max-vw) / var(--vw-base))), 768px);

    justify-content: center;
    min-height: var(--guarantee-h);
    padding-top: 0;
    padding-bottom: var(--guarantee-pb);
  }

  .guarantee__text {
    width: var(--guarantee-text-w);
  }
}
