/* Demo page motion pass (2026-10-22), loaded after try-demo.css.
   Each topic card's picture now tells its small solution once — when it scrolls into view —
   and then rests on the finished state. Hovering or focusing the card plays it again.
   The old endless back-and-forth loops (draw → undraw, pulse, bob) are switched off here.
   try-motion.js adds .motion-armed (start hidden) and .is-playing (run) to .domain-visual. */

/* ---------- 1. Stop the old loops; the resting state is the finished picture ---------- */
.demo-domain-grid .domain-visual *,
.demo-domain-grid .domain-visual *::after,
.demo-domain-grid .domain-exam-visual::before,
.demo-domain-grid .domain-exam-visual::after{animation:none!important}
.demo-domain-grid .domain-exam-visual::after{display:none}
.demo-domain-grid .domain-curve{stroke-dasharray:100;stroke-dashoffset:0}
.demo-domain-grid .domain-geometry .geometry-shape{stroke-dasharray:100;stroke-dashoffset:0;fill-opacity:.4}
.demo-domain-grid .domain-geometry .geometry-arc{stroke-dasharray:100;stroke-dashoffset:0}
.demo-domain-grid .domain-vertex-ring{fill:none;stroke:#d88844;stroke-width:2;opacity:0;transform-box:fill-box;transform-origin:center}

/* ---------- 2. Armed: hidden until the card plays ---------- */
.motion-armed:not(.is-playing) .equation-steps>*,
.motion-armed:not(.is-playing) .geometry-point,
.motion-armed:not(.is-playing) text,
.motion-armed:not(.is-playing) .evidence-conclusion,
.motion-armed:not(.is-playing) .evidence-row b,
.motion-armed:not(.is-playing) .word-choice,
.motion-armed:not(.is-playing) .transition-options i,
.motion-armed:not(.is-playing) .edit-fixed,
.motion-armed:not(.is-playing) .edit-arrow,
.motion-armed:not(.is-playing) .domain-tracer,
.motion-armed:not(.is-playing) .exam-course-symbol{opacity:0}
.motion-armed:not(.is-playing) .domain-curve,
.motion-armed:not(.is-playing) .geometry-shape,
.motion-armed:not(.is-playing) .geometry-arc{stroke-dashoffset:100;fill-opacity:0}
.motion-armed:not(.is-playing) .data-bars i,
.motion-armed:not(.is-playing) .scene-bar{transform:scaleY(0)}
.motion-armed:not(.is-playing) .evidence-row i::after{transform:scaleX(0)}

/* ---------- 3. Cebir: each step of the solution appears in order ---------- */
/* Keep the steps clear of the caption in the bottom-right corner. */
.demo-domain-grid .domain-algebra{justify-items:start;padding-left:5%}
.demo-domain-grid .domain-algebra .equation-steps{width:68%;gap:5px}
.demo-domain-grid .domain-algebra .equation-steps>div{padding:7px 9px}
.is-playing .equation-steps>*{animation:tm-rise .45s cubic-bezier(.2,.8,.3,1) both!important}
.is-playing .equation-steps>:nth-child(2){animation-delay:.35s!important}
.is-playing .equation-steps>:nth-child(3){animation-delay:.6s!important}
.is-playing .equation-steps>:nth-child(4){animation-delay:.95s!important}
.is-playing .equation-steps>:nth-child(5){animation:tm-rise .45s cubic-bezier(.2,.8,.3,1) 1.2s both,tm-ring .9s ease-out 1.7s both!important}

/* ---------- 4. İleri Matematik: the parabola draws, a point slides down to the vertex ---------- */
.is-playing .domain-curve{animation:tm-draw 1.3s cubic-bezier(.45,.05,.25,1) both!important}
.is-playing .domain-tracer{animation:tm-fade .2s ease .9s both!important}
.is-playing .domain-vertex-ring{animation:tm-ping 1s ease-out 2.45s both!important}

/* ---------- 5. Veri: bars rise one after another, then the highest is marked ---------- */
.is-playing .data-bars i{transform-origin:bottom;animation:tm-grow-y .55s cubic-bezier(.2,.8,.3,1) both!important}
.is-playing .data-bars i:nth-child(2){animation-delay:.1s!important}
.is-playing .data-bars i:nth-child(3){animation-delay:.2s!important}
.is-playing .data-bars i:nth-child(4){animation-delay:.3s!important}
.is-playing .data-bars i:nth-child(5){animation-delay:.4s!important}
.is-playing .data-bars i:nth-child(6){animation-delay:.5s!important}
.is-playing .data-bars i:nth-child(7){animation:tm-grow-y .55s cubic-bezier(.2,.8,.3,1) .6s both,tm-peak .8s ease 1.3s both!important}
.domain-data.motion-armed .data-bars i:nth-child(7){background:linear-gradient(#e8b66f,#c98a3b)}
.domain-data.motion-armed:not(.is-playing) .data-bars i:nth-child(7){background:linear-gradient(#79b583,#3e8a62)}

/* ---------- 6. Geometri: edges draw, corners appear, then the angle θ ---------- */
.is-playing .geometry-shape{animation:tm-draw 1.1s ease-in-out both,tm-fill .6s ease 1s both!important}
.is-playing .geometry-point{animation:tm-pop .35s cubic-bezier(.3,1.5,.5,1) both!important}
.is-playing .geometry-point:nth-of-type(1){animation-delay:.42s!important}
.is-playing .geometry-point:nth-of-type(2){animation-delay:.05s!important}
.is-playing .geometry-point:nth-of-type(3){animation-delay:.78s!important}
.is-playing .geometry-arc{animation:tm-draw .55s ease 1.25s both!important}
.is-playing .domain-geometry text,.domain-geometry.is-playing text{animation:tm-fade .35s ease 1.6s both!important}

/* ---------- 7. Bilgi ve Fikirler: evidence fills in, then the conclusion ---------- */
.is-playing .evidence-row i::after{animation:tm-grow-x .7s cubic-bezier(.2,.8,.3,1) both!important}
.is-playing .evidence-row:nth-child(2) i::after{animation-delay:.2s!important}
.is-playing .evidence-row:nth-child(3) i::after{animation-delay:.4s!important}
.is-playing .evidence-row b{animation:tm-fade .3s ease .55s both!important}
.is-playing .evidence-row:nth-child(2) b{animation-delay:.75s!important}
.is-playing .evidence-row:nth-child(3) b{animation-delay:.95s!important}
.is-playing .evidence-conclusion{animation:tm-rise .45s cubic-bezier(.2,.8,.3,1) 1.3s both!important}

/* ---------- 8. Anlatım ve Yapı: options appear, the one that fits the context is chosen ---------- */
.is-playing .word-choice{animation:tm-rise .4s cubic-bezier(.2,.8,.3,1) both!important}
.is-playing .word-choice:nth-of-type(2){animation-delay:.15s!important}
.is-playing .word-choice:nth-of-type(3){animation-delay:.3s!important}
.is-playing .word-choice.is-correct{animation:tm-rise .4s cubic-bezier(.2,.8,.3,1) both,tm-choose .5s ease 1.1s both!important}
.is-playing .word-choice:not(.is-correct){animation:tm-rise .4s cubic-bezier(.2,.8,.3,1) var(--tm-d,.15s) both,tm-dim .4s ease 1.1s both!important}
.is-playing .word-choice:nth-of-type(3):not(.is-correct){--tm-d:.3s}

/* ---------- 9. Fikirleri İfade Etme: the right transition moves into the gap ---------- */
.domain-expression.has-slot .sentence-compare{grid-template-columns:1fr auto 1fr}
.domain-expression.has-slot .sentence-compare>b{position:relative;width:auto;min-width:25px;padding:0 7px;border-radius:13px}
.sentence-compare>b .tm-slot-q{display:grid;place-items:center}
.sentence-compare>b .tm-slot-word{display:none;font-size:10px;font-weight:700;white-space:nowrap}
.domain-expression.is-playing .sentence-compare>b .tm-slot-q{position:absolute;inset:0;animation:tm-out .25s ease 1.2s both!important}
.domain-expression.is-playing .sentence-compare>b .tm-slot-word{display:block;animation:tm-slot-word .4s ease 1.4s both!important}
.domain-expression.is-playing .sentence-compare>b{animation:tm-slot-fill .5s ease 1.25s both!important}
.is-playing .transition-options i{animation:tm-rise .35s cubic-bezier(.2,.8,.3,1) both!important}
.is-playing .transition-options i:not(.is-correct){animation:tm-rise .35s cubic-bezier(.2,.8,.3,1) var(--tm-d,.12s) both,tm-dim .4s ease 1.2s both!important}
.is-playing .transition-options i:nth-child(3):not(.is-correct){--tm-d:.24s}
.is-playing .transition-options i.is-correct{animation:tm-rise .35s cubic-bezier(.2,.8,.3,1) both,tm-choose .5s ease 1s both!important}

/* ---------- 10. Standart İngilizce: the error is struck out, the fix slides in ---------- */
.edit-example>div:first-child p b{position:relative;text-decoration:none}
.edit-example>div:first-child p b::after{content:"";position:absolute;left:-1px;right:-1px;top:52%;height:1.5px;background:currentColor;transform-origin:left}
.is-playing .edit-example>div:first-child p b::after{animation:tm-grow-x .35s ease .35s both!important}
.is-playing .edit-arrow{animation:tm-drop .4s ease .75s both!important}
.is-playing .edit-fixed{animation:tm-rise .45s cubic-bezier(.2,.8,.3,1) 1s both!important}
.is-playing .edit-fixed p b{animation:tm-mark .5s ease 1.5s both!important;border-radius:3px}

/* ---------- 11. AP / IB / IMAT / CEnT-S cards: the scene draws once, the symbol lands ---------- */
.demo-domain-grid .exam-orbit{opacity:.7}
.domain-exam-visual.is-playing .exam-scene svg>*{
  animation-play-state:running!important;animation-iteration-count:1!important;animation-direction:normal!important;animation-fill-mode:both!important;
}
.domain-exam-visual.is-playing .exam-scene :is(.scene-cell-wall,.scene-bond,.scene-wave,.scene-curve,.scene-trend,.scene-link,.scene-scan-line){animation:tm-dash-in 1.3s ease-in-out both!important}
.domain-exam-visual.is-playing .exam-scene .scene-bar{animation:tm-grow-y .6s cubic-bezier(.2,.8,.3,1) both!important;transform-origin:50% 100%}
.domain-exam-visual.is-playing .exam-scene .scene-bar:nth-of-type(2){animation-delay:.1s!important}
.domain-exam-visual.is-playing .exam-scene .scene-bar:nth-of-type(3){animation-delay:.2s!important}
.domain-exam-visual.is-playing .exam-scene .scene-bar:nth-of-type(4){animation-delay:.3s!important}
.domain-exam-visual.is-playing .exam-scene .scene-bar:nth-of-type(5){animation-delay:.4s!important}
.domain-exam-visual.is-playing .exam-scene :is(.scene-nucleus,.scene-mito,.scene-node,.scene-atom,.scene-graph-point,.scene-particle){animation:tm-pop .45s cubic-bezier(.3,1.5,.5,1) .9s both!important}
.domain-exam-visual.is-playing .exam-scene .scene-wave-point{animation:scene-wave-travel 1.3s ease-in-out .2s both!important}
.domain-exam-visual.is-playing .exam-scene .scene-highlight{animation:tm-fade .6s ease .6s both!important}
.domain-exam-visual.is-playing .exam-course-symbol{animation:tm-land .6s cubic-bezier(.3,1.4,.5,1) .25s both!important}
.domain-exam-visual:not(.motion-armed) .exam-scene :is(.scene-cell-wall,.scene-bond,.scene-wave,.scene-curve,.scene-trend,.scene-link,.scene-scan-line){stroke-dashoffset:0}

/* ---------- Keyframes ---------- */
@keyframes tm-rise{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
@keyframes tm-fade{from{opacity:0}to{opacity:1}}
@keyframes tm-out{to{opacity:0;transform:scale(.4)}}
@keyframes tm-draw{from{stroke-dashoffset:100}to{stroke-dashoffset:0}}
@keyframes tm-dash-in{from{stroke-dasharray:1000;stroke-dashoffset:1000}to{stroke-dasharray:1000;stroke-dashoffset:0}}
@keyframes tm-fill{from{fill-opacity:0}to{fill-opacity:.4}}
@keyframes tm-grow-y{from{transform:scaleY(0)}to{transform:scaleY(1)}}
@keyframes tm-grow-x{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes tm-pop{0%{opacity:0;transform:scale(.2)}100%{opacity:1;transform:scale(1)}}
@keyframes tm-land{0%{opacity:0;transform:translateY(-10px) scale(.8)}100%{opacity:1;transform:none}}
@keyframes tm-ring{0%{box-shadow:0 0 0 0 #68a87955}100%{box-shadow:0 0 0 9px #68a87900}}
@keyframes tm-ping{0%{opacity:.9;transform:scale(.6)}100%{opacity:0;transform:scale(2.6)}}
@keyframes tm-peak{0%{filter:none}40%{filter:brightness(1.12) drop-shadow(0 -4px 8px #e8b66f88)}100%{filter:none}}
@keyframes tm-choose{from{border-color:var(--line);background:var(--white);color:var(--muted)}}
@keyframes tm-dim{to{opacity:.45}}
@keyframes tm-drop{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@keyframes tm-mark{from{background:transparent}50%{background:#cfe8cf}to{background:transparent}}
@keyframes tm-slot-fill{from{border-style:dashed}to{border-style:solid;background:#e8f6ed;border-color:#bfdfc7}}
@keyframes tm-slot-word{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
html[data-theme="dark"] .is-playing .edit-fixed p b{animation-name:tm-mark-dark!important}
@keyframes tm-mark-dark{from{background:transparent}50%{background:#2f5a3b}to{background:transparent}}

@media (prefers-reduced-motion:reduce){
  .demo-domain-grid .domain-visual *,.demo-domain-grid .domain-visual *::after{animation:none!important}
  .demo-domain-grid .domain-curve,.demo-domain-grid .geometry-shape,.demo-domain-grid .geometry-arc{stroke-dashoffset:0!important}
}

/* Question counts are not shown on the demo page (2026-10-22): keep the lesson count only. */
.demo-domain-card .domain-meta span:nth-child(2),
.demo-exam-card .domain-lessons li b{display:none}
