/* =============================================================================
   HP6 – Products. Figma "001 Products" (125:3558) 1920x1231 bg #F6F5F2, pad 120/319,
   vertical gap 48. Content column 1280 wide at x=320; every offset below is measured from
   that column's top-left (= .hp6-products__inner, inside .hp6-container after the 120px
   section padding). Shared tokens/components come from css/home-page-v6.css and are never
   redefined here; everything is scoped under .hp6-products.
   ============================================================================= */

/* Stack: eyebrow (32) -> text block (522) -> card row (341), gap 48 => 120+32+48+522+48+341+120 = 1231 */
.hp6-products .hp6-products__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 48px;
}
.hp6-products--image-left .hp6-products__inner { align-items: flex-end; }
.hp6-products--full .hp6-container { max-width: none; }

/* Figma "Glow" 938x983 @ (792,1248): 472 / 48 from the column; fill alpha 48% on top of the .55 */
.hp6-products .hp6-products__glow {
  --hp6-glow-fill: .48;
  top: 48px;
  left: 472px;
  width: 938px;
  height: 983px;
}
.hp6-products--image-left .hp6-products__glow { left: auto; right: 472px; }

/* Figma 2026-10-15 "Hand holding latest iPhone" 1147x1300 @ (889,1126): 569 / -74 from the column
   (it moved 104px down when the section grew). The fill is STRETCH with imageTransform x -0.048 / w 1.095,
   i.e. the 1047x1300 photo is centred in the box (object-position center top).
   Sits under the text and cards (z 0 vs 1) and runs off the right edge; .hp6 clips it. */
.hp6-products .hp6-products__media {
  position: absolute;
  z-index: 0;
  top: -74px;
  left: 569px;
  width: 1147px;
  height: 1300px;
  pointer-events: none;
}
.hp6-products--image-left .hp6-products__media { left: auto; right: 569px; }
.hp6-products .hp6-products__phone {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center top;
}
/* No phone asset yet: a phone-shaped placeholder in the design's gradient, kept clear of the copy */
.hp6-products .hp6-products__phone-placeholder {
  position: absolute;
  top: 80px;
  left: 330px;
  width: 440px;
  height: 900px;
  border-radius: 64px;
  background: var(--hp6-placeholder);
  box-shadow: 0 40px 80px rgba(7, 9, 15, .3);
  transform: rotate(-9deg);
}
.hp6-products .hp6-products__phone-placeholder::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 52px;
  border: 1px solid rgba(255, 255, 255, .14);
}
.hp6-products--image-left .hp6-products__phone-placeholder { left: auto; right: 330px; transform: rotate(9deg); }

/* Intro column: eyebrow, then heading / body / badges (Figma "Frame" 603x522, gap 34) */
.hp6-products .hp6-products__intro {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 48px;
  max-width: 660px;   /* Figma frame hugs the 603px heading; slack so the <br> lines never rewrap */
}
.hp6-products .hp6-products__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 34px;
}

/* Figma line boxes are whole px: eyebrow 16 + 8/8 pad = 32, h2 2 x 67 = 134. The shared components use
   15.6 / 66.56, which leaves this section 1.3px short; pinned here at desktop so the card row lands
   exactly 770 below the section top (the shared tablet/mobile h2 sizes are left untouched). */
@media (min-width: 992px) {
  .hp6-products .hp6-products__eyebrow { line-height: 16px; }
  .hp6-products .hp6-products__heading { line-height: 67px; }
}

/* h2 64/66.56 ls -1.6 weight 300; the products run "Endless Possibilities." is 600 ls -1.92 */
.hp6-products .hp6-products__heading strong,
.hp6-products .hp6-products__heading b { font-weight: 600; }
.hp6-products .hp6-products__heading p { margin: 0; font: inherit; letter-spacing: inherit; color: inherit; }

/* Subtitle 22/28.6 500 ink + two paragraphs 18/28.8 #6B6F78, 560 wide, gap 20.
   Figma rounds every line box to whole px (29 / 29x3 = 87), so the line-heights are the
   rounded values; with the 20px gaps the body is 29+20+87+20+87 = 243 as in the spec. */
