/* Titre animé — So-création Web */
.scw-ah{--scw-ah-word:#a119d2;--scw-ah-stroke:#f2b01e;--scw-ah-width:9;margin:0}
.scw-ah .screen-reader-text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.scw-ah__dyn{color:var(--scw-ah-word);display:inline-block;position:relative;vertical-align:bottom}

/* ---------- Mots qui changent ---------- */
.scw-ah--rotation .scw-ah__dyn{transition:width .45s cubic-bezier(.22,.8,.3,1);white-space:nowrap;text-align:left}
.scw-ah--rotation:not(.scw-ah--machine):not(.scw-ah--lettres) .scw-ah__dyn{overflow:hidden;padding-bottom:.08em;margin-bottom:-.08em}
.scw-ah__word{display:inline-block;white-space:nowrap}
.scw-ah--rotation .scw-ah__word:not(.is-on){position:absolute;left:0;top:0;opacity:0;pointer-events:none}
.scw-ah--rotation.is-ready .scw-ah__word{transition:none}

.scw-ah--fondu .scw-ah__word.is-on{animation:scw-ah-fade-in .6s ease both}
.scw-ah--fondu .scw-ah__word.is-out{animation:scw-ah-fade-out .5s ease both;opacity:1}
@keyframes scw-ah-fade-in{from{opacity:0;filter:blur(6px)}to{opacity:1;filter:none}}
@keyframes scw-ah-fade-out{to{opacity:0;filter:blur(6px)}}

.scw-ah--glisse .scw-ah__word.is-on{animation:scw-ah-up-in .6s cubic-bezier(.22,.8,.3,1) both}
.scw-ah--glisse .scw-ah__word.is-out{animation:scw-ah-up-out .5s cubic-bezier(.6,0,.8,.3) both;opacity:1}
@keyframes scw-ah-up-in{from{transform:translateY(100%);opacity:0}to{transform:none;opacity:1}}
@keyframes scw-ah-up-out{to{transform:translateY(-100%);opacity:0}}

.scw-ah--zoom .scw-ah__word.is-on{animation:scw-ah-zoom-in .55s cubic-bezier(.3,1.4,.5,1) both}
.scw-ah--zoom .scw-ah__word.is-out{animation:scw-ah-zoom-out .4s ease both;opacity:1}
@keyframes scw-ah-zoom-in{from{transform:scale(.3);opacity:0}to{transform:none;opacity:1}}
@keyframes scw-ah-zoom-out{to{transform:scale(1.4);opacity:0}}

.scw-ah--bascule .scw-ah__dyn{perspective:400px}
.scw-ah--bascule .scw-ah__word{transform-origin:50% 100%}
.scw-ah--bascule .scw-ah__word.is-on{animation:scw-ah-flip-in .6s ease both}
.scw-ah--bascule .scw-ah__word.is-out{animation:scw-ah-flip-out .5s ease both;opacity:1}
@keyframes scw-ah-flip-in{from{transform:rotateX(-90deg);opacity:0}to{transform:none;opacity:1}}
@keyframes scw-ah-flip-out{to{transform:rotateX(90deg);opacity:0}}

.scw-ah__l{display:inline-block;white-space:pre}
.scw-ah--lettres .scw-ah__word.is-on .scw-ah__l{animation:scw-ah-letter .45s cubic-bezier(.22,.8,.3,1) both}
.scw-ah--lettres .scw-ah__word.is-out .scw-ah__l{animation:scw-ah-letter-out .3s ease both}
.scw-ah--lettres .scw-ah__word.is-out{opacity:1}
@keyframes scw-ah-letter{from{transform:translateY(.6em) rotate(8deg);opacity:0}to{transform:none;opacity:1}}
@keyframes scw-ah-letter-out{to{transform:translateY(-.4em);opacity:0}}

/* Machine à écrire */
.scw-ah--machine .scw-ah__dyn{max-width:100%;white-space:normal}
.scw-ah--machine .scw-ah__word{max-width:100%;white-space:normal;overflow-wrap:break-word}
.scw-ah--machine .scw-ah__dyn::after{
  content:"";position:absolute;right:-.12em;top:.1em;bottom:.1em;width:.08em;min-width:2px;
  background:var(--scw-ah-stroke);animation:scw-ah-caret .8s steps(1) infinite;
}
@keyframes scw-ah-caret{50%{opacity:0}}

/* ---------- Mot entouré / souligné ---------- */
.scw-ah__mark{white-space:nowrap}
.scw-ah__marktxt{position:relative;z-index:1}
.scw-ah__svg{position:absolute;left:-6%;top:-18%;width:112%;height:136%;overflow:visible;pointer-events:none;z-index:0}
.scw-ah--devant .scw-ah__svg{z-index:2}
.scw-ah__svg path{fill:none;stroke:var(--scw-ah-stroke);stroke-width:var(--scw-ah-width);stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.scw-ah--surligneur .scw-ah__svg path{stroke-width:calc(var(--scw-ah-width) * 4);opacity:.45;stroke-linecap:butt}
.scw-ah--souligne .scw-ah__svg,.scw-ah--vague .scw-ah__svg,.scw-ah--double .scw-ah__svg,.scw-ah--zigzag .scw-ah__svg{top:-6%}
.scw-ah.is-ready .scw-ah__svg path{stroke-dasharray:var(--len);stroke-dashoffset:var(--len)}
.scw-ah.is-drawn .scw-ah__svg path{stroke-dashoffset:0;transition:stroke-dashoffset 1.2s cubic-bezier(.6,.1,.3,1)}
.scw-ah.is-erase .scw-ah__svg path{stroke-dashoffset:calc(var(--len) * -1);transition:stroke-dashoffset .6s ease}

@media (prefers-reduced-motion:reduce){
  .scw-ah__word,.scw-ah__l{animation:none!important}
  .scw-ah.is-ready .scw-ah__svg path{stroke-dashoffset:0!important;transition:none!important}
}
