/* ============================================================
   VAULT HERO — the homepage hero scene.

   Tier 0: an inline SVG poster, always painted, never blank.
   Tier 1: CSS-3D cards driven by one rAF loop (vault-scene.js).
   The <h1> stays the LCP element — the scene sits behind it and
   is decorative (aria-hidden), so it is never LCP-eligible.

   Typography is inherited from styles.css (Inter). Nothing here
   sets a font. Colours come from the tokens below so the scene
   re-lights for dark mode without touching the scene code.
   ============================================================ */

.hero--vault,
.vault-story {
  /* light — the shipping default */
  --v-card-bg: linear-gradient(148deg, rgba(255,255,255,.96) 0%, rgba(240,226,252,.92) 46%, rgba(250,244,255,.86) 100%);
  --v-card-border: rgba(123,52,184,.42);
  --v-card-shadow: 0 1px 0 rgba(255,255,255,.95) inset, 0 14px 30px -14px rgba(61,24,88,.45), 0 2px 6px -2px rgba(61,24,88,.20);
  --v-card-sheen: linear-gradient(160deg, rgba(255,255,255,.75), transparent 46%);
  --v-card-warm-bg: linear-gradient(148deg, rgba(255,250,246,.96), rgba(253,226,209,.92) 46%, rgba(255,246,240,.86));
  --v-card-warm-border: rgba(184,78,27,.46);
  --v-bar: rgba(61,24,88,.46);
  --v-bar-2: rgba(61,24,88,.24);
  --v-glyph: rgba(157,78,221,.85);
  --v-glyph-warm: rgba(232,116,59,.92);

  --v-shell-border: rgba(123,52,184,.44);
  --v-shell-bg: linear-gradient(155deg, rgba(255,255,255,.34), rgba(240,230,250,.22) 55%, rgba(255,240,232,.24));
  /* tinted, not white — a white frost over a near-white page is invisible */
  --v-shell-frost: linear-gradient(155deg, rgba(240,228,253,.90), rgba(226,209,246,.94) 55%, rgba(253,233,222,.88));
  --v-shell-glow: 0 0 50px -20px rgba(157,78,221,.50) inset, 0 30px 70px -32px rgba(61,24,88,.50);
  --v-ring: #6B2AA6;
  --v-link: 123,52,184;
  --v-heir: 200,84,30;

  /* the hero paints its own ground so the scene is self-sufficient in either theme */
  --v-hero-bg: radial-gradient(60% 70% at 50% 0%, rgba(199,125,255,.16) 0%, transparent 70%);

  /* Only as much veil as the text actually needs — the h1 is near-black on a light
     ground, so it stays legible while the cards keep their presence. */
  --v-scrim: radial-gradient(52% 42% at 50% 46%, rgba(252,250,254,.80) 0%, rgba(252,250,254,.42) 55%, rgba(252,250,254,0) 80%);

  --v-cw: 132px;
  --v-ch: 84px;

}

.hero--vault {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--v-hero-bg);
}

/* Dark palette. Deliberately gated on an explicit [data-theme="dark"] and NOT on
   prefers-color-scheme: the rest of the marketing site is light-only today, so a
   dark hero above a light page would read as broken. The day site-wide dark mode
   lands, this switches on with no change here. */
