/* =============================================
   CITISTONE — Animation Styles
   ============================================= */

/* --- Keyframes --- */
@keyframes scroll-line {
  0%, 100% {
    transform: scaleY(0);
    transform-origin: top;
  }
  50% {
    transform: scaleY(1);
    transform-origin: top;
  }
  51% {
    transform-origin: bottom;
  }
  100% {
    transform: scaleY(0);
    transform-origin: bottom;
  }
}

@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
  50% { box-shadow: 0 0 0 15px rgba(212, 175, 55, 0); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes imageReveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes textReveal {
  from {
    transform: translateY(110%);
  }
  to {
    transform: translateY(0);
  }
}

/* --- Initial Hidden States (GSAP will animate in) --- */
[data-animate="fade-up"] {
  opacity: 0;
  transform: translateY(40px);
}

.hero__actions[data-animate="fade-up"],
.hero__actions[data-animate="fade-up"] .btn,
.hero__actions[data-animate="fade-up"] .btn * {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

[data-animate="fade-in"] {
  opacity: 0;
}

[data-animate="scale-in"] {
  opacity: 0;
  transform: scale(0.9);
}

[data-animate="slide-left"] {
  opacity: 0;
  transform: translateX(-60px);
}

[data-animate="slide-right"] {
  opacity: 0;
  transform: translateX(60px);
}

[data-animate="image-reveal"] {
  clip-path: inset(0 100% 0 0);
}

[data-animate="text-reveal"] {
  display: inline-block;
  overflow: hidden;
}

[data-animate="text-reveal"] > span,
.hero__title-line[data-animate="text-reveal"] {
  display: inline-block;
  transform: translateY(110%);
}

/* --- Animated State (fallback if JS fails) --- */
.animated {
  opacity: 1 !important;
  transform: none !important;
  clip-path: inset(0 0 0 0) !important;
}

/* --- Page Transition --- */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: var(--color-dark);
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
}

.page-transition.active {
  animation: pageTransitionIn 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.page-transition.exit {
  animation: pageTransitionOut 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
  transform-origin: top;
}

@keyframes pageTransitionIn {
  0% { transform: scaleY(0); transform-origin: bottom; }
  50% { transform: scaleY(1); transform-origin: bottom; }
  51% { transform: scaleY(1); transform-origin: top; }
  100% { transform: scaleY(0); transform-origin: top; }
}

@keyframes pageTransitionOut {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* --- Parallax Elements --- */
[data-parallax] {
  will-change: transform;
}

/* --- Grid items initial state (GSAP stagger) --- */
.project-card,
.team-card,
.gallery__item,
.blog-card {
  opacity: 0;
  transform: translateY(30px);
}

/* --- Hover Micro-interactions --- */
.service-card,
.project-card,
.team-card,
.blog-card,
.why-us__card {
  will-change: transform;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }

  .hero__scroll-line {
    animation: none;
  }
}

/* --- Standalone Page Animations (404, Coming Soon) --- */
.standalone-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.standalone-page__bg {
  position: absolute;
  inset: 0;
  background: var(--color-dark);
}

.standalone-page__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(212, 175, 55, 0.08) 0%, transparent 60%);
}

.standalone-page__content {
  position: relative;
  z-index: 1;
  padding: 2rem;
}

.standalone-page__code {
  font-family: var(--font-display);
  font-size: clamp(6rem, 20vw, 12rem);
  font-weight: 300;
  color: var(--color-gold);
  line-height: 1;
  opacity: 0;
  animation: fadeInUp 1s ease 0.3s forwards;
}

.standalone-page__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--color-white);
  margin: 1rem 0;
  opacity: 0;
  animation: fadeInUp 1s ease 0.6s forwards;
}

.standalone-page__desc {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto 2rem;
  opacity: 0;
  animation: fadeInUp 1s ease 0.9s forwards;
}

.standalone-page__actions {
  opacity: 0;
  animation: fadeInUp 1s ease 1.2s forwards;
}

/* --- Countdown (Coming Soon) --- */
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 4vw, 3rem);
  margin: 3rem 0;
}

.countdown__item {
  text-align: center;
}

.countdown__number {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--color-gold);
  line-height: 1;
}

.countdown__label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-accent);
  border: 1px solid var(--color-gold);
  color: var(--color-white);
  padding: 1rem 2rem;
  font-size: 0.9rem;
  z-index: 9700;
  opacity: 0;
  transition: all 0.4s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Performance hints for hero to reduce scroll jank --- */
.hero__video {
  will-change: transform;
  transform: translateZ(0);
}

.hero__title-line,
[data-animate="text-reveal"] > span {
  will-change: transform;
}
