/* GripMargin v2 — story layout. Loaded after styles.css. */

.prerelease-tag {
  margin-left: 10px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--emerald-bright);
  border: 1px solid rgba(49, 184, 132, 0.35);
  border-radius: var(--radius-full);
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sand-warm);
  margin-bottom: 18px;
}

/* ---------- Hero ---------- */
.v2-hero {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  text-align: center;
  padding: 80px 0 60px;
  position: relative;
}
.v2-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 6.2rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: var(--bone-bright);
  margin: 0 auto;
}
.v2-lede {
  max-width: 640px;
  margin: 28px auto 0;
  font-size: 1.2rem;
  color: var(--muted);
}
.v2-hero .hero-form-wrap { margin-top: 40px; }

.form-consent {
  margin: 10px auto 0;
  max-width: 480px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--quiet);
}
.form-consent a { color: var(--bone-dim); text-decoration: underline; text-underline-offset: 2px; }

.scroll-cue {
  display: block;
  width: 26px; height: 42px;
  margin: 56px auto 0;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  position: relative;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px;
  width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%;
  background: var(--sand-warm);
  animation: grain-drop 1.8s ease-in infinite;
}
@keyframes grain-drop {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(20px); opacity: 0; }
}

/* ---------- Scroll story ---------- */
.story { height: 340vh; position: relative; }
.story-sticky {
  position: sticky; top: 0;
  height: 100vh;
  overflow: hidden;
}
#story-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.story-captions {
  position: absolute;
  left: max(24px, calc((100vw - 1180px) / 2 + 24px));
  top: 50%;
  transform: translateY(-50%);
  width: min(460px, 42vw);
  height: 320px;
}
.story-caption {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  opacity: 0;
  will-change: opacity, transform;
}
.story-caption h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--bone-bright);
  margin-bottom: 16px;
}
.story-caption p { font-size: 1.15rem; color: var(--muted); max-width: 420px; }
.story-caption .btn { align-self: flex-start; margin-top: 24px; }

.story-counter {
  position: absolute;
  right: max(24px, calc((100vw - 1180px) / 2 + 24px));
  top: 100px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(27,28,30,.7); border: 1px solid var(--line-subtle);
  transition: color .4s ease;
}
.story-counter-label { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--red-loss); transition: color .4s; }
.story-counter-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--bone); font-variant-numeric: tabular-nums; }
.story-counter-note { font-size: .7rem; color: var(--quiet); }
.story-counter-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red-loss); box-shadow: 0 0 10px var(--red-loss); transition: background .4s, box-shadow .4s; }
.story-counter.is-caught .story-counter-dot { background: var(--emerald-bright); box-shadow: 0 0 10px var(--emerald-bright); }
.story-counter.is-caught .story-counter-label { color: var(--emerald-bright); }
.story-counter.is-caught .story-counter-value { color: var(--emerald-bright); }

.story-progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--line-subtle);
}
.story-progress span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--sand-warm), var(--emerald));
  transform-origin: left; transform: scaleX(0);
}

/* ---------- Sections ---------- */
.v2-section { padding: 128px 0; }
.v2-alt { background: rgba(18, 19, 21, 0.5); border-block: 1px solid var(--line-subtle); }
.v2-h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--bone-bright);
  max-width: 820px;
}
.v2-sub { margin-top: 16px; color: var(--muted); max-width: 620px; font-size: 1.1rem; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
}
.step {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-lg);
  transition: transform .4s ease, border-color .4s ease;
}
.step:hover { transform: translateY(-4px); border-color: rgba(49,184,132,.35); }
.step-num {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; margin-bottom: 20px;
  border-radius: 50%;
  background: var(--emerald-subtle); color: var(--emerald-bright);
  font-weight: 700;
}
.step h3 { font-size: 1.25rem; color: var(--bone-bright); margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 1rem; }

.v2 .scanner-box, .v2 .calc-wrap { margin-top: 48px; }
.scanner-label { font-size: .875rem; font-weight: 600; color: var(--bone-dim); }

/* ---------- Final CTA ---------- */
.final-card {
  max-width: 680px; margin: 0 auto;
  padding: 72px 32px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(49,184,132,.12), transparent 60%), var(--bg-card);
  border: 1px solid var(--line-subtle);
  border-radius: 28px;
  box-shadow: var(--shadow-card);
}
.final-mark { width: 72px; height: 72px; border-radius: 16px; margin-bottom: 28px; box-shadow: 0 0 32px var(--emerald-glow); }
.final-card h2 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.03em; color: var(--bone-bright); }
.final-card > p { margin: 14px auto 32px; color: var(--muted); max-width: 480px; }
.final-form { width: min(480px, 100%); margin: 0 auto; }

/* ---------- Sticky CTA ---------- */
.sticky-cta {
  position: fixed; bottom: 24px; left: 50%;
  transform: translate(-50%, 140%);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: var(--emerald); color: #0E1512;
  font-weight: 700; text-decoration: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 24px var(--emerald-glow);
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
  z-index: 60;
}
.sticky-cta.show { transform: translate(-50%, 0); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue span { animation: none; }
  .story { height: auto; }
  .story-sticky { position: relative; height: 100vh; }
}

