/* ============================================================
   ProfVault cinematic hero — brand tokens (mirrors app tailwind)
   ============================================================ */
:root {
  --vault-950: #0a0f14;
  --vault-900: #0d1520;   /* locked brand base */
  --vault-800: #131d2e;
  --vault-700: #1a2940;
  --vault-400: #4a6580;
  --vault-300: #6b879f;
  --vault-200: #9eb4c7;
  --vault-100: #d4e0e9;

  --accent-600: #c44b3f;
  --accent-500: #e86b5d;
  --accent-400: #f08d7d;
  --accent-300: #f7b5a8;

  --cyan-500: #22d3ee;
  --cyan-400: #67e8f9;
  --lavender-500: #a78bfa;
  --success: #34d399;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --glow-coral: 0 0 30px rgba(232,107,93,.2), 0 0 60px rgba(232,107,93,.1);
}

/* Scoped to the /story page root; the app layout's global styles stay king
   elsewhere. The stylesheet itself only loads on the story view. */
.story-root, .story-root * { margin: 0; padding: 0; box-sizing: border-box; }
/* The tailwind base layer sets `html { scroll-behavior: smooth }` app-wide.
   On the story page that breaks Lenis and any per-frame programmatic
   scrolling — every JS scroll write starts a queued native animation instead
   of moving the page. JS owns all smooth scrolling here, so force it off. */
html:has(.story-root) { scroll-behavior: auto; }
/* overflow-x must be `clip`, not `hidden`: hidden turns body into a scroll
   container, so the beat-copy sticky `top: 50%` resolves against the full
   document height and the copy pins to each section's bottom instead of
   the viewport center. */
body:has(.story-root) { background: var(--vault-900); overflow-x: clip; }
.story-root {
  background: var(--vault-900);
  color: var(--vault-100);
  font-family: var(--font-body);
  font-weight: 300;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
.story-root ::selection { background: rgba(232,107,93,.35); color: #fff; }

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--vault-950);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  transition: opacity .7s var(--ease-out), visibility .7s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-mark { position: relative; width: 54px; height: 54px; }
.loader-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(232,107,93,.25); border-top-color: var(--accent-500);
  animation: spin 1s linear infinite;
}
.loader-dot {
  position: absolute; inset: 21px; border-radius: 50%;
  background: var(--accent-500); box-shadow: var(--glow-coral);
  animation: breathe 1.6s ease-in-out infinite;
}
.loader-word {
  font-family: var(--font-display); font-size: 15px; letter-spacing: .35em;
  text-transform: uppercase; color: var(--vault-300);
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%,100% { transform: scale(1); opacity:.9 } 50% { transform: scale(.82); opacity:.6 } }

/* ---------- nav ---------- */
.story-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px clamp(24px, 5vw, 72px);
  background: linear-gradient(to bottom, rgba(10,15,20,.55), transparent);
}
.nav-brand {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--font-display); font-size: 21px; color: var(--vault-100);
  text-decoration: none; letter-spacing: .01em;
}
.nav-brand-mark {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--accent-400), var(--accent-600));
  box-shadow: 0 0 12px rgba(232,107,93,.7);
}
.story-nav nav { display: flex; gap: 36px; }
.story-nav nav a {
  color: var(--vault-300); text-decoration: none; font-size: 15px; font-weight: 400;
  letter-spacing: .02em; transition: color .25s;
}
.story-nav nav a:hover, .story-nav nav a:focus-visible { color: var(--vault-100); }
.nav-actions { display: flex; gap: 14px; align-items: center; }

/* ---------- buttons ---------- */
.sbtn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 500; font-size: 15px;
  padding: 11px 22px; border-radius: 999px; text-decoration: none;
  cursor: pointer; letter-spacing: .01em;
  transition: transform .3s var(--ease-out), box-shadow .3s, background .3s, border-color .3s, color .3s;
  will-change: transform;
}
.sbtn:focus-visible { outline: 2px solid var(--cyan-400); outline-offset: 3px; }
.sbtn-lg { padding: 16px 30px; font-size: 16px; }
.sbtn-solid {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
  color: #fff; box-shadow: 0 4px 24px rgba(232,107,93,.35);
}
.sbtn-solid:hover { box-shadow: 0 6px 40px rgba(232,107,93,.55); }
.sbtn-solid svg { transition: transform .3s var(--ease-out); }
.sbtn-solid:hover svg { transform: translateX(4px); }
.sbtn-ghost { color: var(--vault-200); padding: 11px 14px; }
.sbtn-ghost:hover { color: #fff; }
.sbtn-outline {
  color: var(--vault-100); border: 1px solid var(--vault-400);
  background: rgba(19,29,46,.35); backdrop-filter: blur(8px);
}
.sbtn-outline:hover { border-color: var(--vault-200); background: rgba(26,41,64,.5); }

/* ---------- fixed stage backdrop ---------- */
#vault-canvas {
  width: 100%; height: 100%;
  display: block; opacity: 0; transition: opacity 1.4s ease .1s;
}
#vault-canvas.on { opacity: 1; }

