/* Motion on the Story timeline's dots (31 October 2026), with Shared/atelier-timeline-motion.js and atelier-motion.css.
   Each class is a state with one meaning; under prefers-reduced-motion the states stay but nothing moves.
   Desktop dots: #timeline g.event (the whole moment bends about its stem's foot, --tlm-ox / --tlm-oy, set by the js);
   phone dots: .ptl-dot (its round ::after moves, the button itself keeps its pinch transform). */
#timeline g.event.tlm-stretch,#timeline g.event.tlm-swing,#timeline g.event.tlm-droop,#timeline g.event.tlm-lift{transform-box:fill-box;transform-origin:var(--tlm-ox,50%) var(--tlm-oy,100%)}
/* Breathing: the moment is open in the editor right now. The dot swells and settles slowly. */
#timeline g.event.tlm-breathe:not(.new) :is(.multicolor-dot,.disc,circle.draft-ring,.family-mark){transform-box:fill-box;transform-origin:center;animation:tlm-breathe 4.2s ease-in-out infinite}
@keyframes tlm-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.18)}}
/* Stretch: the moment was just saved. The stem grows up a little, then settles (a small burst of sparks with it). */
#timeline g.event.tlm-stretch{animation:tlm-stretch 1.8s ease-out both;animation-delay:var(--tlm-delay,0s)}
@keyframes tlm-stretch{0%{transform:scale(1,1)}30%{transform:scale(1.04,1.12)}60%{transform:scale(1,.98)}100%{transform:scale(1,1)}}
/* Swing, once: the last draft child was submitted, so every child is filled in. */
#timeline g.event.tlm-swing{animation:tlm-swing 2.6s ease-out both;animation-delay:var(--tlm-delay,0s)}
@keyframes tlm-swing{0%{transform:rotate(0)}12%{transform:rotate(5deg)}26%{transform:rotate(-4.2deg)}40%{transform:rotate(3.2deg)}55%{transform:rotate(-2.2deg)}70%{transform:rotate(1.3deg)}85%{transform:rotate(-.5deg)}100%{transform:rotate(0)}}
/* Droop: a draft nobody has opened for 30 days bends its head; it lifts back when opened. */
#timeline g.event.tlm-droop{transform:rotate(var(--tlm-droop,-10deg));opacity:.82}
#timeline g.event.tlm-lift{animation:tlm-lift 1.4s ease-in-out both;animation-delay:var(--tlm-delay,0s)}
@keyframes tlm-lift{from{transform:rotate(var(--tlm-droop,-10deg))}to{transform:rotate(0)}}
/* The label stays upright while its moment droops or lifts: the text turns back by the same angle about its own start. */
#timeline g.event:is(.tlm-droop,.tlm-lift) .event-title-label text{transform-box:fill-box;transform-origin:0 70%}
#timeline g.event.tlm-droop .event-title-label text{transform:rotate(calc(var(--tlm-droop,-10deg) * -1))}
#timeline g.event.tlm-lift .event-title-label text{animation:tlm-unlift 1.4s ease-in-out both;animation-delay:var(--tlm-delay,0s)}
@keyframes tlm-unlift{from{transform:rotate(calc(var(--tlm-droop,-10deg) * -1))}to{transform:rotate(0)}}
/* Sound waves: a voice recording on the moment is playing (rings from atelier-motion.css .wv). */
#timeline g.event .tlm-wv{pointer-events:none}
#timeline .bf,#timeline .tlm-bf{pointer-events:none}
.tlm-defs{position:absolute;width:0;height:0;overflow:hidden}

/* Phone dots */
.ptl-dot.tlm-breathe:after{animation:tlm-breathe 4.2s ease-in-out infinite}
.ptl-dot.tlm-stretch:after{animation:tlm-pstretch 1.8s ease-out both;animation-delay:var(--tlm-delay,0s);transform-origin:50% 100%}
@keyframes tlm-pstretch{0%{transform:scale(1)}30%{transform:scale(1.08,1.3)}60%{transform:scale(1,.95)}100%{transform:scale(1)}}
.ptl-dot.tlm-swing:after{animation:tlm-swing 2.6s ease-out both;animation-delay:var(--tlm-delay,0s);transform-origin:50% 260%}
.ptl-dot.tlm-droop:after{transform:translate(-3px,3px) scale(.86);opacity:.75}
.ptl-dot.tlm-lift:after{animation:tlm-plift 1.4s ease-in-out both;animation-delay:var(--tlm-delay,0s)}
@keyframes tlm-plift{from{transform:translate(-3px,3px) scale(.86);opacity:.75}to{transform:none;opacity:1}}
.ptl-dot.tlm-waves:before{content:"";position:absolute;inset:6px;border-radius:50%;border:2px solid var(--c,#91d9c1);animation:tlm-pwave 2.4s cubic-bezier(.2,.6,.3,1) infinite;pointer-events:none}
@keyframes tlm-pwave{0%{transform:scale(.7);opacity:0}10%{opacity:.8}100%{transform:scale(2.2);opacity:0}}

/* Birds high in Full View (atelier-motion.js birds()), behind the dots. */
.tlm-sky{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;overflow:hidden;z-index:0}
html[data-theme="dark"] .tlm-sky .bird path{stroke:#c9cdd0}
html[data-theme="dark"] .tlm-sky .bird circle{fill:#c9cdd0}

/* The switch in Timeline Settings (aqua when on). */
.tlm-settings{padding:10px 16px}
.tlm-tog{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;height:36px;margin:0;padding:0;border:0;background:none;font:inherit;font-size:14px;color:var(--ink,#242423);cursor:pointer}
.tlm-tog i{width:40px;height:22px;border-radius:999px;background:#d9d2c8;position:relative;flex:none;transition:background .15s;box-sizing:border-box;border:1.5px solid transparent}
.tlm-tog i::after{content:"";position:absolute;top:1.5px;left:1.5px;width:16px;height:16px;border-radius:50%;background:#fff;transition:left .15s}
.tlm-tog[aria-checked="true"] i{background:#91d9c1;border-color:#6fbfa6}
.tlm-tog[aria-checked="true"] i::after{left:19.5px}
.tlm-tog:focus-visible{outline:2px solid #91d9c1;outline-offset:3px;border-radius:8px}
html[data-theme="dark"] .tlm-tog{background:none!important;border:0!important;box-shadow:none!important;color:#efe9e2!important}
html[data-theme="dark"] .tlm-tog:not([aria-checked="true"]) i{background:#4a5356}

@media (prefers-reduced-motion:reduce){
  #timeline g.event.tlm-lift .event-title-label text,#timeline g.event.tlm-stretch,#timeline g.event.tlm-swing,#timeline g.event.tlm-lift,
  .ptl-dot:is(.tlm-breathe,.tlm-stretch,.tlm-swing,.tlm-lift,.tlm-waves):after,.ptl-dot.tlm-waves:before{animation:none!important;transition:none!important}
  #timeline g.event.tlm-breathe:not(.new) :is(.multicolor-dot,.disc,circle.draft-ring,.family-mark){animation:none}
}
