/* Pathways to Practice: smooth page-to-page transitions + loading states (airy, light, a little high-tech). */

/* 1. Browsers that support it (Chrome, Edge, Safari 18.2+, iPad): the old page fades + lifts away while the new one
      settles in, with no blank flash between pages. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: pt-out .28s cubic-bezier(.4, 0, .2, 1) both; }
::view-transition-new(root) { animation: pt-in .42s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pt-out { to { opacity: 0; transform: translateY(-8px) scale(.995); filter: blur(3px); } }
@keyframes pt-in { from { opacity: 0; transform: translateY(12px) scale(.995); filter: blur(4px); } }

/* 2. Fallback for other browsers (transitions.js adds .pt-js): fade in on arrival, fade out on leaving. */
html.pt-js body { animation: pt-in .45s cubic-bezier(.2, .8, .2, 1) backwards; }
html.pt-js.pt-leaving body { animation: pt-out .24s cubic-bezier(.4, 0, .2, 1) both; }

/* 3. Thin progress line along the top while a page or a tab is loading. */
#pt-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; background: #2b54a8; border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px rgba(66, 119, 187, .55); opacity: 0; transition: width .35s ease, opacity .3s ease; pointer-events: none; }
#pt-bar::after { content: ""; position: absolute; right: 0; top: 0; width: 26px; height: 3px; background: #fecd0b; border-radius: 3px; }
#pt-bar.on { opacity: 1; }

/* 4. Branded loader for the first moment of the dashboard (instead of a blank page). */
.pt-loader { display: grid; justify-items: center; gap: 14px; padding: 70px 0 40px; text-align: center; }
.pt-loader svg { width: 74px; height: 74px; filter: drop-shadow(0 10px 24px rgba(43, 84, 168, .22)); animation: pt-float 2.4s ease-in-out infinite; }
.pt-loader .pt-path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: pt-draw 1.4s ease-in-out infinite; }
.pt-loader p { margin: 0; color: var(--muted, #5b6478); font-weight: 600; letter-spacing: .01em; }
.pt-loader .pt-dots i { display: inline-block; width: 6px; height: 6px; margin: 0 3px; border-radius: 50%; background: #2b54a8; opacity: .25; animation: pt-dot 1.1s infinite; }
.pt-loader .pt-dots i:nth-child(2) { animation-delay: .15s; } .pt-loader .pt-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pt-float { 50% { transform: translateY(-6px); } }
@keyframes pt-draw { 60%, 100% { stroke-dashoffset: 0; } }
@keyframes pt-dot { 40% { opacity: 1; transform: translateY(-3px); } }

/* 5. Skeleton placeholders while a tab loads: soft shimmering cards instead of the word "Loading…". */
.pt-skel { display: grid; gap: 14px; margin-top: 6px; }
.pt-skel .row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.pt-skel i { display: block; height: 86px; border-radius: 20px; background: #edf2fa; position: relative; overflow: hidden; }
.pt-skel i.tall { height: 180px; }
.pt-skel i::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent); animation: pt-shine 1.3s infinite; }
@keyframes pt-shine { to { transform: translateX(100%); } }

/* 6. When a tab's content arrives, it fades up, and its cards follow one after another. */
/* fill-mode backwards (not both) so hover lifts/tilts still work after the entrance finishes */
.pt-enter { animation: pt-in .45s cubic-bezier(.2, .8, .2, 1) backwards; }
.pt-enter > * { animation: pt-rise .5s cubic-bezier(.2, .8, .2, 1) backwards; }
.pt-enter > *:nth-child(2) { animation-delay: .05s; } .pt-enter > *:nth-child(3) { animation-delay: .1s; }
.pt-enter > *:nth-child(4) { animation-delay: .15s; } .pt-enter > *:nth-child(5) { animation-delay: .2s; } .pt-enter > *:nth-child(n+6) { animation-delay: .24s; }
@keyframes pt-rise { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  html.pt-js body, html.pt-js.pt-leaving body, .pt-enter, .pt-enter > *, .pt-loader svg, .pt-loader .pt-path, .pt-skel i::after { animation: none !important; }
}