:root[data-theme="dark"] .hero--vault,
:root[data-theme="dark"] .vault-story {
  --v-card-bg: linear-gradient(148deg, rgba(199,125,255,.24) 0%, rgba(157,78,221,.08) 42%, rgba(255,255,255,.035) 100%);
  --v-card-border: rgba(199,125,255,.32);
  --v-card-shadow: 0 0 0 1px rgba(255,255,255,.05) inset, 0 18px 40px -22px rgba(0,0,0,.9);
  --v-card-sheen: linear-gradient(160deg, rgba(255,255,255,.18), transparent 40%);
  --v-card-warm-bg: linear-gradient(148deg, rgba(232,116,59,.24), rgba(232,116,59,.06) 45%, rgba(255,255,255,.03));
  --v-card-warm-border: rgba(232,116,59,.44);
  --v-bar: rgba(255,255,255,.28);
  --v-bar-2: rgba(255,255,255,.14);
  --v-glyph: rgba(199,125,255,.58);
  --v-glyph-warm: rgba(232,116,59,.66);

  --v-shell-border: rgba(199,125,255,.34);
  --v-shell-bg: linear-gradient(155deg, rgba(199,125,255,.10), rgba(18,10,28,.20) 55%, rgba(232,116,59,.07));
  --v-shell-frost: linear-gradient(155deg, rgba(199,125,255,.22), rgba(14,8,22,.72) 55%, rgba(232,116,59,.16));
  --v-shell-glow: 0 0 60px -18px rgba(157,78,221,.55) inset, 0 40px 90px -50px #000;
  --v-ring: #C77DFF;
  --v-link: 199,125,255;
  --v-heir: 232,116,59;

  --v-scrim: radial-gradient(58% 46% at 50% 48%, rgba(11,7,16,.86) 0%, rgba(11,7,16,.52) 52%, rgba(11,7,16,0) 80%);

  --v-hero-bg:
    radial-gradient(70% 55% at 50% 6%, rgba(157,78,221,.26), transparent 68%),
    radial-gradient(48% 40% at 84% 78%, rgba(232,116,59,.15), transparent 70%),
    linear-gradient(180deg, #0B0710 0%, #150C21 46%, #0B0710 100%);
}

/* In dark the hero also owns its text colours — the rest of the site is still light,
   so the section cannot inherit them from a page-level theme that does not exist yet. */
:root[data-theme="dark"] .vault-story {
  background:
    radial-gradient(60% 60% at 50% 30%, rgba(157,78,221,.16), transparent 70%),
    linear-gradient(180deg, #0B0710 0%, #120A1B 50%, #0B0710 100%);
}
:root[data-theme="dark"] .vault-story .section-title,
:root[data-theme="dark"] .vault-story__cap h3 { color: #F3EEF8; }
:root[data-theme="dark"] .vault-story__cap p,
:root[data-theme="dark"] .vault-story__legend { color: #A08FB4; }
:root[data-theme="dark"] .vault-story .section-label,
:root[data-theme="dark"] .vault-story__cap h3 span,
:root[data-theme="dark"] .vault-story__steps button[aria-current="true"] { color: #C77DFF; }
:root[data-theme="dark"] .vault-story__steps button { color: #7C6B90; }
:root[data-theme="dark"] .vault-story__rail { background: rgba(199,125,255,.20); }

:root[data-theme="dark"] .hero--vault h1 { color: #F3EEF8; }
:root[data-theme="dark"] .hero--vault .hero__subtitle,
:root[data-theme="dark"] .hero--vault .hero__reassure { color: #A08FB4; }
:root[data-theme="dark"] .hero--vault .hero__more a,
:root[data-theme="dark"] .hero--vault .trust-badge { color: #C77DFF; }
:root[data-theme="dark"] .hero--vault .trust-badge,
:root[data-theme="dark"] .hero--vault .hero__badge {
  background: rgba(199,125,255,.10);
  border-color: rgba(199,125,255,.28);
  color: #C77DFF;
}

/* ── the scene layer ─────────────────────────────────── */

.vault {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  contain: layout paint;
}

.vault__poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity .8s ease;
}
.vault__poster svg {
  width: min(560px, 78vw);
  height: auto;
}
.vault.is-live .vault__poster { opacity: 0; }

.vault__wrap {
  position: absolute;
  inset: 0;
  perspective: 1150px;
  perspective-origin: 50% 46%;
  opacity: 0;
  transition: opacity .9s ease;
}
.vault.is-live .vault__wrap { opacity: 1; }

/* graph edges, drawn behind the cards.
   width/height are required: canvas is a replaced element, so an absolutely
   positioned one keeps its intrinsic (attribute) size and inset:0 will NOT
   stretch it — it would render at buffer size and get clipped. */
.vault__links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
  transition: opacity .9s ease;
}
.vault.is-live .vault__links { opacity: 1; }
.vault__wrap { z-index: 1; }
.vault__links--front { z-index: 2; }

.vault__stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 900px;
  height: 520px;
  margin: -260px 0 0 -450px;
  transform-style: preserve-3d;
  will-change: transform;
}

.vault__card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--v-cw);
  height: var(--v-ch);
  margin-left: calc(var(--v-cw) / -2);
  margin-top: calc(var(--v-ch) / -2);
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--v-card-border);
  background: var(--v-card-bg);
  box-shadow: var(--v-card-shadow);
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
}
.vault__card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--v-card-sheen);
  opacity: .6;
}
.vault__card--warm {
  border-color: var(--v-card-warm-border);
  background: var(--v-card-warm-bg);
}

/* card contents are redacted bars, never text — language-neutral across all
   locales, and a redacted bar is what encrypted data actually looks like */
.vault__inner {
  display: flex;
  flex-direction: column;
  gap: 7px;
  filter: blur(calc(var(--frost, 0) * 4.4px));
}
.vault__row { display: flex; align-items: center; gap: 8px; }
.vault__glyph {
  width: 15px;
  height: 15px;
  flex: none;
  border-radius: 4px;
  background: var(--v-glyph);
}
.vault__card--warm .vault__glyph { background: var(--v-glyph-warm); }
.vault__bars { display: flex; flex-direction: column; gap: 5px; }
.vault__bar { height: 5px; border-radius: 3px; background: var(--v-bar); }
.vault__bar--s { background: var(--v-bar-2); }

.vault__shell {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 640px;
  height: 430px;
  margin: -215px 0 0 -320px;
  border-radius: 28px;
  border: 1px solid var(--v-shell-border);
  background: var(--v-shell-bg);
  box-shadow: var(--v-shell-glow);
  opacity: 0;
  transform: translateZ(60px);
  will-change: opacity;
}
.vault__shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--v-shell-frost);
  opacity: var(--frost, 0);
}
.vault__shell.is-frosting::before {
  -webkit-backdrop-filter: blur(calc(var(--frost, 0) * 8px));
  backdrop-filter: blur(calc(var(--frost, 0) * 8px));
}
.vault__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 118px;
  height: 118px;
  margin: -59px 0 0 -59px;
  opacity: 0;
}
.vault__ring circle,
.vault__ring line { stroke: var(--v-ring); fill: none; }

