/* IOT motion tokens + canonical patterns. Generated by tools/build-tokens.js from motion-tokens.json. Do not hand-edit values here.
   Rules: animate transform / opacity / clip-path / mask only. Never width, height, top, left. */
:root {
  --mo-dur-instant: 90ms;
  --mo-dur-fast: 160ms;
  --mo-dur-base: 280ms;
  --mo-dur-moderate: 420ms;
  --mo-dur-slow: 640ms;
  --mo-dur-slower: 900ms;
  --mo-dur-cinematic: 1400ms;
  --mo-dur-hero: 1700ms;
  --mo-dur-loop-shimmer: 1600ms;
  --mo-dur-loop-sweep: 2000ms;
  --mo-dur-loop-breathe: 2800ms;
  --mo-ease-brand: cubic-bezier(0.22, 1, 0.36, 1);
  --mo-ease-settle: cubic-bezier(0.16, 1, 0.3, 1);
  --mo-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --mo-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --mo-ease-exit: cubic-bezier(0.5, 0, 0.75, 0);
  --mo-ease-linear: linear;
  --mo-spring-press: linear(
    0,
    0.0198,
    0.0691,
    0.1357,
    0.2111,
    0.2895,
    0.367,
    0.4409,
    0.5099,
    0.573,
    0.6299,
    0.6808,
    0.7258,
    0.7653,
    0.7997,
    0.8296,
    0.8554,
    0.8776,
    0.8966,
    0.9128,
    0.9266,
    0.9383,
    0.9483,
    0.9567,
    0.9637,
    0.9697,
    0.9747,
    0.9789,
    0.9824,
    0.9854,
    0.9878,
    0.9899,
    0.9916,
    0.993,
    0.9942,
    0.9952,
    0.996,
    0.9967,
    0.9973,
    0.9978,
    1
  );
  --mo-spring-press-dur: 285ms;
  --mo-spring-lift: linear(
    0,
    0.0172,
    0.0623,
    0.1267,
    0.2035,
    0.2869,
    0.3726,
    0.4571,
    0.538,
    0.6136,
    0.6826,
    0.7446,
    0.7992,
    0.8466,
    0.887,
    0.9208,
    0.9487,
    0.9712,
    0.9889,
    1.0025,
    1.0126,
    1.0197,
    1.0243,
    1.027,
    1.0281,
    1.028,
    1.027,
    1.0254,
    1.0234,
    1.0211,
    1.0187,
    1.0163,
    1.0139,
    1.0117,
    1.0097,
    1.0079,
    1.0063,
    1.0048,
    1.0036,
    1.0026,
    1
  );
  --mo-spring-lift-dur: 450ms;
  --mo-spring-sheet: linear(
    0,
    0.0123,
    0.0446,
    0.0907,
    0.1459,
    0.2066,
    0.2698,
    0.3334,
    0.3958,
    0.4559,
    0.5128,
    0.5661,
    0.6155,
    0.6608,
    0.7021,
    0.7394,
    0.773,
    0.803,
    0.8297,
    0.8533,
    0.8741,
    0.8924,
    0.9083,
    0.9222,
    0.9342,
    0.9446,
    0.9536,
    0.9612,
    0.9678,
    0.9733,
    0.978,
    0.982,
    0.9854,
    0.9882,
    0.9905,
    0.9925,
    0.9941,
    0.9954,
    0.9965,
    0.9974,
    1
  );
  --mo-spring-sheet-dur: 410ms;
  --mo-spring-pop: linear(
    0,
    0.0277,
    0.0994,
    0.1998,
    0.3161,
    0.4379,
    0.5574,
    0.6688,
    0.7685,
    0.8542,
    0.9251,
    0.9814,
    1.0238,
    1.0539,
    1.0732,
    1.0836,
    1.0869,
    1.0847,
    1.0786,
    1.07,
    1.0599,
    1.0493,
    1.0389,
    1.0292,
    1.0205,
    1.013,
    1.0068,
    1.0018,
    0.9981,
    0.9954,
    0.9937,
    0.9928,
    0.9925,
    0.9926,
    0.9931,
    0.9939,
    0.9948,
    0.9957,
    0.9966,
    0.9974,
    1
  );
  --mo-spring-pop-dur: 435ms;
  --mo-stagger-glyph: 12ms;
  --mo-stagger-word: 45ms;
  --mo-stagger-line: 70ms;
  --mo-stagger-list-item: 40ms;
  --mo-stagger-card: 80ms;
  --mo-stagger-sede: 90ms;
  --mo-stagger-arc: 100ms;
  --mo-stagger-cap: 480ms;
  --mo-reveal-y: 24px;
  --mo-reveal-y-card: 40px;
  --mo-reveal-y-hero: 64px;
  --mo-scale-from: 0.96;
  --mo-image-settle-scale: 1.08;
  --mo-toast-y: 16px;
  --mo-press-scale: 0.97;
  --mo-hover-lift: 4px;
  --mo-sk-base: #e9e4dc; /* Warm Stone */
  --mo-sk-hi: #f7f9fb; /* Pearl */
  --mo-brand-navy: #0a1d3f;
  --mo-brand-azure: #0b55a8;
  --mo-brand-cyan: #25b3da;
}
@media (prefers-color-scheme: dark) {
  :root {
    --mo-sk-base: #10264f;
    --mo-sk-hi: #1b3a72;
  }
}

