/* Split hero + phone conversation (auto-revealed messages on desktop) */

html {
  overflow-x: clip;
}

.hero-stage {
  --hero-msg-count: 9;
  position: relative;
  overflow: visible;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  background: #fff;
  border-bottom: 1px solid #e4e4e7;
}

.hero.hero--split {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  max-height: 100vh;
  max-height: 100svh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(64px + 24px) 20px 48px;
  background: #fff;
  border-bottom: none;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  overflow: hidden;
  box-sizing: border-box;
}

.hero--split .hero-terms-note {
  bottom: clamp(12px, 2vh, 22px);
  z-index: 3;
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  width: min(1140px, 100%);
  margin: 0 auto;
}

.hero--split .hero-content {
  max-width: none;
  width: 100%;
  text-align: left;
  animation: none;
}

.hero--split h1 {
  font-size: clamp(2.85rem, 5.5vw, 4.75rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: #09090b;
  margin: 0 0 16px;
  max-width: 14ch;
  margin-left: 0;
  margin-right: 0;
}

.hero--split .subheadline {
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  color: #52525b;
  line-height: 1.55;
  margin: 0 0 28px;
  max-width: 34ch;
  padding: 0;
}

.hero--split .hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

/* Phone column */
.hero-phone-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.hero-phone {
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 300 / 600;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.12));
}

.hero-phone-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  line-height: 0;
  border-radius: 32px;
  overflow: hidden;
}

.hero-phone-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hero-phone-messages {
  position: absolute;
  z-index: 2;
  top: 25%;
  left: 6.25%;
  right: 6.25%;
  bottom: 16%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  pointer-events: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hero-phone-messages::-webkit-scrollbar {
  display: none;
}

@keyframes heroBubbleIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Bubbles inside phone */
.hero-phone-messages .dm-bubble {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  max-width: 86%;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.28;
  margin: 0 !important;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.hero-phone-messages .dm-bubble:not(.is-visible) {
  display: none;
}

.hero-phone-messages .dm-bubble.sent {
  align-self: flex-end;
  background: #007aff;
  color: #fff;
  border-radius: 16px 16px 6px 16px;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.22);
}

.hero-phone-messages .dm-bubble.received {
  align-self: flex-start;
  background: #3a3a3c;
  color: #fff;
  border-radius: 16px 16px 16px 6px;
}

.hero-phone-messages .dm-bubble.is-visible {
  display: block;
  animation: heroBubbleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: auto;
}

.hero-phone-messages .dm-bubble.sent + .dm-bubble.sent,
.hero-phone-messages .dm-bubble.received + .dm-bubble.received {
  margin-top: -2px;
}

.hero-phone-messages .dm-bubble.sent + .dm-bubble.received,
.hero-phone-messages .dm-bubble.received + .dm-bubble.sent {
  margin-top: 8px;
}

.hero-phone-messages .dm-link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Scroll progress */
.hero-scroll-progress {
  width: min(240px, 72%);
  height: 4px;
  background: #e4e4e7;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.hero-scroll-progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #007aff 0%, #09090b 100%);
  border-radius: inherit;
  transition: width 0.2s ease-out;
  will-change: width;
}

.hero-stage.is-complete .hero-scroll-progress-bar {
  width: 100% !important;
}

.hero-stage.is-complete .hero-scroll-cue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: absolute;
  bottom: clamp(36px, 5vh, 52px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a1a1aa;
  z-index: 3;
  animation: heroCueBounce 2s ease-in-out infinite;
  pointer-events: none;
}

.hero-stage.is-complete .hero-scroll-cue svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

.hero-stage.is-complete .hero-terms-note {
  opacity: 0.65;
}

.hero-page-progress {
  display: none;
}

.hero-scroll-cue {
  display: none;
}
@media (min-width: 901px) {
  .hero.hero--split .hero-cat-trigger,
  .hero.hero--split::after {
    display: none !important;
  }

  .hero-scroll-progress,
  .hero-stage.is-complete .hero-scroll-cue,
  .hero-page-progress {
    display: none !important;
  }
}

@keyframes heroCueBounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(4px);
  }
}

/* Hide old standalone DM phone block (legacy) */
.dm-section .dm-container {
  display: none;
}

.dm-section {
  padding-top: clamp(40px, 6vw, 64px);
}

/* Mobile: full-screen centered hero (no phone conversation) */
@media (max-width: 900px) {
  .hero-stage,
  .hero-stage.hero-stage--mobile {
    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 100vh;
    min-height: 100svh;
    max-height: none;
    overflow: hidden;
    border-bottom: 1px solid #e4e4e7;
  }

  .hero.hero--split,
  .hero.hero--split.hero--mobile {
    position: relative !important;
    top: auto !important;
    z-index: 1;
    height: 100%;
    min-height: 100%;
    max-height: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--header-h, 52px) + env(safe-area-inset-top, 0px) + 16px)
      20px calc(20px + env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    box-sizing: border-box;
    transform: none !important;
    will-change: auto !important;
  }

  .hero-split {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 36rem;
    margin: 0 auto;
    flex: 1 1 auto;
    gap: 0;
  }

  .hero--split .hero-content {
    width: 100%;
    text-align: center;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hero--split h1 {
    font-size: clamp(2.25rem, 8vw, 3rem);
    margin: 0 auto 12px;
    max-width: none;
  }

  .hero--split .subheadline {
    font-size: clamp(0.95rem, 3.5vw, 1.08rem);
    margin: 0 auto 20px;
    max-width: 34ch;
  }

  .hero--split .hero-buttons {
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .hero-phone-col,
  .hero-scroll-progress,
  .hero-scroll-cue,
  .hero-page-progress,
  .hero--split .hero-cat-trigger {
    display: none !important;
  }

  .hero--split .hero-terms-note,
  .hero-stage.is-complete .hero-terms-note {
    position: static !important;
    transform: none !important;
    left: auto !important;
    bottom: auto !important;
    width: 100%;
    max-width: 34rem;
    margin: 20px auto 0;
    padding: 0 4px;
    opacity: 1 !important;
    flex-shrink: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-stage {
    min-height: auto;
  }

  .hero.hero--split {
    position: relative;
  }

  .hero-phone-messages .dm-bubble {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .hero-scroll-progress {
    display: none;
  }
}
