/* Korean Studio — movement follows the mounted content and its actual state. */
@keyframes ks-arrive { from { opacity:0 } to { opacity:1 } }
@keyframes ks-rise { from { opacity:0; translate:0 9px } to { opacity:1; translate:0 0 } }
@keyframes ks-panel-in { from { opacity:0; translate:14px 0 } to { opacity:1; translate:0 0 } }
@keyframes ks-feedback-in { from { opacity:.45; translate:0 3px } to { opacity:1; translate:0 0 } }
@media (prefers-reduced-motion:no-preference) {
  :root { --ks-motion-ease:cubic-bezier(.2,.72,.24,1) }

  /* Page shells fade without creating a translated ancestor for fixed controls. */
  #view > :first-child, .studio-home-welcome, body > main > :is(article,section),
  #root > :first-child { animation:ks-arrive 220ms ease-out }

  .studio-home-hero, .studio-home-profile-heading, .studio-home-activity,
  .kt-tile, .gs-card, .ks-practice-card, .kc-card, .ks-service-card,
  .korean-grammar-grid > a, .ks-home-references > a,
  .dictionary-catalog-card, .cabinet-words-card, #results tbody tr {
    animation:ks-rise 260ms var(--ks-motion-ease) backwards;
    animation-delay:var(--ks-item-delay,0ms)
  }
  :is(.kt-tile,.gs-card,.ks-practice-card,.kc-card,.ks-service-card,.dictionary-catalog-card,.cabinet-words-card,.korean-grammar-grid > a,.ks-home-references > a,#results tbody tr):nth-child(2) { --ks-item-delay:28ms }
  :is(.kt-tile,.gs-card,.ks-practice-card,.kc-card,.ks-service-card,.dictionary-catalog-card,.cabinet-words-card,.korean-grammar-grid > a,.ks-home-references > a,#results tbody tr):nth-child(3) { --ks-item-delay:56ms }
  :is(.kt-tile,.gs-card,.ks-practice-card,.kc-card,.ks-service-card,.dictionary-catalog-card,.cabinet-words-card,.korean-grammar-grid > a,.ks-home-references > a,#results tbody tr):nth-child(n+4) { --ks-item-delay:84ms }

  [data-ks-lesson-part=rail], .ks-article-outline, dialog[open] {
    animation:ks-panel-in 250ms var(--ks-motion-ease)
  }
  dialog.ks-word-card[open] { animation:ks-feedback-in 160ms ease-out }
  dialog[open]::backdrop, .sidebar-scrim:not([hidden]) { animation:ks-arrive 180ms ease-out }
  dialog[open] > :is(header,h2,form,section,footer) { animation:ks-rise 220ms var(--ks-motion-ease) 35ms backwards }
  details[open] > :not(summary,style,script), .ks-written-feedback:not(:empty):not(.ks-ux-feedback-reader),
  .ks-picture-feedback:not(:empty), .korean-listening-feedback:not(:empty),
  .ks-ux-particle-hint:not([hidden]), [data-ks-answer-key] { animation:ks-feedback-in 160ms ease-out }
}
@media (prefers-reduced-motion:no-preference) {
  #studio-sidebar.open .nav-item:nth-child(-n+5) { animation:ks-rise 200ms var(--ks-motion-ease) backwards }
  #studio-sidebar.open .nav-item:nth-child(2) { animation-delay:18ms }
  #studio-sidebar.open .nav-item:nth-child(3) { animation-delay:36ms }
  #studio-sidebar.open .nav-item:nth-child(4) { animation-delay:54ms }
  #studio-sidebar.open .nav-item:nth-child(5) { animation-delay:72ms }
  .ks-theme-choice, .ks-picture-options button {
    transition:background-color 130ms ease-out, border-color 130ms ease-out, color 130ms ease-out;
  }
}
