/* Fysiotherapie Roerdomplaan: motion, version 2.
   Concept "Herstellen. Fit worden. In beweging.": everything rises, moves forward and comes alive.
   Only when the visitor allows motion; without JavaScript nothing is hidden. */

/* ================= layout polish (always on) ================= */

/* call to action pair: buttons line up at the bottom of both cards */
.t8-call > div > :last-child:not(.rd-w), .t8-call > div > .rd-w:last-child > .btn { margin-top: auto; }
/* cards in grids: the closing link sits on the bottom edge, so rows line up */
.g2 > .card > .rd-w:last-child > a.link, .g3 > .card > .rd-w:last-child > a.link, .g4 > .card > .rd-w:last-child > a.link,
.g2 > a.card > .link:last-child, .g3 > a.card > .link:last-child, .g4 > a.card > .link:last-child,
.g3 > a.card > .small:last-child, .pers-card > .meer { margin-top: auto; }
/* team strip and team page: an incomplete last row is centred */
.t8-team { display: flex !important; flex-wrap: wrap; justify-content: center; }
.t8-team > a { flex: 0 0 calc((100% - 5 * 14px) / 6); }
.rd-teamgrid { display: flex !important; flex-wrap: wrap; justify-content: center; column-gap: 20px; }
.rd-teamgrid > * { flex: 0 0 calc((100% - 3 * 20px) / 4); }
@media (max-width: 900px) {
  .t8-team > a { flex-basis: calc((100% - 2 * 14px) / 3); }
  .rd-teamgrid { column-gap: 14px; }
  .rd-teamgrid > * { flex-basis: calc((100% - 14px) / 2); }
}
@media (max-width: 360px) { .rd-teamgrid > * { flex-basis: 100%; } }

/* scroll progress bar (saffron, top of the window) */
.rd-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 90; background: var(--leef); transform-origin: 0 50%; transform: scaleX(var(--rd-p, 0)); pointer-events: none; }
[dir=rtl] .rd-progress { transform-origin: 100% 50%; }

