/*
  FindMyService — animations.css
  NOTE: kept separate from main.css per Step 8 build instruction, so
  animation tweaks are isolated and easy to roll back without touching the
  design-token/layout file.
*/

/* ---------------------------------------------------------------------- */
/* Landing: "FMS" -> "FindMyService" morph (UI/UX Section 1)             */
/* ---------------------------------------------------------------------- */
.landing-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.fms-wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--ink);
  font-size: clamp(56px, 14vw, 128px);
  display: flex;
  white-space: nowrap;
}

/* Each letter/segment is its own span so it can be independently timed.
   NOTE: letters start heavily tracked-out and slightly rotated, like
   individual signboard letters not yet hung straight; they settle and
   the hidden syllables fade/expand in between them. */
.fms-wordmark .seg {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px) rotate(-3deg);
  animation: seg-settle 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.fms-wordmark .seg.expand {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  animation: seg-expand 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

/* stagger via inline --d custom property set in landing.js, fallback delays below */
.fms-wordmark .seg { animation-delay: var(--d, 0s); }

@keyframes seg-settle {
  to { opacity: 1; transform: translateY(0) rotate(0deg); }
}
@keyframes seg-expand {
  to { opacity: 1; max-width: 600px; }
}

.landing-tagline {
  opacity: 0;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink-soft);
  margin-top: 18px;
  animation: fade-up 0.6s ease forwards;
  animation-delay: 1.9s;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Start-screen reveal, triggered by JS adding .is-visible after the morph */
.start-screen {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}
.start-screen.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.landing-stage.is-condensed .fms-hero { transform: scale(0.6); transition: transform 0.5s ease; }

/* ---------------------------------------------------------------------- */
/* AI verification page — animated "stamping" confirmation (UI/UX 4.2)   */
/* ---------------------------------------------------------------------- */
.verify-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.verify-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--teal);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.verify-result {
  opacity: 0;
  transform: translateY(10px);
}
.verify-result.reveal {
  animation: fade-up 0.5s ease forwards;
}

/* Stamp mark that "thunks" down once the AI result is ready — echoes the
   signage/stamp vernacular used across the app rather than a generic
   checkmark pop */
.stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--teal);
  color: var(--teal);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  transform: scale(2.2) rotate(-8deg);
  opacity: 0;
  animation: stamp-down 0.35s cubic-bezier(0.3, 1.6, 0.4, 1) forwards;
  animation-delay: 0.15s;
}
@keyframes stamp-down {
  to { transform: scale(1) rotate(-8deg); opacity: 1; }
}

/* ---------------------------------------------------------------------- */
/* Shared micro-interactions                                             */
/* ---------------------------------------------------------------------- */
.fade-in { animation: fade-up 0.5s ease forwards; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
