/* SetDM-style motion, mapped to existing TRDMRKD sections and brand colors. */
@keyframes tr-reveal {
  from { opacity: 0; filter: blur(6px); translate: 0 28px; }
  to { opacity: 1; filter: blur(0); translate: 0 0; }
}
@keyframes tr-load {
  from { opacity: 0; filter: blur(12px); translate: 0 48px; }
  to { opacity: 1; filter: blur(0); translate: 0 0; }
}
@keyframes tr-message {
  from { opacity: 0; translate: 0 14px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes tr-book {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes tr-float {
  0%, 100% { transform: translateY(0) rotate(-.3deg); }
  33% { transform: translateY(-7px) rotate(.2deg); }
  66% { transform: translateY(4px) rotate(-.1deg); }
}
@keyframes tr-halo {
  0%, 100% { box-shadow: 0 24px 80px -24px #ffd63826, 0 8px 30px -8px #0007; }
  50% { box-shadow: 0 32px 96px -16px #ffd63842, 0 11px 36px -6px #0009; }
}
@keyframes tr-wave { to { background: #171305; } }
@keyframes tr-ring { from { scale: .8; opacity: .7; } to { scale: 1.5; opacity: 0; } }
@keyframes tr-node {
  0%, 8% { opacity: 0; translate: -12px 0; }
  20%, 82% { opacity: 1; translate: 0 0; }
  92%, 100% { opacity: 0; translate: -12px 0; }
}
@keyframes tr-arrow { 0%, 40%, 92%, 100% { opacity: 0; } 50%, 82% { opacity: 1; } }
@keyframes tr-import {
  0%, 52%, 92%, 100% { opacity: 0; scale: .6; }
  64%, 82% { opacity: 1; scale: 1; }
}
@keyframes tr-line { from { opacity: 0; translate: -10px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes tr-check { from { scale: 0; } to { scale: 1; } }

.motion-enabled .hero > h1,
.motion-enabled .hero-copy,
.motion-enabled .hero-cta { animation: tr-load .9s cubic-bezier(.2,.8,.2,1) both; }
.motion-enabled .hero-copy { animation-delay: .08s; }
.motion-enabled .hero-cta { animation-delay: .16s; }
.motion-enabled .motion-reveal:not(.motion-shown) { opacity: 0; translate: 0 28px; }
.motion-enabled .motion-reveal.motion-shown { animation: tr-reveal .85s cubic-bezier(.2,.7,.2,1) var(--reveal-delay,0ms) both; }
.motion-enabled .motion-reveal:focus-within { opacity: 1; translate: none; animation: none; }
.motion-enabled header { transition: box-shadow .35s ease; }
.motion-enabled header.motion-scrolled { box-shadow: 0 8px 24px -16px #0009; }
.motion-enabled .nav { transition: min-height .35s ease; }
.motion-enabled .motion-scrolled .nav { min-height: 71px; }
.motion-enabled .video.motion-visible:not(.motion-playing):not(:has(iframe)) {
  animation: tr-float 7s ease-in-out infinite, tr-halo 5.8s ease-in-out infinite;
}
.motion-enabled .features > .motion-stack {
  position: sticky;
  top: var(--stack-top);
  z-index: var(--stack-order);
  isolation: isolate;
  transform-origin: 50% 0;
  transform: scale(var(--stack-scale,1));
  filter: brightness(var(--stack-light,1));
}
.motion-enabled .motion-stack::before {
  content: '';
  position: absolute;
  inset: -18px -12px;
  z-index: -1;
  border-radius: 22px;
  background: #17150f;
  box-shadow: 0 -24px 60px -36px #0008;
  pointer-events: none;
}
.motion-enabled .chat:not(.motion-played) .messages > *,
.motion-enabled .lead:not(.motion-played) dd,
.motion-enabled .lead:not(.motion-played) .booked { opacity: 0; }
.motion-enabled .chat.motion-played .messages > * { animation: tr-message .55s cubic-bezier(.22,1,.36,1) both; }
.motion-enabled .chat.motion-played .messages > p:first-child { animation-delay: .2s; }
.motion-enabled .chat.motion-played .wave-msg { animation-delay: 2s; }
.motion-enabled .chat.motion-played .messages > small { animation-delay: 2.2s; }
.motion-enabled .chat.motion-played .messages > p:last-child { animation-delay: 4.6s; }
.motion-enabled .chat.motion-played .wave i {
  background: #6c560b66;
  animation: tr-wave .12s linear calc(2.3s + var(--bar-index) * 90ms) both;
}
.wave-msg > span { position: relative; }
.motion-enabled .chat.motion-played .wave-msg > span::after {
  content: '';
  position: absolute;
  inset: -7px;
  border: 1px solid #6c560b;
  border-radius: 50%;
  opacity: 0;
  animation: tr-ring 1.4s ease-out 2.2s 2;
}
.motion-enabled .lead.motion-played dd { animation: tr-message .3s ease var(--row-delay) both; }
.motion-enabled .lead.motion-played .booked { animation: tr-book .55s cubic-bezier(.34,1.56,.64,1) 3.1s both; }
.dm-typing { display: none; }
.motion-enabled .content-mini .dm-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.motion-enabled .content-mini .dm-typing { display: inline; }
.dm-remaining { visibility: hidden; }
.motion-enabled .content-mini:not(.dm-finished) > div { opacity: 0; }
.motion-enabled .content-mini.dm-finished > div {
  animation: tr-message .55s cubic-bezier(.22,1,.36,1) .1s both;
}
.motion-enabled .mini.motion-played.pain-points-mini li,
.motion-enabled .mini.motion-played.flow > div > span { animation: tr-node 6s cubic-bezier(.22,1,.36,1) var(--item-delay,0ms) infinite; }
.motion-enabled .mini.motion-played.flow i { animation: tr-arrow 6s ease infinite; }
.motion-enabled .mini.motion-played.flow > b { animation: tr-import 6s cubic-bezier(.34,1.56,.64,1) infinite; }
.motion-enabled .mini:not(.motion-visible) *,
.motion-enabled .mini:not(.content-mini):hover *,
.motion-paused * { animation-play-state: paused !important; }
.motion-enabled .setup-display.motion-played .step-line { animation: tr-line .5s cubic-bezier(.22,1,.36,1) var(--line-delay,300ms) both; }
.motion-enabled .setup-display.motion-played .step-line svg { animation: tr-check .42s cubic-bezier(.34,1.56,.64,1) calc(var(--line-delay,300ms) + 320ms) both; }
.motion-enabled .step { transition: background .3s ease, border-color .3s ease, transform .3s ease; }
.motion-enabled .step:hover { transform: translateX(3px); }
.motion-accordion { overflow: hidden; }
.motion-enabled details[open] p { animation: tr-message .24s ease-out both; }
.motion-enabled .choice { transition: border-color .2s, background .2s, transform .15s; }
.motion-enabled .choice:active { transform: scale(.985); }
.final-card { position: relative; isolation: isolate; }
.motion-enabled .final-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(620px circle at var(--glow-x,50%) var(--glow-y,50%),#ffd63830,transparent 85%);
  opacity: 0;
  transition: opacity .5s ease;
}
.motion-enabled .final-card:hover::before { opacity: 1; }
@media (hover:hover) {
  .motion-enabled .coach { transition: transform .3s ease, box-shadow .3s ease; }
  .motion-enabled .coach:hover { transform: translateY(-4px); box-shadow: 0 22px 50px -22px #ffd63832; }
}
@media (max-width:850px) { .motion-enabled .motion-scrolled .nav { min-height: 63px; } }
@media (prefers-reduced-motion:reduce) {
  .motion-reveal, .messages > *, .lead dd, .lead .booked { opacity: 1 !important; translate: none !important; filter: none !important; }
  .features > .split { position: static !important; transform: none !important; filter: none !important; }
}
