/* Animations page home — Studio OkDak */

body.home-motion .home-reveal {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(4px);
  transition:
    opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.45s ease;
  transition-delay: calc(var(--home-stagger, 0) * 55ms);
}

body.home-motion .home-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

@keyframes homePanelIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.home-motion .home-studio-panel.home-panel--enter {
  animation: homePanelIn 0.44s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes homeSubpanelIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.home-motion .home-start-subpanel.home-subpanel--enter {
  animation: homeSubpanelIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.home-motion .home-studio-nav__btn {
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1),
    box-shadow 0.22s ease;
}

body.home-motion .home-studio-nav__btn.is-active {
  transform: scale(1.02);
  box-shadow: 0 4px 18px rgba(76, 130, 255, 0.15);
}

body.home-motion .home-studio-nav__btn:active:not(.is-active) {
  background: rgba(255, 255, 255, 0.06);
}

body.home-motion .home-start-card {
  transition:
    transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1),
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

body.home-motion .home-start-card:hover {
  transform: translateY(-3px);
}

body.home-motion .home-template-pick {
  transition:
    transform 0.18s cubic-bezier(0.34, 1.2, 0.64, 1),
    border-color 0.18s ease,
    background 0.18s ease;
}

body.home-motion .home-template-pick:hover {
  transform: translateY(-2px);
}

body.home-motion .home-shell-btn {
  transition: transform 0.18s cubic-bezier(0.34, 1.2, 0.64, 1), background 0.18s ease;
}

body.home-motion .home-shell-btn:active {
  background: rgba(255, 255, 255, 0.06);
}

body.page-home:not(.home-motion) .home-reveal {
  opacity: 1;
  transform: none;
  filter: none;
}

/* —— Insertion d’un bloc dans « Mon site » —— */

@keyframes homePreviewInsert {
  0% {
    transform: scale(0.985);
    box-shadow: 0 0 0 0 rgba(41, 151, 255, 0);
  }
  35% {
    transform: scale(1.014);
    box-shadow:
      0 0 0 3px rgba(41, 151, 255, 0.45),
      0 12px 36px rgba(41, 151, 255, 0.18);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(41, 151, 255, 0);
  }
}

@keyframes homeSitePreviewInsert {
  0% {
    opacity: 1;
  }
  25% {
    opacity: 1;
    outline-color: rgba(41, 151, 255, 0.55);
    outline-offset: 3px;
  }
  100% {
    opacity: 1;
    outline-color: transparent;
    outline-offset: 8px;
  }
}

@keyframes homeBadgePop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.22);
  }
  70% {
    transform: scale(0.94);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes homeDraftExit {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.94) translateY(-10px);
    filter: blur(3px);
  }
}

body.home-motion .home-preview-viewport.home-preview--insert {
  animation: homePreviewInsert 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: center top;
  border-radius: 14px;
}

body.home-motion .home-site-preview.home-site-preview--insert {
  outline: 2px solid transparent;
  outline-offset: 4px;
  border-radius: 14px;
  animation: homeSitePreviewInsert 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.home-motion .home-preview-badge.home-badge--pop {
  animation: homeBadgePop 0.55s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  display: inline-block;
}

body.home-motion #modulePreview.home-draft--exit {
  animation: homeDraftExit 0.38s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

/* —— Publication du site —— */

@keyframes homePublishHubBusy {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(41, 151, 255, 0);
    border-color: var(--apple-border, rgba(255, 255, 255, 0.12));
  }
  50% {
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.28), 0 16px 40px rgba(41, 151, 255, 0.12);
    border-color: rgba(41, 151, 255, 0.45);
  }
}

@keyframes homePublishHubSuccess {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
  30% {
    transform: scale(1.018);
    box-shadow:
      0 0 0 4px rgba(52, 199, 89, 0.35),
      0 20px 48px rgba(52, 199, 89, 0.14);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
}

@keyframes homePublishPanelSuccess {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  25% {
    transform: translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes homePublishStepPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(41, 151, 255, 0.4);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 0 6px rgba(41, 151, 255, 0);
  }
}

@keyframes homePublishShareEnter {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes homeDeployReveal {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }
  60% {
    opacity: 1;
    transform: translateY(2px);
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.3);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    box-shadow: none;
  }
}

