/* ==========================================================================
   WIYS-IT — beweging & interactie (gedeeld door alle pagina's)
   1. Paginaovergang   2. Klik-feedback   3. Inschuiven bij scrollen
   4. Actieve sectie in menu
   Alles wordt uitgeschakeld bij prefers-reduced-motion.
   ========================================================================== */

/* ── 1. PAGINAOVERGANG ───────────────────────────────────────────────────── */
/* Moderne browsers: native cross-document View Transitions */
@view-transition { navigation: auto; }
#navbar { view-transition-name: navbar; }            /* menu blijft staan */
::view-transition-old(root) { animation: wiys-page-out .45s ease-in both; }
::view-transition-new(root) { animation: wiys-page-in .75s cubic-bezier(.2,.7,.2,1) .05s both; }

/* Fallback (oudere browsers, file://): JS zet .no-vt op <html> */
/* alleen opacity op body: een transform/translate op body zou het vaste menu laten meescrollen */
.no-vt body { animation: wiys-fade-in .7s ease-out backwards; }
.no-vt.page-leave body { animation: wiys-fade-out .38s ease-in forwards; }
@keyframes wiys-fade-in  { from { opacity: 0; } }
@keyframes wiys-fade-out { to { opacity: 0; } }

@keyframes wiys-page-in  { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes wiys-page-out { from { opacity: 1; } to { opacity: 0; translate: 0 -8px; } }

/* ── 2. KLIK-FEEDBACK ────────────────────────────────────────────────────── */
/* Kort inveren (via de losse 'scale'-eigenschap, botst niet met hover-transforms) */
.is-pressed { animation: wiys-press .32s cubic-bezier(.3,1.6,.5,1); }
@keyframes wiys-press { 0% { scale: 1; } 35% { scale: .94; } 70% { scale: 1.02; } 100% { scale: 1; } }
.card.is-pressed, .svc-card.is-pressed, .dienst-card.is-pressed { animation-name: wiys-press-soft; }
@keyframes wiys-press-soft { 0% { scale: 1; } 35% { scale: .975; } 70% { scale: 1.006; } 100% { scale: 1; } }

/* Ripple-golf op knoppen */
.btn-primary, .btn-outline, .btn-dark, .contact-btn, .btn { position: relative; overflow: hidden; isolation: isolate; }
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: -1;
  width: var(--rs); height: var(--rs); left: var(--rx); top: var(--ry);
  translate: -50% -50%; background: rgba(255,255,255,.45);
  animation: wiys-ripple .6s ease-out forwards;
}
.btn-dark .ripple, .contact-btn .ripple { background: rgba(26,95,189,.18); }
@keyframes wiys-ripple { from { scale: 0; opacity: 1; } to { scale: 1; opacity: 0; } }

/* ── 3. INSCHUIVEN BIJ SCROLLEN ──────────────────────────────────────────── */
/* .reveal wordt alleen door JS gezet: zonder JS (en voor zoekmachines) is alles zichtbaar */
.reveal { opacity: 0; }
.reveal.in { animation: wiys-reveal .75s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--d, 0ms); }
@keyframes wiys-reveal { from { opacity: 0; translate: 0 28px; } to { opacity: 1; translate: 0 0; } }
.photo.reveal.in { animation-name: wiys-reveal-photo; animation-duration: .9s; }
@keyframes wiys-reveal-photo { from { opacity: 0; translate: 0 28px; scale: .97; } to { opacity: 1; translate: 0 0; scale: 1; } }

/* ── 4. ACTIEVE SECTIE IN MENU ───────────────────────────────────────────── */
#nav-desktop a.nav-active, #nav-mobile a.nav-active { color: var(--blue); }
#nav-mobile a.nav-active { background: rgba(26,95,189,.08); box-shadow: inset 4px 0 0 var(--cyan); }
.nav-indicator {
  position: absolute; bottom: 12px; height: 3px; border-radius: 3px; left: 0; width: 0;
  background: var(--g1); opacity: 0; pointer-events: none;
  transition: left .45s cubic-bezier(.2,.8,.2,1), width .45s cubic-bezier(.2,.8,.2,1), opacity .3s;
}
.nav-indicator.on { opacity: 1; }
section[id] { scroll-margin-top: 64px; }

/* ── MINDER BEWEGING ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .no-vt body, .no-vt.page-leave body, .is-pressed, .reveal.in { animation: none !important; }
  .reveal { opacity: 1 !important; }
  .ripple { display: none; }
  .nav-indicator { transition: none; }
}
