/* I am J Home v25 — editorial motion layer. The original HERO is untouched.
   JS opts into reveals only when IntersectionObserver and motion preferences allow. */

/* A faint, static aurora gives the opening of the editorial story more depth. */
#iamj-v8-root .v8-intro {
  position: relative;
  isolation: isolate;
}
#iamj-v8-root .v8-intro::before {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  inset: 1% -12% 10%;
  background:
    radial-gradient(ellipse 44% 57% at 35% 32%, rgba(92, 89, 219, .15), transparent 75%),
    radial-gradient(ellipse 40% 54% at 68% 48%, rgba(50, 158, 223, .11), transparent 78%);
}
#iamj-v8-root .v8-intro > * { position: relative; z-index: 1; }

/* This fixed two-pixel line is purely decorative and does not intercept input. */
.v25-scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  z-index: 2100;
  background: linear-gradient(90deg, #4eb8f1, #8060ef 58%, #ba83f4);
  box-shadow: 0 0 12px rgba(96, 155, 239, .38);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.v25-scroll-progress[data-rtl="true"] { transform-origin: 100% 50%; }
.v25-scroll-progress.v25-progress-visible { opacity: .87; }

/* Fade and rise once as each section enters view, with a leisurely filmic pace.
   No content is concealed unless the JS enhancement has positively initialized. */
html.v25-motion-enabled .v25-reveal:not(.v25-visible):not(.v8-grid) {
  opacity: 0;
  transform: translate3d(0, 27px, 0);
}
html.v25-motion-enabled .v25-reveal:not(.v8-grid) {
  transition:
    opacity 860ms cubic-bezier(.2, .7, .2, 1),
    transform 1050ms cubic-bezier(.2, .75, .2, 1);
}
html.v25-motion-enabled #iamj-v8-root .v8-grid.v25-reveal .v8-left,
html.v25-motion-enabled #iamj-v8-root .v8-grid.v25-reveal .v8-right {
  transition:
    opacity 850ms cubic-bezier(.2, .7, .2, 1),
    transform 1040ms cubic-bezier(.2, .75, .2, 1);
}
html.v25-motion-enabled #iamj-v8-root .v8-grid.v25-reveal:not(.v25-visible) .v8-left {
  opacity: 0;
  transform: translate3d(-18px, 22px, 0);
}
html.v25-motion-enabled #iamj-v8-root .v8-grid.v25-reveal:not(.v25-visible) .v8-right {
  opacity: 0;
  transform: translate3d(18px, 22px, 0);
}
html.v25-motion-enabled #iamj-v8-root .v8-grid.v25-reveal.v25-visible .v8-right {
  transition-delay: 135ms;
}
/* RTL: reverse the editorial entrance so language direction feels natural. */
html.v25-motion-enabled #iamj-v8-root[dir="rtl"] .v8-grid.v25-reveal:not(.v25-visible) .v8-left {
  transform: translate3d(18px, 22px, 0);
}
html.v25-motion-enabled #iamj-v8-root[dir="rtl"] .v8-grid.v25-reveal:not(.v25-visible) .v8-right {
  transform: translate3d(-18px, 22px, 0);
}

/* The image gently settles into its final scale as the banner arrives. */
html.v25-motion-enabled #iamj-v8-root .v8-banner.v13-with-photo .v13-banner-image {
  transform: scale(1);
  transition: transform 1650ms cubic-bezier(.17, .7, .2, 1);
}
html.v25-motion-enabled #iamj-v8-root .v8-banner.v13-with-photo.v25-reveal:not(.v25-visible) .v13-banner-image {
  transform: scale(1.065);
}

/* A subtle divider gives the five chapters a deliberate visual rhythm. */
#iamj-v8-root .v8-feature + .v8-feature { position: relative; }
#iamj-v8-root .v8-feature + .v8-feature::before {
  content: "";
  position: absolute;
  top: -33px;
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, 46vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(159, 181, 242, .28), transparent);
  pointer-events: none;
}

/* Desktop-only, understated interaction cues; keep all focus rings intact. */
@media (hover: hover) and (pointer: fine) {
  #iamj-v8-root .v8-tabs button,
  #iamj-v8-root .v8-subchoices button,
  #iamj-v8-root a.v16-app-button {
    transition: transform 230ms ease, background 230ms ease, border-color 230ms ease, box-shadow 230ms ease;
  }
  #iamj-v8-root .v8-tabs button:hover,
  #iamj-v8-root .v8-subchoices button:hover { transform: translateY(-2px); }
  #iamj-v8-root a.v16-app-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 39px rgba(70, 100, 220, .3);
  }
  #iamj-v8-root .v8-banner.v13-with-photo {
    transition: border-color 400ms ease, box-shadow 400ms ease;
  }
  #iamj-v8-root .v8-banner.v13-with-photo:hover {
    border-color: rgba(183, 202, 255, .3);
    box-shadow: 0 26px 72px rgba(0, 0, 0, .28);
  }
}
@media (max-width: 720px) {
  html.v25-motion-enabled .v25-reveal:not(.v25-visible):not(.v8-grid) {
    transform: translate3d(0, 17px, 0);
  }
  html.v25-motion-enabled #iamj-v8-root .v8-grid.v25-reveal:not(.v25-visible) .v8-left,
  html.v25-motion-enabled #iamj-v8-root .v8-grid.v25-reveal:not(.v25-visible) .v8-right {
    transform: translate3d(0, 18px, 0);
  }
  #iamj-v8-root .v8-feature + .v8-feature::before { top: -24px; }
}
@media (prefers-reduced-motion: reduce) {
  .v25-scroll-progress { display: none !important; }
  html.v25-motion-enabled .v25-reveal,
  html.v25-motion-enabled .v25-reveal *,
  #iamj-v8-root .v8-banner.v13-with-photo .v13-banner-image {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  #iamj-v8-root .v8-tabs button,
  #iamj-v8-root .v8-subchoices button,
  #iamj-v8-root a.v16-app-button { transition: none !important; }
}