/* Poster fallback: always painted beneath the canvas. If WebGL never starts
   (mobile / reduced-motion / failure) this IS the page backdrop. */
.hero-poster {
  background:
    radial-gradient(ellipse 42% 34% at 63% 46%, rgba(232,107,93,.16), transparent 70%),
    radial-gradient(ellipse 30% 26% at 30% 66%, rgba(34,211,238,.07), transparent 70%),
    radial-gradient(ellipse 26% 22% at 78% 72%, rgba(167,139,250,.06), transparent 70%),
    radial-gradient(ellipse 60% 55% at 50% 50%, var(--vault-800), var(--vault-900) 75%),
    var(--vault-900);
}
.hero-vignette {
  pointer-events: none;
  background: radial-gradient(ellipse 90% 85% at 50% 45%, transparent 55%, rgba(10,15,20,.75) 100%);
}
.hero-grain {
  pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  animation: grain 9s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0) } 20% { transform: translate(-6%,4%) }
  40% { transform: translate(4%,-7%) } 60% { transform: translate(-3%,-4%) } 80% { transform: translate(5%,6%) }
}

.hero-ctas { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 34px; }

/* ---------- next-section button ---------- */
.beat-next {
  /* centered via inset+margin (not transform) so the [data-reveal] y-offset
     and gsap's transform animation don't fight the centering */
  position: fixed; bottom: 30px; left: 0; right: 0;
  margin-inline: auto; width: max-content;
  z-index: 40;
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--vault-200);
  border: 1px solid rgba(74,101,128,.4); border-radius: 999px;
  padding: 12px 22px 12px 26px;
  background: rgba(13,21,32,.55); backdrop-filter: blur(8px);
  cursor: pointer;
  transition: color .25s, border-color .25s, background .25s,
              opacity .45s var(--ease-out), visibility .45s;
}
.beat-next:hover, .beat-next:focus-visible {
  color: #fff; border-color: var(--accent-400); background: rgba(26,41,64,.65);
}
.beat-next:focus-visible { outline: 2px solid var(--cyan-400); outline-offset: 3px; }
.beat-next svg { color: var(--accent-400); animation: nextNudge 2.2s var(--ease-out) infinite; }
@keyframes nextNudge { 0%,100% { transform: translateY(0) } 50% { transform: translateY(4px) } }
.beat-next.is-done { opacity: 0 !important; visibility: hidden; pointer-events: none; }

/* ---------- custom cursor (fine pointers only) ---------- */
#cursor {
  position: fixed; z-index: 90; pointer-events: none;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(232,107,93,.5);
  transform: translate(-50%,-50%);
  transition: width .25s, height .25s, border-color .25s, opacity .3s;
  opacity: 0; left: 0; top: 0;
  display: none;
}
@media (pointer: fine) { #cursor { display: block; } }
#cursor.active { width: 58px; height: 58px; border-color: rgba(103,232,249,.7); }
#cursor::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent-400);
  transform: translate(-50%,-50%);
}

/* ---------- reveal initial states (JS animates in; static if reduced motion) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); }

/* ---------- reduced motion: everything readable, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  .story-root *, .story-root *::before, .story-root *::after {
    animation: none !important; transition: none !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  #vault-canvas { display: none; }
  #cursor { display: none; }
}

@media (max-width: 720px) {
  .story-nav nav { display: none; }
  .hero-ctas .sbtn-lg { padding: 14px 24px; }
}
/* ============================================================
   sections.css — scroll beats, pricing, CTA
   The .stage (canvas) is fixed; these sections scroll over it.
   ============================================================ */

.stage { position: fixed; inset: 0; z-index: 0; }
.stage > * { position: absolute; inset: 0; }
.stage .hero-grain { inset: -50%; }

.story-root main { position: relative; z-index: 1; }

/* ---------- story beats ---------- */
.beat {
  position: relative;
  min-height: 170vh;             /* generous runway: the camera travels here */
  padding-top: 55vh;             /* keeps pre-stick copy out of the previous beat's frame */
  display: block;
}
/* first beat is now the landing view — no previous frame to clear, and the
   sticky clamp centers the copy in the viewport on load */
.story-root main > .beat:first-child { padding-top: 30vh; }
.beat-copy {
  position: sticky;
  top: 50%;
  transform: translateY(-50%);
  max-width: 480px;
  padding: 0 clamp(24px, 5vw, 72px);
}
.beat-right .beat-copy { margin-left: auto; }
.beat-left  .beat-copy { margin-right: auto; }
/* apply beat: the core orb crosses the upper-left, so this copy rides lower */
#apply .beat-copy { top: 66%; }

