/* Approved homepage presentation. Section changes are scoped by existing ids. */

#case-studies .homepage-video-shell {
  position: relative;
  max-width: 1180px;
  margin: 46px auto 0;
}

#case-studies .homepage-video-rail {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 28px;
  scrollbar-color: rgba(141, 167, 255, .55) transparent;
  scrollbar-width: thin;
  padding: 2px 28px 18px;
}

#case-studies .homepage-video-card {
  appearance: none;
  flex: 0 0 calc((100% - 44px) / 3);
  min-width: 0;
  align-self: flex-start;
  padding: 0;
  color: var(--text);
  font: inherit;
  text-align: left;
  white-space: normal;
  border: 0;
  background: transparent;
  cursor: pointer;
  scroll-snap-align: start;
}

#case-studies .homepage-video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surf);
}

#case-studies .homepage-video-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#case-studies .homepage-play-mark {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: grid;
  width: 36px;
  height: 30px;
  place-items: center;
  border-radius: 5px;
  background: var(--text);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .32);
}

#case-studies .homepage-play-mark::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--bg);
}

#case-studies .homepage-video-title {
  display: block;
  margin-top: 13px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  text-wrap: pretty;
}

#case-studies .homepage-video-card:hover .homepage-video-title {
  text-decoration: underline;
  text-decoration-color: rgba(141, 167, 255, .7);
  text-underline-offset: 4px;
}

#case-studies .homepage-carousel-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  max-width: 1120px;
  margin: -44px auto 18px;
  padding: 0 28px;
}

#case-studies .homepage-carousel-controls button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--text);
  font: inherit;
  font-size: 20px;
  border: 1px solid var(--line2);
  border-radius: 50%;
  background: rgba(18, 19, 24, .94);
  cursor: pointer;
}

#case-studies .homepage-carousel-controls button:hover {
  border-color: var(--blue2);
}

#case-studies .homepage-playlist-link {
  margin: 12px auto 0;
  padding: 0 28px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

#case-studies .homepage-playlist-link a {
  color: var(--blue2);
  text-underline-offset: 3px;
}

.homepage-video-dialog {
  width: min(1000px, calc(100% - 32px));
  max-height: 90vh;
  max-height: 90dvh;
  overflow: auto;
  padding: 22px;
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: 16px;
  background: var(--bg);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .72);
}

.homepage-video-dialog::backdrop {
  background: rgba(0, 0, 0, .88);
  backdrop-filter: blur(7px);
}

.homepage-video-dialog .homepage-modal-toolbar,
.homepage-video-dialog .homepage-modal-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.homepage-video-dialog .homepage-modal-toolbar {
  margin-bottom: 18px;
}

.homepage-video-dialog h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.homepage-video-dialog button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 14px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: var(--surf);
  cursor: pointer;
}

.homepage-video-dialog a {
  color: var(--blue2);
  font-size: 14px;
  text-underline-offset: 3px;
}

.homepage-video-dialog .homepage-modal-navigation {
  margin-top: 18px;
  flex-wrap: wrap;
}

#homepage-video-player iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

#case-studies button:focus-visible,
.homepage-video-dialog button:focus-visible,
.homepage-video-dialog a:focus-visible {
  outline: 2px solid var(--blue2);
  outline-offset: 3px;
}

/* Keep the existing eleven designs and full-email modal, with a longer crop and
   a slightly narrower desktop card so nearly four designs fit in the 1120px rail. */
@media (min-width: 861px) {
  #creative-examples .showcase-card {
    flex-basis: 268px;
    width: 268px;
  }
  #creative-examples .showcase-media {
    height: 590px;
  }
}

@media (max-width: 860px) {
  #creative-examples .showcase-media {
    height: 540px;
  }
}

/* Compact numbered rows for the five current systems. */
#how .homepage-systems-heading {
  max-width: 980px;
  margin-inline: auto;
}

#how .homepage-system-rows {
  max-width: 900px;
  margin: 46px auto 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line2);
}

#how .homepage-system-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 20px;
  padding: 23px 0;
  border-bottom: 1px solid var(--line2);
}

#how .homepage-system-number {
  color: var(--blue2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

#how .homepage-system-copy h3 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.25;
  text-wrap: balance;
}

#how .homepage-system-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  text-wrap: pretty;
}

@media (max-width: 900px) {
  #case-studies .homepage-video-card {
    flex-basis: calc((100% - 22px) / 2);
  }
}

@media (max-width: 620px) {
  #case-studies .homepage-video-card {
    flex-basis: 86%;
  }
  #case-studies .homepage-video-rail {
    gap: 18px;
    padding-inline: 20px;
    scroll-padding-inline: 20px;
  }
  #case-studies .homepage-carousel-controls {
    display: none;
  }
  #case-studies .homepage-video-title {
    font-size: 15px;
  }
  .homepage-video-dialog {
    padding: 16px;
  }
  .homepage-video-dialog .homepage-modal-toolbar {
    align-items: flex-start;
  }
  .homepage-video-dialog h3 {
    font-size: 14px;
  }
  #how .homepage-system-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 13px;
    padding: 20px 0;
  }
  #how .homepage-system-copy p {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #case-studies .homepage-video-rail {
    scroll-behavior: auto;
  }
}

/* Review refinement: let FAQ answer lines use the available dropdown width. */
.faq .fa p { text-wrap: wrap; max-width: none; }

/* Four unnumbered cards; arrows show reading order on desktop and phone. */
#next-steps .homepage-next-steps {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 32px;
  max-width: 1064px; margin: 42px auto 36px; padding: 0; list-style: none; text-align: left;
}
#next-steps .homepage-next-steps li {
  position: relative; padding: 24px 22px; background: var(--surf2);
  border: 1px solid var(--line2); border-radius: 16px;
}
#next-steps .homepage-next-steps li:not(:last-child)::after {
  content: ""; position: absolute; right: -29px; top: calc(50% - 12px);
  width: 24px; height: 24px;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238da7ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E");
}
#next-steps .homepage-next-steps h3 {
  min-height: 3.75em; margin: 0 0 16px; color: var(--text); font-size: 18px;
  font-weight: 650; letter-spacing: -.025em; line-height: 1.25;
}
#next-steps .homepage-next-steps p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
@media(max-width:900px) {
  #next-steps .homepage-next-steps { grid-template-columns: 1fr; max-width: 580px; gap: 36px; }
  #next-steps .homepage-next-steps li { padding: 24px; }
  #next-steps .homepage-next-steps h3 { min-height: 0; margin-bottom: 10px; font-size: 19px; }
  #next-steps .homepage-next-steps li:not(:last-child)::after {
    top: auto; right: calc(50% - 12px); bottom: -31px; transform: rotate(90deg);
  }
}

/* Approved review: use the full benefits-card content width without changing copy. */
#retention-bridge .bridge-benefits .checklist { width:100%; max-width:none; }
#retention-bridge .bridge-benefits .checklist li { grid-template-columns:21px minmax(0,1fr); }
#retention-bridge .bridge-benefits .checklist li > span { text-wrap:wrap; }
#retention-bridge .bridge-benefits .text-tail { white-space:normal; }