@media (max-width: 760px) {
  .prerelease-tag { display: none; }
  .steps { grid-template-columns: 1fr; }
  .story-captions {
    left: 20px; right: 20px; width: auto;
    top: 84px; transform: none; height: 200px;
  }
  .story-caption { justify-content: flex-start; }
  .story-caption p { font-size: 1rem; }
  .v2 .nav { display: none; }
  .story-counter { display: none; }
  .story-caption h2 { font-size: 1.7rem; }
  .story-counter-value { font-size: 1.4rem; }
  .v2-section { padding: 88px 0; }
}

/* A persistent chapter rail makes the pinned scene's scroll interaction explicit. */
.story-depth {
  position: absolute; inset: -220px 0; pointer-events: none;
  background-image: repeating-linear-gradient(0deg, transparent 0 118px, rgba(236,232,208,.045) 119px 120px);
  mask-image: linear-gradient(90deg, transparent 42%, #000 90%);
  transform: translateY(var(--story-travel, 0px));
}
.story-chapters {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 18px;
}
.story-chapters button {
  display: flex; align-items: center; gap: 9px; padding: 4px 0;
  border: 0; background: none; font: inherit; font-size: .72rem;
  color: var(--muted); cursor: pointer; text-align: left;
}
.story-chapters button span:first-child {
  display: grid; place-items: center; width: 28px; height: 28px;
  border: 1px solid var(--line-strong); border-radius: 50%; transition: .3s;
}
.story-chapters .is-current { color: var(--bone-bright); }
.story-chapters .is-current span:first-child { background: var(--emerald); color: #111; border-color: var(--emerald); }
.story-chapters .is-complete span:first-child { border-color: var(--emerald); color: var(--emerald); }
.story-scroll-guide {
  position: absolute; bottom: 92px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; color: var(--bone-dim); font-size: .8rem;
  letter-spacing: .04em; padding: 8px 14px;
  border: 1px solid var(--line-subtle); border-radius: 999px;
  background: rgba(18,19,21,.8); animation: scroll-nudge 2.3s ease-in-out infinite;
}
@keyframes scroll-nudge { 50% { translate: 0 5px; } }
@media (max-width: 1100px) {
  .story-chapters button span:last-child { display: none; }
  .story-chapters { right: 12px; }
}
@media (max-width: 760px) {
  .story-chapters { top: auto; bottom: 150px; right: 12px; transform: none; gap: 10px; }
  .story-scroll-guide { bottom: 88px; font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .story-scroll-guide, .story-chapters, .story-depth { display: none; }
}

/* Keep the supplied dashboard entirely isolated from the marketing page. */
.dashboard-preview {
  margin-top: 40px; overflow: hidden; border: 1px solid var(--line-strong);
  border-radius: 18px; background: #f8faf7; box-shadow: var(--shadow-card);
}
.dashboard-preview-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 20px; background: #202325;
  color: var(--bone-dim); font-size: .8rem;
}
.dashboard-preview-bar > span { display: flex; align-items: center; gap: 8px; }
.preview-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); }
.dashboard-preview-bar a { color: var(--bone); white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.dashboard-preview iframe { display: block; width: 100%; height: 820px; border: 0; }
@media (max-width: 760px) {
  .dashboard-preview-bar { align-items: flex-start; flex-direction: column; gap: 8px; padding: 14px; }
  .dashboard-preview iframe { height: 700px; }
}

/* Mobile story: reserve a real footer for controls, not an overlay on the catcher. */
.sticky-cta { white-space: nowrap; width: max-content; max-width: calc(100vw - 32px); text-align: center; }
@media (max-width: 760px) {
  .story-sticky { height: 100svh; }
  .sticky-cta {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 11px 22px; font-size: .875rem; line-height: 1.4;
    box-shadow: 0 5px 18px rgba(0,0,0,.3);
  }
  .story-scroll-guide {
    bottom: calc(66px + env(safe-area-inset-bottom, 0px));
    padding: 3px 8px; font-size: .68rem; line-height: 1.5;
    border: 0; background: none; animation: none;
  }
  .story-chapters { bottom: 140px; }
  .story-captions { top: 84px; }
  .story-caption .eyebrow { margin-bottom: 12px; }
  .story-caption h2 { margin-bottom: 12px; }
  .story-caption p { line-height: 1.55; }
  .story-caption .btn { display: none; }
  .v2-hero .signup-row, .final-form .signup-row { flex-direction: column; }
  .v2-hero .signup-row button, .final-form .signup-row button { width: 100%; }
}
@media (max-width: 760px) and (max-height: 650px) {
  .story-captions { top: 76px; }
  .story-caption h2 { font-size: 1.4rem; }
  .story-caption p { font-size: .875rem; }
  .story-caption .eyebrow { font-size: .65rem; margin-bottom: 8px; }
}

/* Android WebView/Via compatibility: do not rely on svh, max-content or env(). */
html, body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.sticky-cta { box-sizing: border-box; width: 192px; white-space: nowrap; }
@media (max-width: 760px) {
  .story-sticky { height: var(--story-viewport-height, 100vh); }
  .sticky-cta {
    width: 176px; min-width: 176px; max-width: calc(100% - 32px);
    bottom: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    font-size: 14px; line-height: 20px; padding: 11px 16px;
  }
  .story-scroll-guide {
    bottom: 66px;
    bottom: calc(66px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 24px); text-align: center;
    font-size: 11px; line-height: 17px;
  }
}