/* ---------- 1. Scroll / entrance reveal (IntersectionObserver or GSAP sets data-in) ---------- */
[data-mo="reveal"] {
  opacity: 0;
  transform: translate3d(0, var(--mo-reveal-y), 0);
  transition:
    opacity var(--mo-dur-slow) var(--mo-ease-brand),
    transform var(--mo-dur-slow) var(--mo-ease-brand);
  transition-delay: min(calc(var(--mo-i, 0) * var(--mo-stagger-list-item)), var(--mo-stagger-cap));
}
[data-mo="reveal"][data-in] {
  opacity: 1;
  transform: none;
}
[data-mo="reveal"][data-mo-size="card"] {
  transform: translate3d(0, var(--mo-reveal-y-card), 0);
  transition-delay: min(calc(var(--mo-i, 0) * var(--mo-stagger-card)), var(--mo-stagger-cap));
}
[data-mo="reveal"][data-mo-size="card"][data-in] {
  transform: none;
}

/* Headline mask-up: <h1><span class="mo-line"><span>Texto</span></span></h1> (one .mo-line per line, --mo-i = line index) */
.mo-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.mo-line > span {
  display: block;
  transform: translate3d(0, 105%, 0);
  transition: transform var(--mo-dur-slower) var(--mo-ease-brand);
  transition-delay: calc(var(--mo-i, 0) * var(--mo-stagger-line));
}
[data-in] .mo-line > span,
.mo-line[data-in] > span {
  transform: none;
}

/* ---------- 2. Press / hover (buttons, chips, cards) ---------- */
.mo-press {
  transition:
    transform var(--mo-spring-press-dur) var(--mo-spring-press),
    box-shadow var(--mo-dur-fast) var(--mo-ease-standard),
    background-color var(--mo-dur-fast) var(--mo-ease-standard);
}
.mo-press:active {
  transform: scale(var(--mo-press-scale));
  transition-duration: var(--mo-dur-instant);
}
.mo-lift {
  transition:
    transform var(--mo-spring-lift-dur) var(--mo-spring-lift),
    box-shadow var(--mo-dur-base) var(--mo-ease-standard);
}
@media (hover: hover) {
  .mo-lift:hover {
    transform: translate3d(0, calc(var(--mo-hover-lift) * -1), 0);
    box-shadow: 0 18px 40px -18px rgba(10, 29, 63, 0.35);
  }
}
.mo-focus:focus-visible {
  outline: 2px solid var(--mo-brand-cyan);
  outline-offset: 3px;
  transition: outline-offset var(--mo-dur-fast) var(--mo-ease-brand);
}

