/* Ikigai Traveler — Hub "signature" motion
   Layered on top of the existing entrance system (screen-anim.css): a living
   hero, page-wide scroll-reveal, and a spring pop for the quick actions.
   Everything is gated so prefers-reduced-motion (motion.css `*{animation:none}`)
   plus the JS guard in hub-motion.js leaves content fully visible + static. */

:root{ --ease-back:cubic-bezier(.34,1.56,.64,1); }

/* ============================================================= 1. LIVING HERO */

/* wrapper clips the Ken-Burns scale and carries the scroll parallax (JS sets
   --hub-par on the scroll container). It must stay flush with .home-hero-fade
   (top:0, height:400px) — the fade's opaque bottom hides the gap that parallax
   (which only ever moves the wrapper UP) opens beneath it, so no photo bleeds
   through behind the quick-action row. */
#HUB .home-hero{
  position:absolute; top:0; left:0; right:0; height:400px; z-index:0;
  overflow:hidden;
  transform:translate3d(0,var(--hub-par,0px),0);
  will-change:transform;
}
#HUB .home-hero-bg{
  position:absolute; inset:0; height:100%; z-index:0;
  transform-origin:60% 42%;
  animation:hub-kenburns 28s ease-in-out infinite;
}
@keyframes hub-kenburns{
  0%   { transform:scale(1.06) translate3d(0,0,0); }
  50%  { transform:scale(1.16) translate3d(-1.6%,-1.4%,0); }
  100% { transform:scale(1.06) translate3d(0,0,0); }
}

/* headline: masked line-by-line reveal. Lines are block spans; an inner span
   slides up from behind the mask. Per-line delay comes from inline --d. */
#HUB .home-title .htl{ display:block; overflow:hidden; padding-bottom:.14em; margin-bottom:-.10em; }
#HUB .home-title .htl-in{ display:block; }

@keyframes hub-line{ from{ opacity:0; transform:translateY(112%); } to{ opacity:1; transform:none; } }
@keyframes hub-rise{ from{ opacity:0; transform:translateY(14px); } to{ opacity:1; transform:none; } }

/* armed state (added by JS only when motion is allowed) drives the reveal */
#HUB.hub-hero-armed .home-eyebrow{ animation:hub-rise .6s var(--ease) .04s both; }
#HUB.hub-hero-armed .htl-in{ animation:hub-line .82s var(--ease) var(--d,0s) both; }
#HUB.hub-hero-armed .home-sub{ animation:hub-rise .6s var(--ease) .54s both; }

/* accent word: animated gradient shimmer (always on), plus the line reveal when
   armed. Kept as one rule so the reveal doesn't clobber the shimmer. */
#HUB .home-title-accent{
  background:linear-gradient(100deg,
    var(--green) 0%, var(--green-400) 26%, #d9f5e6 46%, var(--green-400) 66%, var(--green) 100%);
  background-size:230% 100%;
  -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent; color:transparent;
  animation:hub-shine 5s linear infinite;
}
#HUB.hub-hero-armed .home-title-accent{
  animation:hub-line .82s var(--ease) var(--d,0s) both,
            hub-shine 5s linear calc(var(--d,0s) + .9s) infinite;
}
@keyframes hub-shine{ from{ background-position:190% 0; } to{ background-position:-90% 0; } }

/* ============================================ 1b. CINEMATIC PARALLAX BANNER */
/* Full-width photo banner mid-feed. The photo layer is taller than the frame and
   is translated by JS (--hub-feat-par) as the banner passes through the viewport,
   so the image drifts slower than the page — header-style parallax. */
#HUB .hub-feat{
  display:block; position:relative; width:100%;
  height:360px; margin-top:16px; border-radius:0;
  overflow:hidden; text-align:left;
  -webkit-tap-highlight-color:transparent;
}
/* Photo covers the band by default (static / reduced-motion). hub-motion.js grows
   it to viewport height and counter-translates it on scroll so it looks pinned to
   the screen — the band becomes a moving "window" onto one fixed picture. */
#HUB .hub-feat-photo{
  position:absolute; left:0; right:0; top:0; height:100%;
  background-size:cover; background-position:center 55%;
  will-change:transform;
}
#HUB .hub-feat-scrim{
  position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(0,20,12,.12) 0%, rgba(0,20,12,.05) 34%, rgba(0,18,11,.82) 100%);
}
#HUB .hub-feat-body{ position:absolute; left:18px; right:18px; bottom:16px; z-index:1; color:#fff; }
#HUB .hub-feat-eyebrow{
  display:inline-block; font-size:var(--caption2); letter-spacing:.14em; font-weight:800;
  color:#eafbf1; opacity:.92; text-transform:uppercase;
  background:rgba(10,125,85,.42); padding:4px 9px; border-radius:999px;
  -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
}
#HUB .hub-feat-title{ display:block; margin-top:9px; font-size:26px; line-height:1.12; font-weight:800; letter-spacing:-.01em;
  text-shadow:0 2px 14px rgba(0,0,0,.4); }
#HUB .hub-feat-sub{ display:block; margin-top:5px; font-style:normal; font-size:var(--subhead); line-height:1.4;
  color:rgba(255,255,255,.9); max-width:34ch; text-shadow:0 1px 10px rgba(0,0,0,.4); }
#HUB .hub-feat-cta{
  display:inline-flex; align-items:center; gap:6px; margin-top:12px;
  font-size:var(--footnote); font-weight:700; color:#0c1512;
  background:rgba(255,255,255,.94); padding:8px 14px; border-radius:999px;
}
#HUB .hub-feat-cta .ic{ width:16px; height:16px; }
#HUB .hub-feat:active{ transform:scale(.99); }

/* ================================================= 2. SCROLL-REVEAL (sections) */
/* JS adds .hub-rev to below-the-fold flow sections (and strips their data-si so
   the entry stagger doesn't fight this), then .hub-rev-in as they scroll in. */
#HUB .hub-rev{
  opacity:0; transform:translateY(30px);
  transition:opacity .6s var(--ease), transform .6s var(--ease);
  will-change:opacity, transform;
}
#HUB .hub-rev.hub-rev-in{ opacity:1; transform:none; }

/* ================================================ 3. QUICK ACTIONS — spring pop */
/* Higher specificity (#app #HUB …) than screen-anim.css so this wins for both the
   base entrance and the directional-push name override. Reuses --si for stagger. */
#app #HUB .qa-grid5 > [data-si]{
  animation:hub-pop .52s var(--ease-back) both;
  animation-delay:calc(min(var(--si,0), 8) * .05s + .08s);
}
@keyframes hub-pop{
  0%   { opacity:0; transform:translateY(10px) scale(.6); }
  60%  { opacity:1; transform:translateY(0) scale(1.06); }
  100% { transform:none; }
}
