/* ============================================================
   SEIRC Entries: motion.css (after sections.css)
   A small motion system, adapted from golawskimail's: five durations, curves that never overshoot (one gentle
   float for arrivals), and one rule that keeps it safe: the resting style IS the end state and every keyframe
   only says where a thing comes FROM. So animation:none (reduced motion, a throttled headless clock, an
   element re-used by Blazor) always leaves content fully visible and drawn.
   Hooks are m-* (utilities), es-* (EmptyState), fs-* and erg (FloorStage, in schedule.css), fp-* (FloorPlan).
   ============================================================ */
:root {
  /* durations: touch, settle, move, travel, ceremony */
  --mo-1: 90ms; --mo-2: 160ms; --mo-3: 240ms; --mo-4: 420ms; --mo-5: 720ms;
  --e-settle: cubic-bezier(.20,.70,.20,1);   /* arriving: fast start, soft landing */
  --e-leave:  cubic-bezier(.40,0,.80,.60);   /* leaving: gathers speed            */
  --e-move:   cubic-bezier(.45,.05,.20,1);   /* changing place: decisive in-out    */
  --e-weight: cubic-bezier(.16,1,.30,1);     /* landing with mass: long, heavy tail */
  --e-ink:    cubic-bezier(.65,0,.35,1);     /* a pen stroke: hesitant start, sure */
  --e-float:  cubic-bezier(.26,1.1,.32,1);   /* a slight lift on arrival (the only overshoot) */
  --m-stagger: 45ms;
  --m-lift: 0 1px 0 rgba(27,36,64,.05), 0 10px 18px -12px rgba(18,71,188,.35);
  --m-held: 0 2px 0 rgba(27,36,64,.05), 0 22px 36px -16px rgba(18,71,188,.45);
}

/* ---------- keyframes: all "from" (see header) ---------- */
@keyframes m-arrive  { from { transform: translateY(6px); } }
@keyframes m-rise    { from { transform: translateY(10px) scale(.985); } }
@keyframes m-fade    { from { opacity: 0; } }
@keyframes m-word    { from { opacity: 0; transform: translateY(5px); } }
@keyframes m-draw    { from { stroke-dashoffset: 1; } }
@keyframes m-fill    { from { fill-opacity: 0; } }
@keyframes m-stamp   { from { opacity: 0; transform: rotate(var(--m-rot, -6deg)) scale(1.6); } 60% { opacity: 1; } }
@keyframes m-land    { from { box-shadow: var(--m-held); transform: translateY(-3px); } }
@keyframes m-chip    { from { opacity: 0; translate: 0 4px; rotate: -2deg; } }
@keyframes m-mark    { from { transform: scaleY(0); } }
@keyframes m-dot     { from { transform: scale(.45); opacity: .35; } }
@keyframes m-slide   { from { transform: translateY(var(--m-from, 16px)); opacity: 0; } }
@keyframes m-step-fwd  { from { transform: translateX(32px); opacity: 0; } }
@keyframes m-step-back { from { transform: translateX(-32px); opacity: 0; } }
@keyframes m-pop     { from { transform: scale(.4); opacity: 0; } }
@keyframes m-row-in  { from { transform: translateY(-6px); opacity: 0; } }
/* the one exit: a row fades aside while its height folds, then Blazor removes it (Enter.razor waits 180 ms) */
@keyframes m-row-out { to { transform: translateX(24px); opacity: 0; height: 0; padding-block: 0; margin-block: 0; border-width: 0; } }
@keyframes m-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
/* loops: these two are the only infinite ones (selected / live) */
@keyframes m-ring    { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(var(--m-ring-to, 1.18)); } }
@keyframes m-breathe { 0%, 100% { opacity: .25; } 50% { opacity: .85; } }

