/* ==========================================================================
   J.I.M - How It Works (Figma frame 1306:2, 1728 x 4224)
   Built on home.css (header, footer, hero frame, pills).
   ========================================================================== */

/* 2. Hero (193 - 935px): shared .page-hero from home.css */
.how-hero-logo {
  left: 684.8px;
  top: 575.6px;
}

/* 3. GET STARTED WITH J.I.M (935 - 1311px) */
.how-intro {
  height: 376px;
  padding-top: 107px;
}

.how-intro-row {
  display: grid;
  grid-template-columns: 1012.5px 1fr;
  align-items: start;
}

.how-intro-left {
  position: relative;
  padding: 1px 0 0 60.5px;
}

.how-intro-title {
  font-family: "Futura", sans-serif;
  font-weight: 700;
  font-size: 60px;
  line-height: 62px;
  color: #ffffff;
  text-transform: uppercase;
  margin: 0;
}

.how-intro-logo {
  position: absolute;
  left: 227.6px;
  top: 55.1px;
  width: 158.8px;
  height: auto;
  pointer-events: none;
}

.how-intro-lead {
  font-family: "Futura", sans-serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 32px;
  color: #ffffff;
  margin: 0;
  max-width: 497px;
}

/* 4. Stacked step cards (each 1654x500, r30; cards 2 & 3 overlap the one above) */
.how-step-card {
  position: relative;
  width: calc(100% + 1px);
  height: 500px;
  border-radius: 30px;
  overflow: hidden;
  background-color: #f8b5b2;
  color: #000000;
}

.how-step-card--2 {
  margin-top: -90px;
  background-color: #f04e36;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.how-step-card--3 {
  margin-top: -63px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.how-step-photo {
  position: absolute;
  top: 0;
  right: 0;
  width: 831px;
  height: 500px;
  border-radius: 30px;
  object-fit: cover;
  display: block;
}

.how-step-title {
  position: absolute;
  left: 53px;
  top: 78px;
  font-family: "Futura", sans-serif;
  font-weight: 700;
  font-size: 60px;
  line-height: 62px;
  text-transform: uppercase;
  margin: 0;
}

.how-step-sub {
  position: absolute;
  left: 62px;
  top: 307px;
  font-family: "Futura", sans-serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 32px;
  text-transform: uppercase;
  margin: 0;
}

.how-step-card--1 .how-step-title {
  left: 54px;
}

.how-step-card--1 .how-step-sub {
  top: 207px;
}

.how-step-sub-app {
  position: absolute;
  left: 139px;
  top: 32px;
}

.how-step-sub-logo {
  position: absolute;
  left: 61.6px;
  top: 30.6px;
  width: 71.8px;
  height: auto;
  pointer-events: none;
}

.how-step-desc {
  position: absolute;
  left: 62px;
  top: 406px;
  max-width: 294px;
  font-family: "Futura", sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 17px;
  letter-spacing: var(--ls-futura-medium);
  color: rgba(0, 0, 0, 0.5);
  margin: 0;
}

.how-step-card--1 .how-step-desc {
  top: 307px;
}

.how-step-card--3 .how-step-desc {
  max-width: 398px;
}

.how-badge {
  position: absolute;
  display: block;
}

.how-badge img {
  display: block;
  width: 100%;
  height: 100%;
}

.how-badge--apple {
  left: 61px;
  top: 388px;
  width: 146px;
  height: 49px;
}

.how-badge--google {
  left: 251px;
  top: 389px;
  width: 164px;
  height: 48px;
}

/* 5. A QUICK GUIDE TO YOUR FIRST VISIT (2882 - 3822px) */
.how-guide {
  padding-top: 224px;
}

.how-guide-title {
  font-family: "Futura", sans-serif;
  font-weight: 700;
  font-size: 60px;
  line-height: 62px;
  color: #ffffff;
  text-transform: uppercase;
  text-align: center;
  margin: 0;
}

.how-guide-video {
  position: relative;
  width: 1372px;
  max-width: 100%;
  height: 681px;
  margin: 135px auto 0;
  border-radius: 30px;
  background-color: #f8b5b2;
}

.how-guide-play {
  position: absolute;
  left: calc(50% - 34px);
  top: 283px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.how-guide-play svg {
  display: block;
}

/* Footer: 26px further left than the home page */
.jim-footer--how {
  margin-top: 131px;
  padding-bottom: 69px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1400px) {
  .how-intro-row {
    grid-template-columns: 1fr 1fr;
  }
  .how-step-photo {
    width: 50%;
  }
}

@media (max-width: 992px) {
  .how-intro {
    height: auto;
    padding: 64px 0;
  }
  .how-intro-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .how-step-card,
  .how-step-card--2,
  .how-step-card--3 {
    width: 100%;
    height: auto;
    margin-top: 24px;
    padding: 40px 32px 0;
  }
  .how-step-title,
  .how-step-sub,
  .how-step-desc,
  .how-step-photo {
    position: static;
  }
  .how-step-sub {
    position: relative;
    margin-top: 32px;
  }
  .how-step-desc {
    margin-top: 16px;
    max-width: none;
  }
  .how-step-badges {
    display: flex;
    gap: 16px;
    margin-top: 24px;
  }
  .how-badge {
    position: static;
  }
  .how-step-photo {
    width: calc(100% + 64px);
    height: 320px;
    margin: 32px -32px 0;
    border-radius: 30px;
  }
  .how-guide {
    padding-top: 96px;
  }
  .how-guide-video {
    height: 420px;
    margin-top: 48px;
  }
  .how-guide-play {
    top: calc(50% - 57px);
  }
  .jim-footer--how {
    margin-top: 80px;
  }
}

@media (max-width: 480px) {
  .how-step-title {
    font-size: 40px;
    line-height: 44px;
  }
}

@media (max-width: 768px) {
  .how-intro-left {
    padding-left: 0;
  }
  .how-intro-title {
    font-size: 40px;
    line-height: 44px;
  }
  .how-intro-logo {
    left: 118px;
    top: 28px;
    width: 110px;
  }
}

/* ==========================================================================
   Stacking step cards: the cards sit apart normally; while scrolling each one sticks near the
   top and the next card slides up over it (js/script.js shrinks/dims the card underneath).
   ========================================================================== */
.how-steps .how-step-card {
  position: sticky;
  top: var(--stack-top);
  margin-top: 48px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
  transform-origin: 50% 0;
}

.how-steps .how-step-card--1 {
  --stack-top: 40px;
  margin-top: 0;
}

.how-steps .how-step-card--2 {
  --stack-top: 64px;
}

.how-steps .how-step-card--3 {
  --stack-top: 88px;
}

/* Guide video: thumbnail fills the box, the video plays in place (js/script.js 7b) */
.how-guide-video {
  overflow: hidden;
}

.how-guide-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.how-guide-play {
  z-index: 2;
}

.how-guide-play svg {
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.45));
  transition: transform 0.2s ease;
}

