/* Homepage (spec 2026-10-18, approved prototype v18): hero · scroll chat story · features · FAQ · closing band.
   Classes are prefixed hm- so they never clash with the shared site styles. */

/* HERO — one wide 3D picture made for the web; its plain left side matches the page colour */
.hm-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #ecf6fd 0%, #ecf6fd 45%, #b9dafa 100%);
}

.hm-hero__art {
  position: absolute;
  top: -40px;
  bottom: -40px;
  right: clamp(-120px, calc((100vw - 1180px) / 2 - 160px), 400px);
  aspect-ratio: 1672 / 941;
  background: url("../../images/hero-wide.webp") center / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32%, #000 86%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 32%, #000 86%, transparent 100%);
  will-change: translate;
}

.hm-hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 90px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff);
  content: "";
}

.hm-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 680px;
  align-items: center;
}

.hm-hero__copy {
  max-width: 560px;
}

.hm-hero h1 {
  max-width: none;
  margin: 0 0 18px;
}

.hm-hero h1 em {
  color: var(--ocean-600);
  font-style: normal;
}

.hm-hero .lead {
  margin-bottom: 28px;
}

.hm-offer {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: .875rem;
}

/* STORY — the phone stays on screen while the chat plays as you scroll */
.hm-story {
  position: relative;
  height: 420vh;
  background: var(--canvas);
}

/* sits below the sticky site header (77px, 71px at <=720px); svh keeps it inside the visible area on phones */
.hm-story {
  --hdr: 77px;
  overflow-x: clip;
}

.hm-story__stage {
  position: sticky;
  top: var(--hdr);
  display: grid;
  height: calc(100vh - var(--hdr));
  height: calc(100svh - var(--hdr));
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
}

.hm-steps {
  position: relative;
}

.hm-steps h2 {
  max-width: none;
  margin: 0 0 18px;
}

.hm-steps__list {
  position: relative;
}

.hm-steps__track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--line);
}

.hm-steps__fill {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--ocean-600), #16a34a);
  transform: scaleY(var(--p, 0));
  transform-origin: top;
}

.hm-step {
  padding: 14px 0 14px 18px;
  opacity: .45;
  transform: translateX(-6px);
  transition: opacity var(--t-exit) var(--ease-leave), transform var(--t-exit) var(--ease-leave);
}

.hm-step.on {
  opacity: 1;
  transform: none;
  transition-duration: var(--t-enter);
  transition-timing-function: var(--ease-arrive);
}

.no-js .hm-step {
  opacity: 1;
  transform: none;
}

.hm-step b {
  display: block;
  color: var(--navy-950);
  font-size: 1.25rem;
}

.hm-step span {
  color: var(--muted);
}

.hm-phonewrap {
  position: relative;
  justify-self: center;
  perspective: 1400px;
}

.hm-phone {
  width: 340px;
  height: min(640px, calc(100vh - var(--hdr) - 72px));
  height: min(640px, calc(100svh - var(--hdr) - 72px));
  padding: 14px;
  border-radius: 44px;
  background: #0b1b2e;
  box-shadow: 0 40px 80px -30px rgba(6, 23, 42, .55);
  transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg));
  transition: transform .2s linear;
}

.hm-screen {
  display: flex;
  height: 100%;
  overflow: hidden;
  flex-direction: column;
  border-radius: 32px;
  background: #eef3f8;
}

.hm-screen__bar {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: var(--border);
  background: #fff;
  font-size: .9375rem;
  font-weight: var(--weight-semibold);
}

.hm-screen__bar small {
  color: var(--muted);
  font-weight: var(--weight-regular);
}

/* a chat starts at the top; once it is full it follows the newest message */
.hm-msgs {
  display: flex;
  min-height: 0;
  overflow: hidden;
  flex: 1;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  padding: 16px 12px;
}

.hm-m {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: .9375rem;
  line-height: 1.45;
  transform-origin: bottom left;
}

/* without JS every message is shown; with JS, unsent ones take no space */
.js .hm-m,
.js .hm-time {
  display: none;
}

.js .hm-m.show,
.js .hm-time.show {
  display: block;
  animation: hm-pop var(--t-enter) var(--ease-arrive) both;
}

.js .hm-m--chip.show {
  display: flex;
}

