/* PUBLAB 2027 — motion layer.
   Loaded after styles.css so canvas syncs (which regenerate styles.css) never overwrite it.
   Principles: transform + opacity only, strong custom ease-out, UI under 300ms,
   text reveals a little longer, hover gated to real pointers, reduced motion = opacity only. */

:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1); /* subtle overshoot, playful bits only */
}

/* ---------- press feedback on everything pressable ---------- */
a[href="#register"], [data-register], [data-register-main], .arrow, .nav-toggle, .acc-btn {
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease, opacity 200ms ease;
}
a[href="#register"]:active, [data-register]:active, .arrow:active:not(:disabled), .nav-toggle:active { transform: scale(0.97); }
.acc-btn:active { transform: scale(0.995); }

/* ---------- hero step cards: tilt, straighten on hover (real pointers only) ---------- */
.flow-card { transition: transform 260ms var(--ease-spring), box-shadow 260ms var(--ease-out), opacity 500ms var(--ease-out), translate 700ms var(--ease-out); }
.flow-card img { transition: transform 260ms var(--ease-spring); }
.flow-card:hover { transform: rotate(var(--tilt)); box-shadow: 8px 8px 0 0 #BFDDD5 !important; }
.flow-card:hover img { transform: none; }
@media (hover: hover) and (pointer: fine) {
  .flow-card:hover { transform: rotate(0deg) translateY(-6px); box-shadow: 10px 12px 0 0 #BFDDD5 !important; }
  .flow-card:hover img { transform: rotate(-6deg) scale(1.06); }
}

/* ---------- accordion ---------- */
.acc-icon { transition: transform 220ms var(--ease-out), background-color 200ms ease, color 200ms ease, border-color 200ms ease; }
.acc-panel { animation: accIn 240ms var(--ease-out); }
@keyframes accIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- scroller progress: transform instead of width ---------- */
#who-progress { width: 100% !important; transform-origin: 0 50%; transition: transform 200ms var(--ease-out) !important; }

/* ---------- text reveals ---------- */
/* Split words and letters: rise from a soft blur into place, staggered. */
.js [data-split] .w { display: inline-block; white-space: nowrap; }
.js [data-split] .wi {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.45em);
  filter: blur(6px);
  transition:
    transform 560ms var(--ease-out),
    opacity 360ms var(--ease-out),
    filter 420ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 1ms);
  will-change: transform, opacity, filter;
}
.js [data-split].is-in .wi { opacity: 1; transform: none; filter: blur(0); }

/* Hero wordmark: letters rise out of a mask, faster and tighter. */
.js [data-split="chars"] .w { overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.js [data-split="chars"] .wi { transform: translateY(105%); filter: none; opacity: 1; transition: transform 640ms var(--ease-out); transition-delay: calc(var(--d, 0) * 1ms); }

/* Supporting copy: short fade-up after its heading. */
.js [data-fade] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 420ms var(--ease-out), transform 520ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 1ms);
}
.js [data-fade].is-in { opacity: 1; transform: none; }

/* Dimension line under the wordmark draws out from the centre. */
.js [data-draw] { transform: scaleX(0.4); opacity: 0; transition: transform 700ms var(--ease-out), opacity 300ms ease-out; transition-delay: calc(var(--d, 0) * 1ms); }
.js [data-draw].is-in { transform: none; opacity: 1; }

/* Hero step cards drop in with a short stagger (uses `translate`, so the tilt `transform` is untouched). */
.js .flow-card[data-enter] { opacity: 0; translate: 0 18px; transition-delay: calc(var(--d, 0) * 1ms), calc(var(--d, 0) * 1ms), 0ms, 0ms; }
.js .flow-card[data-enter].is-in { opacity: 1; translate: 0 0; }

/* ---------- reduced motion: keep fades, drop movement and blur ---------- */
@media (prefers-reduced-motion: reduce) {
  .js [data-split] .wi, .js [data-split="chars"] .wi, .js [data-fade], .js [data-draw], .js .flow-card[data-enter] {
    transform: none !important; translate: none !important; filter: none !important;
    transition: opacity 200ms ease !important; transition-delay: 0ms !important;
  }
  .js [data-split="chars"] .wi { opacity: 0; }
  .js [data-split="chars"].is-in .wi { opacity: 1; }
  .flow-card, .flow-card img, .acc-icon, a, button { transition-duration: 0ms !important; }
  .acc-panel { animation: none; }
}