.how-guide-video:hover .how-guide-play svg {
  transform: scale(1.08);
}

@media (max-width: 992px) {
  .how-steps .how-step-card,
  .how-steps .how-step-card--2,
  .how-steps .how-step-card--3 {
    margin-top: 24px;
  }
  .how-steps .how-step-card--1 {
    --stack-top: 16px;
    margin-top: 0;
  }
  .how-steps .how-step-card--2 {
    --stack-top: 32px;
  }
  .how-steps .how-step-card--3 {
    --stack-top: 48px;
  }
}

@media (max-width: 768px) {
  /* Compact cards, so a whole card fits on a phone screen while it is stuck */
  .how-step-card,
  .how-step-card--2,
  .how-step-card--3 {
    padding: 28px 22px 0;
  }
  .how-step-title {
    font-size: 36px;
    line-height: 40px;
  }
  .how-step-sub {
    margin-top: 20px;
    font-size: 22px;
    line-height: 26px;
  }
  .how-step-desc {
    margin-top: 12px;
    font-size: 14px;
    line-height: 17px;
  }
  .how-step-photo {
    width: calc(100% + 44px);
    height: 220px;
    margin: 24px -22px 0;
  }
  .how-guide {
    padding-top: 72px;
  }
  .how-guide-title {
    font-size: 40px;
    line-height: 44px;
  }
  .how-guide-video {
    height: auto;
    aspect-ratio: 16 / 9;
    margin-top: 32px;
  }
  .how-guide-play {
    left: calc(50% - 32px);
    top: calc(50% - 37px);
  }
  .how-guide-play svg {
    width: 64px;
    height: auto;
  }
}

@media (max-width: 480px) {
  .how-step-title {
    font-size: 32px;
    line-height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .how-steps .how-step-card {
    transform: none !important;
    filter: none !important;
  }
}

/* Stack end: sticky cards can't pass the end of their container, so without this all three
   would line up at the same top as the stack leaves. A card's bottom margin = how much lower
   the last card sticks; the margins collapse into the 48px gap, so spacing is unchanged. */
.how-steps .how-step-card--1 {
  margin-bottom: 48px; /* 88 - 40 */
}

.how-steps .how-step-card--2 {
  margin-bottom: 24px; /* 88 - 64 */
}

/* Room for the finished stack to hold for a moment before it scrolls away;
   the guide section's top padding gives the same amount back. */
.how-steps > .content-container {
  padding-bottom: 120px;
}

.how-guide {
  padding-top: 104px;
}

@media (max-width: 992px) {
  .how-steps .how-step-card--1 {
    margin-bottom: 32px; /* 48 - 16 */
  }
  .how-steps .how-step-card--2 {
    margin-bottom: 16px; /* 48 - 32 */
  }
  .how-steps > .content-container {
    padding-bottom: 64px;
  }
  .how-guide {
    padding-top: 32px;
  }
  /* The desktop "top: 307px / 207px" still moved the relative subtitle down onto the photo */
  .how-step-sub,
  .how-step-card--1 .how-step-sub {
    top: auto;
  }
  .how-step-card--1 .how-step-desc {
    top: auto;
  }
}

@media (max-width: 768px) {
  .how-steps > .content-container {
    padding-bottom: 48px;
  }
  .how-guide {
    padding-top: 24px;
  }
  /* "THE [logo] APP" in step 1 is laid out for 30px type; scale it to the 22px phone size */
  .how-step-sub-logo {
    left: 45px;
    top: 22px;
    width: 53px;
  }
  .how-step-sub-app {
    left: 102px;
    top: 26px;
  }
}

@media (min-width: 993px) and (max-width: 1300px) {
  /* Hero title wrapped onto the LOCATIONS pill at these widths */
  .page-hero-title {
    font-size: 64px;
    line-height: 68px;
    max-width: 760px;
  }
}

@media (max-width: 992px) {
  /* ...and the desktop "left: 62px" pushed it right of the title and text */
  .how-step-sub {
    left: auto;
  }
}