/* ---------- utilities ---------- */
/* arrival: transform only, so it can never leave a thing invisible */
.m-arrive { animation: m-arrive var(--mo-3) var(--e-settle) both; animation-delay: calc(var(--i, 0) * var(--m-stagger)); }
.m-rise   { animation: m-rise var(--mo-4) var(--e-float) both; animation-delay: calc(var(--i, 0) * var(--m-stagger)); }
/* children arrive one after another (first 8 staggered, the rest together) */
.m-stagger > * { animation: m-arrive var(--mo-3) var(--e-settle) both; }
.m-stagger > :nth-child(2) { animation-delay: calc(1 * var(--m-stagger)); } .m-stagger > :nth-child(3) { animation-delay: calc(2 * var(--m-stagger)); }
.m-stagger > :nth-child(4) { animation-delay: calc(3 * var(--m-stagger)); } .m-stagger > :nth-child(5) { animation-delay: calc(4 * var(--m-stagger)); }
.m-stagger > :nth-child(6) { animation-delay: calc(5 * var(--m-stagger)); } .m-stagger > :nth-child(7) { animation-delay: calc(6 * var(--m-stagger)); }
.m-stagger > :nth-child(n+8) { animation-delay: calc(7 * var(--m-stagger)); }
/* words written in: wrap each word in <span class="w" style="--i:n"> */
.m-words .w { display: inline-block; animation: m-word var(--mo-3) var(--e-settle) both; animation-delay: calc(var(--i, 0) * 70ms + var(--m-delay, 0ms)); }
/* SVG strokes draw themselves: give the shape pathLength="1"; --d delays it */
.m-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: m-draw var(--mo-5) var(--e-ink) both; animation-delay: var(--d, 0s); }
/* rubber stamp (badges, "placed", "1st") */
.m-stamp { display: inline-block; transform: rotate(var(--m-rot, -6deg)); transform-box: fill-box; transform-origin: center;
  animation: m-stamp var(--mo-3) var(--e-weight) both; animation-delay: var(--d, 0s); }
/* a card put down with weight */
.m-land { animation: m-land var(--mo-4) var(--e-weight) both; }
/* hover lift for cards and rows */
.m-lift { transition: transform var(--mo-2) var(--e-settle), box-shadow var(--mo-2) var(--e-settle); }
@media (hover: hover) { .m-lift:hover { transform: translateY(-2px); box-shadow: var(--m-lift); } .m-lift:active { transform: none; box-shadow: none; transition-duration: var(--mo-1); } }
/* shimmer skeleton: <i class="m-skel" style="width:60%"></i> */
.m-skel { position: relative; display: block; overflow: hidden; height: 12px; border-radius: 6px; background: #EAEEF6; }
.m-skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 0, rgba(255,255,255,.85) 45%, rgba(242,183,5,.10) 55%, transparent 100%); animation: m-shimmer 1.8s var(--e-move) infinite; }
.m-skel.lg { height: 18px; } .m-skel.dot { width: 36px; height: 36px; border-radius: 10px; }
.m-skel-rows { display: grid; gap: 10px; padding: 8px 0; }
.m-skel-row { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; }
.m-skel-row > span { display: grid; gap: 6px; }
/* ring / pulse: selected and live things. Put on a positioned element; the ring is its ::after */
.m-ring { position: relative; }
.m-ring::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 2px solid var(--m-c, var(--blue)); pointer-events: none;
  animation: m-ring 1.8s var(--e-settle) infinite; }
.m-live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--m-c, #1D6B3F); position: relative; }
.m-live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; --m-ring-to: 2.6; animation: m-ring 1.6s var(--e-settle) infinite; }
/* a step card enters from the side it is reached from (forward from the right, back from the left) */
.m-step-fwd  { animation: m-step-fwd var(--mo-3) var(--e-settle) both; }
.m-step-back { animation: m-step-back var(--mo-3) var(--e-settle) both; }
/* a count or tick that changes pops in (re-key the element so it plays again) */
.m-pop { animation: m-pop var(--mo-3) var(--e-float) both; }
/* list rows: in from just above; out sideways, folding their height */
.m-row-in  { animation: m-row-in var(--mo-2) var(--e-settle) both; }
.m-row-out { animation: m-row-out 180ms var(--e-leave) forwards; overflow: hidden; pointer-events: none; }
/* the selected-nav mark grows */
.m-mark { transform-origin: 50% 50%; animation: m-mark var(--mo-3) var(--e-settle) both; }