.hp6-products .hp6-products__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 560px;
}
.hp6-products .hp6-products__subtitle {
  margin: 0;
  font-size: 22px;
  line-height: 29px;
  font-weight: 500;
  letter-spacing: 0;
  color: inherit;
}
.hp6-products .hp6-products__prose {
  --hp6-prose-gap: 20px;
  font-size: 18px;
  line-height: 29px;
  font-weight: 400;
  letter-spacing: 0;
}
.hp6-products .hp6-products__prose p { margin-bottom: 0; }
/* The shared .hp6-prose > * + * gap (0,1,0) loses to .hp6 p { margin: 0 } (0,1,1); restate it at (0,2,0) */
.hp6-products .hp6-products__prose > * + * { margin-top: var(--hp6-prose-gap, 20px); }

/* Badges row (Figma "Container" 362.85x77, gap 17): badge image 50 tall (168x50 / 148x50),
   then 6px, then gold star 15x15 + "4.6 on Google Play" 16/20.8 500 ink@60% (gap 10) */
.hp6-products .hp6-products__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 17px;
}
.hp6-products .hp6-products__badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.hp6-products .hp6-products__badge-link {
  display: inline-flex;
  align-items: center;
  height: 50px;
  color: inherit;
  text-decoration: none;
}
.hp6-products .hp6-products__badge-img {
  display: block;
  width: auto;
  height: 50px;
  max-width: none;
  object-fit: contain;
}
.hp6-products .hp6-products__badge-fallback {
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  background: var(--hp6-dark);
  color: var(--hp6-white);
  font-size: 13px;
  line-height: 16.9px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}
.hp6-products .hp6-products__rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 16px;
  line-height: 21px;   /* Figma line box 21: badge 50 + 6 + 21 = 77 */
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(20, 22, 28, .6);
}
.hp6-products.theme-dark .hp6-products__rating { color: rgba(255, 255, 255, .6); }
.hp6-products .hp6-products__star {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  fill: #F5B301;
}

/* Card row (Figma "Product cards" 981x341): 3 x 315 with 18px between (SPACE_BETWEEN over 981) */
.hp6-products .hp6-products__cards {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: 981px;
  max-width: 100%;
}
.hp6-products--cols-2 .hp6-products__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Card 315x341: r=24 bg #ECEBE6, pad 16/16/24, gap 18; photo 283x260 r=12; title row pad 0 8 gap 12 */
.hp6-products .hp6-products__card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 16px 24px;
  overflow: hidden;
  text-decoration: none;
}
.hp6-products .hp6-products__card-photo {
  width: 100%;
  aspect-ratio: 283 / 260;
}
@supports not (aspect-ratio: 1 / 1) {
  .hp6-products .hp6-products__card-photo { height: 260px; }
}
.hp6-products .hp6-products__card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}
.hp6-products .hp6-products__card-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 18px;
  line-height: 23px;   /* Figma line box 23: card = 16 + 260 + 18 + 23 + 24 = 341 */
  font-weight: 500;
  letter-spacing: 0;
}
.hp6-products .hp6-products__card-arrow {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 23px;
  font-weight: 400;
  letter-spacing: 0;
  transition: transform .2s ease;
}
.hp6-products a.hp6-products__card:hover .hp6-products__card-arrow,
.hp6-products a.hp6-products__card:focus-visible .hp6-products__card-arrow { transform: translateX(4px); }
.hp6-products a.hp6-products__card:focus-visible { outline: 2px solid var(--hp6-accent); outline-offset: 2px; }

/* ---------------------------------------------------------------------------
   Responsive (2026-10-29). Desktop >=1366 is the pixel build above and never changes. Below it the media is
   the phone part of the 928x1152 photo (x 70-500, y 40-700 = a 430x660 crop box, the phone treatment of
   2026-10-22) with the hand fading out at the bottom and on the right where the crop cuts it; each range
   sets the box's size and placement:
     992-1365  absolutely placed like the desktop, right-aligned, scaled with the viewport, ending above the cards
     768-991   in the flow between the copy and the store badges, centred, 339 wide = 520 tall
     <=767     the same, 320 wide = 491 tall (design/oct-28-mobile-382-8)
   --------------------------------------------------------------------------- */