/* ── hero content sits above the scene ───────────────── */

.hero--vault .container { position: relative; z-index: 2; }
.hero--vault .container::before {
  content: "";
  position: absolute;
  inset: -6% -14%;
  z-index: -1;
  background: var(--v-scrim);
  pointer-events: none;
}

/* one primary action, stores second, everything else demoted to text */
.hero__primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
}
.hero__primary .btn--primary {
  font-size: 1.02rem;
  padding: 1rem 2.1rem;
}
.hero__reassure {
  font-size: .82rem;
  font-weight: 500;
  color: var(--gray-500);
}
.hero__stores {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
  align-items: center;
  margin-top: 1.4rem;
}
.hero__more {
  margin-top: 1.15rem;
  font-size: .9rem;
  color: var(--gray-600);
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
  justify-content: center;
}
.hero__more a { color: var(--purple-700); font-weight: 600; }

a.trust-badge {
  text-decoration: none;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
a.trust-badge:hover {
  border-color: var(--purple-400);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -12px rgba(94,42,133,.5);
}

/* ── explore band: the homepage's internal-linking hub ── */

.explore { padding: 4rem 0; }
.explore__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.explore__card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-xl);
  text-decoration: none;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, border-color .3s;
}
.explore__card:hover {
  transform: translateY(-4px);
  border-color: rgba(217,105,43,.35);
  box-shadow: 0 24px 50px -18px rgba(94,42,133,.45);
}
.explore__card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: .45rem;
}
.explore__card h3::after {
  content: "→";
  color: var(--purple-600);
  transition: transform .3s;
}
.explore__card:hover h3::after { transform: translateX(3px); }
.explore__card p { font-size: .88rem; color: var(--gray-600); line-height: 1.55; margin: 0; }

