/* VaultHQ public-site motion. Everything here is progressive: content is fully visible without
   JavaScript, and nothing moves when the visitor has asked for reduced motion. The approved
   header is never animated or restyled; it is only pinned during page transitions. */

/* ---------- Page-to-page transitions (same-origin navigations in supporting browsers) ---------- */
@view-transition { navigation: auto; }
nav { view-transition-name: site-header; }
.mobile-menu { view-transition-name: site-menu; }
::view-transition-old(root) { animation: vt-out .2s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in .42s cubic-bezier(.2, .8, .2, 1) both; }
::view-transition-group(site-header), ::view-transition-group(site-menu) { animation: none; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }

/* ---------- Reading progress ---------- */
.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: var(--cobalt); }

/* ---------- Scroll reveals ---------- */
.motion [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2, .8, .2, 1), transform .8s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0ms); }
.motion [data-reveal="left"] { transform: translateX(-34px); }
.motion [data-reveal="right"] { transform: translateX(34px); }
.motion [data-reveal="scale"] { transform: scale(.94); }
.motion [data-reveal].is-in { opacity: 1; transform: none; }
.motion [data-stagger] > * { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.2, .8, .2, 1), transform .6s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 90ms); }
.motion [data-stagger].is-in > * { opacity: 1; transform: none; }

/* ---------- Hero entrance (runs once on load) ---------- */
.motion .hero .intro > * { animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; }
.motion .hero .intro > *:nth-child(2) { animation-delay: .12s; }
.motion .hero .intro > *:nth-child(3) { animation-delay: .24s; }
.motion .hero .intro > *:nth-child(4) { animation-delay: .34s; }
.motion .hero .board { animation: board-in 1.1s .2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } }
@keyframes board-in { from { opacity: 0; transform: translateY(40px) rotate(4deg); } }