@media (max-width: 1365px) {
  .hp6-products .hp6-products__media,
  .hp6-products--image-left .hp6-products__media {
    height: auto;
    max-width: none;
    aspect-ratio: 430 / 660;
    overflow: hidden;
    /* fade the hand out at the bottom and on the right where the crop cuts it */
    -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%), linear-gradient(to right, #000 78%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to bottom, #000 82%, transparent 100%), linear-gradient(to right, #000 78%, transparent 100%);
    mask-composite: intersect;
  }
  /* Zoom on the phone: the visible box is the phone part of the photo (x 70-500, y 40-700), 1 photo px = 1 box px
     before the box scales */
  .hp6-products .hp6-products__phone {
    position: absolute;
    top: -6.06%;
    left: -16.28%;
    width: 215.8%;
    max-width: none;
    height: auto;
    /* The photo is lazy-loaded and has no width/height attributes: without an intrinsic ratio this absolute
       image is 0px tall until it loads, so the browser never considers it "near the viewport" and never loads
       it. The ratio of the 928x1152 photo gives it its box up front. */
    aspect-ratio: 928 / 1152;
  }
  /* No phone asset: the placeholder fills the crop box */
  .hp6-products .hp6-products__phone-placeholder,
  .hp6-products--image-left .hp6-products__phone-placeholder { top: 0; left: 0; right: auto; width: 100%; height: 100%; border-radius: 48px; transform: none; }
}

/* Small desktops 992-1365: the 1147x1300 photo box placed for the 1280 column ran off the viewport (the phone was
   cut at the right edge at 1024-1180) and its hand ran under the third card. The crop box is right-aligned in the
   column, 45% of it minus a 16px gutter to the copy (max 420), so it ends above the card row: box top -29
   (= the phone's top at desktop: -74 + 40 x 1.128), height 420 x 660 / 430 = 645 -> bottom 616, while the cards
   start >= 625 below the column top (eyebrow 32 + 48 + heading 2 x 54.4 + 34 + body 243 + 34 + badges 77 + 48).
   The copy column is 55% and the heading scales 52-64 (clamp) so "Endless Possibilities." (600 wide at 64)
   never rewraps its <br> lines; line-height 1.047 = the 67px desktop pin at 64. z-index stays 0, under the copy
   and the cards (1). At 1024: copy 533, box 549-969 (420 x 645); at 1180: copy 619, box 705-1125. */
@media (min-width: 992px) and (max-width: 1365px) {
  .hp6-products .hp6-products__intro { max-width: min(660px, 55%); }
  .hp6-products .hp6-products__heading { font-size: clamp(52px, 5.2vw, 64px); line-height: 1.047; }
  .hp6-products .hp6-products__media,
  .hp6-products--image-left .hp6-products__media { top: -29px; left: auto; right: 0; width: min(420px, calc(45% - 16px)); }
  .hp6-products--image-left .hp6-products__media { left: 0; right: auto; }
}

/* Tablet 768-991 + phones <=767 (tablets joined the phone design on 2026-10-29: the 2+1 card grid under a
   full-width phone photo is gone): copy -> phone crop (centred) -> store badges -> the card row as the shared
   horizontal scroller (data-hp6-scroller on the row in module.html; css/home-page-v6.css section 12, js
   section 7). The intro box dissolves (display: contents) so its eyebrow / text / badges can be re-ordered
   around the image. */
