package dev.kaizen.app.ui.motion

import androidx.compose.animation.core.CubicBezierEasing
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.SpringSpec
import androidx.compose.animation.core.spring
import androidx.compose.animation.core.tween

/**
 * Kaizen animation primitives — single source of truth for all motion.
 *
 * Every motion in the app references these tokens. Defined here so the
 * feel stays consistent and tuning is centralised.
 */

// ── Easing Curves ──────────────────────────────────────────────────────────

/** Overshoot ease — entrance animations */
val EaseSpring = CubicBezierEasing(0.34f, 1.56f, 0.64f, 1f)

/** Expo-out — smooth transitions */
val EaseSmooth = CubicBezierEasing(0.22f, 1f, 0.36f, 1f)

/** System-aligned standard */
val EaseStandard = FastOutSlowInEasing

/** M3 emphasized — page transitions */
val EaseEmphasized = CubicBezierEasing(0.05f, 0.7f, 0.1f, 1f)

// ── Spring Specs ───────────────────────────────────────────────────────────

/** Fast, punchy — squircle press, quick reactions */
val SpringSnappy: SpringSpec<Float> = spring(dampingRatio = 0.55f, stiffness = 800f)

/** Balanced — general state changes */
val SpringDefault: SpringSpec<Float> = spring(dampingRatio = 0.75f, stiffness = 400f)

/** Slow, fluid — tilt response, sidebar slide */
val SpringGentle: SpringSpec<Float> = spring(dampingRatio = 0.85f, stiffness = 200f)

// ── Duration Constants ─────────────────────────────────────────────────────

object Durations {
    const val DROPDOWN_OPEN = 150
    const val PAGE_TRANSITION = 280
    const val BUBBLE_ENTRANCE = 350
    const val THEME_CROSSFADE = 600
    const val ORB_BREATH = 7000
    const val ORB_BREATH_STREAMING = 1800
    const val THINKING_DOT_CYCLE = 600
    const val THINKING_DOT_PHASE_OFFSET = 160
}