/* ---------- 3. Toasts (container: position fixed; one toast = .mo-toast; remove after exit animationend) ---------- */
@keyframes mo-toast-in {
  from {
    opacity: 0;
    transform: translate3d(0, var(--mo-toast-y), 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes mo-toast-out {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
}
.mo-toast {
  animation: mo-toast-in var(--mo-spring-sheet-dur) var(--mo-spring-sheet) both;
}
.mo-toast[data-leaving] {
  animation: mo-toast-out var(--mo-dur-base) var(--mo-ease-exit) both;
}
.mo-toast__bar {
  transform-origin: left;
  animation: mo-toast-timer var(--mo-toast-ms, 4000ms) linear forwards;
}
@keyframes mo-toast-timer {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* ---------- 4. Skeleton shimmer ---------- */
.mo-skeleton {
  background:
    linear-gradient(100deg, var(--mo-sk-base) 30%, var(--mo-sk-hi) 50%, var(--mo-sk-base) 70%) 100% 0 / 300%
    100% no-repeat var(--mo-sk-base);
  border-radius: 8px;
  animation: mo-shimmer var(--mo-dur-loop-shimmer) linear infinite;
}
@keyframes mo-shimmer {
  to {
    background-position: 0 0;
  }
}

/* ---------- 5. Page transitions (cross-document View Transitions; instant fallback elsewhere) ---------- */
@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: mo-page-out var(--mo-dur-base) var(--mo-ease-exit) both;
}
::view-transition-new(root) {
  animation: mo-page-in var(--mo-dur-moderate) var(--mo-ease-brand) both;
  animation-delay: 60ms;
}
@keyframes mo-page-out {
  to {
    opacity: 0;
    transform: translate3d(0, -8px, 0);
  }
}
@keyframes mo-page-in {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
}
/* shared element: give the card image and the detail hero the same view-transition-name (e.g. sede-principal) */

/* ---------- 6. Scroll-driven parallax (CSS, no JS). data-depth: 0.12 background, 0.3 mid, 0.6 near ---------- */
@supports (animation-timeline: view()) {
  [data-mo="parallax"] {
    animation: mo-parallax linear both;
    animation-timeline: view();
    animation-range: cover;
    will-change: transform;
  }
  @keyframes mo-parallax {
    from {
      transform: translate3d(0, calc(var(--mo-depth, 0.3) * 12vh), 0);
    }
    to {
      transform: translate3d(0, calc(var(--mo-depth, 0.3) * -12vh), 0);
    }
  }
  [data-mo="settle"] {
    animation: mo-settle linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 45%;
  }
  @keyframes mo-settle {
    from {
      transform: scale(1.08);
    }
    to {
      transform: scale(1);
    }
  }
}

/* ---------- 7. Product: live board row insert (citas) + success tick ---------- */
@keyframes mo-row-in {
  from {
    opacity: 0;
    transform: translate3d(0, -12px, 0);
    background-color: rgba(37, 179, 218, 0.16);
  }
  60% {
    background-color: rgba(37, 179, 218, 0.16);
  }
  to {
    opacity: 1;
    transform: none;
    background-color: transparent;
  }
}
.mo-row-in {
  animation: mo-row-in 1200ms var(--mo-ease-brand) both;
}
@keyframes mo-tick {
  from {
    stroke-dashoffset: 24;
  }
  to {
    stroke-dashoffset: 0;
  }
}
.mo-tick path {
  stroke-dasharray: 24;
  animation: mo-tick var(--mo-dur-moderate) var(--mo-ease-brand) 120ms both;
}

/* ---------- 8. Reduced motion: no travel, no parallax, no sweeps. Opacity only. ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-mo="reveal"],
  [data-mo="reveal"][data-mo-size="card"] {
    transform: none;
    transition: opacity 120ms linear;
    transition-delay: 0s;
  }
  .mo-line > span {
    transform: none;
    transition: opacity 120ms linear;
  }
  [data-mo="parallax"],
  [data-mo="settle"] {
    animation: none;
    transform: none;
    will-change: auto;
  }
  .mo-press,
  .mo-lift {
    transition:
      background-color 120ms linear,
      box-shadow 120ms linear;
  }
  .mo-press:active {
    transform: none;
  }
  .mo-lift:hover {
    transform: none;
  }
  .mo-toast {
    animation: mo-fade 120ms linear both;
  }
  .mo-toast[data-leaving] {
    animation: mo-fade-out 120ms linear both;
  }
  @keyframes mo-fade {
    from {
      opacity: 0;
    }
  }
  @keyframes mo-fade-out {
    to {
      opacity: 0;
    }
  }
  .mo-toast__bar {
    animation: none;
  }
  .mo-skeleton {
    animation: mo-pulse 2400ms var(--mo-ease-in-out) infinite;
    background: var(--mo-sk-base);
  }
  @keyframes mo-pulse {
    50% {
      opacity: 0.55;
    }
  }
  .mo-row-in {
    animation: mo-fade 200ms linear both;
  }
  .mo-tick path {
    animation: none;
    stroke-dashoffset: 0;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 120ms;
    animation-delay: 0s;
    animation-name: mo-fade;
  }
}