@keyframes hm-pop {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.hm-m--in { align-self: flex-start; border-bottom-left-radius: 6px; background: #fff; }
.hm-m--out { align-self: flex-end; border-bottom-right-radius: 6px; background: #16a34a; color: #fff; transform-origin: bottom right; }
.hm-m--card { width: 78%; align-self: flex-end; border: var(--border); background: #fff; transform-origin: bottom right; }
.hm-m--card .t { display: flex; align-items: center; gap: 6px; color: var(--navy-950); font-weight: var(--weight-semibold); }
.hm-m--card .s { color: var(--muted); font-size: .8125rem; }
.hm-m--chip { display: flex; align-items: center; align-self: center; gap: 6px; border: 1px solid #a7deba; border-radius: 99px; background: #e8f7ee; color: var(--navy-950); font-size: .8125rem; }
.hm-time { align-self: center; color: var(--muted); font-size: .6875rem; }

.hm-typing { display: none; align-self: flex-end; gap: 5px; padding: 12px 14px; border-radius: 18px; background: #dfe7ee; }
.hm-typing.show { display: flex; }
.hm-typing i { width: 7px; height: 7px; border-radius: 50%; background: #7b8ea1; animation: hm-dot 1s infinite ease-in-out; }
.hm-typing i:nth-child(2) { animation-delay: .15s; }
.hm-typing i:nth-child(3) { animation-delay: .3s; }

@keyframes hm-dot {
  0%, 80%, 100% { opacity: .35; transform: none; }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* one icon beside the phone, matching the current step */
.hm-sticker {
  position: absolute;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(.7) rotate(var(--r, 0deg));
  transition: opacity var(--t-exit) var(--ease-leave), transform var(--t-exit) var(--ease-leave);
}

.hm-sticker.on {
  opacity: 1;
  transform: translateY(0) scale(1) rotate(var(--r, 0deg));
  transition: opacity var(--t-enter) var(--ease-arrive), transform .6s cubic-bezier(.34, 1.56, .64, 1);
}

.hm-sticker.on .hm-badge { animation: hm-bob 4s ease-in-out infinite; }

.hm-badge {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 16px 30px -14px rgba(6, 23, 42, .35), 0 0 0 6px rgba(234, 244, 252, .9);
}

.hm-sticker--0 { --r: -8deg; top: 40px; left: -110px; }
.hm-sticker--2 { --r: 7deg; top: 330px; right: -120px; }
.hm-sticker--3 { --r: -6deg; bottom: 90px; left: -120px; }

@keyframes hm-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hm-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.hm-dots span { width: 8px; height: 8px; border-radius: 99px; background: var(--line); transition: width var(--t-enter) var(--ease-arrive), background var(--t-enter); }
.hm-dots span.on { width: 26px; background: var(--ocean-600); }

/* FEATURES */
.hm-features {
  padding: var(--section-space) 0;
  background: linear-gradient(180deg, #fff, var(--surface));
}

.hm-features h2,
.hm-faq h2 {
  max-width: none;
  margin: 0 0 40px;
  text-align: center;
}

.hm-features__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.hm-feature {
  padding: 26px;
  border: var(--border);
  border-radius: var(--radius-lg);
  background: var(--canvas);
  box-shadow: 0 14px 34px -26px rgba(6, 23, 42, .4);
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease;
}

.hm-feature:hover {
  box-shadow: 0 22px 40px -26px rgba(6, 23, 42, .5);
  transform: translateY(-3px);
}

.hm-feature h3 { margin: 0 0 6px; }
.hm-feature p { margin: 0; color: var(--muted); }

.hm-tile {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, #eaf4fc, #e3f6ec);
  transition: transform .3s var(--ease-arrive);
}

.hm-feature:hover .hm-tile { transform: translateY(-4px); }

/* FAQ — the same questions are in the FAQPage JSON-LD */
.hm-faq {
  padding: 0 0 var(--section-space);
  background: var(--surface);
}

.hm-faq__list {
  max-width: 820px;
  margin: 0 auto;
}

.hm-faq details {
  margin-bottom: 12px;
  padding: 18px 22px;
  border: var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.hm-faq summary {
  color: var(--navy-950);
  cursor: pointer;
  font-weight: var(--weight-semibold);
}

.hm-faq details p { margin: 10px 0 0; color: var(--muted); }

/* CLOSING BAND */
.hm-cta {
  position: relative;
  overflow: hidden;
  padding: 96px 0;
  background:
    radial-gradient(ellipse 60% 120% at 50% 120%, rgba(33, 193, 223, .28), transparent 60%),
    radial-gradient(ellipse 40% 90% at 85% -20%, rgba(22, 163, 74, .22), transparent 60%),
    var(--navy-950);
  color: #fff;
  text-align: center;
}

.hm-cta h2 { max-width: none; margin: 0 0 10px; color: #fff; }
.hm-cta p { margin: 0 auto 26px; color: #b8c7d6; }
.hm-cta .button { background: #fff; color: var(--navy-950); }

@media (max-width: 820px) {
  .hm-hero { background: linear-gradient(180deg, #ecf6fd 0%, #ecf6fd 55%, #d2e8fb 100%); }
  .hm-hero__inner { min-height: auto; padding: 28px 0 330px; }
  .hm-hero__art {
    inset: auto 0 0 0;
    height: 340px;
    aspect-ratio: auto;
    background-position: 72% bottom;
    background-size: auto 100%;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%);
    mask-image: linear-gradient(180deg, transparent, #000 30%);
  }
  .hm-story__stage { grid-template-columns: 1fr; align-content: center; gap: 16px; }
  .js .hm-step:not(.on) { display: none; }
  .hm-steps__track { display: none; }
  .hm-phone { width: 260px; height: min(440px, 58vh); height: min(440px, 58svh); }
  .hm-steps h2 { margin-bottom: 8px; font-size: 1.6rem; }
  .hm-step { padding: 8px 0; }
  .hm-badge { width: 64px; height: 64px; }
  .hm-badge svg { width: 34px; height: 34px; }
  .hm-sticker--0 { left: -34px; }
  .hm-sticker--2 { right: -40px; }
  .hm-sticker--3 { left: -40px; }
  .hm-features__grid { grid-template-columns: 1fr; }
  .hm-cta { padding: 64px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-step, .hm-sticker { transition: none; }
  .hm-step, .js .hm-step:not(.on) { display: block; opacity: 1; transform: none; }
  .hm-sticker.on .hm-badge, .js .hm-m.show, .js .hm-time.show { animation: none; }
  .hm-story { height: auto; }
  .hm-story__stage { position: static; height: auto; padding: 60px 0; }
}

.no-js .hm-story { height: auto; }
.no-js .hm-story__stage { position: static; height: auto; padding: 60px 0; }

@media (max-width: 1040px) and (min-width: 821px) {
  .hm-sticker--0, .hm-sticker--3 { left: -60px; }
  .hm-sticker--2 { right: -60px; }
}

@media (max-width: 720px) {
  .hm-story { --hdr: 71px; }
}