/* ── responsive ──────────────────────────────────────── */

/* iPad landscape and small laptops */
@media (max-width: 1194px) {
  .hero--vault, .vault-story { --v-cw: 118px; --v-ch: 76px; }
}

/* iPad portrait */
@media (max-width: 900px) {
  .hero--vault, .vault-story { --v-cw: 108px; --v-ch: 70px; }
  .vault__wrap { opacity: 0; }
  .hero--vault .vault.is-live .vault__wrap { opacity: .92; }
}

/* phones */
@media (max-width: 640px) {
  .hero--vault, .vault-story { --v-cw: 96px; --v-ch: 62px; }
  .hero--vault .container::before { inset: -4% -20%; }
  .hero--vault .vault.is-live .vault__wrap { opacity: .9; }
  .vault__card { padding: 8px 9px; border-radius: 9px; }
  .vault__inner { gap: 5px; }
  .vault__glyph { width: 12px; height: 12px; }
  .vault__bar { height: 4px; }
  .vault__shell { width: 92vw; margin-left: -46vw; }
  .hero__more { font-size: .85rem; }
}

@media (max-width: 480px) {
  .hero--vault, .vault-story { --v-cw: 86px; --v-ch: 56px; }
  .hero__primary { width: 100%; }
  .hero__primary .btn--primary { width: 100%; justify-content: center; text-align: center; }
  /* styles.css stacks .hero__actions on 480 — keep the stores row horizontal */
  .hero__stores { flex-direction: row; }
}

/* short landscape phones: don't let a 100svh hero swallow the fold */
@media (max-height: 520px) and (orientation: landscape) {
  .hero--vault .vault.is-live .vault__wrap { opacity: .55; }
}

@media (prefers-reduced-motion: reduce) {
  .vault__wrap { display: none; }
  .vault.is-live .vault__poster { opacity: 1; }
  .explore__card, .explore__card h3::after, a.trust-badge { transition: none; }
  .explore__card:hover { transform: none; }
}


/* ============================================================
   THE THREE ACTS — its own section, scrubbed by scroll.

   Without JS (or under reduced motion) this is a plain section:
   the poster plus all three captions, stacked and readable. The
   .is-live class — added by vault-scene.js only when the scene
   actually runs — is what turns on the tall scroller and sticky.
   ============================================================ */

.vault-story {
  position: relative;
  background:
    radial-gradient(60% 60% at 50% 30%, rgba(199,125,255,.10), transparent 70%);
}
.vault-story__scroller { position: relative; }
.vault-story__sticky { padding: 4rem 0; }

.vault-story.is-live .vault-story__scroller { height: 300vh; }
.vault-story.is-live .vault-story__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 540px;
  padding: 0;
  display: flex;
  align-items: center;
}
.vault-story.is-live .vault-story__sticky > .container {
  display: flex;
  flex-direction: column;
  gap: clamp(.6rem, 1.6vh, 1.25rem);
  height: 100%;
  padding-top: 5.5rem;
  padding-bottom: 1.5rem;
}

.vault-story__head { text-align: center; }
.vault-story__head .section-title { margin-bottom: 0; font-size: clamp(1.5rem, 3.2vw, 2.25rem); }

.vault-story__frame {
  position: relative;
  min-height: 220px;
  border-radius: var(--radius-2xl);
}
.vault-story.is-live .vault-story__frame { flex: 1 1 auto; min-height: 0; }
.vault-story__frame .vault { position: absolute; inset: 0; }
.vault-story:not(.is-live) .vault-story__frame { height: 340px; }

