/* Homepage only. Apple-style scroll scenes on pure black:
   - zoom scenes: a phone pins, scales up until its screen fills the view, then a stats grid fades in over it
   - word cards: one giant word pinned and scaled by scroll
   - app stories: pinned steps that swap the phone screen
   Everything is prefixed hm- so it never collides with style.css. js/home.js drives the motion;
   .hm-js (set in <head>) gates hidden-until-animated states, so the page reads fine without JS. */

.home {
  --hm-bg: #000; --hm-ink: #f5f5f7; --hm-ink2: #a1a1a6; --hm-ink3: #6e6e73;
  --hm-violet: #8b5cf6; --hm-violet2: #a78bfa; --hm-line: rgba(255, 255, 255, 0.1);
  background: var(--hm-bg); color: var(--hm-ink);
}
body.home { overflow-x: clip; background: var(--hm-bg); }

.hm-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; border: 0; cursor: pointer; transition: transform 0.2s, background 0.2s; }
.hm-btn:hover { transform: translateY(-2px); }
.hm-btn--main { background: var(--hm-ink); color: #000; }
.hm-btn--ghost { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--hm-line); color: var(--hm-ink); }
.hm-btn .material-icons { font-size: 18px; }
.hm-link { color: var(--hm-violet2); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.hm-link:hover { text-decoration: underline; }
.hm-link .material-icons { font-size: 18px; }

/* Phone frame: aspect matches the 540x1108 screenshots, so nothing stretches or crops. */
.hm-phone { position: relative; width: min(21vh, 240px, 38vw); aspect-ratio: 540 / 1108; padding: 3%; border-radius: 15% / 7.4%; background: #0a0a0c; flex: none;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.16), 0 60px 120px -40px rgba(0, 0, 0, 1); }
.hm-scr { position: relative; width: 100%; height: 100%; border-radius: 12.5% / 6.1%; overflow: hidden; background: #111; }
.hm-scr img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity 0.5s ease; }
.hm-scr .on { opacity: 1; }

.hm-stick { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

/* ===== Zoom scene ===== */
.hm-zoom { position: relative; height: 380vh; }
.hm-ambient { position: absolute; inset: -10%; background-size: cover; background-position: center top; filter: blur(70px) saturate(1.3); opacity: 0; transform: scale(1.1); pointer-events: none; }
.hm-copy { position: absolute; top: 15vh; left: 0; right: 0; text-align: center; z-index: 3; padding: 0 16px; will-change: transform, opacity; }
.hm-eyebrow { font-size: 1.15rem; font-weight: 600; color: var(--hm-ink); margin-bottom: 10px; letter-spacing: -0.01em; }
.hm-zoom h1, .hm-zoom .hm-h { font-size: clamp(2.5rem, 6.6vw, 5.6rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 800; }
.hm-zoom .dim { color: var(--hm-ink3); }
.hm-w { display: inline-block; transition: opacity 1s, transform 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hm-js .hm-zoom:not(.ready) .hm-w { opacity: 0; transform: translateY(30px); }
.hm-cta { margin-top: 22px; display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; align-items: center; }

.hm-stage { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 2; }
.hm-stage .hm-phone { position: absolute; left: 0; top: 0; translate: -50% -50%; will-change: transform; transform: translateY(17vh); }
.hm-tag { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 600; font-size: 0.9rem; color: var(--hm-ink2); translate: -50% 0; }
.hm-tag img { width: 24px; height: 24px; border-radius: 6px; }
.hm-tag:hover { color: var(--hm-ink); }

.hm-dim { position: absolute; inset: 0; background: #000; opacity: 0; z-index: 4; pointer-events: none; }
.hm-stats { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; text-align: center; padding: 0 16px; pointer-events: none; }
.hm-stats h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); letter-spacing: -0.035em; font-weight: 800; margin-bottom: clamp(30px, 6vh, 64px); }
.hm-stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 260px)); gap: clamp(26px, 5vh, 54px) 40px; justify-content: center; }
.hm-stat small { display: block; font-size: 0.85rem; color: var(--hm-ink2); }
.hm-stat strong { display: block; font-size: clamp(1.8rem, 3.6vw, 3rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.hm-stat span { display: block; font-size: 0.9rem; color: var(--hm-ink2); margin-top: 2px; }
.hm-js .hm-stats { opacity: 0; }
.hm-stat { will-change: transform, opacity; }

/* ===== Word card ===== */
.hm-word { position: relative; height: 230vh; }
.hm-word .hm-stick { display: grid; place-items: center; }
.hm-word-txt { font-size: clamp(4.5rem, 19vw, 17rem); font-weight: 800; letter-spacing: -0.055em; line-height: 1.1; white-space: nowrap; will-change: transform, opacity; }
.grad { background: linear-gradient(90deg, #c4b5fd, #8b5cf6 55%, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ===== Centered intro copy ===== */
/* padding-top/bottom only: a padding shorthand would wipe .container's side gutter */
.hm-intro { padding-top: 120px; padding-bottom: 60px; text-align: center; }
.hm-intro .hm-k { margin-bottom: 12px; }
.hm-intro h2 { font-size: clamp(2.3rem, 5.4vw, 4.4rem); letter-spacing: -0.04em; line-height: 1.04; font-weight: 800; }
.hm-intro p { max-width: 680px; margin: 22px auto 0; color: var(--hm-ink2); font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.55; }
.hm-intro p b { color: var(--hm-ink); font-weight: 600; }
.hm-intro .hm-cta { margin-top: 28px; }
.hm-fade { transition: opacity 1s, transform 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hm-js .hm-fade:not(.in) { opacity: 0; transform: translateY(40px); }

/* ===== App stories (pinned scrollytelling) ===== */
.hm-story { position: relative; height: 420vh; }
.hm-story .hm-stick { display: grid; align-items: center; }
/* .container centres itself with auto margins, which would shrink a grid item to its content. */
.hm-story .hm-inner { width: 100%; }
.hm-inner { display: grid; grid-template-columns: 1fr auto; gap: 90px; align-items: center; }
.hm-story--flip .hm-inner { grid-template-columns: auto 1fr; }
.hm-story--flip .hm-text { order: 2; }
.hm-steps { position: relative; min-height: 330px; }
.hm-step { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(30px); transition: opacity 0.5s, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); pointer-events: none; }
.hm-step.on { opacity: 1; transform: none; pointer-events: auto; }
.hm-k { font-size: 1rem; font-weight: 600; color: var(--hm-violet2); }
.hm-step h3 { font-size: clamp(2rem, 4.4vw, 3.6rem); letter-spacing: -0.04em; line-height: 1.04; font-weight: 800; margin: 10px 0 16px; }
.hm-step p { color: var(--hm-ink2); font-size: 1.12rem; line-height: 1.6; max-width: 460px; }
.hm-rail { display: flex; gap: 8px; margin-top: 30px; }
.hm-rail i { height: 3px; flex: 1; max-width: 60px; background: rgba(255, 255, 255, 0.14); border-radius: 3px; overflow: hidden; position: relative; }
.hm-rail i::after { content: ''; position: absolute; inset: 0; background: var(--hm-ink); transform-origin: left; transform: scaleX(var(--f, 0)); }
.hm-btns { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }
.hm-visual { position: relative; display: grid; place-items: center; }
.hm-visual .hm-phone { width: min(290px, 31vh); }

/* ===== Services ===== */
.hm-svc { padding-top: 120px; padding-bottom: 60px; }
.hm-big { font-size: clamp(2.4rem, 5.4vw, 4.6rem); line-height: 1.02; letter-spacing: -0.045em; font-weight: 800; }
.hm-line { display: block; }
.hm-js .hm-line { background: linear-gradient(90deg, var(--hm-ink) var(--fill, 0%), #3a3a3c calc(var(--fill, 0%) + 8%)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hm-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 50px; }
.hm-card { padding: 32px; border-radius: 28px; background: #111113; border: 1px solid rgba(255, 255, 255, 0.06); transition: opacity 0.8s, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hm-js .hm-card:not(.in) { opacity: 0; transform: translateY(60px); }
.hm-card .material-icons { font-size: 30px; color: var(--hm-violet2); }
.hm-card h3 { margin: 18px 0 10px; font-size: 1.3rem; letter-spacing: -0.02em; }
.hm-card p { color: var(--hm-ink2); line-height: 1.6; font-size: 0.98rem; }
.hm-more { margin-top: 30px; }

/* ===== Final CTA ===== */
.hm-final { padding: 150px 0 160px; text-align: center; position: relative; overflow: hidden; }
.hm-final .hm-big { font-size: clamp(3rem, 10vw, 9rem); }
.hm-final .hm-big span { display: inline-block; will-change: transform; }
.hm-final p { color: var(--hm-ink2); margin: 24px auto 34px; max-width: 520px; font-size: 1.15rem; line-height: 1.55; }
.hm-final .hm-btn { padding: 15px 28px; font-size: 1.05rem; }

/* ===== Phones and small tablets ===== */
@media (max-width: 860px) {
  .hm-zoom { height: 320vh; }
  .hm-copy { top: 13vh; }
  .hm-eyebrow { font-size: 1rem; }
  .hm-cta { gap: 16px; }
  .hm-stats-grid { grid-template-columns: repeat(2, minmax(0, 170px)); gap: 26px 20px; }
  .hm-stat strong { font-size: 1.7rem; }
  .hm-stat span { font-size: 0.8rem; }
  .hm-tag { font-size: 0.8rem; }
  .hm-tag img { width: 20px; height: 20px; }
  .hm-word { height: 180vh; }
  .hm-intro { padding-top: 80px; padding-bottom: 40px; }
  .hm-inner, .hm-story--flip .hm-inner { grid-template-columns: 1fr; }
  .hm-story .hm-inner { gap: 22px; align-content: center; height: 100%; padding-top: 70px; padding-bottom: 22px; }
  .hm-story--flip .hm-text { order: 0; }
  .hm-story .hm-visual { order: -1; }
  .hm-visual .hm-phone { width: min(190px, 26vh); }
  .hm-steps { min-height: 210px; }
  .hm-step h3 { font-size: 1.8rem; margin: 6px 0 8px; }
  .hm-step p { font-size: 0.98rem; }
  .hm-rail { margin-top: 12px; }
  .hm-story .hm-btns { display: none; }
  .hm-svc { padding-top: 80px; padding-bottom: 30px; }
  .hm-cards { grid-template-columns: 1fr; }
  .hm-final { padding: 110px 0 120px; }
}

/* ===== Reduced motion: a still, readable page ===== */
@media (prefers-reduced-motion: reduce) {
  .hm-zoom, .hm-story, .hm-word { height: auto; }
  .hm-stick { position: relative; height: auto; overflow: visible; }
  .hm-stage, .hm-dim, .hm-ambient { display: none; }
  .hm-copy { position: relative; top: auto; padding: 22vh 16px 60px; }
  .hm-stats { position: relative; opacity: 1; padding-bottom: 100px; }
  .hm-word .hm-stick { padding: 80px 0; }
  .hm-story .hm-stick { padding: 90px 0; }
  .hm-story .hm-inner { height: auto; padding-top: 0; padding-bottom: 0; }
  .hm-steps { min-height: 0; }
  .hm-step { position: relative; opacity: 1; transform: none; margin-bottom: 30px; pointer-events: auto; }
  .hm-rail { display: none; }
}

/* ===== Services-first homepage blocks ===== */
.home .dim { color: var(--hm-ink3); }
.hm-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 50px; text-align: left; }
.hm-path { display: block; padding: 40px; border-radius: 28px; background: #111113; border: 1px solid rgba(255, 255, 255, 0.06); transition: border-color 0.3s, transform 0.3s; }
.hm-path:hover { border-color: rgba(167, 139, 250, 0.45); transform: translateY(-4px); }
.hm-path > .material-icons { font-size: 34px; color: var(--hm-violet2); }
.hm-path h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); letter-spacing: -0.03em; margin: 18px 0 12px; }
.hm-path p { color: var(--hm-ink2); line-height: 1.6; font-size: 1.05rem; }
.hm-more-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 18px; color: var(--hm-violet2); font-weight: 600; }
.hm-more-link .material-icons { font-size: 18px; transition: transform 0.2s; }
a.hm-card { display: block; }
a.hm-card:hover { border-color: rgba(167, 139, 250, 0.4); }
a.hm-card:hover .hm-more-link .material-icons, .hm-path:hover .hm-more-link .material-icons { transform: translateX(4px); }
.hm-intro .hm-cards, .hm-intro .hm-process { text-align: left; }
.hm-process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 50px; }
.hm-process b { display: block; font-size: 0.9rem; color: var(--hm-violet2); letter-spacing: 0.06em; }
.hm-process h3 { margin-top: 14px; }
.hm-intro .faq { margin-top: 44px; text-align: left; }
.home .faq details { background: #111113; border-color: rgba(255, 255, 255, 0.06); }
.home .stack span { background: #111113; border-color: rgba(255, 255, 255, 0.08); color: var(--hm-ink2); }

@media (max-width: 860px) {
  .hm-paths, .hm-process { grid-template-columns: 1fr; }
  .hm-path { padding: 28px; }
}
