/* Home page (BLA-2635): five short beats over one 3D scene (orbit.js).
   The real app sits in the middle on a tilted iPhone; Blankies orbit it.
   Colors are var(--token) only; tokens.css (imported by styles.css) holds
   every value, and generate-web-tokens.mjs --check fails on a copied one. */

/* The header stays, so Get the app is always one tap away. */
.home .site-header { position: sticky; top: 0; z-index: 3; background: var(--ground); }

/* The scene stays put while the beats scroll over it. Layers, back to
   front: Blankies behind the phone, the phone, Blankies in front of it. */
/* --scene-x and --scene-y are the planet's center; orbit.js reads them. */
.stage { --scene-x: 50%; --scene-y: 35%; position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; perspective: 1600px; }
.stage .layer { position: absolute; inset: 0; width: 100%; height: 100%; }
#orbit-front { z-index: 2; }
.beats { position: relative; z-index: 1; }
.home .site-footer { position: relative; z-index: 1; background: var(--ground); }

/* The phone: the app's own screens (snapshot references, test data). It
   stands in front of the planet's lower right, like a moon. */
.phone {
  --phone-h: min(40svh, 360px);
  position: absolute; z-index: 1;
  left: calc(var(--scene-x) + var(--phone-h) * 0.24);
  top: calc(var(--scene-y) + var(--phone-h) * 0.14);
  height: var(--phone-h); aspect-ratio: 640 / 1391;
  padding: calc(var(--phone-h) * 0.022);
  border-radius: calc(var(--phone-h) * 0.075);
  background: var(--photo-backdrop);
  box-shadow: 0 2px 4px rgba(51, 55, 59, 0.12), 0 24px 60px rgba(51, 55, 59, 0.22);
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  will-change: transform;
}
.phone::before { content: ""; position: absolute; z-index: 2; left: 50%; top: calc(var(--phone-h) * 0.035); width: 28%; height: calc(var(--phone-h) * 0.022); border-radius: var(--radius-pill); background: var(--photo-backdrop); transform: translateX(-50%); }
.screen { position: absolute; inset: calc(var(--phone-h) * 0.022); width: calc(100% - var(--phone-h) * 0.044); height: calc(100% - var(--phone-h) * 0.044); object-fit: cover; object-position: top; border-radius: calc(var(--phone-h) * 0.058); opacity: 0; transition: opacity 0.45s ease-out; }
.screen.on { opacity: 1; }

.beat { min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; padding-bottom: var(--space-8); }
.hero { min-height: calc(100svh - 72px); }
.beat-inner { position: relative; }
.beat-copy { position: relative; display: flex; flex-direction: column; gap: 14px; max-width: 34rem; }
/* On phones the words pass over the scene while scrolling: orbit.js fades
   the scene back under them (no paper block over the graphics). */
.stage { transition: opacity 0.12s linear; }

.display-xl { font-size: clamp(52px, 8.6vw, 132px); line-height: 0.94; letter-spacing: -0.03em; text-wrap: balance; }
.display-lg { font-size: clamp(34px, 4.8vw, 72px); line-height: 1.02; letter-spacing: -0.02em; text-wrap: balance; }
.beat-line { max-width: 30ch; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; color: var(--ink-muted); text-wrap: pretty; }
.hero .beat-line { color: var(--ink); }

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 6px; }
.btn.xl { min-height: 56px; padding: 0 28px; font-size: 18px; font-weight: 800; box-shadow: 0 10px 28px var(--button-shadow); }
.cta-note { font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--ink-muted); }
.talk { font-size: 16px; line-height: 1.5; color: var(--ink-muted); }
.talk a { display: inline-block; padding-block: 10px; font-weight: 800; }

/* Short phones: a smaller phone so the words keep their room. */
@media (max-height: 700px) and (max-width: 899px) {
  .stage { --scene-y: 34%; }
  .phone { --phone-h: min(36svh, 280px); }
  .display-xl { font-size: 46px; }
  .display-lg { font-size: 30px; }
}

.home ::selection { background: var(--mood-great); color: var(--on-accent); }
.home a:focus-visible, .home .btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

@media (min-width: 900px) {
  .stage { --scene-x: 70%; --scene-y: 48%; }
  .phone { --phone-h: min(60vh, 560px); left: calc(var(--scene-x) + var(--phone-h) * 0.3); top: calc(var(--scene-y) + var(--phone-h) * 0.16); }
  .beat, .hero { min-height: 100vh; align-items: center; padding-bottom: 0; }
  .beat-copy { max-width: min(44vw, 40rem); gap: 22px; }
  .hero .beat-copy { max-width: min(46vw, 44rem); }
  .close { padding-bottom: 64px; }
}
