.acg-theme{
  --acg-purple:#907EC7; --acg-rust:#DC6929; --acg-sand:#E29C5A;
  --acg-blue:#0277BA; --acg-cyan:#3EB8E0;
  --acg-font-base:"Avenir Next","AvenirNext",Avenir,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --acg-font-accent:"Brandon Grotesque","BrandonGrotesque-Regular","Avenir Next",Avenir,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --acg-size:clamp(20px,3.2vw,34px); --acg-weight:500; --acg-accent-weight:600; --acg-letter:.2px;
  --acg-duration:520ms; --acg-ease:cubic-bezier(.2,.8,.2,1.05);
}
.acg-rotator{font:var(--acg-weight) var(--acg-size)/1.25 var(--acg-font-base); letter-spacing:var(--acg-letter)}
.acg-rotator__inner{display:inline}
.acg-text{opacity:.92}
.acg-text--lead,.acg-text--mid,.acg-text--tail{transition:opacity .25s ease}
.acg-rotator__slot{position:relative;white-space:nowrap;font-family:var(--acg-font-accent);font-weight:var(--acg-accent-weight)}
.acg-slot--modalities{color:var(--acg-blue)}
.acg-slot--mechanisms{color:var(--acg-purple)}
.acg-slot--outcomes{color:var(--acg-rust)}

/* Build mode: temporarily hide later slots at start of each cycle */
.acg-rotator .acg-rotator__slot[data-hidden="true"]{opacity:0; transform:translateY(.5em) scale(.99); transition:opacity .2s ease, transform .2s ease}

/* Fade/slide base transitions */
.acg-rotator[data-transition="fade"] .acg-rotator__slot{transition:opacity var(--acg-duration) var(--acg-ease),transform var(--acg-duration) var(--acg-ease)}
.acg-rotator[data-transition="fade"] .acg-rotator__slot[data-state="out"]{opacity:0;transform:translateY(.12em)}
.acg-rotator[data-transition="fade"] .acg-rotator__slot[data-state="in"]{opacity:1;transform:none}

.acg-rotator[data-transition="slide"] .acg-rotator__slot{display:inline-block;overflow:hidden;height:1.25em;line-height:1.25em;transition:transform calc(var(--acg-duration) * 1.1) var(--acg-ease),opacity calc(var(--acg-duration) * 1.1) var(--acg-ease)}
.acg-rotator[data-transition="slide"] .acg-rotator__slot[data-phase="pre"]{transform:translateY(.9em);opacity:0}
.acg-rotator[data-transition="slide"] .acg-rotator__slot[data-phase="post"]{transform:translateY(-.9em);opacity:0}

/* Flip transition (3D) */
.acg-flip-out{display:inline-block;transform-origin:50% 60%;animation:acgFlipOut var(--acg-duration) var(--acg-ease) forwards}
.acg-flip-in{display:inline-block;transform-origin:50% 60%;animation:acgFlipIn var(--acg-duration) var(--acg-ease) forwards}
@keyframes acgFlipOut{0%{transform:rotateX(0) scale(1);opacity:1}100%{transform:rotateX(90deg) scale(.98);opacity:0}}
@keyframes acgFlipIn{0%{transform:rotateX(-90deg) scale(.98);opacity:0}100%{transform:rotateX(0) scale(1);opacity:1}}

/* Typewriter caret */
.acg-typing{border-right:2px solid currentColor;animation:acgCaret .9s steps(1,end) infinite}
@keyframes acgCaret{0%,49%{border-right-color:transparent}50%,100%{border-right-color:currentColor}}

@media (prefers-reduced-motion: reduce){
  .acg-rotator .acg-rotator__slot{transition:none!important;animation:none!important;border-right:none!important}
}
@media (prefers-contrast: more){
  .acg-slot--modalities,.acg-slot--mechanisms,.acg-slot--outcomes{color:currentColor;text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:2px}
}
