/* Home page: static nav; the product demo is the only scroll-driven section. */
.landing-page .nav {
  position: absolute;
  background: var(--bg);
  transition: none;
}
.landing-page .nav.scrolled {
  background: var(--bg);
  backdrop-filter: none;
  box-shadow: none;
}
.landing-page .nav-link,
.landing-page .footer-link {
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  transition: none;
}
.landing-page .nav-cta {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  border-radius: 8px;
  box-shadow: none;
}
.home-hero,
.home-product,
.home-download {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 80px;
  align-items: center;
  padding-top: 144px;
  padding-bottom: 96px;
}
.home-eyebrow {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 24px;
}
.home-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(64px, 7vw, 96px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0.5px;
  margin-bottom: 28px;
}
.home-lead {
  max-width: 440px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-dim);
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
}
.home-button {
  display: inline-flex;
  justify-content: center;
  padding: 13px 24px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 16px;
  font-weight: 600;
}
.home-button:hover { background: #ff6289; }
.home-text-link { font-size: 15px; color: var(--text-dim); }
.home-text-link:hover { color: var(--text); text-decoration: underline; }
.home-text-link span { margin-left: 6px; }
.iphone-frame {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 864 / 1808;
  filter: drop-shadow(0 20px 28px rgb(0 0 0 / 0.3));
}
/* Screen opening: x=30, y=30, 804×1748 in the shared 864×1808 frame.
   Keep the capture's status bar and Dynamic Island; the overlay adds hardware only. */
.iphone-frame > img {
  position: absolute;
  top: 1.659292%;
  left: 3.472222%;
  display: block;
  width: 93.055556%;
  height: auto;
  border-radius: 14.427861% / 6.636156%;
  background: #000;
}
.iphone-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/devices/iphone-frame.svg") center / 100% 100% no-repeat;
  pointer-events: none;
}
.home-product { padding-top: 64px; padding-bottom: 72px; }
.home-product-intro { max-width: 600px; margin-bottom: 56px; }
.home-product h2,
.home-download h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -1px;
}
.home-product-intro p { color: var(--text-dim); margin-top: 20px; max-width: 460px; }
.home-demos-stage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px 48px; }
.home-demo-progress { display: none; }
.home-demo { display: grid; grid-template-rows: auto 1fr; gap: 28px; }
.home-demo figcaption { min-height: 124px; }
.home-demo h3 { font-size: 19px; line-height: 1.4; font-weight: 500; margin-bottom: 12px; }
.home-demo p { font-size: 15px; line-height: 1.7; color: var(--text-dim); }
.home-demo .iphone-frame { max-width: 280px; justify-self: center; align-self: start; }
.home-download { text-align: center; padding-top: 64px; padding-bottom: 100px; }
.home-download h2 { margin-bottom: 32px; }
.landing-page .store-btn { border-radius: 10px; }
.landing-page .store-name { font-family: var(--font-body); font-size: 18px; letter-spacing: 0; }
.landing-page .store-pre { font-family: var(--font-body); letter-spacing: 0; font-size: 11px; }
@media (max-width: 900px) {
  .home-hero { gap: 40px; grid-template-columns: minmax(0, 1fr) 240px; }
  .home-intro h1 { font-size: 64px; }
  /* Three columns shrink the screenshots below legibility; give each card a row. */
  .home-demos-stage { grid-template-columns: 1fr; gap: 64px; }
  .home-demo { grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: none; align-items: center; gap: 40px; }
  .home-demo figcaption { min-height: 0; max-width: 360px; }
}
@media (max-width: 640px) {
  .home-hero { grid-template-columns: 1fr; gap: 48px; padding-top: 112px; padding-bottom: 40px; }
  .home-intro h1 { font-size: clamp(52px, 12vw, 72px); }
  .home-lead { font-size: 17px; }
  .home-hero-screen { max-width: 260px; justify-self: center; }
  .home-product { padding-top: 48px; padding-bottom: 40px; }
  .home-product-intro { margin-bottom: 40px; }
  .home-demos-stage { grid-template-columns: 1fr; gap: 56px; }
  .home-demo { grid-template-columns: 1fr; align-items: start; gap: 24px; }
  .home-demo .iphone-frame { max-width: 260px; }
  .home-download { padding-top: 40px; padding-bottom: 64px; }
}

/* Scroll-driven demo: main.js adds .is-scroll-driven (skipped for reduced motion),
   pins one phone, and crossfades captions and screens as the section scrolls.
   Each scroll segment (set by main.js) is 75svh; main.js reads the resulting height. */
.home-demos.is-scroll-driven {
  height: calc(100vh + var(--demo-scroll-segments) * 75vh);
  height: calc(100svh + var(--demo-scroll-segments) * 75svh);
}
.is-scroll-driven .home-demos-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 1fr auto auto 1fr;
  grid-template-areas: ". phone" "progress phone" "caption phone" ". phone";
  gap: 0 80px;
  padding: 40px 0;
}
.home-demos.is-scroll-driven .home-demo { display: contents; }
.is-scroll-driven .home-demo figcaption {
  grid-area: caption;
  align-self: start;
  min-height: 0;
  max-width: 440px;
  will-change: opacity, transform;
}
.is-scroll-driven .home-demo h3 {
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 18px;
}
.is-scroll-driven .home-demo p { font-size: 17px; }
.home-demos.is-scroll-driven .home-demo .iphone-frame {
  grid-area: phone;
  align-self: center;
  justify-self: center;
  width: auto;
  max-width: none;
  height: min(640px, calc(100svh - 96px));
  will-change: opacity, transform;
}
.is-scroll-driven .home-demo-progress {
  grid-area: progress;
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
}
.home-demo-progress span {
  position: relative;
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.home-demo-progress span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--segment-fill, 0));
}
@media (max-width: 640px) {
  .is-scroll-driven .home-demos-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "progress" "caption" "phone";
    padding: 32px 0 24px;
  }
  .is-scroll-driven .home-demo h3 { font-size: 26px; margin-bottom: 10px; }
  .is-scroll-driven .home-demo p { font-size: 15px; }
  .is-scroll-driven .home-demo-progress { margin-bottom: 20px; }
  .home-demos.is-scroll-driven .home-demo .iphone-frame { height: min(540px, calc(100svh - 280px)); }
}
