/* Zastrolo motion layer. Everything here is decorative and switches off for reduced-motion visitors. */
@property --score { syntax: '<percentage>'; inherits: true; initial-value: 0%; }

/* Step 2: birth details glide in */
.z-reveal { animation: z-rise .55s cubic-bezier(.2,.7,.2,1) both; }
@keyframes z-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Question box: soft golden glow while typing */
#question-input { transition: box-shadow .4s ease, border-color .4s ease; }
#question-input:focus { box-shadow: 0 0 0 3px #d8b46a33, 0 0 28px #d8b46a40; border-color: #c9a35b; }

/* Primary buttons: a slow light sweep, like starlight across glass */
.step-next, #reading-form .form-button { position: relative; overflow: hidden; }
.step-next::after, #reading-form .form-button::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, #ffffff55 50%, transparent 65%);
  transform: translateX(-120%); animation: z-sweep 4.5s ease-in-out 1.5s infinite;
}
@keyframes z-sweep { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* Shooting stars in the hero sky */
.z-shooting { position: absolute; top: 0; left: 0; width: 120px; height: 2px; pointer-events: none; z-index: 0;
  background: linear-gradient(90deg, #fff0, #fff8e0 70%, #fff); border-radius: 2px; opacity: 0;
  filter: drop-shadow(0 0 6px #ffe9b0); animation: z-shoot 1.4s ease-out forwards; }
@keyframes z-shoot {
  0% { opacity: 0; transform: translate(var(--x0), var(--y0)) rotate(-28deg) scaleX(.3); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(var(--x0) + 420px), calc(var(--y0) + 220px)) rotate(28deg) scaleX(1); }
}

/* Waiting for the answer: planets orbit while the reading is prepared */
.z-orbit { display: grid; place-items: center; gap: 14px; padding: 28px 0; color: inherit; text-align: center; }
.z-orbit-sky { position: relative; width: 110px; height: 110px; }
.z-orbit-sky .sun { position: absolute; inset: 42px; border-radius: 50%; background: radial-gradient(#ffe6a6, #d9a446); box-shadow: 0 0 22px #e9b95a; }
.z-orbit-sky .ring { position: absolute; border: 1px dashed #c9a35b66; border-radius: 50%; animation: z-spin linear infinite; }
.z-orbit-sky .ring::before { content: ''; position: absolute; top: -5px; left: calc(50% - 5px); width: 10px; height: 10px; border-radius: 50%; background: #9fb7d9; box-shadow: 0 0 10px #9fb7d9; }
.z-orbit-sky .r1 { inset: 26px; animation-duration: 2.2s; }
.z-orbit-sky .r2 { inset: 10px; animation-duration: 3.6s; }
.z-orbit-sky .r2::before { background: #e8a1a1; box-shadow: 0 0 10px #e8a1a1; }
.z-orbit-sky .r3 { inset: -4px; animation-duration: 5.4s; }
.z-orbit-sky .r3::before { background: #c9a35b; box-shadow: 0 0 10px #c9a35b; }
@keyframes z-spin { to { transform: rotate(360deg); } }
.z-orbit p { margin: 0; font-size: 14px; opacity: .8; transition: opacity .3s; }

/* Result: the score ring fills, then each block rises in turn */
.score-ring { animation: z-ring 1.6s cubic-bezier(.2,.8,.2,1) .2s backwards; transition: --score 1s ease; }
@keyframes z-ring { from { --score: 0%; } }
.reading-output > .z-stagger { animation: z-rise .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 90ms); }

/* Sections float up as you scroll */
.z-scroll { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.z-scroll.z-in { opacity: 1; transform: none; }

/* Typed example questions in the empty box */
#question-input.z-typing::placeholder { color: #8a7a5c; }

@media (prefers-reduced-motion: reduce) {
  .z-reveal, .reading-output > .z-stagger { animation: none; }
  .z-scroll { opacity: 1; transform: none; transition: none; }
  .step-next::after, #reading-form .form-button::after, .z-shooting { display: none; }
  .z-orbit-sky .ring { animation-duration: 0s; }
  .score-ring { animation: none; transition: none; }
}