@media (max-width: 991px) {
  .hp6-products .hp6-products__inner,
  .hp6-products--image-left .hp6-products__inner { align-items: flex-start; gap: 40px; }
  .hp6-products .hp6-products__glow,
  .hp6-products--image-left .hp6-products__glow { top: 0; left: auto; right: -200px; width: 640px; height: 640px; }
  .hp6-products .hp6-products__intro,
  .hp6-products .hp6-products__text { display: contents; }
  /* display: contents drops the intro's layer (z-index 1), so the copy would sit under the rainbow glow
     (z 0): give each piece its own layer above it (user, 2026-10-22: text looked washed out on phones) */
  .hp6-products .hp6-products__eyebrow,
  .hp6-products .hp6-products__heading,
  .hp6-products .hp6-products__body,
  .hp6-products .hp6-products__badges { position: relative; z-index: 1; }
  .hp6-products .hp6-products__eyebrow { order: 1; }
  .hp6-products .hp6-products__heading { order: 2; }
  .hp6-products .hp6-products__body { order: 3; }
  .hp6-products .hp6-products__media { order: 4; }
  .hp6-products .hp6-products__badges { order: 5; margin-top: -8px; }
  .hp6-products .hp6-products__cards { order: 6; }
  /* The crop box drops into the flow, centred: 339 wide = 520 tall (the ~520 cap, user 2026-10-29) */
  .hp6-products .hp6-products__media,
  .hp6-products--image-left .hp6-products__media {
    position: relative;
    z-index: 1;
    top: auto;
    left: auto;
    right: auto;
    width: min(100%, 339px);
    margin: 0 auto;
    pointer-events: auto;
  }
  .hp6-products .hp6-products__media--empty { display: none; }
  /* Store badges: two equal columns with a gap (up to 220 each, centred; full width on phones below); each badge
     is a black button with the store artwork centred at its own proportions */
  .hp6-products .hp6-products__badges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px));
    justify-content: center;
    gap: 12px;
    width: 100%;
  }
  .hp6-products .hp6-products__badge { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
  .hp6-products .hp6-products__badge-link {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 56px; padding: 0 8px;
    border-radius: 12px; background: #000000;
  }
  /* Figma: "Get it on Google Play" 154.55x46 / "Download on the App Store" 136.62x46, each with a black
     INSIDE stroke = the designer covering the artwork's own keyline ("possible to remove the white border
     inside the container?"). The PNGs (336x100 / 297x100) carry a 3px light-grey outline, 1.4px at 46 tall:
     clip it off so the badge's black meets the button's #000 with no outline. height auto + max-height
     (not a fixed height) keeps the box equal to the drawn image, so the 2px inset lands on the keyline
     even when a narrow phone shrinks the badge through max-width; the 8px corner clips black on black. */
  .hp6-products .hp6-products__badge-img {
    width: auto; height: auto; max-width: 100%; max-height: 46px; object-fit: contain;
    -webkit-clip-path: inset(2px round 8px); clip-path: inset(2px round 8px);
  }
  .hp6-products .hp6-products__rating { justify-content: center; font-size: 13px; white-space: nowrap; }

  /* Cards (2026-10-29, Figma "Container" 1113x380.83, gap 14.45): ONE row of 361.36x380.82 cards r=21.68
     bg #ECEBE6 pad 14.45/14.45/21.68/14.45, photo 332.45x305.43 r=10.84 (same 283/260 ratio as desktop),
     title 18/23 with 7.23 side padding, no arrows = the shared scroller (data-hp6-scroller on the row in
     module.html; css/home-page-v6.css section 12), at 768 two cards with a peek. The base card-row rule above
     is (0,2,0) and this file loads after the shared CSS, so its grid / width values are restated here as the
     track values. align-self: stretch because the row is an item of the column flexbox .hp6-products__inner
     (align-items: flex-start), where an auto width is fit-content = the whole 1111px row instead of the
     viewport, i.e. nothing to scroll. First card at x=20 like the other sliders (Figma draws the row at x=4).
     52 below the badges' rating line on phones as in Figma (32 inner gap + 20). */
  .hp6-products .hp6-products__cards,
  .hp6-products--cols-2 .hp6-products__cards {
    --hp6-scroller-item: 361px;
    --hp6-scroller-gap: 14px;
    align-self: stretch;
    display: flex;
    gap: var(--hp6-scroller-gap);
    width: auto;
    max-width: none;
    margin-top: 20px;
  }
  .hp6-products .hp6-products__card { gap: 16px; padding: 14px 14px 22px; border-radius: 22px; }
  .hp6-products .hp6-products__card-photo { border-radius: 11px; }
  .hp6-products .hp6-products__card-row { padding: 0 7px; }
}

/* Phones <=767 (design/oct-28-mobile-382-8): tighter rhythm, the 320-wide crop, full-width badges */
@media (max-width: 767px) {
  .hp6-products .hp6-products__inner { gap: 32px; }
  .hp6-products .hp6-products__subtitle { font-size: 20px; line-height: 26px; }
  .hp6-products .hp6-products__prose { font-size: 17px; line-height: 27.2px; }
  .hp6-products .hp6-products__media,
  .hp6-products--image-left .hp6-products__media { width: min(100%, 320px); }
  .hp6-products .hp6-products__badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Interaction states (added 2026-09-29) ---- */
/* Cards are not links (user 2026-10-22): no lift or shadow on hover, only the photo zoom and the title
   colour. A card that does get a link keeps its arrow (module.html). */
.hp6-products .hp6-products__card .hp6-photo img { transition: transform .45s ease; }
.hp6-products .hp6-products__card-row { transition: color .2s ease; }
.hp6-products .hp6-products__card:hover .hp6-photo img { transform: scale(1.04); }
.hp6-products .hp6-products__card:hover .hp6-products__card-row { color: var(--hp6-accent); }
.hp6-products .hp6-products__badge-link { transition: opacity .15s ease; }
.hp6-products .hp6-products__badge-link:hover { opacity: .8; }