@keyframes homeFlowStepCelebrate {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.08);
    color: #34c759;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes homePublishSuggestionGlow {
  0% {
    background: rgba(76, 130, 255, 0.12);
    border-color: rgba(76, 130, 255, 0.28);
  }
  40% {
    background: rgba(52, 199, 89, 0.18);
    border-color: rgba(52, 199, 89, 0.5);
    box-shadow: 0 0 24px rgba(52, 199, 89, 0.2);
  }
  100% {
    background: rgba(76, 130, 255, 0.12);
    border-color: rgba(76, 130, 255, 0.28);
    box-shadow: none;
  }
}

@keyframes homePublishBtnSuccess {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.06);
    filter: brightness(1.15);
  }
  100% {
    transform: scale(1);
    filter: none;
  }
}

@keyframes homeCelebrationIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes homeCelebrationOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes homeCelebrationCardIn {
  0% {
    opacity: 0;
    transform: scale(0.82) translateY(24px);
    filter: blur(8px);
  }
  70% {
    transform: scale(1.04) translateY(-4px);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes homeCelebrationGlow {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

@keyframes homeCheckCircle {
  0% {
    stroke-dashoffset: 166;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes homeCheckPath {
  0% {
    stroke-dashoffset: 48;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes homeCelebrationUrlIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
    letter-spacing: 0.2em;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 0.02em;
  }
}

@keyframes homeConfettiFall {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--p-dx, 0), var(--p-dy, 120px)) rotate(540deg) scale(0.3);
  }
}

body.home-motion .home-publish-hub.home-publish-hub--busy,
body.home-motion .home-publish-modal__panel.home-publish-hub--busy {
  animation: homePublishHubBusy 1.6s ease-in-out infinite;
  border-radius: 16px;
}

body.home-motion .home-publish-hub.home-publish-hub--success {
  animation: homePublishHubSuccess 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.home-motion #studioPanelPublish.home-publish-panel--success {
  animation: homePublishPanelSuccess 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.home-motion .home-publish-share-wrap.home-publish-share--enter,
body.home-motion .home-publish-result.home-publish-share--enter {
  animation: homePublishShareEnter 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.home-motion .home-deploy-status.home-deploy-status--reveal {
  animation: homeDeployReveal 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.home-motion .home-module-flow__step.home-flow-step--celebrate {
  animation: homeFlowStepCelebrate 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

body.home-motion .home-publish-hub__suggestion.home-publish-suggestion--glow {
  animation: homePublishSuggestionGlow 1.1s ease both;
}

body.home-motion .home-publish-one-click.home-publish-btn--success {
  animation: homePublishBtnSuccess 0.65s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

body.home-motion .home-publish-sticky__badge.home-publish-sticky__badge--live {
  animation: homeBadgePop 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  display: inline-block;
}

/* Stepper de progression */
.home-publish-stepper {
  margin: 0.5rem 0 0.35rem;
}

.home-publish-stepper__track {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  position: relative;
  z-index: 1;
}

.home-publish-stepper__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  min-width: 0;
  opacity: 0.45;
  transition: opacity 0.3s ease;
}

.home-publish-stepper__step.is-active,
.home-publish-stepper__step.is-done {
  opacity: 1;
}

.home-publish-stepper__dot {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.18);
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
}

.home-publish-stepper__step.is-done .home-publish-stepper__dot {
  background: rgba(52, 199, 89, 0.2);
  border-color: #34c759;
  color: #34c759;
}

.home-publish-stepper__step.is-active .home-publish-stepper__dot {
  background: rgba(41, 151, 255, 0.22);
  border-color: #2997ff;
  color: #7ec8ff;
  animation: homePublishStepPulse 1.2s ease-in-out infinite;
}

.home-publish-stepper__label {
  font-size: 0.68rem;
  text-align: center;
  line-height: 1.2;
  opacity: 0.85;
}

.home-publish-stepper__bar {
  height: 3px;
  margin: -1.1rem 0.8rem 0.65rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.home-publish-stepper__bar::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--home-publish-progress, 0) * 1%);
  border-radius: inherit;
  background: linear-gradient(90deg, #2997ff, #34c759);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-publish-stepper__status {
  margin: 0;
  font-size: 0.8rem;
  color: var(--apple-blue, #4c82ff);
  min-height: 1.2em;
}

body.home-publishing .home-publish-one-click.is-busy i {
  animation: homePublishStepPulse 1s ease-in-out infinite;
}

/* Overlay de célébration */
.home-publish-celebration {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  pointer-events: auto;
  animation: homeCelebrationIn 0.35s ease both;
}

.home-publish-celebration.is-leaving {
  animation: homeCelebrationOut 0.4s ease forwards;
  pointer-events: none;
}

.home-publish-celebration__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 18, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.home-publish-celebration__particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.home-publish-celebration__particle {
  position: absolute;
  width: var(--p-size, 8px);
  height: var(--p-size, 8px);
  border-radius: 2px;
  background: hsl(var(--p-hue, 210) 88% 62%);
  left: var(--p-x, 50%);
  top: 38%;
  opacity: 0;
  animation: homeConfettiFall 1.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  animation-delay: var(--p-delay, 0s);
}

.home-publish-celebration__card {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  padding: 2rem 1.75rem 1.75rem;
  border-radius: 20px;
  text-align: center;
  background: linear-gradient(165deg, rgba(28, 32, 48, 0.96), rgba(18, 20, 32, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(52, 199, 89, 0.15);
  animation: homeCelebrationCardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.home-publish-celebration__glow {
  position: absolute;
  inset: -40%;
  margin: auto;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(52, 199, 89, 0.35), transparent 70%);
  animation: homeCelebrationGlow 1.2s ease-out 0.15s both;
  pointer-events: none;
}

.home-publish-celebration__icon {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1rem;
}

.home-publish-celebration__check {
  width: 100%;
  height: 100%;
}

.home-publish-celebration__check-circle {
  stroke: #34c759;
  stroke-width: 2.5;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: homeCheckCircle 0.55s cubic-bezier(0.65, 0, 0.45, 1) 0.2s forwards;
}

.home-publish-celebration__check-path {
  stroke: #34c759;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: homeCheckPath 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.65s forwards;
}

.home-publish-celebration__kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #34c759;
}

.home-publish-celebration__title {
  margin: 0 0 0.75rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.home-publish-celebration__url {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #7ec8ff;
  word-break: break-all;
  animation: homeCelebrationUrlIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.85s both;
}

.home-publish-celebration__hint {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  body.home-motion .home-reveal,
  body.home-motion .home-studio-panel.home-panel--enter,
  body.home-motion .home-start-subpanel.home-subpanel--enter,
  body.home-motion .home-preview-viewport.home-preview--insert,
  body.home-motion .home-site-preview.home-site-preview--insert,
  body.home-motion .home-preview-badge.home-badge--pop,
  body.home-motion #modulePreview.home-draft--exit,
  body.home-motion .home-publish-hub.home-publish-hub--busy,
  body.home-motion .home-publish-hub.home-publish-hub--success,
  body.home-motion #studioPanelPublish.home-publish-panel--success,
  body.home-motion .home-publish-share-wrap.home-publish-share--enter,
  body.home-motion .home-publish-result.home-publish-share--enter,
  body.home-motion .home-deploy-status.home-deploy-status--reveal,
  body.home-motion .home-module-flow__step.home-flow-step--celebrate,
  body.home-motion .home-publish-hub__suggestion.home-publish-suggestion--glow,
  body.home-motion .home-publish-one-click.home-publish-btn--success,
  body.home-motion .home-publish-sticky__badge.home-publish-sticky__badge--live {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
    transition: none !important;
    outline: none !important;
  }

  .home-publish-celebration {
    display: none !important;
  }

  .home-publish-stepper__step.is-active .home-publish-stepper__dot {
    animation: none !important;
  }
}