/* ---------- EmptyState (Components/Shared/EmptyState.razor) ---------- */
.es { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 28px 16px 24px; color: var(--muted); list-style: none; }
.es-illo { width: 160px; height: 120px; display: block; margin-bottom: 8px; overflow: visible; color: #3A4A78; }
.es-illo path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 0; animation: m-draw var(--mo-5) var(--e-ink) both; animation-delay: calc(var(--i, 0) * 70ms); }
.es-illo path.faint { opacity: .4; }
.es-illo path.dash { stroke-dasharray: 3 4; animation: m-fade var(--mo-4) var(--e-settle) both; animation-delay: calc(var(--i, 0) * 70ms); }
/* fills wash in once the lines are down */
.es-illo path.fill { stroke: none; animation: m-fade var(--mo-4) var(--e-settle) both; animation-delay: calc(var(--n, 8) * 70ms + 200ms); }
.es-illo .fill.blue { fill: var(--blue); opacity: .16; } .es-illo .fill.purple { fill: var(--purple); opacity: .18; }
.es-illo .fill.gold { fill: var(--gold, #F2B705); opacity: .45; } .es-illo .fill.paper { fill: #fff; }
.es-illo .fill.ink { fill: currentColor; opacity: .7; } .es-illo .fill.water { fill: #29BDDC; opacity: .12; } .es-illo .fill.grey { fill: #8A94AD; opacity: .14; }
.es-title { margin: 0; font: var(--t-head, 600 14px/1.3 Inter, sans-serif); font-size: 15px; color: var(--ink); animation: m-word var(--mo-4) var(--e-settle) both; animation-delay: 120ms; }
.es-text { margin: 0; max-width: 34ch; font: var(--t-body, 400 13px/1.45 Inter, sans-serif); animation: m-word var(--mo-4) var(--e-settle) both; animation-delay: 200ms; }
.es-act { margin-top: 10px; animation: m-word var(--mo-4) var(--e-settle) both; animation-delay: 280ms; }
.es-act .linkbtn { padding: 4px 8px; }
.es.compact { padding: 14px 8px 12px; gap: 2px; }
.es.compact .es-illo { width: 128px; height: 96px; margin-bottom: 4px; }
.es.compact .es-title { font-size: 13px; } .es.compact .es-text { font-size: 12px; }
.es.ox .es-illo { color: #1A3F8F; } .es.ld .es-illo { color: #4F2E78; }
/* inside lists that already style .empty, keep the row neutral */
li.es-wrap { list-style: none; border: 0; background: none; padding: 0; display: block; }

/* ---------- page calm: no scrollbar jump, cross-page fade, scroll reveal, loading, busy buttons ---------- */
/* the scrollbar's room is always kept, so a page that grows past the screen doesn't nudge everything sideways */
html { scrollbar-gutter: stable; }
/* full page loads (sign-in, /my) cross-fade instead of flashing white, where the browser can (Chromium); others just load */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--mo-3); animation-timing-function: var(--e-settle); }
/* below-the-screen sections wait (js/motion.js adds .m-later) and rise in when scrolled to (.m-shown) */
.m-later { transition: opacity var(--mo-4) var(--e-settle), transform var(--mo-4) var(--e-settle); }
.m-later:not(.m-shown) { opacity: 0; transform: translateY(16px); }
/* card grids inside them follow one after another */
.m-later .m-seq > * { transition: opacity var(--mo-3) var(--e-settle), transform var(--mo-3) var(--e-settle); }
.m-later:not(.m-shown) .m-seq > * { opacity: 0; transform: translateY(10px); }
.m-later .m-seq > :nth-child(2) { transition-delay: 60ms; } .m-later .m-seq > :nth-child(3) { transition-delay: 120ms; }
.m-later .m-seq > :nth-child(4) { transition-delay: 180ms; } .m-later .m-seq > :nth-child(n+5) { transition-delay: 240ms; }
@media print { .m-later, .m-later .m-seq > * { opacity: 1 !important; transform: none !important; } }
/* content that replaces a skeleton fades up; its list rows follow (first 8, then together) */
@keyframes m-in { from { opacity: 0; transform: translateY(6px); } }
.m-in { animation: m-in var(--mo-3) var(--e-settle) backwards; }
.m-in-rows > * { animation: m-in var(--mo-3) var(--e-settle) backwards; }
.m-in-rows > :nth-child(2) { animation-delay: 30ms; } .m-in-rows > :nth-child(3) { animation-delay: 60ms; } .m-in-rows > :nth-child(4) { animation-delay: 90ms; }
.m-in-rows > :nth-child(5) { animation-delay: 120ms; } .m-in-rows > :nth-child(6) { animation-delay: 150ms; } .m-in-rows > :nth-child(7) { animation-delay: 180ms; }
.m-in-rows > :nth-child(n+8) { animation-delay: 210ms; }
/* a panel opening under its row grows to its height (where the browser can animate to auto) and fades in; .m-fold is the reverse */
@keyframes m-open { from { opacity: 0; } }
@keyframes m-fold { to { opacity: 0; } }
.m-open { animation: m-open var(--mo-3) var(--e-settle) backwards; }
.m-fold { animation: m-fold var(--mo-2) var(--e-leave) forwards; pointer-events: none; }
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  @keyframes m-open { from { opacity: 0; height: 0; padding-block: 0; } }
  @keyframes m-fold { to { opacity: 0; height: 0; padding-block: 0; } }
  .m-open, .m-fold { overflow: clip; }
}
/* skeletons (Components/Shared/Skeleton.razor): cards and rows the size of the real ones, so nothing moves when data lands */
.skel { display: grid; gap: var(--s4); }
.skel-head { display: flex; align-items: center; gap: var(--s3); padding: var(--card-pad); min-height: 135px; border-top: 4px solid var(--line); }
.skel-head > span, .skel-row > span { flex: 1; display: grid; gap: 8px; }
.skel-list { padding: var(--s1) 0; }
.skel-row { display: flex; align-items: center; gap: var(--s3); min-height: 62px; padding: var(--s2) var(--card-pad); }
.skel-row + .skel-row { border-top: 1px solid #F0F2F7; }
.m-skel.av { width: 36px; height: 36px; border-radius: 50%; flex: none; } .m-skel.blade { width: 56px; height: 44px; border-radius: 10px; flex: none; }
.skel-h { width: 140px; height: 16px; margin: var(--s2) 0 calc(-1 * var(--s2)); }
/* busy buttons (js/motion.js): the label goes clear, a spinner takes its place, the width stays */
@keyframes m-spin { to { transform: rotate(360deg); } }
.btn.m-busy, .mbtn.m-busy { position: relative; color: transparent !important; }
.btn.m-busy:disabled, .mbtn.m-busy:disabled { opacity: .85; }
.btn.m-busy::before, .mbtn.m-busy::before { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: m-spin .7s linear infinite; }
.btn.ghost.m-busy::before, .btn.white.m-busy::before, .mbtn.neutral.m-busy::before, .mbtn.text.m-busy::before, .mbtn.outlined.m-busy::before { border-color: rgba(18,71,188,.25); border-top-color: var(--blue); }
.mbtn.sm.m-busy::before, .btn.sm.m-busy::before { width: 14px; height: 14px; }

/* ---------- reduced motion: keep a short fade at most, drop every transform and loop ---------- */
@media (prefers-reduced-motion: reduce) {
  :root { --mo-1: 0ms; --mo-2: 120ms; --mo-3: 120ms; --mo-4: 120ms; --mo-5: 120ms; --m-stagger: 0ms; }
  .m-step-fwd, .m-step-back, .m-pop, .m-row-in, .tab-num, .m-arrive, .m-rise, .m-stagger > *, .m-words .w, .m-draw, .m-stamp, .m-land, .m-mark,
  .es-illo path, .es-title, .es-text, .es-act { animation: none !important; }
  .m-skel::after, .m-ring::after, .m-live-dot::after { animation: none !important; }
  .m-ring::after { opacity: .6; }
  .m-lift:hover { transform: none; }
  .m-row-out { animation: m-fade 1ms reverse forwards; }
  .tabs::before { transition: none; }
  .m-later, .m-later .m-seq > * { transform: none !important; }
  .m-in, .m-in-rows > * { animation-name: m-fade; }
  .m-open { animation-name: m-fade; } .m-fold { animation: m-fade var(--mo-2) reverse forwards; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 1ms; }
  .btn.m-busy::before, .mbtn.m-busy::before { animation-duration: 1.6s; }
}
