/* Asilia Impact — scroll hero v2.
   Three stacked layers inside one sticky stage: photography, a solid Dhow scrim,
   and the live particle canvas. Tokens match website/assets/site.css. */

/* site.css sets a global `section { padding: clamp(64px,9vw,120px) 0 }`, which the old
   `.hero` overrode. Without resetting it the sticky stage starts 120px down the track
   and its bottom edge (credit, scroll hint) falls below the fold on first paint. */
.hero-track { position: relative; height: 420vh; padding: 0; background: var(--ink, #1A2541); }

.hero-stage {
  /* Stick below the site's sticky header rather than behind it, or the top of the
     composition is permanently covered by a solid bar. --head-h is measured in JS. */
  position: sticky; top: var(--head-h, 0px);
  height: calc(100svh - var(--head-h, 0px)); /* svh, not vh: vh on iOS is the tall viewport */
  overflow: hidden;
  background: var(--ink, #1A2541);
}

/* --- layer 1: the photographs --- */
.hero-photo {
  position: absolute; inset: 0;
  margin: 0;
  opacity: 0;
  will-change: transform, opacity;
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
  display: block;
}

/* --- layer 2: the scrim ---
   A flat fill at varying opacity, never a gradient: §04 of the brief prohibits
   gradients on brand colours. */
.hero-scrim {
  position: absolute; inset: 0;
  background: #1A2541;
  opacity: .52;
  pointer-events: none;
}

/* --- layer 3: the data --- */
#heroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* --- copy --- */
.hero-copy {
  position: absolute; inset: auto 0 0 0;
  padding: 0 var(--gutter, 24px) clamp(64px, 11vh, 132px);
  color: #F1EBDD;
  pointer-events: none;
  z-index: 2;
}
.cap {
  margin: 0; max-width: 46ch;
  opacity: 0; transform: translateY(18px);
  transition: opacity .45s ease, transform .45s ease;
}
.cap + .cap { position: absolute; inset: auto 0 clamp(64px, 11vh, 132px) 0; padding: 0 var(--gutter, 24px); }
.cap.on { opacity: 1; transform: none; }

.hero-copy .kicker {
  margin: 0 0 1.1rem;
  font-family: var(--sans, system-ui, sans-serif); font-weight: 600;
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: #C9714F; /* Udongo lifted for AA against photography and Dhow alike */
}
.hero-copy .line {
  margin: 0;
  font-family: var(--serif, Georgia, serif); font-weight: 600;
  font-size: clamp(2.3rem, 5.4vw, 4.2rem); line-height: 1.04;
  letter-spacing: -0.015em; color: #F7F3EB;
}
.hero-copy .sub {
  margin: 1.1rem 0 0; max-width: 42ch;
  font-size: clamp(1rem, 1.3vw, 1.12rem); line-height: 1.7;
  color: #C8CEDB;
}

/* Photo credit. Uncredited field photography is the thing the ethical gate flags
   first, so the slot is part of the component, not an afterthought. */
.hero-credit {
  position: absolute; right: var(--gutter, 24px); bottom: 1.1rem;
  z-index: 2;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(247, 243, 235, .62);
  transition: opacity .5s ease;
  margin: 0;
}

.scroll-hint {
  position: absolute; left: 50%; bottom: 2rem; transform: translateX(-50%);
  z-index: 2;
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--sans, system-ui, sans-serif); font-weight: 500;
  font-size: .7rem; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(247, 243, 235, .6);
  opacity: 0; transition: opacity .5s ease;
}
.scroll-hint.on { opacity: 1; }
.scroll-hint span { width: 1px; height: 26px; background: #B8593A; }

.hero-progress { position: absolute; inset: auto 0 0 0; height: 2px; background: rgba(247,243,235,.12); z-index: 3; }
.hero-progress i { display: block; height: 100%; width: 0; background: #B8593A; }

/* --- reduced motion ---
   No scrub, no pin: the resolved end state, painted once, in a single screen.
   The canvas still renders, so this is the real composition rather than a flat image. */
body[data-hero="static"] .hero-track { height: 100svh; }
body[data-hero="static"] .hero-stage { position: relative; top: 0; height: calc(100svh - var(--head-h, 0px)); }
body[data-hero="static"] .scroll-hint,
body[data-hero="static"] .hero-progress { display: none; }
body[data-hero="static"] .cap:not(.on) { display: none; }

@media (prefers-reduced-motion: reduce) {
  .cap, .scroll-hint, .hero-credit { transition: none; }
  .hero-photo { transition: none; }
}

@media (max-width: 768px) {
  /* The animation now costs nothing to download, so phones keep it. Only the
     scrub budget shortens, because a 420vh track is a long way to thumb through. */
  .hero-track { height: 320vh; }
  .hero-copy .line { font-size: clamp(2rem, 8vw, 2.8rem); }
  .hero-credit { left: var(--gutter, 24px); right: auto; font-size: .58rem; }
}

/* ---------- site integration ----------
   The old markup was `.hero`, so site.css hung the heading, lede and button
   treatments off that class. The stage replaces it, so those rules are re-pointed
   here rather than edited in site.css, which every other page also reads. */

.hero-copy .wrap { position: relative; }
.hero-copy .cap + .cap { position: absolute; inset: auto 0 0 0; padding: 0 var(--gutter); }

.hero-copy h1,
.hero-copy .line {
  color: #F7F3EB; max-width: 15ch; margin: 0;
  font-family: var(--serif); font-weight: 600; line-height: 1.06;
  font-size: clamp(2.6rem, 5vw, 4.4rem); letter-spacing: -0.01em;
}
.hero-copy .lede { margin-top: 1.4rem; max-width: 47ch; color: #F7F3EB; }
.hero-copy .hero-kicker { color: #F0B79C; margin: 0 0 1.4rem; font-weight: 500; }

/* The copy layer ignores the pointer so scrolling never snags; the buttons must
   opt back in or the hero's two calls to action are dead. */
.hero-copy .actions {
  display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem;
  pointer-events: auto;
}
.hero-copy .btn-primary { background: #B8593A; border-color: #B8593A; color: #fff; }
.hero-copy .btn-primary:hover { background: #F7F3EB; border-color: #F7F3EB; color: #1A2541; }
.hero-copy .btn-ghost { color: #F7F3EB; border-color: rgba(247,243,235,.6); }
.hero-copy .btn-ghost:hover { background: #F7F3EB; color: #1A2541; }

.hero-credit { background: rgba(26,37,65,.8); padding: .15rem .5rem; color: #F7F3EB; }

@media (max-width: 768px) {
  .hero-copy .actions .btn { width: 100%; text-align: center; }
}
