/* OptiMED Elite: scroll-driven motion layer (hero, colour flow, pinned journey, image reveals) */

/* ── Hero: photo drifts, quote and terms rise in ── */
.hero__img { will-change: transform; transform: scale(1.08); }

/* ── Colour flow: soft bridges instead of hard cuts into and out of dark sections ── */
.on-deep { isolation: isolate; }
.on-deep::before { content: ""; position: absolute; left: 0; right: 0; top: -90px; height: 90px; background: linear-gradient(to bottom, rgba(13, 36, 64, 0), var(--blue-900)); pointer-events: none; z-index: -1; }
.on-deep + .section { isolation: isolate; border-top-color: transparent; }
.on-deep + .section::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 80px; background: linear-gradient(to bottom, var(--blue-900), rgba(13, 36, 64, 0)); pointer-events: none; z-index: -1; }
.section--exec::before { z-index: -1; }

/* ── Photo reveals: frames open up while the picture settles ── */
.imgrev { clip-path: inset(14% 9% 14% 9%); transition: clip-path 1.4s var(--ease); will-change: clip-path; }
.imgrev img { transform: scale(1.2); transition: transform 1.8s var(--ease); }
.imgrev.in { clip-path: inset(0 0 0 0); }
.imgrev.in img { transform: scale(1); }
.figure.imgrev:hover img, .framed.imgrev:hover img { transform: scale(1.025); }
.figure.imgrev:not(.in):hover img { transform: scale(1.2); }

/* ── Biological age card: bars fill when it arrives ── */
.mock [style*="--w"], .mock .mock__zones li i::after { transform: scaleX(0); transform-origin: left; transition: transform 1.5s var(--ease) 0.35s; }
.mock.is-go [style*="--w"], .mock.is-go .mock__zones li i::after { transform: none; }

/* ── Pinned journey (desktop): one step at a time as you scroll through ── */
@media (min-width: 1024px) {
  .journey--on .journey__pin { height: 380vh; position: relative; }
  .journey--on .journey__stage { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; }
  .journey--on .journey__stage > .shell { width: 100%; padding-top: 4.5rem; position: relative; }
  .journey--on .sec-head { margin-bottom: clamp(1.5rem, 3vh, 2.5rem); }
  .journey--on .timeline { display: block; position: relative; min-height: 19rem; width: 100%; margin-top: clamp(2.5rem, 6vh, 4rem); }
  .journey--on .timeline li {
    position: absolute; left: 0; top: 0; width: min(36rem, 52%); padding: 0 0 0 0; border-top: 0;
    opacity: 0; transform: translateY(26px); pointer-events: none;
    transition: opacity 0.6s var(--ease), transform 0.7s var(--ease);
  }
  .journey--on .timeline li::before { display: none; }
  .journey--on .timeline li.is-active { opacity: 1; transform: none; pointer-events: auto; }
  .journey--on .timeline li::after { content: attr(data-n); position: absolute; left: -0.15em; top: -0.35em; font: 300 8rem/1 var(--serif); color: var(--accent); opacity: 0.09; pointer-events: none; z-index: -1; }
  .journey--on .timeline .step__idx { margin-bottom: 1rem; }
  .journey--on .timeline h3 { font-size: clamp(1.7rem, 2.6vw, 2.5rem); line-height: 1.12; margin-bottom: 1rem; }
  .journey--on .timeline p:not(.step__idx) { font-size: 1.05rem; line-height: 1.65; max-width: 46ch; }
  .journey__nav { position: absolute; right: var(--gut); top: 50%; transform: translateY(-40%); width: min(21rem, 34%); margin: 0; padding: 0 0 0 1.5rem; list-style: none; border-left: 1px solid var(--line-soft); }
  .journey__nav i { position: absolute; left: -1px; top: 0; width: 2px; height: 0; background: var(--accent); }
  .journey__nav button { display: flex; gap: 0.9rem; align-items: baseline; width: 100%; padding: 0.7rem 0; text-align: left; background: none; border: 0; cursor: pointer; font: inherit; color: var(--ink-3); transition: color 0.3s, transform 0.4s var(--ease); }
  .journey__nav button span { font: 500 0.75rem/1 var(--sans); letter-spacing: 0.14em; min-width: 1.6rem; }
  .journey__nav button b { font: 400 1.05rem/1.3 var(--serif); }
  .journey__nav li.is-active button { color: var(--ink); transform: translateX(6px); }
  .journey__nav li.is-active button span { color: var(--accent-ink); }
  .journey__nav li.is-done button { color: var(--ink-2); }
}
@media (max-width: 1023px) { .journey__nav { display: none; } }

/* ── Page-to-page transition (supported browsers) ── */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 0.25s var(--ease) both vtOut; }
::view-transition-new(root) { animation: 0.4s var(--ease) both vtIn; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  .imgrev, .imgrev img, .hero__img { clip-path: none; transform: none; transition: none; }
  .mock [style*="--w"], .mock .mock__zones li i::after { transform: none; transition: none; }
}
