/* =====================================================
   #product  —  "Built to earn your trust" stacked cards
   ===================================================== */

/* ---------- 1. Design tokens ---------- */
#product {
  --black: #050505;
  --ink: #080808;
  --ink-2: #171717;
  --white: #fff;
  --grey-600: #666;
  --font-heading: "Cabinet Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Geist", "Helvetica Neue", Arial, sans-serif;
  --font-ui: "Geist", sans-serif;
}

/* ---------- 2. Section variables ---------- */
#product,
#product .ws__list,
#product .ws__item[style*="--i:0"] {
  --dwell: 30vh;
  /* 30vh = short, 60vh = ~2 scrolls, 90vh = ~3 scrolls */
}

#product.ws {
  --head-h: 238px;
  --top: var(--head-h);
  --step: 56px;
  --img-reserve: 90px;
  --dwell: 30vh;
  /* 30vh = short, 60vh = ~2 scrolls, 90vh = ~3 scrolls */
  --avail: clamp(520px, calc(100vh - var(--head-h)), 800px);
  --card: calc(var(--avail) + 4 * var(--step));

  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  padding: 80px 0 0;
  /* pricing slides up over the 05 box */
  margin-bottom: calc(-1 * (var(--card) - 5 * var(--step) + var(--dwell)));
}

@media (max-width: 809px) {
  #product.ws {
    --step: 66px;
    --card: clamp(580px, 85svh, 780px);
    padding-top: 96px;
    margin-bottom: 0;
  }
}

/* ---------- 3. Container + eyebrow ---------- */
#product .container {
  width: 95%;
  margin-inline: auto;
}

@media (max-width: 809px) {
  #product .container {
    width: 90%;
  }
}

#product .eyebrow {
  font-family: var(--font-ui);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #080808;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
}

/* ---------- 4. Sticky header ---------- */
#product .ws__head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  position: sticky;
  top: 0;
  z-index: 100;
  margin-block: 0;
  padding: 24px 0 0;
  /* 24px 0 -> 24px 0 0 (neeche ka padding 0) */
  background: #000;
  box-shadow: 0 0 0 100vmax #000;
  clip-path: inset(0 -100vmax);
}

@media (max-width: 809px) {
  #product .ws__head {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

#product .ws__headtxt {
  display: flex;
  flex-direction: column;
}

#product .ws__h2 {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -.03em;
  color: var(--ink);
  margin: 0;
  font-size: clamp(32px, 3vw, 46px);
  line-height: 1.05;
}

#product .ws__intro {
  max-width: 650px;
  font-family: var(--font-body);
  letter-spacing: -.01em;
  color: var(--grey-600);
  justify-self: end;
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

@media (max-width: 809px) {
  #product .ws__intro {
    justify-self: start;
  }
}

/* ---------- 5. Cards list ---------- */
#product .ws__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* spacer at the end: 05 stays pinned while its title moves up */
/* spacer at the end: 05 stays pinned, dwell -> collapse -> pricing slides over */
#product .ws__hold {
  display: block;
  /* pehla part = pricing ke negative margin jitna (margin-bottom wala formula)
     --last-dwell / --last-cover JS se set hote hain */
  height: calc(var(--card) - 5 * var(--step) + var(--dwell) + var(--last-dwell, 70vh) + var(--last-cover, 40vh));
}

@media (max-width: 809px) {
  #product .ws__hold { height: 0; }
}
#product .ws__item:not(:last-child) {
  height: calc(var(--card) - var(--i) * var(--step) + var(--dwell));
}

#product .ws__item {
  position: sticky;
  top: calc(var(--head-h) + var(--i) * var(--step));
  height: calc(var(--card) - var(--i) * var(--step));
  z-index: calc(1 + var(--i));
}

#product .ws__card {
  background: var(--bg);
  color: var(--white);
  border-top: 1px solid #ffffff24;
}

#product .ws__grid {
  display: grid;
  grid-template-columns: 6% 30% minmax(0, 1fr);
  align-items: start;
  column-gap: 24px;
  height: 100%;
  padding: 8px 0 52px;
}