.beat-kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .28em;
  text-transform: uppercase; color: var(--accent-400); margin-bottom: 20px;
}
.beat-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.2rem, 4.2vw, 3.9rem);
  line-height: 1.08; letter-spacing: -0.01em;
  color: #f4f7fa; margin-bottom: 22px;
}
.beat-title em {
  font-style: italic;
  background: linear-gradient(100deg, var(--accent-400), var(--accent-500) 60%, var(--lavender-500) 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .05em;
}
.beat-body {
  font-size: clamp(1rem, 1.2vw, 1.1rem); line-height: 1.7;
  color: var(--vault-200); font-weight: 300; margin-bottom: 26px;
}

.beat-list { list-style: none; display: grid; gap: 14px; }
.beat-list li {
  display: flex; align-items: center; gap: 14px;
  font-size: 15.5px; color: var(--vault-100); font-weight: 400;
}
.beat-list svg {
  width: 20px; height: 20px; flex: none; color: var(--accent-400);
}

.beat-stat { display: flex; align-items: baseline; gap: 14px; }
.stat-num {
  font-family: var(--font-display); font-size: clamp(3rem, 5vw, 4.6rem);
  color: var(--accent-400); font-style: italic;
}
.stat-label {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--vault-300);
}

/* ---------- pricing ---------- */
.beat-pricing {
  position: relative; min-height: 140vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 18vh clamp(24px, 5vw, 72px);
  gap: 54px;
}
.pricing-head { text-align: center; }
.pricing-head .beat-kicker { margin-bottom: 14px; }

.pricing-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px; max-width: 1060px; margin: 0 auto; width: 100%;
  align-items: stretch;
}
.price-card {
  position: relative;
  background: rgba(13, 21, 32, .72);
  border: 1px solid rgba(74, 101, 128, .35);
  border-radius: 22px;
  padding: 34px 30px;
  backdrop-filter: blur(14px);
  display: flex; flex-direction: column; gap: 14px;
  transition: transform .35s var(--ease-out), border-color .35s, box-shadow .35s;
}
.price-card:hover { transform: translateY(-6px); border-color: rgba(158, 180, 199, .5); }
.price-card.featured {
  border-color: rgba(232, 107, 93, .55);
  box-shadow: 0 0 0 1px rgba(232,107,93,.25), 0 24px 70px rgba(232,107,93,.12);
  background: linear-gradient(170deg, rgba(232,107,93,.10), rgba(13,21,32,.8) 45%);
}
.price-card.featured:hover { box-shadow: 0 0 0 1px rgba(232,107,93,.4), 0 30px 80px rgba(232,107,93,.2); }
.price-flag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: #fff;
  background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
  padding: 6px 16px; border-radius: 999px; white-space: nowrap;
}
.price-card h3 {
  font-family: var(--font-display); font-size: 24px; font-weight: 500; color: #f4f7fa;
}
.price-tag { display: flex; align-items: baseline; gap: 8px; }
.price-num {
  font-family: var(--font-display); font-size: 52px; color: #fff; letter-spacing: -0.02em;
}
.price-per { font-size: 14px; color: var(--vault-300); }
.price-sub { font-size: 13.5px; color: var(--vault-300); min-height: 2.6em; }
.price-card ul { list-style: none; display: grid; gap: 11px; margin: 4px 0 18px; flex: 1; }
.price-card ul li {
  font-size: 14.5px; color: var(--vault-100); font-weight: 300;
  padding-left: 26px; position: relative;
}
.price-card ul li::before {
  content: ""; position: absolute; left: 2px; top: 5px;
  width: 12px; height: 7px;
  border-left: 2px solid var(--accent-400); border-bottom: 2px solid var(--accent-400);
  transform: rotate(-45deg);
}
.price-card .sbtn { justify-content: center; }

/* ---------- final CTA ---------- */
.beat-cta {
  position: relative; min-height: 120vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20vh clamp(24px, 5vw, 72px) 0;
}
/* scrim so the CTA copy stays readable over the flaring core */
.beat-cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 56% 46% at 50% 44%, rgba(10,15,20,.78), transparent 72%);
}
.beat-cta > * { position: relative; }
.beat-cta .beat-title { font-size: clamp(2.6rem, 5.5vw, 5.2rem); }
.beat-cta .beat-body { max-width: 34em; margin-bottom: 36px; }
.cta-center { justify-content: center; }

.site-footer {
  margin-top: auto; width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 60px 0 34px;
  font-size: 13px; color: var(--vault-400);
}
.site-footer nav { display: flex; gap: 26px; }
.site-footer a { color: var(--vault-300); text-decoration: none; transition: color .25s; }
.site-footer a:hover { color: var(--vault-100); }

/* ---------- section reveal initial state (JS-gated, reduced-motion safe) ---------- */
.js.motion [data-srev] { opacity: 0; transform: translateY(34px); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .pricing-grid { grid-template-columns: 1fr; max-width: 440px; }
  .price-card.featured { order: -1; }
}
@media (max-width: 820px) {
  .beat { min-height: auto; padding: 18vh 0; }
  .beat-copy {
    position: static; transform: none;
    margin: 0 auto !important;
    background: rgba(13,21,32,.6); border: 1px solid rgba(74,101,128,.25);
    border-radius: 20px; padding: 30px 26px; max-width: 560px;
    backdrop-filter: blur(10px);
  }
  .beat-pricing { min-height: auto; padding: 14vh 20px; }
  .beat-cta { min-height: 90vh; }
  .site-footer { flex-direction: column; gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-srev] { opacity: 1 !important; transform: none !important; }
}
