/* ============================================================
   The home page's hero: sky gradient, nav, headline, store
   buttons, and the keyed duck video drawn through WebGL with
   drifting dandelion seeds over it (js/hero.js).

   From the hero blueprint (2026-10-17). Its global rules (`*`,
   `body`, `a`, `h1`, `.wrap`, `:root`) are scoped to `.hero` here
   so the feature rows, footer and legal pages keep tokens.css.
   Light only, like the rest of the site.
   ============================================================ */

:root { --hero-tail: clamp(24px, 3.5vw, 52px); }

.hero {
  --sky-top: #4a71bd;
  --sky-mid: #6087cd;
  --sky-horizon: #a3a9c8;   /* warm haze at the horizon, like the clip */
  --on-sky: #ffffff;
  --on-sky-soft: rgba(255, 255, 255, 0.82);
  --hero-ink: #1b2a52;
  --store-bg: #111a2e;
  --hero-accent: #007aff;   /* Apple's systemBlue, the app's primary */
  --hero-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --hero-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* One screen, plus a strip below the fold the page's curved top edge
     rises into (sections.css .how2), so the curve only shows on scroll. */
  height: calc(100vh + var(--hero-tail));
  height: calc(100svh + var(--hero-tail));
  min-height: calc(560px + var(--hero-tail));
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-horizon) 100%);
  color: var(--on-sky);
  font-family: var(--hero-body);
  font-size: 17px;
  line-height: 1.6;
}
.hero a { color: inherit; }
.hero :focus-visible { outline: 3px solid var(--hero-accent); outline-offset: 3px; border-radius: 6px; }

.hero__wrap {
  position: relative;
  z-index: 2;
  flex: none;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---- nav ---- */
.hero__nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; }
.hero__logo {
  font-family: var(--hero-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--on-sky);
}
.hero__links { display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.hero__links a { text-decoration: none; color: var(--on-sky-soft); }
.hero__links a:hover { color: var(--on-sky); }
.hero__links .hero__cta {
  background: var(--on-sky);
  color: var(--hero-ink);
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
}

/* ---- headline, description, store buttons ---- */
.hero__copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.8vh, 18px);
  padding-top: var(--title-top, 16.5vh);
  text-align: center;
}
.hero__copy h1 {
  margin: 0;
  max-width: 12ch;
  font-family: var(--hero-display);
  font-size: clamp(34px, min(5.2vw, 7vh), 68px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
  /* tokens.css pins opsz for Inter; Bricolage has its own axis. */
  font-optical-sizing: auto;
  font-variation-settings: normal;
}
.hero__copy p { margin: 0; max-width: 44ch; font-size: clamp(16px, 1.6vw, 19px); color: var(--on-sky-soft); }

.hero__stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }
.hero__store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--store-bg);
  color: #fff;
  text-decoration: none;
  text-align: left;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.15;
}
.hero__store small { display: block; font-weight: 500; font-size: 11px; opacity: 0.75; }
.hero__store svg { width: 20px; height: 20px; flex: none; }
/* No listing yet: visibly inert rather than a live-looking dead link. */
.hero__store[aria-disabled="true"], .hero__cta[aria-disabled="true"] { opacity: 0.6; cursor: default; }

/* ---- the scene: keyed video at the bottom, seeds over it ---- */
.hero__scene {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 240px;
  margin-top: -4vh;
}
/* Its bottom padding is the tail: js/hero.js places the video against the
   top of it (the fold) and lets the hill carry on down into it. */
.hero__stage { position: absolute; inset: 0; padding-bottom: var(--hero-tail); }
/* The <video> elements are only the WebGL canvas's sources. */
.hero__stage video { position: absolute; inset: 0; width: 100%; height: 100%; visibility: hidden; }
.hero__video, .hero__seeds { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__seeds { z-index: 2; pointer-events: none; }
.hero__still {
  position: absolute;
  left: 50%;
  bottom: var(--hero-tail);
  height: 100%;
  max-width: none;
  transform: translateX(-50%);
}

.hero__desc-narrow { display: none; }

@media (max-width: 760px) {
  .hero__links { gap: 16px; }
  .hero__scene { margin-top: -10px; }
  /* Phone: the short description, and no "Get the app" up top, the store
     buttons are right under it. */
  .hero__desc-wide, .hero__cta { display: none; }
  .hero__desc-narrow { display: inline; }
}

/* ---- breathing on scroll (js/motion.js sets transform and opacity) ---- */
.hero__copy { transform-origin: 50% 30%; will-change: transform, opacity; }
.hero__scene { transform-origin: 50% 100%; will-change: transform; }
/* Blocks below the hero rise in once (js/motion.js adds .reveal, then .is-in). */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1); transition-delay: var(--reveal-delay, 0ms); }
.reveal.is-in { opacity: 1; transform: none; }