.vault-story__legend {
  position: absolute;
  left: 50%;
  bottom: .25rem;
  transform: translateX(-50%);
  z-index: 3;
  margin: 0;
  font-size: .78rem;
  font-weight: 500;
  color: var(--gray-500);
  text-align: center;
  white-space: nowrap;
  transition: opacity .4s ease;
}
/* the legend explains cards and lines — both are behind the frost by act 3 */
.vault-story.is-act3 .vault-story__legend { opacity: 0; }

/* captions: all three in the DOM always; only one shown once live */
.vault-story__caps { display: grid; gap: 1rem; }
.vault-story.is-live .vault-story__caps {
  position: relative;
  display: block;
  min-height: 9.5rem;
}
.vault-story__cap { text-align: center; max-width: 62ch; margin-inline: auto; }
.vault-story.is-live .vault-story__cap {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s ease, transform .45s ease;
  pointer-events: none;
}
.vault-story.is-live .vault-story__cap.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.vault-story__cap h3 {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: .35rem;
}
.vault-story__cap h3 span {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--purple-600);
  margin-bottom: .3rem;
}
.vault-story__cap p { color: var(--gray-600); font-size: .98rem; line-height: 1.6; margin: 0; }

.vault-story__track { max-width: 620px; margin: 0 auto; width: 100%; }
.vault-story:not(.is-live) .vault-story__track { display: none; }
.vault-story__rail {
  height: 3px;
  border-radius: 999px;
  background: var(--purple-200);
  overflow: hidden;
}
.vault-story__rail i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand-warm, linear-gradient(90deg, var(--purple-600), var(--warm)));
}
.vault-story__steps { display: flex; }
.vault-story__steps button {
  flex: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: .7rem .4rem;
  font: 600 .82rem/1.3 inherit;
  color: var(--gray-500);
  transition: color .3s;
}
.vault-story__steps button[aria-current="true"] { color: var(--purple-700); }

@media (max-width: 900px) {
  .vault-story.is-live .vault-story__scroller { height: 260vh; }
  .vault-story__cap p { font-size: .92rem; }
}
@media (max-width: 640px) {
  .vault-story.is-live .vault-story__scroller { height: 240vh; }
  .vault-story.is-live .vault-story__sticky > .container { padding-top: 4.5rem; }
  .vault-story.is-live .vault-story__caps { min-height: 12rem; }
  .vault-story__legend { font-size: .72rem; white-space: normal; width: 90%; }
}

@media (prefers-reduced-motion: reduce) {
  .vault-story.is-live .vault-story__scroller { height: auto; }
  .vault-story.is-live .vault-story__sticky { position: static; height: auto; padding: 4rem 0; }
  .vault-story.is-live .vault-story__caps { display: grid; }
  .vault-story.is-live .vault-story__cap { position: static; opacity: 1; transform: none; }
}


/* Short viewports (landscape phones, iPad landscape): compact the furniture so the
   scene itself keeps a usable share of the sticky frame. */
@media (max-height: 800px) {
  .vault-story.is-live .vault-story__sticky > .container { padding-top: 4.25rem; gap: .5rem; }
  .vault-story__head .section-label { margin-bottom: .2rem; }
  .vault-story__head .section-title { font-size: clamp(1.25rem, 2.6vw, 1.75rem); }
  .vault-story.is-live .vault-story__caps { min-height: 8rem; }
  .vault-story__cap h3 { font-size: 1.1rem; margin-bottom: .2rem; }
  .vault-story__cap p { font-size: .88rem; line-height: 1.5; }
  .vault-story__steps button { padding: .5rem .4rem; font-size: .78rem; }
}
@media (max-width: 640px) and (max-height: 800px) {
  .vault-story__head .section-label { display: none; }
  .vault-story__head .section-title { font-size: 1.2rem; }
  .vault-story.is-live .vault-story__caps { min-height: 10.5rem; }
  .vault-story__cap p { font-size: .85rem; }
}
@media (max-height: 620px) {
  .vault-story.is-live .vault-story__caps { min-height: 7rem; }
  .vault-story__head .section-title { font-size: 1.15rem; }
  .vault-story__cap p { font-size: .82rem; }
}
