/* ============================================================
   Secuble — Homepage motion layer
   Loaded by index.html only. Every rule is scoped to
   body.page-home, so no other page can be affected.

   Motion rules taken from the landing-page-design skill:
   - base curve  cubic-bezier(.22, 1, .36, 1)
   - 300ms for colour / opacity, 500ms for layout
   - scroll reveals rise 32px, 700ms, once only
   - animate transform and opacity only
   - every effect gated by prefers-reduced-motion

   Deliberately NOT applied (conflicts with the brand or with
   the "homepage only" scope): the skill's typeface swap,
   removal of background gradients, and the floating pill nav.
   ============================================================ */

body.page-home {
  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur-fast: 300ms;
  --dur-base: 500ms;
  --dur-slow: 700ms;
}

/* ------------------------------------------------------------
   1. Scroll progress
   ------------------------------------------------------------ */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 130;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
  will-change: transform;
}

/* ------------------------------------------------------------
   2. Hero — photo layer, entrance, scroll cue
   ------------------------------------------------------------ */
body.page-home .hero--home {
  background: var(--blue-900);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 50% 45%;
  will-change: transform;
}

/* Re-stack the hero layers so the photo sits under the tint
   and the existing blur pass, with the copy on top. */
body.page-home .hero--home::before { z-index: 1; }
body.page-home .hero--home::after { z-index: 2; }
body.page-home .hero-content {
  z-index: 3;
  will-change: transform, opacity;
}

/* The 2.5px blur pass is dropped here: the photo now drifts, and
   re-blurring a full viewport every frame is expensive on mobile.
   The blue tint in ::before still carries text contrast. */
body.page-home .hero--home::after {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Scroll cue */
.hero-cue {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 50%;
  opacity: .85;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}

.hero-cue:hover {
  background: rgba(255, 255, 255, .16);
  color: var(--white);
  border-color: var(--white);
}

.hero-cue svg { width: 18px; height: 18px; }

@keyframes hero-rise {
  from { opacity: 0; transform: translate3d(0, 32px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes hero-rule {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}

@keyframes hero-drift {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to   { transform: scale(1.07) translate3d(0, -1.5%, 0); }
}

@keyframes cue-in {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: .85; transform: translate3d(0, 0, 0); }
}

@keyframes cue-bob {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, 5px, 0); }
}

@media (prefers-reduced-motion: no-preference) {
  body.page-home .hero-content h1 {
    animation: hero-rise var(--dur-slow) var(--ease) 60ms both;
  }
  body.page-home .hero-underline {
    animation: hero-rule 900ms var(--ease) 200ms both;
  }
  body.page-home .hero-sub {
    animation: hero-rise var(--dur-slow) var(--ease) 280ms both;
  }
  body.page-home .hero-actions {
    animation: hero-rise var(--dur-slow) var(--ease) 400ms both;
  }
  .hero-media img {
    animation: hero-drift 26s var(--ease) infinite alternate;
  }
  .hero-cue {
    animation: cue-in var(--dur-slow) var(--ease) 900ms both;
  }
  .hero-cue svg {
    animation: cue-bob 2.6s var(--ease) 1.6s infinite;
  }
}

/* ------------------------------------------------------------
   3. Scroll reveal — homepage tuning of the shared [data-reveal]
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  body.page-home [data-reveal] {
    opacity: 0;
    transform: translate3d(0, 32px, 0);
    transition: opacity var(--dur-slow) var(--ease),
                transform var(--dur-slow) var(--ease);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  body.page-home [data-reveal].is-revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* ------------------------------------------------------------
   4. Tagline band — word by word reveal (landing-page-design B11)
   ------------------------------------------------------------ */
.tagline-band {
  padding-block: var(--sp-8);
  background: var(--blue-900);
  color: var(--white);
  overflow: hidden;
}

.tagline-text {
  max-width: 1000px;
  margin: 0 auto;
  font-size: 2.25rem;      /* text-4xl, 36px */
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.015em;
  text-align: center;
  text-wrap: balance;
}

.tagline-text .word {
  display: inline-block;
  opacity: .26;
  transform: translate3d(0, .28em, 0);
  transition: opacity 480ms var(--ease),
              transform 480ms var(--ease);
  will-change: opacity, transform;
}

.tagline-text .word.is-on {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (min-width: 768px) {
  .tagline-band { padding-block: var(--sp-12); }
  .tagline-text { font-size: 3rem; line-height: 1.1; }        /* text-5xl, 48px */
}

@media (min-width: 1200px) {
  .tagline-text { font-size: 3.75rem; line-height: 1; }       /* text-6xl, 60px */
}

/* ------------------------------------------------------------
   5. Micro interactions
   ------------------------------------------------------------ */
body.page-home .app-tile {
  transition: transform var(--dur-base) var(--ease),
              background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}

body.page-home .app-tile:hover {
  transform: translate3d(0, -4px, 0);
  box-shadow: var(--shadow-card);
}

body.page-home .app-tile svg {
  transition: color var(--dur-fast) var(--ease),
              transform var(--dur-base) var(--ease);
}

body.page-home .app-tile:hover svg {
  transform: translate3d(0, -2px, 0) scale(1.04);
}

/* Arrow nudge on the homepage buttons and action strip links */
body.page-home .btn .tri,
body.page-home .action-strip .tri {
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease);
}

body.page-home .btn:hover .tri,
body.page-home .action-strip a:hover .tri {
  transform: translate3d(3px, 0, 0);
}

/* The map settles into place when the section arrives */
@media (prefers-reduced-motion: no-preference) {
  body.page-home .reach-map img {
    transform: scale(1.06);
    transition: transform 1200ms var(--ease);
  }
  body.page-home .reach-map.is-revealed img {
    transform: scale(1);
  }
}

/* ------------------------------------------------------------
   6. Fix: .cta-band a paints every link white, which made the
   white secondary button white on white. Restore the label.
   ------------------------------------------------------------ */
body.page-home .cta-band .btn,
body.page-home .cta-band .btn:hover {
  color: var(--blue-700);
  text-decoration: none;
}

/* ------------------------------------------------------------
   7. Small screens
   The hero used a fixed 60vh height with centred content, which
   is shorter than the stack on a phone, so the copy overflowed
   upward and collided with the absolute header logo. Let the
   hero size itself and reserve room for the header instead.
   ------------------------------------------------------------ */
@media (max-width: 767px) {
  .hero-cue { display: none; }

  body.page-home .hero--home {
    height: auto;
    min-height: 0;
    align-items: stretch;
  }

  body.page-home .hero-content {
    /* --site-header-h is measured in home.js; the fallback covers
       the first paint before the script runs. */
    padding-top: calc(var(--site-header-h, 150px) + 40px);
    padding-bottom: var(--sp-4);
  }

  .tagline-text { line-height: 1.2; }
}

/* ------------------------------------------------------------
   8. Reduced motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
  .tagline-text .word { opacity: 1; transform: none; transition: none; }
  body.page-home .hero-content { transform: none !important; opacity: 1 !important; }
  body.page-home .reach-map img { transform: none; }
}