@media (max-width: 1099px) {
  #product .ws__grid {
    grid-template-columns: 8% 34% minmax(0, 1fr);
  }
}

@media (max-width: 809px) {
  #product .ws__grid {
    grid-template-columns: 40px 1fr;
    grid-template-rows: calc(var(--step) - 14px) 1fr;
    row-gap: 0;
    padding: 14px 0 24px;
  }
}

/* ---------- 6. Number + title (same height = same line) ---------- */
#product .ws__num,
#product .ws__title {
  margin: 0 !important;
  padding: 0 !important;
  height: 40px;
  line-height: 40px;
  align-self: start;
  position: static !important;
  top: auto !important;
}

#product .ws__title {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -.03em;
  color: var(--white);
  font-size: clamp(22px, 1.7vw, 30px);
  text-align: center;
  /* was left */
  white-space: nowrap;
  transform-origin: center top;
  /* was left top */
}

@media (max-width: 1099px) {
  #product .ws__title {
    font-size: 22px;
  }
}

/* big in the middle of the card (1.6x)  ->  normal size in the strip */
@media (min-width: 810px) and (prefers-reduced-motion: no-preference) {
  #product .ws__title {
    will-change: transform;
    transform:
      translateY(calc((1 - var(--p, 1)) * (var(--dy-t, 0px) - 2 * var(--step) - var(--dwell) / 2))) scale(calc(1 + (1 - var(--p, 1)) * .6));
  }

  /* last card has no dwell */
  #product .ws__item--last .ws__title {
    transform:
      translateY(calc((1 - var(--p, 1)) * ((var(--card) - 4 * var(--step)) / 2 - 20px - 2 * var(--step)))) scale(calc(1 + (1 - var(--p, 1)) * .6));
  }

  /* ---------- 7. Right column: text + image ---------- */
  #product .ws__right {
    display: flex;
    flex-direction: column;
    justify-self: end;
    width: min(100%, calc((var(--avail) - 3 * var(--step) - var(--img-reserve)) * 32 / 21));
    max-width: 1000px;
     transition: opacity .35s ease, visibility .35s;
}
  }

  /* hide text + image (all cards 01-05) once the title starts moving up */
  @media (min-width: 810px) {
    #product .ws__item.is-up .ws__right {
      opacity: 0 !important;
      /* beats the inline opacity from the Astro script */
      visibility: hidden;
    }
  }

  @media (max-width: 809px) {
    #product .ws__right {
      grid-column: 1 / -1;
      align-self: stretch;
      gap: 16px;
      max-width: 100%;
      min-height: 0;
    }
  }

  #product .ws__txt {
    display: flex;
    flex-direction: column;
  }

  #product .ws__sub {
    font-family: var(--font-body);
    letter-spacing: -.02em;
    color: var(--white);
    margin: 0;
    font-size: clamp(18px, 1.5vw, 22px);
    font-weight: 500;
    line-height: 1.3;
  }

  #product .ws__text {
    max-width: 520px;
    font-family: var(--font-body);
    letter-spacing: -.01em;
    color: #ffffffb8;
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
  }

  @media (max-width: 809px) {
    #product .ws__sub {
      font-size: 17px;
    }

    #product .ws__text {
      font-size: 14px;
    }
  }

  /* ---------- 8. Figure ---------- */
  #product .ws__fig {
    flex: none;
    margin: 0;
    width: 100%;
    aspect-ratio: 32 / 21;
    max-height: none;
    background: transparent;
    border: 0;
    border-radius: 4px;
    overflow: hidden;
  }

  #product .ws__fig picture {
    display: block;
    width: 100%;
    height: 100%;
  }

  #product .ws__fig img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    translate: 0 !important;
    will-change: auto;
    visibility: visible;
    opacity: 1;
  }

  @media (max-width: 809px) {
    #product .ws__fig {
      width: 100%;
      min-height: 0;
    }
  }

  /* ---------- 9. Pricing slides over the 05 box ---------- */
  #pricing {
    position: relative;
    z-index: 05;
    max-width: none !important;
    background: var(--bg);
    padding-top: 50px !important;
    margin-top: 0 !important;
  }