/* Ten musical gestures, one quiet layer beneath each heading. */
.stm-heading{position:relative;isolation:isolate}
.stm-heading-ornament{--stm-accent:var(--champagne,var(--cyan,#d4bd95));position:absolute!important;display:flex!important;align-items:center;left:0;right:auto;bottom:-11px;width:min(210px,75%);height:14px;margin:0!important;padding:0!important;overflow:visible;pointer-events:none;opacity:0;color:var(--stm-accent)!important;font:inherit!important;letter-spacing:0!important;z-index:-1}
.stm-heading-ornament i{position:relative;display:block;flex:none;margin:0;padding:0;background:currentColor;border:0;font-style:normal;transform-origin:left center}
.stm-h-active>.stm-heading-ornament{animation:stm-h-presence 1.55s ease both}
@keyframes stm-h-presence{0%{opacity:0}12%{opacity:.75}75%{opacity:.65}100%{opacity:0}}

/* Staff: five ruled lines and a slender playhead traversing them. */
[data-stm-motif="staff"]>.stm-heading-ornament{height:17px;background:repeating-linear-gradient(to bottom,currentColor 0 1px,transparent 1px 4px);background-size:100% 17px;clip-path:inset(0 100% 0 0)}
.stm-h-active[data-stm-motif="staff"]>.stm-heading-ornament{animation:stm-h-presence 1.55s ease both,stm-h-staff 1.1s cubic-bezier(.2,.7,.2,1) both}
[data-stm-motif="staff"]>.stm-heading-ornament i:first-child{width:1px;height:27px;position:absolute;left:0;top:-5px}
[data-stm-motif="staff"]>.stm-heading-ornament i:last-child{width:6px;height:6px;position:absolute;top:6px;left:0;border-radius:50%;opacity:.65}
.stm-h-active[data-stm-motif="staff"]>.stm-heading-ornament i{animation:stm-h-traverse 1.2s cubic-bezier(.25,.6,.2,1) both}
@keyframes stm-h-staff{0%{clip-path:inset(0 100% 0 0)}65%,100%{clip-path:inset(0 0 0 0)}}
@keyframes stm-h-traverse{from{left:0;opacity:0}15%{opacity:.8}to{left:100%;opacity:0}}

/* Wave: a run of finely staggered sample peaks. */
[data-stm-motif="wave"]>.stm-heading-ornament{gap:7px}
[data-stm-motif="wave"]>.stm-heading-ornament i{width:2px;height:calc(14px * var(--stm-height));transform:scaleY(.1);transform-origin:center}
.stm-h-active[data-stm-motif="wave"]>.stm-heading-ornament i{animation:stm-h-wave 1.05s cubic-bezier(.3,.6,.3,1) both;animation-delay:calc(var(--stm-piece)*.027s)}
@keyframes stm-h-wave{0%{transform:scaleY(.1)}30%{transform:scaleY(1)}75%{transform:scaleY(.45)}100%{transform:scaleY(.05)}}

/* Split: two separated rules resolve to a single phrase. */
[data-stm-motif="split"]>.stm-heading-ornament{justify-content:space-between;gap:10px}
[data-stm-motif="split"]>.stm-heading-ornament i{height:1px;flex:1;transform:scaleX(0)}
[data-stm-motif="split"]>.stm-heading-ornament i:last-child{transform-origin:right center}
.stm-h-active[data-stm-motif="split"]>.stm-heading-ornament i{animation:stm-h-rule 1.15s cubic-bezier(.2,.7,.2,1) both}
@keyframes stm-h-rule{0%{transform:scaleX(0)}50%,75%{transform:scaleX(1)}100%{transform:scaleX(.9)}}

/* Shutter: three passing edits, deliberately below rather than over the words. */
[data-stm-motif="shutter"]>.stm-heading-ornament{gap:4px}
[data-stm-motif="shutter"]>.stm-heading-ornament i{height:5px;flex:1;transform:scaleX(0) skewX(-18deg)}
.stm-h-active[data-stm-motif="shutter"]>.stm-heading-ornament i{animation:stm-h-shutter .95s cubic-bezier(.2,.7,.3,1) both;animation-delay:calc(var(--stm-piece)*.1s)}
@keyframes stm-h-shutter{0%{transform:scaleX(0) skewX(-18deg);transform-origin:left}45%{transform:scaleX(1) skewX(-18deg);transform-origin:left}46%{transform-origin:right}100%{transform:scaleX(0) skewX(-18deg);transform-origin:right}}

/* Beat: four measured impulses with a longer downbeat. */
[data-stm-motif="beat"]>.stm-heading-ornament{gap:13px}
[data-stm-motif="beat"]>.stm-heading-ornament i{width:5px;height:5px;border-radius:50%;transform-origin:center;opacity:.25}
[data-stm-motif="beat"]>.stm-heading-ornament i:first-child{width:17px;border-radius:2px}
.stm-h-active[data-stm-motif="beat"]>.stm-heading-ornament i{animation:stm-h-beat .48s ease both;animation-delay:calc(var(--stm-piece)*.2s)}
@keyframes stm-h-beat{0%,100%{transform:scale(.8);opacity:.2}40%{transform:scale(1.3);opacity:1}}

/* Tape: two reel rims with a pulled length of tape between them. */
[data-stm-motif="tape"]>.stm-heading-ornament{width:133px;justify-content:space-between}
[data-stm-motif="tape"]>.stm-heading-ornament i{width:16px;height:16px;border:1px dashed currentColor;border-radius:50%;background:none;transform-origin:center}
[data-stm-motif="tape"]>.stm-heading-ornament i:nth-child(2){position:absolute;left:19px;right:19px;top:7px;width:auto;height:1px;border:0;border-radius:0;background:currentColor;transform-origin:left}
.stm-h-active[data-stm-motif="tape"]>.stm-heading-ornament i:not(:nth-child(2)){animation:stm-h-reel 1.35s cubic-bezier(.2,.7,.2,1) both}
.stm-h-active[data-stm-motif="tape"]>.stm-heading-ornament i:nth-child(2){animation:stm-h-rule 1.1s ease both}
@keyframes stm-h-reel{from{transform:rotate(-80deg)}to{transform:rotate(240deg)}}

/* Vinyl: concentric grooves and one tonearm stroke. */
[data-stm-motif="vinyl"]>.stm-heading-ornament{width:150px;height:20px}
[data-stm-motif="vinyl"]>.stm-heading-ornament i{position:absolute;left:0;top:0;width:20px;height:20px;border-radius:50%;border:1px solid currentColor;background:none;transform-origin:center}
[data-stm-motif="vinyl"]>.stm-heading-ornament i:nth-child(2){inset:4px auto auto 4px;width:12px;height:12px;border-style:dashed}
[data-stm-motif="vinyl"]>.stm-heading-ornament i:last-child{left:27px;top:9px;width:100px;height:1px;border:0;background:currentColor;border-radius:0;transform-origin:left center}
.stm-h-active[data-stm-motif="vinyl"]>.stm-heading-ornament i:not(:last-child){animation:stm-h-reel 1.3s ease both}
.stm-h-active[data-stm-motif="vinyl"]>.stm-heading-ornament i:last-child{animation:stm-h-rule 1.1s ease both}

/* Cue: console cue points travelling across a narrow timeline. */
[data-stm-motif="cue"]>.stm-heading-ornament{gap:6px}
[data-stm-motif="cue"]>.stm-heading-ornament i{width:12px;height:3px;opacity:.2}
[data-stm-motif="cue"]>.stm-heading-ornament i:nth-child(3n){width:23px}
.stm-h-active[data-stm-motif="cue"]>.stm-heading-ornament i{animation:stm-h-cue .65s ease both;animation-delay:calc(var(--stm-piece)*.09s)}
@keyframes stm-h-cue{0%{opacity:.1;transform:translateX(-8px)}45%{opacity:1;transform:translateX(0)}100%{opacity:.2;transform:translateX(3px)}}

/* Harmonics: three strings settle after a single pluck. */
[data-stm-motif="harmonics"]>.stm-heading-ornament{display:block!important}
[data-stm-motif="harmonics"]>.stm-heading-ornament i{position:absolute;left:0;top:calc(3px + var(--stm-piece)*4px);width:100%;height:1px;opacity:calc(1 - var(--stm-piece)*.22);transform-origin:center}
.stm-h-active[data-stm-motif="harmonics"]>.stm-heading-ornament i{animation:stm-h-string 1.25s ease-out both;animation-delay:calc(var(--stm-piece)*.05s)}
@keyframes stm-h-string{0%{transform:scaleX(.1) skewY(0)}25%{transform:scaleX(1) skewY(.9deg)}45%{transform:scaleX(1) skewY(-.6deg)}65%{transform:scaleX(1) skewY(.3deg)}100%{transform:scaleX(1) skewY(0)}}

/* Levels: ten small faders rise and settle in a single pass. */
[data-stm-motif="levels"]>.stm-heading-ornament{gap:5px;align-items:end}
[data-stm-motif="levels"]>.stm-heading-ornament i{width:6px;height:calc(14px*var(--stm-height));transform:scaleY(.1);transform-origin:bottom;opacity:.7}
.stm-h-active[data-stm-motif="levels"]>.stm-heading-ornament i{animation:stm-h-level 1.15s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--stm-piece)*.02s)}
@keyframes stm-h-level{0%{transform:scaleY(.1)}30%{transform:scaleY(1)}55%{transform:scaleY(.65)}75%{transform:scaleY(.85)}100%{transform:scaleY(.1)}}

body.motion-off .stm-heading-ornament{display:none!important}
.vocal-section .stm-heading-ornament{color:inherit!important}
body.page-inactive .stm-heading-ornament,body.page-inactive .stm-heading-ornament i{animation-play-state:paused!important}
@media(max-width:800px){.stm-heading-ornament{width:min(160px,72%);bottom:-10px}.stm-heading-ornament i{max-width:100%}}
@media(prefers-reduced-motion:reduce){.stm-heading-ornament{display:none!important}.stm-heading-ornament,.stm-heading-ornament i{animation:none!important}}
