/* ==========================================================================
   BAMFLOW — assets/css/about-hero.css · ve-chung-toi.html hero intro (vòng 104)
   Linked after ve-chung-toi.css. Production port of lab/bamflow-name.css (stage parts only).
   about-hero.js builds .ah-intro inside #top.vct-hero (above the copy, clicks pass through): the
   block words on .ah-canvas (WebGL), captions / white tiles / crisp B · A · M in .ah-layer, then
   the centred wordmark (.ah-lockup) + meaning line (.ah-final). After a 1 s hold the mark flies
   onto the header logo and the word onto the H1's BAMFLOW (.ah-fly, fixed, above the header),
   then the rest of the hero fades up. html.ah-gl (inline gate at the top of the hero) = the intro
   can run; .ah-landed = the header mark + H1 word are back; .ah-done = everything is final.
   Sky (gradient, fog, dot grid) is untouched.
   ========================================================================== */

/* ---------- the intro stage: the first screen of the hero ---------- */
.vct-hero .ah-intro {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: 0;
  height: min(100%, 100vh);
  height: min(100%, 100svh);
  overflow: hidden;
  pointer-events: none;
  color: #ffffff;
}
.ah-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ah-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.ah-tile {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  border-radius: 24%;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7ff 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 22px 44px -22px rgba(4, 12, 40, .7), 0 2px 6px rgba(4, 12, 40, .18);
  transform-origin: 50% 50%;
  opacity: 0;
  will-change: transform, opacity;
}
.ah-cap {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: .6em;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: var(--ah-cap, 18px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: rgba(236, 244, 255, .94);
  opacity: 0;
  will-change: transform, opacity;
}
.ah-cap::before {
  content: "";
  flex: none;
  width: 1.15em;
  height: 2px;
  border-radius: 2px;
  background: #93c5fd;
}
.ah-cap--b::before { display: none; }
.ah-cap--b { gap: .5em; }
.ah-cap--b b { font-weight: 700; color: #ffffff; }
.ah-cap__sep { color: #93c5fd; font-weight: 700; }
.ah-glyph {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  color: #1d4ed8;
  transform-origin: 0 0;
  opacity: 0;
}
.ah-glyph i { display: inline-block; width: 0; height: 0; vertical-align: baseline; }

/* the centred wordmark + meaning line (the prototype's final frame, held 1 s) */
.ah-final {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  top: 46%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px;
  text-align: center;
}
.ah-lockup {
  display: inline-flex;
  align-items: center;
  gap: .24em;
  margin: -.625em 0 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 7.4vw, 112px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: .06em;
  white-space: nowrap;
  color: #ffffff;
}
.ah-lockup__mark {
  display: block;
  flex: none;
  width: 1.25em;
  height: 1.25em;
  color: #ffffff;
  opacity: 0;
}
.ah-lockup__word { display: block; margin-right: -.06em; opacity: 0; }
.ah-base { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.ah-meaning {
  max-width: min(100%, 36em);
  margin: clamp(18px, 3.2vh, 32px) auto 0;
  font-size: clamp(1rem, 1.35vw, 1.3rem);
  font-weight: 500;
  line-height: 1.55;
  color: rgba(255, 255, 255, .92);
  text-wrap: balance;
  opacity: 0;
}
.ah-meaning__k { white-space: nowrap; }

/* ---------- the flyers: fixed, above the header (z 100), removed at landing ---------- */
.ah-fly {
  position: fixed;
  inset: 0;
  z-index: 101;
  overflow: visible;
  pointer-events: none;
}
.ah-fly__mark {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  transform-origin: 0 0;
}
.ah-fly__word {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  transform-origin: 0 0;
}

/* ---------- the hero waits (opacity only: layout kept, nothing jumps) ---------- */
/* the entrance animations of ve-chung-toi.css are replaced by the intro's own reveal */
html.ah-gl .vct-hero .vct-hero__copy > *,
html.ah-gl .vct-hero .vct-evo__card,
html.ah-gl .vct-hero .vct-evo__arrow { animation: none; }
html.ah-gl:not(.ah-done) .vct-hero.sky .vct-hero__title { color: transparent; }           /* "Về" */
html.ah-gl:not(.ah-landed) .vct-hero.sky .vct-hero__title em { opacity: 0; }             /* BAMFLOW */
html.ah-gl:not(.ah-done) .vct-hero .vct-hero__lead,
html.ah-gl:not(.ah-done) .vct-hero .vct-hero__cred,
html.ah-gl:not(.ah-done) .vct-hero .vct-hero__actions,
html.ah-gl:not(.ah-done) .vct-hero .vct-evo { opacity: 0; pointer-events: none; }
/* the header's logo mark waits for the flying mark (the BAMFLOW text next to it stays) */
html.ah-gl:not(.ah-landed) #header .logo .logo__mark { opacity: 0; }

/* failsafe: the module never booted → the final hero anyway */
html.ah-gl:not(.ah-boot) .vct-hero .vct-hero__lead,
html.ah-gl:not(.ah-boot) .vct-hero .vct-hero__cred,
html.ah-gl:not(.ah-boot) .vct-hero .vct-hero__actions,
html.ah-gl:not(.ah-boot) .vct-hero .vct-evo,
html.ah-gl:not(.ah-boot) .vct-hero.sky .vct-hero__title em,
html.ah-gl:not(.ah-boot) #header .logo .logo__mark { animation: ah-failsafe .4s ease 6.5s both; }
html.ah-gl:not(.ah-boot) .vct-hero.sky .vct-hero__title { animation: ah-failsafe-c .4s ease 6.5s both; }
@keyframes ah-failsafe { from { opacity: 0; } to { opacity: 1; } }
@keyframes ah-failsafe-c { from { color: transparent; } to { color: #ffffff; } }

@media (max-width: 600px) {
  .ah-final { padding: 0 16px; }
  .ah-meaning { max-width: 24em; }
}