@media (prefers-reduced-motion: no-preference) {

/* ================= page transitions (Chrome, Edge, Safari 18) ================= */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: rd-vt-out .28s ease both; }
::view-transition-new(root) { animation: rd-vt-in .45s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rd-vt-out { to { opacity: 0; translate: 0 -12px; } }
@keyframes rd-vt-in { from { opacity: 0; translate: 0 18px; } }

/* ================= keyframes ================= */
@keyframes rd-rise { from { opacity: 0; translate: 0 34px; } to { opacity: 1; translate: 0 0; } }
@keyframes rd-word { from { translate: 0 105%; } to { translate: 0 0; } }
@keyframes rd-photo { from { opacity: 0; clip-path: inset(18% 10% 18% 10% round 24px); scale: 1.08; } to { opacity: 1; clip-path: inset(0 0 0 0 round 24px); scale: 1; } }
@keyframes rd-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes rd-stroke { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rd-band { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes rd-pop { 0% { scale: .6; opacity: 0; } 60% { scale: 1.06; opacity: 1; } 100% { scale: 1; } }
@keyframes rd-ring { 0% { box-shadow: 0 0 0 0 rgba(242,178,51,.6); } 100% { box-shadow: 0 0 0 16px rgba(242,178,51,0); } }
@keyframes rd-enter { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes rd-up { from { translate: 0 130%; } to { translate: 0 0; } }
@keyframes rd-tick { 0%, 100% { rotate: 0deg; } 30% { rotate: -14deg; } 60% { rotate: 9deg; } }
@keyframes rd-pulse { 0%, 100% { scale: 1; } 50% { scale: 1.04; } }

/* ================= hero: headline, underline and band stay static; the photo moves ================= */
/* hero photo: opens like a window, then breathes; follows the pointer (tilt set by the script) */
.rd-motion .t8-hero .w > img, .rd-motion .t8-hero .w > figure img,
.rd-motion .rd-page > section.sec:first-child .frame,
.rd-motion .rd-page > section.sec:first-child .pers-foto,
.rd-motion .rd-page > section.sec:first-child .art-ill {
  animation: rd-photo 1.1s cubic-bezier(.2,.7,.2,1) .25s both, rd-float 8s ease-in-out 1.6s infinite;
}
.rd-w8 { display: inline-block; overflow: hidden; vertical-align: top; padding: .06em .02em .1em; margin: -.06em -.02em -.1em; }
.rd-w8 > rd-i { display: inline-block; }
.rd-motion .rd-split .rd-w8 > rd-i { animation: rd-word .9s cubic-bezier(.2,.75,.15,1) calc(var(--i) * .07s + .1s) both; }
.rd-motion .rd-split.rd-wait .rd-w8 > rd-i { animation-play-state: paused; }
.rd-tilt { transition: transform .5s cubic-bezier(.2,.7,.2,1); will-change: transform; }

/* ================= reveal on scroll ================= */
.rd-motion [data-rd-r] { transition: opacity .8s cubic-bezier(.2,.7,.2,1) var(--rd-d, 0s), translate .8s cubic-bezier(.2,.7,.2,1) var(--rd-d, 0s), scale .8s cubic-bezier(.2,.7,.2,1) var(--rd-d, 0s), clip-path 1s cubic-bezier(.2,.7,.2,1) var(--rd-d, 0s); }
.rd-motion [data-rd-r]:not(.rd-in) { opacity: 0; translate: 0 34px; }

/* photo tiles wipe up, the photo inside settles */
.rd-motion .t8-tiles > a[data-rd-r] { translate: none; }
.rd-motion .t8-tiles > a[data-rd-r]:not(.rd-in) { opacity: 1; clip-path: inset(100% 0 0 0 round 18px); }
.rd-motion .t8-tiles > a[data-rd-r].rd-in { clip-path: inset(0 0 0 0 round 18px); }
.t8-tiles img { transition: transform .6s cubic-bezier(.2,.7,.2,1), scale 1.2s cubic-bezier(.2,.7,.2,1) var(--rd-d, 0s); }
.rd-motion .t8-tiles > a[data-rd-r]:not(.rd-in) img { scale: 1.25; }
.t8-tiles span { transition: translate .35s cubic-bezier(.2,.7,.2,1); }
.t8-tiles span::after { content: ""; display: block; height: 3px; margin-top: 6px; border-radius: 3px; background: var(--leef); transform: scaleX(0); transform-origin: 0 50%; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
[dir=rtl] .t8-tiles span::after { transform-origin: 100% 50%; }
.t8-tiles a:hover span, .t8-tiles a:focus-visible span { translate: 0 -6px; }
.t8-tiles a:hover span::after, .t8-tiles a:focus-visible span::after { transform: scaleX(1); }

/* team: portraits spring in, the saffron ring lights up */
.rd-motion .t8-team > a[data-rd-r]:not(.rd-in), .rd-motion .pers-card[data-rd-r]:not(.rd-in) { translate: 0 20px; scale: .9; }
.t8-team img, .pers-card .avatar, .pers-mini .avatar { transition: translate .35s cubic-bezier(.2,.7,.2,1), border-color .6s ease var(--rd-d, 0s); }
.rd-motion .t8-team > a[data-rd-r]:not(.rd-in) img { border-color: transparent; }
.t8-team a:hover img, .pers-card:hover .avatar, .pers-mini:hover .avatar { translate: 0 -8px; animation: rd-ring 1s ease-out; }

/* route from care to health: draws itself while it scrolls into view */
.journey .stop::before { transform-origin: left center; transition: transform 1s cubic-bezier(.2,.7,.2,1) calc(var(--rd-d, 0s) + .1s); }
[dir=rtl] .journey .stop::before { transform-origin: right center; }
.rd-motion .journey[data-rd-r]:not(.rd-in) .stop::before { transform: scaleX(0); }
.journey .dot { transition: scale .6s cubic-bezier(.3,1.7,.5,1) calc(var(--rd-d, 0s) + .6s); }
.rd-motion .journey[data-rd-r]:not(.rd-in) .dot { scale: 0; }
.rd-motion .journey .stop:nth-child(2) { --rd-d: .25s; } .rd-motion .journey .stop:nth-child(3) { --rd-d: .5s; } .rd-motion .journey .stop:nth-child(4) { --rd-d: .75s; }

.rd-motion .f8-bar { clip-path: inset(0 calc((1 - var(--rd-s, 1)) * 100%) 0 0); }
[dir=rtl] .rd-motion .f8-bar { clip-path: inset(0 0 0 calc((1 - var(--rd-s, 1)) * 100%)); }
.f8-b, .f8-dot, .f8-lab { transition: clip-path 1s cubic-bezier(.2,.7,.2,1) var(--rd-d, 0s), scale .6s cubic-bezier(.3,1.7,.5,1) var(--rd-d, 0s), opacity .6s ease var(--rd-d, 0s); }
.rd-motion .flow8[data-rd-r]:not(.rd-in) .f8-b { clip-path: inset(0 100% 0 0 round 18px); }
[dir=rtl] .rd-motion .flow8[data-rd-r]:not(.rd-in) .f8-b { clip-path: inset(0 0 0 100% round 18px); }
.rd-motion .flow8[data-rd-r]:not(.rd-in) .f8-dot { scale: 0; }
.rd-motion .flow8[data-rd-r]:not(.rd-in) .f8-lab { opacity: 0; }
.f8-b:nth-child(2) { --rd-d: .3s; } .f8-b:nth-child(3) { --rd-d: .6s; } .f8-b:nth-child(4) { --rd-d: .9s; }

/* gym banner: photo settles from a slow zoom, then drifts with the scroll */
.t8-gym img { transition: scale 1.8s cubic-bezier(.2,.7,.2,1); translate: 0 var(--rd-py, 0); }
.rd-motion .t8-gym[data-rd-r]:not(.rd-in) img { scale: 1.18; }

/* ================= interaction ================= */
.btn { transition: translate .2s cubic-bezier(.2,.7,.2,1), box-shadow .2s ease, background-color .2s ease, color .2s ease; }
.btn:hover { box-shadow: 0 12px 26px rgba(18,114,133,.22); }
.btn:active { scale: .97; }
.btn:hover svg { animation: rd-tick .5s ease; }
.lk svg, .link svg { transition: translate .25s cubic-bezier(.2,.7,.2,1); }
.lk:hover svg, .link:hover svg { translate: 5px 0; }
[dir=rtl] .lk:hover svg, [dir=rtl] .link:hover svg { translate: -5px 0; }

/* cards tilt toward the pointer with a soft light (pointer devices only, set by the script) */
.rd-card3d { transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease; transform-style: preserve-3d; }
.rd-card3d:hover { box-shadow: 0 22px 44px rgba(18,114,133,.16); }
.rd-sheen { position: relative; }
.rd-sheen::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s ease; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.22), transparent 45%); }
.rd-sheen:hover::after { opacity: 1; }

.plan.sel .price { animation: rd-pop .5s cubic-bezier(.3,1.6,.5,1); display: inline-block; }
.rd-enter { animation: rd-enter .45s cubic-bezier(.2,.7,.2,1) both; }

/* primary call to action breathes once in a while */
.rd-motion .t8-news .btn, .rd-motion .sec.deep .btn.primary { animation: rd-pulse 3.2s ease-in-out 2s infinite; }

/* mobile: sticky booking bar arrives, header hides while reading and returns when scrolling up */
@media (max-width: 900px) {
  .rd-motion .ak-sticky { animation: rd-up .7s cubic-bezier(.2,.7,.2,1) 1.2s both; }
  .rd-header { transition: translate .35s cubic-bezier(.2,.7,.2,1); }
  .rd-hide-hdr .rd-header { translate: 0 -100%; }
}
.hdr { transition: box-shadow .3s ease; }
.rd-scrolled .hdr { box-shadow: 0 10px 28px rgba(18,114,133,.2); }

}

@media (prefers-reduced-motion: reduce) { .rd-progress { display: none; } }
@media print { [data-rd-r] { opacity: 1 !important; translate: none !important; clip-path: none !important; } .rd-progress { display: none; } }
