/* ============================================================
   Bet Journal — scroll-story hero (bevel-style pinned scrub)
   ============================================================ */

.hero-scrolly { position: relative; height: 320vh; z-index: 2; }
.hs-stage {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  overflow: hidden; display: grid; place-items: center;
  background: var(--paper);
  isolation: isolate;
}

/* ---- phase 1: big title ---- */
.hs-title {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  text-align: center; padding-inline: var(--gut);
  padding-top: clamp(12px, 2.5vh, 22px);
  pointer-events: none;
}
.hs-title .eyebrow { justify-content: center; }
.hs-title .eyebrow::before { width: 12px; }
.hs-title h1 {
  font-size: clamp(38px, 5.4vw, 74px); letter-spacing: -.035em; line-height: 1.12;
  margin-top: 14px; max-width: none; text-align: center;
}
.hs-title h1 .ink-accent { color: var(--accent-deep); font-family: var(--hand); font-style: var(--hand-style, normal); font-weight: 500; letter-spacing: 0; }
.rotate-word { display: inline-block; transition: opacity .32s ease, transform .32s ease; will-change: opacity, transform; }
.rotate-word.out { opacity: 0; transform: translateY(-0.35em); }
.rotate-word.pre { transition: none; opacity: 0; transform: translateY(0.35em); }
@media (prefers-reduced-motion: reduce) { .rotate-word { transition: none; } }

/* both headline lines are nearly the same size for a balanced lockup */
.rline { white-space: nowrap; font-size: .92em; }
.h1-line2 { display: block; font-size: 1em; letter-spacing: -.03em; margin-top: .38em; color: var(--ink); }
/* fixed-width slot: one representative ghost word defines a constant width,
   so "Track" never shifts; longer words overflow to the right harmlessly */
.rslot { display: inline-block; position: relative; }
.rghost {
  visibility: hidden; pointer-events: none;
  font-family: var(--hand); font-style: var(--hand-style, normal); font-weight: 500; letter-spacing: 0;
}
.rotate-word { position: absolute; left: 0; top: 0; white-space: nowrap; }
.hs-title .sub {
  font-size: clamp(17px, 1.7vw, 22px); color: var(--ink-soft);
  margin-top: clamp(20px, 2.5vh, 28px);
  margin-bottom: clamp(36px, 8vh, 64px);
  max-width: 44ch; line-height: 1.55;
}

/* white veil softens title/phone overlap — keep below phone to avoid scroll flicker */
.hs-veil {
  position: absolute; left: 0; right: 0; top: 0; height: 64%;
  z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, var(--paper) 0%, var(--paper) 34%, color-mix(in oklab, var(--paper) 65%, transparent) 68%, transparent 100%);
  will-change: opacity;
}
.hs-title { z-index: 5; }

.hs-hint {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint); display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 5; pointer-events: none;
}
.hs-hint svg { width: 16px; height: 16px; color: var(--accent-deep); }

/* Desktop: same stacked lockup as mobile — copy high, phone peeks from bottom */
@media (min-width: 901px) {
  .hs-title .sub {
    margin-bottom: clamp(56px, 14vh, 120px);
  }
}

/* ---- phones ---- */
.hs-phones { position: relative; z-index: 3; display: grid; place-items: center; transform: translateZ(0); }
.hs-main {
  position: relative; z-index: 3;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}
/* Hero phone: drop inset rim + soften shadow to stop white fringe flicker on scroll */
.hs-main .app-phone {
  box-shadow:
    0 0 0 1px #100d0a,
    0 28px 64px -28px rgba(16, 13, 10, 0.42);
  overflow: hidden;
}
.hs-main .app-phone .screen {
  background: #0a0a0a;
  border-radius: 33px;
}
.hs-main .app-phone .screen .shot {
  transform: scale(1.045) translateZ(0);
  transform-origin: center center;
}

