/* ============================================================
   Hero story — one long scroll-driven sequence.
   Phase 1 (video): the cheers-at-the-bar clip plays frame-by-frame
   on <canvas> as you scroll, then the phone floats up.
   Phase 2 (screens): the canvas fades to white and a real 3D phone
   showcase flips 360 between the actual app screens.
   Phase 3 (outro): closing line + CTA.
   ============================================================ */

.hero {
  position: relative;
  height: 640vh;            /* the long scroll track */
  background: #fff;
}
.hero__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #fff;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* loading shimmer until frames are ready */
.hero__stage[data-ready="0"]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  background: linear-gradient(100deg, #fff 30%, #f3f1ec 50%, #fff 70%);
  background-size: 200% 100%;
  animation: heroShimmer 1.3s linear infinite;
}
@keyframes heroShimmer { to { background-position: -200% 0; } }

/* ---- real-screen 3D showcase ---- */
.hero__device {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  perspective: 1600px;
}
.device {
  width: min(680px, 86vw);
  transform-style: preserve-3d;
  will-change: transform;
  margin-top: -4vh;
}
.device__img {
  width: 100%;
  height: auto;
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ---- text panels layer ---- */
.hero__panels { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.hero__panel {
  position: absolute;
  inset: 0;
  display: flex;
  padding: clamp(24px, 6vw, 96px);
  opacity: 0;
  will-change: opacity, transform;
}
.hero__panel .inner { position: relative; max-width: 560px; }
.hero__panel[data-pos="right"]  { justify-content: flex-end; align-items: center; text-align: right; }
.hero__panel[data-pos="left"]   { justify-content: flex-start; align-items: center; text-align: left; }
.hero__panel[data-pos="center-low"] { justify-content: center; align-items: flex-end; text-align: center; padding-bottom: clamp(48px, 8vh, 90px); }
.hero__panel[data-pos="center"] { justify-content: center; align-items: center; text-align: center; }
.hero__panel[data-pos="center"] .inner,
.hero__panel[data-pos="center-low"] .inner { max-width: 720px; }

.hero__panel h1,
.hero__panel h2 { font-family: var(--ff-display); font-weight: 700; letter-spacing: -0.03em; line-height: 0.98; }
.hero__panel h1 { font-size: clamp(40px, 8.2vw, 108px); }
.hero__panel h2 { font-size: clamp(28px, 4.6vw, 60px); }
/* darker than body --ink-soft for readability over the footage (no scrim) */
.hero__panel .sub { font-size: clamp(16px, 2vw, 21px); color: #2b2930; font-weight: 500; margin-top: 20px; max-width: 44ch; }
.hero__panel[data-pos="right"] .sub,
.hero__panel[data-pos="center"] .sub,
.hero__panel[data-pos="center-low"] .sub { margin-left: auto; margin-right: auto; }
.hero__panel .accent { color: var(--accent-text); }
.hero__panel .kicker {
  display: inline-block; font-weight: 700; font-size: 12.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent-text); margin-bottom: 16px;
}
.hero__panel .actions { margin-top: 32px; display: flex; gap: 14px; pointer-events: auto; }
.hero__panel[data-pos="right"] .actions,
.hero__panel[data-pos="center"] .actions,
.hero__panel[data-pos="center-low"] .actions { justify-content: center; }
.hero__panel[data-pos="right"] .actions { justify-content: flex-end; }

/* fixed chrome over hero */
.hero__cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-faint);
  transition: opacity 0.4s var(--ease);
}
.hero__cue .line { width: 1px; height: 38px; background: linear-gradient(var(--ink-faint), transparent); overflow: hidden; position: relative; }
.hero__cue .line::after {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 40%;
  background: var(--accent); animation: cueDrop 1.8s var(--ease) infinite;
}
@keyframes cueDrop { 0% { transform: translateY(-100%);} 60%,100% { transform: translateY(280%);} }

.hero__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0%; background: var(--accent); z-index: 6; }

@media (max-width: 760px) {
  .hero { height: 580vh; }
  .device { width: 92vw; margin-top: -2vh; }
  .hero__panel[data-pos="right"],
  .hero__panel[data-pos="left"] { justify-content: center; text-align: center; align-items: flex-end; padding-bottom: 14vh; }
  .hero__panel[data-pos="right"] .actions,
  .hero__panel[data-pos="left"] .actions { justify-content: center; }
  .hero__panel .inner { max-width: 92%; }
  .hero__panel[data-pos="center-low"] { padding-bottom: 8vh; }
}

/* reduced motion: static first frame + first panel */
@media (prefers-reduced-motion: reduce) {
  .hero { height: auto; min-height: 100vh; }
  .hero__stage { position: relative; height: auto; min-height: 100vh; display: flex; align-items: center; }
  .hero__canvas { position: absolute; }
}
