﻿/* =========================================================
   OnRemark — Enhanced Animations & Micro-interactions
   Intentional movement without noise
   ========================================================= */

/* ---------- Scroll Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

/* Scroll-triggered animation classes */
.animate-on-scroll {
  opacity: 0;
  will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
  animation: fadeInUp 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.animate-on-scroll.from-left.is-visible {
  animation: fadeInLeft 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.animate-on-scroll.from-right.is-visible {
  animation: fadeInRight 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.animate-on-scroll.scale.is-visible {
  animation: scaleIn 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* Staggered delays for grid items */
.animate-on-scroll:nth-child(1) { animation-delay: 0ms; }
.animate-on-scroll:nth-child(2) { animation-delay: 100ms; }
.animate-on-scroll:nth-child(3) { animation-delay: 200ms; }
.animate-on-scroll:nth-child(4) { animation-delay: 300ms; }
.animate-on-scroll:nth-child(5) { animation-delay: 400ms; }
.animate-on-scroll:nth-child(6) { animation-delay: 500ms; }

/* ---------- Enhanced Button Interactions ---------- */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn--primary {
  position: relative;
  background-size: 200% auto;
  background-image: linear-gradient(118deg, #F89244 0%, #E06A2A 50%, #F89244 100%);
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* ---------- Card Hover Effects ---------- */
.proof-card, .fit-tile, .ops-chip, .pe-card {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1), 
              box-shadow 0.3s cubic-bezier(0.22, 0.61, 0.36, 1),
              border-color 0.3s ease;
}

.proof-card::after, .fit-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, var(--orange), var(--violet));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.proof-card:hover::after, .fit-tile:hover::after {
  opacity: 0.6;
}

/* ---------- Hero Enhancements ---------- */
.hero-badge {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.hero-badge .dot {
  animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 3px var(--orange-tint); }
  50% { box-shadow: 0 0 0 6px var(--orange-tint), 0 0 12px var(--orange); }
}

/* ---------- Counter Animation ---------- */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ---------- Floating Elements ---------- */
.float-element {
  animation: float 6s ease-in-out infinite;
}

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

.float-element-delayed {
  animation: float 6s ease-in-out infinite;
  animation-delay: 1s;
}

/* ---------- Progress Bar Animation ---------- */
.progress-bar {
  width: 0%;
  transition: width 1.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.progress-bar.animated {
  width: var(--progress);
}

/* ---------- Typing Effect ---------- */
.typing-effect {
  overflow: hidden;
  border-right: 2px solid var(--orange);
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--orange); }
}

/* ---------- Smooth Language Transition ---------- */
.lang-transition {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lang-transition.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.lang-transition.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Interactive Dashboard Preview ---------- */
.dashboard-preview {
  position: relative;
  overflow: hidden;
}

.dashboard-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ---------- Tooltip Animation ---------- */
.tooltip {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.tooltip-trigger:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- Menu Animation ---------- */
.mega {
  transform-origin: top center;
}

.has-menu:hover .mega {
  animation: menuSlide 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes menuSlide {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* ---------- Number Counter Animation ---------- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.counter-animate {
  animation: countUp 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* ---------- Interactive Process Flow ---------- */
.process-step {
  position: relative;
}

.process-step::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -20px;
  width: 0;
  height: 2px;
  background: var(--orange);
  transition: width 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.process-step.active::after {
  width: 20px;
}

/* ---------- Card Tilt Effect ---------- */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.tilt-card:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(2deg);
}

/* ---------- Magnetic Button Effect ---------- */
.magnetic-btn {
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Text Reveal Animation ---------- */
.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.text-reveal.visible span {
  transform: translateY(0);
}

/* ---------- Image Parallax ---------- */
.parallax-img {
  transition: transform 0.1s linear;
}

/* ---------- Loading Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--cream-2) 25%, var(--sand) 50%, var(--cream-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Notification Badge Pulse ---------- */
.notification-badge {
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ---------- Smooth Scroll Behavior ---------- */
html {
  scroll-behavior: smooth;
}

/* ---------- Focus States for Accessibility ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* ---------- Reduced Motion Support ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}