.hs-side {
  position: absolute; top: 50%; left: 50%; z-index: 2;
  width: 212px; background: #100d0a; border-radius: 36px; padding: 9px;
  box-shadow: var(--shadow-lg), inset 0 0 0 2px #2c2620;
}
.hs-side .scr { background: #fbfaf6; border-radius: 28px; height: 426px; overflow: hidden; display: flex; flex-direction: column; padding: 18px 16px 16px; }
.hs-side .scr.shot-wrap { padding: 0; }
.hs-side .scr.shot-wrap .shot, .app-phone .screen .shot {
  width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.hs-side .scr .t { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.hs-side .scr .s { font-family: var(--mono); font-size: 9.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; }

/* scanner mini-screen */
.scan-frame {
  margin-top: 14px; flex: 1; border: 2px dashed color-mix(in oklab, var(--accent) 55%, transparent);
  border-radius: 14px; position: relative; display: grid; place-items: center; overflow: hidden;
  background: color-mix(in oklab, var(--accent-wash) 40%, #fff);
}
.scan-frame .slipmock {
  background: #fff; border: 1px solid var(--card-edge); border-radius: 6px;
  font-family: var(--mono); font-size: 9.5px; color: var(--ink-soft);
  padding: 10px 12px; line-height: 1.7; transform: rotate(-3deg);
  box-shadow: var(--shadow-sm);
}
.scan-frame .slipmock b { color: var(--ink); display: block; font-size: 10.5px; }
.scan-frame .beam {
  position: absolute; left: 8%; right: 8%; height: 3px; border-radius: 2px;
  background: var(--accent); opacity: .85; top: 30%;
  box-shadow: 0 0 14px 3px color-mix(in oklab, var(--accent) 45%, transparent);
}
.hs-side .scanbtn {
  margin-top: 14px; background: var(--accent); color: #fff; border-radius: 12px;
  font-family: var(--sans); font-weight: 600; font-size: 13px; text-align: center; padding: 11px;
}

/* analytics mini-screen */
.donut-wrap { margin-top: 16px; display: grid; place-items: center; }
.donut {
  width: 116px; height: 116px; border-radius: 50%;
  background: conic-gradient(var(--accent) 0 62%, var(--brick) 62% 78%, var(--paper-2) 78% 100%);
  display: grid; place-items: center;
}
.donut::after { content: "62%"; width: 78px; height: 78px; border-radius: 50%; background: #fbfaf6; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 18px; color: var(--ink); }
.mini-rows { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.mini-rows .mr { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 9.5px; color: var(--ink-soft); }
.mini-rows .mr .bar { flex: 1; height: 7px; border-radius: 4px; background: var(--paper-2); overflow: hidden; position: relative; }
.mini-rows .mr .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); }
.mini-rows .mr .bar i.neg { background: var(--brick); }
.mini-rows .mr .v { width: 38px; text-align: right; font-weight: 700; color: var(--ink); }

/* bet slip tags around the hero phone */
.hs-slip { z-index: 2; }
.hs-slip--tl { top: 5%; left: -12%; transform: rotate(-7deg); }
.hs-slip--bl { bottom: 7%; left: -16%; transform: rotate(5deg); }
.hs-slip--tr { top: 9%; right: -12%; transform: rotate(6deg); }
.hs-slip--br { bottom: 5%; right: -16%; transform: rotate(-4deg); }

@media (max-width: 1100px) {
  .hs-slip--tl { left: -6%; }
  .hs-slip--bl { left: -8%; }
  .hs-slip--tr { right: -6%; }
  .hs-slip--br { right: -8%; }
}

/* ---- phase 3: CTA ---- */
.hs-cta {
  position: absolute; bottom: clamp(14px, 2.5vh, 30px); left: 0; right: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  isolation: isolate;
  pointer-events: none;
}
.hs-cta .stores,
.hs-cta .meta { pointer-events: auto; }
.hs-cta .stores { gap: 16px; flex-wrap: wrap; justify-content: center; }
.hs-cta .stores .store-btn {
  padding: 14px 22px 14px 18px;
  border-radius: 14px;
}
.hs-cta .stores .store-btn svg { width: 26px; height: 26px; }
.hs-cta .stores .store-btn .lab small { font-size: 12px; }
.hs-cta .stores .store-btn .lab b { font-size: 19px; }
.hs-cta .meta {
  font-family: var(--sans);
  font-size: clamp(11px, 2.85vw, 20px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink-soft);
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  padding-inline: clamp(8px, 2.5vw, 16px);
}
.hs-cta .meta b { color: var(--ink-soft); font-weight: 600; }

@media (max-width: 860px) {
  .hs-side { display: none; }
}

/* Mobile: sit hero copy just below the fixed nav; scale phone + CTA */
@media (max-width: 900px) {
  .hero-scrolly { height: 250vh; }
  .hs-phones { width: 100%; max-width: 100%; }
  .hs-main .app-phone {
    --pw: clamp(196px, 56vw, 248px);
    border-radius: calc(var(--pw) * 0.138);
    padding: calc(var(--pw) * 0.035);
  }
  .hs-main .app-phone .screen {
    height: calc(var(--pw) * 2.006);
    border-radius: calc(var(--pw) * 0.107);
  }
  .hs-main .app-phone .notch {
    width: calc(var(--pw) * 0.34);
    height: calc(var(--pw) * 0.082);
    top: calc(var(--pw) * 0.028);
    border-radius: calc(var(--pw) * 0.05);
  }
  .hs-slip {
    font-size: 10px;
    padding: 8px 10px;
    line-height: 1.45;
  }
  .hs-slip--bl,
  .hs-slip--br { display: none; }
  .hs-slip--tl { top: 6%; left: 0; }
  .hs-slip--tr { top: 8%; right: 0; }
  .hs-cta {
    bottom: clamp(8px, 1.8vh, 18px);
    gap: 12px;
    padding-inline: var(--gut);
    box-sizing: border-box;
  }
  .hs-cta .stores {
    width: min(100%, 340px);
    justify-content: center;
  }
  .hs-title {
    justify-content: flex-start;
    padding-top: clamp(12px, 2.5vh, 22px);
    gap: 0;
  }
  .hs-title h1 {
    margin-top: 14px;
    font-size: clamp(30px, 8vw, 42px);
    line-height: 1.14;
  }
  .hs-title .sub {
    margin-top: 18px;
    margin-bottom: clamp(36px, 7vh, 52px);
    font-size: clamp(14px, 3.8vw, 17px);
    line-height: 1.5;
    max-width: 36ch;
  }
  .hs-title .eyebrow { font-size: 12px; }
  .h1-line2 { margin-top: .42em; }
  .rline { white-space: normal; }
  .hs-cta .stores .store-btn {
    padding: 10px 14px 10px 12px;
    border-radius: 12px;
  }
  .hs-cta .stores .store-btn svg { width: 20px; height: 20px; }
  .hs-cta .stores .store-btn .lab small { font-size: 9.5px; }
  .hs-cta .stores .store-btn .lab b { font-size: 15px; }
  .hs-cta .meta {
    font-size: clamp(10px, 2.6vw, 14px);
    line-height: 1.45;
    white-space: normal;
    max-width: 34ch;
  }
  .hs-hint { bottom: 18px; font-size: 10px; }
}

@media (max-width: 520px) {
  .hs-cta .stores.stores-inline {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .hs-cta .stores.stores-inline .store-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .hero-scrolly { height: 230vh; }
  .hs-main .app-phone { --pw: clamp(172px, 50vw, 208px); }
  .hs-title h1 { font-size: clamp(28px, 7.6vw, 34px); }
}

@media (max-width: 900px) and (max-height: 700px) {
  .hs-main .app-phone { --pw: clamp(168px, 48vw, 210px); }
}

@media (max-height: 700px) and (min-width: 901px) {
  .hs-main .app-phone { --pw: 270px; }
  .hs-main .app-phone .screen { height: 540px; }
}

/* ---- static fallback (motion off / reduced motion) ---- */
.hs-static { height: auto !important; }
.hs-static .hs-stage { position: static; height: auto; padding: clamp(40px,6vw,80px) 0 60px; display: flex; flex-direction: column; align-items: center; gap: 40px; }
.hs-static .hs-title { position: static; pointer-events: auto; opacity: 1 !important; transform: none !important; }
.hs-static .hs-veil { display: none; }
.hs-static .hs-hint { display: none; }
.hs-static .hs-phones [data-hs] { opacity: 1 !important; }
.hs-static .hs-main { transform: none !important; }
.hs-static .hs-side { position: absolute; opacity: 1 !important; }
.hs-static .hs-side.left  { transform: translate(-315px, -52%) rotate(-7deg) !important; }
.hs-static .hs-side.right { transform: translate(105px, -48%) rotate(7deg) !important; }
.hs-static .hs-cta { position: static; opacity: 1 !important; transform: none !important; }
.hs-static .hs-slip { opacity: 1 !important; }
@media (max-width: 860px) {
  .hs-static .hs-side { display: none; }
}