/* ---------- Pause control for anything that moves on its own ---------- */
.motion-pause { position: absolute; z-index: 4; display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid var(--ink); border-radius: 50%; background: #fff; color: var(--ink); font: 700 12px "DM Sans", sans-serif; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.motion-pause:hover { background: var(--lemon); }
.motion-pause:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }
.motion-pause .icon-play { display: none; }
.is-paused .motion-pause .icon-play { display: inline; }
.is-paused .motion-pause .icon-pause { display: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Infinite feature ticker ---------- */
.ticker { position: relative; }
.ticker .ticker-track { display: flex; width: max-content; }
.motion .ticker .ticker-track { animation: marquee 32s linear infinite; }
.ticker.is-paused .ticker-track, .ticker:hover .ticker-track { animation-play-state: paused; }
.ticker .ticker-track > div { padding-right: 27px; }
.ticker .motion-pause { right: 3vw; top: 50%; transform: translateY(-50%) rotate(1deg); width: 30px; height: 30px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Gentle lift on interactive cards ---------- */
.lift { transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s; }
.lift:hover { transform: translate(-2px, -3px); }

/* ---------- Shared small pieces used in diagrams ---------- */
.b { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-style: normal; font-size: 10px; font-weight: 700; background: #eef2ff; color: #2749ba; white-space: nowrap; }
.b.green { background: #e3f6ec; color: #087f5b; }
.b.amber { background: #fff1d6; color: #8a4f00; }
.b.red { background: #ffe8e4; color: #b42318; }
.av { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border: 1.5px solid var(--ink); border-radius: 50%; font-size: 9px; font-weight: 800; background: #fff; }
.av.lilac { background: var(--lilac); } .av.coral { background: var(--coral); } .av.lemon { background: var(--lemon); } .av.blue { background: var(--cobalt); color: #fff; }

/* ---------- Product page ---------- */
/* 'clip' keeps the no-sideways-scroll guard without breaking position: sticky. */
@supports (overflow: clip) { body { overflow-x: clip; } main { overflow: clip; } }
.feature-section { scroll-margin-top: 90px; }
.feature-jumps { position: sticky; top: 12px; z-index: 20; transition: box-shadow .3s, border-color .3s; }
.feature-jumps.is-stuck { border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.feature-jumps a { transition: background .25s, color .25s; }
.feature-jumps a.is-active { background: var(--ink); color: #fff; }
.motion .hero-dashboard .mini-chart span { animation: bar-up 1s cubic-bezier(.2, .8, .2, 1) both; transform-origin: 50% 100%; }
.motion .hero-dashboard .mini-chart span:nth-child(2) { animation-delay: .08s; } .motion .hero-dashboard .mini-chart span:nth-child(3) { animation-delay: .16s; }
.motion .hero-dashboard .mini-chart span:nth-child(4) { animation-delay: .24s; } .motion .hero-dashboard .mini-chart span:nth-child(5) { animation-delay: .32s; }
.motion .hero-dashboard .mini-chart span:nth-child(6) { animation-delay: .4s; } .motion .hero-dashboard .mini-chart span:nth-child(7) { animation-delay: .48s; }
.motion .hero-dashboard { animation: board-in 1.1s .15s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes bar-up { from { transform: scaleY(0); } }
.motion .feature-graphic[data-animate] > * { opacity: 0; transform: translateY(14px); transition: opacity .55s cubic-bezier(.2, .8, .2, 1), transform .55s cubic-bezier(.2, .8, .2, 1); }
.motion .feature-graphic.is-in > * { opacity: 1; transform: none; }
.motion .feature-graphic.is-in > :nth-child(2) { transition-delay: .25s; }
.motion .feature-graphic.is-in > :nth-child(3) { transition-delay: .5s; }
.motion .feature-graphic.is-in > :nth-child(4) { transition-delay: .75s; }
.motion .feature-graphic.is-in > :nth-child(5) { transition-delay: 1s; }
.motion .feature-graphic.is-in .rota-grid i { animation: drop-in .5s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: calc(.5s + var(--col) * .12s); }
.motion .feature-graphic.is-in .rota-grid .shift-open { animation: drop-in .5s 1.2s both, open-pulse 1.2s 1.8s ease-in-out 3; }
.motion .feature-graphic.is-in .match-row > div { animation: slide-x .5s cubic-bezier(.2, .8, .2, 1) both; }
.motion .feature-graphic.is-in .match-row > div:nth-child(1) { animation-delay: .9s; } .motion .feature-graphic.is-in .match-row > div:nth-child(2) { animation-delay: 1.1s; }
.motion .feature-graphic.is-in .flow-line i { animation: line-grow .8s .5s cubic-bezier(.2, .8, .2, 1) both; transform-origin: 0 50%; }
.motion .feature-graphic.is-in .flow-line i:last-child { transform-origin: 100% 50%; }
.motion .feature-graphic.is-in .attention-list > div { animation: slide-x .45s both; }
.motion .feature-graphic.is-in .attention-list > div:nth-of-type(1) { animation-delay: .8s; } .motion .feature-graphic.is-in .attention-list > div:nth-of-type(2) { animation-delay: 1s; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-18px) rotate(-3deg); } }
@keyframes open-pulse { 50% { background: rgba(255, 107, 87, .2); } }
@keyframes slide-x { from { opacity: 0; transform: translateX(22px); } }
@keyframes line-grow { from { transform: scaleX(0); } }

/* ---------- Pricing: who counts ---------- */
.who-counts { padding: 90px 7vw 30px; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 50px; align-items: center; }
.wc-intro h2 { margin: 16px 0 0; font-size: clamp(34px, 3.6vw, 56px); line-height: 1; letter-spacing: -.05em; }
.wc-intro h2 em { font-family: "DM Serif Display", serif; font-weight: 400; color: var(--cobalt); letter-spacing: -.03em; }
.wc-intro > p:last-child { margin: 20px 0 0; color: #5a5862; font-size: 16px; line-height: 1.6; max-width: 460px; }
.wc-diagram { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; padding: 22px; background: #fff; border: 2px solid var(--ink); border-radius: 20px; box-shadow: 10px 10px 0 var(--lemon); }
.wc-pool { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: start; }
.wc-person { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 9px; border: 1.5px solid var(--ink); border-radius: 12px; background: #fff; box-shadow: 2px 2px 0 var(--ink); transition: opacity .4s, transform .4s, box-shadow .4s, background .4s, filter .4s; }
.wc-person b { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-person[data-counts="no"] { opacity: .5; box-shadow: none; border-style: dashed; filter: grayscale(.6); }
.wc-person[data-counts="yes"] { background: #f3f0ff; }
.motion .wc-person { opacity: 0; transform: translateY(-14px) scale(.96); }
.motion .wc-person.in { opacity: 1; transform: none; background: #fff; border-style: solid; filter: none; box-shadow: 2px 2px 0 var(--ink); }
.motion .wc-person.in.sorted[data-counts="no"] { opacity: .45; transform: scale(.97); box-shadow: none; border-style: dashed; filter: grayscale(.7); }
.motion .wc-person.in.sorted[data-counts="yes"] { background: #f3f0ff; transform: translateX(4px); box-shadow: 3px 3px 0 var(--cobalt); }
.wc-total { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 18px; border-radius: 14px; background: var(--ink); color: #fff; }
.wc-status { margin: 0; min-height: 2.6em; font-size: 12px; font-weight: 700; color: var(--lemon); }
.wc-maths { margin: 0; font-size: 18px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.wc-maths b { font-size: 40px; letter-spacing: -.04em; }
.wc-maths strong { font-size: 26px; color: #fff; }
.wc-maths small { width: 100%; font-size: 11px; color: #c9c7d1; font-weight: 400; }
.wc-note { margin: 0; font-size: 11px; line-height: 1.5; color: #c9c7d1; }
.wc-diagram .motion-pause { right: -14px; top: -14px; }
.monthly-total-bump { animation: total-bump .35s; }
@keyframes total-bump { 40% { transform: scale(1.06); } }
@media (max-width: 900px) { .who-counts { grid-template-columns: 1fr; gap: 30px; } }
@media (max-width: 560px) {
  .who-counts { padding: 64px 18px 20px; }
  .wc-diagram { grid-template-columns: 1fr; padding: 14px; box-shadow: 6px 6px 0 var(--lemon); }
  .wc-pool { grid-template-columns: 1fr 1fr; gap: 6px; }
  .wc-person { padding: 6px; gap: 6px; } .wc-person .av { width: 22px; height: 22px; font-size: 8px; }
  .wc-person em.b { display: none; }
}

/* ---------- Legal pages: active section in the contents ---------- */
.legal-toc a.is-active { color: var(--cobalt); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .motion [data-reveal], .motion [data-stagger] > * { opacity: 1 !important; transform: none !important; transition: none !important; }
  .motion .hero .intro > *, .motion .hero .board { animation: none; }
  .motion .ticker .ticker-track { animation: none; }
  .read-progress { display: none; }
  .lift:hover { transform: none; }
  .motion .feature-graphic[data-animate] > *, .motion .wc-person { opacity: 1; transform: none; transition: none; }
  .feature-jumps a, .wc-person { transition: none; }
}
