/* Mazano Health: the motion layer, shared by every page.
   Anyone who asks their device for reduced motion gets a still page. */

/* ---------- Bar that slides in once the top of the page has gone ---------- */
.mini { position: fixed; z-index: 30; top: 0; left: 0; right: 0; color: #fff; transform: translateY(-110%); visibility: hidden;
  background: rgba(7,26,22,.8); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(255,255,255,.08), 0 24px 40px -28px rgba(0,0,0,.7);
  transition: transform .5s cubic-bezier(.16,1,.3,1), visibility 0s linear .5s; }
.mini.on { transform: none; visibility: visible; transition: transform .5s cubic-bezier(.16,1,.3,1), visibility 0s; }
.mini .bar { padding-top: .7rem; padding-bottom: .7rem; }
.mini .brand b { font-size: 1.15rem; }
.mini .bar nav .menu-btn { display: none; }
.mini .bar nav .btn.top-cta { display: inline-flex; background: var(--mint); color: var(--ink); box-shadow: none; }
.mini .bar nav .btn.top-cta:hover { background: #6aedbd; }
.mini .prog { position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--mint-deep), var(--mint)); box-shadow: 0 0 14px rgba(59,227,166,.8); }

/* ---------- The heartbeat line along the bottom of the hero ---------- */
.pulse { position: absolute; left: 0; bottom: 100%; width: 100%; height: 88px; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
@media (min-width: 1024px) { .pulse { height: 112px; } }

/* ---------- Moving wall of photos in the hero ---------- */
.wall { position: relative; width: min(23rem, 86%); aspect-ratio: 4 / 5; border-radius: 2.25rem; overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; padding: 0 .7rem; background: var(--ink-2);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.6); }
.wall::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); background: linear-gradient(to top, rgba(7,26,22,.45), transparent 35%); }
.wall .col { overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent); }
.wall .rail { display: flex; flex-direction: column; gap: .7rem; padding-bottom: .7rem; }
.wall img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 1.25rem; }
.wall .col:last-child .rail { transform: translateY(-6%); }

@media (prefers-reduced-motion: no-preference) {
  /* The opening: lines rise out of a mask, then the rest follows in order */
  .hero h1 .ln { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
  .hero h1 .ln > span { display: block; animation: line-up 1.15s cubic-bezier(.16,1,.3,1) var(--d, 0s) both; }
  [data-in] { animation: rise 1s cubic-bezier(.16,1,.3,1) var(--d, 0s) both; }
  .wall[data-in] { animation-name: rise-wall; animation-duration: 1.4s; }
  .hero .lead[data-in] { animation-name: rise-text; }
  @keyframes line-up { from { transform: translateY(105%); } }
  @keyframes rise { from { opacity: 0; transform: translateY(26px); } }
  @keyframes rise-text { from { transform: translateY(26px); } }
  @keyframes rise-wall { from { opacity: 0; transform: translateY(40px) scale(.96); } }

  /* The photo wall drifts: one column up, the other down */
  .wall .rail { animation: drift-up 46s linear infinite; }
  .wall .col:last-child .rail { transform: none; animation-direction: reverse; animation-duration: 52s; }
  @keyframes drift-up { to { transform: translateY(-50%); } }

  /* Small signs of life */
  .tag i { position: relative; }
  .tag i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--mint); animation: ping 2.4s cubic-bezier(0,0,.2,1) infinite; }
  @keyframes ping { 75%, 100% { transform: scale(2.8); opacity: 0; } }
  .visual .halo { animation: breathe 7s ease-in-out infinite; }
  @keyframes breathe { 50% { transform: translate(-50%, -50%) scale(1.08); opacity: .75; } }

  /* Things that come into view as you scroll (switched on by motion.js) */
  .rv-on [data-rv] { opacity: 0; transform: translateY(30px); transition: opacity 1s cubic-bezier(.16,1,.3,1), transform 1s cubic-bezier(.16,1,.3,1); transition-delay: calc(var(--i, 0) * 95ms); }
  .rv-on [data-rv].is-in { opacity: 1; transform: none; }

  /* The name, letter by letter */
  .rv-on .word span { display: inline-block; opacity: 0; transform: translateY(.5em) rotate(4deg); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); transition-delay: calc(var(--i, 0) * 70ms); }
  .rv-on .word.is-in span { opacity: 1; transform: none; }

  /* The steps: the dashed line draws across, one step after another */
  .rv-on .steps li::after { transform: scaleX(0); transform-origin: 0 50%; transition: transform .9s cubic-bezier(.65,0,.35,1); transition-delay: calc(var(--i, 0) * 260ms + 250ms); }
  .rv-on .steps.is-in li::after { transform: none; }
  .rv-on .steps .n { transform: scale(.4); opacity: 0; transition: transform .7s cubic-bezier(.34,1.56,.64,1), opacity .4s; transition-delay: calc(var(--i, 0) * 260ms); }
  .rv-on .steps.is-in .n { transform: none; opacity: 1; }

  /* Photos drift inside their frames as the page scrolls */
  @supports (animation-timeline: view()) {
    .area .ph img { animation: frame-drift linear both; animation-timeline: view(); animation-range: cover; }
    @keyframes frame-drift { from { transform: scale(1.16) translateY(-5%); } to { transform: scale(1.16) translateY(5%); } }
  }

  /* Partner cards follow the pointer with a soft light */
  .partner { transition: translate .5s cubic-bezier(.16,1,.3,1); }
  .partner .pic { position: relative; }
  .partner::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s;
    background: radial-gradient(24rem circle at var(--mx, 50%) var(--my, 50%), rgba(59,227,166,.22), transparent 60%); }
  .partner:hover { translate: 0 -4px; }
  .partner:hover::before { opacity: 1; }
  .area { transition: translate .5s cubic-bezier(.16,1,.3,1), box-shadow .5s; }
  .area:hover { translate: 0 -4px; box-shadow: inset 0 0 0 1px rgba(7,26,22,.08), 0 30px 50px -30px rgba(7,26,22,.35); }
}

@media (prefers-reduced-motion: reduce) {
  .mini, .mini.on { transition: none; }
}
