/* ============================================================
   Hardinge Repair — Animations
   hr-animations.css
   ============================================================ */

/* ── Keyframes ── */
@keyframes hr-fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes hr-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes hr-slide-in-left {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes hr-slide-in-right {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes hr-scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes hr-pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 98, 26, 0); }
  50%       { box-shadow: 0 0 0 12px rgba(232, 98, 26, 0.15); }
}

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

@keyframes hr-spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

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

@keyframes hr-bar-grow {
  from { width: 0; }
}

@keyframes hr-counter-up {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes hr-underline-expand {
  from { width: 0; }
  to   { width: 100%; }
}

/* ── Hero Animations ── */
.hr-hero-content .hr-hero-label {
  animation: hr-fade-up 0.7s ease both;
  animation-delay: 0.2s;
}
.hr-hero-content .hr-hero-title {
  animation: hr-fade-up 0.8s ease both;
  animation-delay: 0.4s;
}
.hr-hero-content .hr-hero-desc {
  animation: hr-fade-up 0.8s ease both;
  animation-delay: 0.6s;
}
.hr-hero-content .hr-hero-actions {
  animation: hr-fade-up 0.8s ease both;
  animation-delay: 0.8s;
}
.hr-hero-stats {
  animation: hr-fade-in 1s ease both;
  animation-delay: 1s;
}
.hr-hero-accent-bar {
  animation: hr-slide-in-left 0.5s ease both;
  animation-delay: 0.1s;
}

/* ── Scroll-Reveal Base ── */
.hr-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
.hr-reveal.hr-in-view {
  opacity: 1;
  transform: translateY(0);
}

.hr-reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
.hr-reveal-left.hr-in-view {
  opacity: 1;
  transform: translateX(0);
}

.hr-reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
.hr-reveal-right.hr-in-view {
  opacity: 1;
  transform: translateX(0);
}

.hr-reveal-scale {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
.hr-reveal-scale.hr-in-view {
  opacity: 1;
  transform: scale(1);
}

/* ── Staggered Children ── */
.hr-stagger-children > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.hr-stagger-children.hr-in-view > *:nth-child(1)  { opacity: 1; transform: translateY(0); transition-delay: 0.05s; }
.hr-stagger-children.hr-in-view > *:nth-child(2)  { opacity: 1; transform: translateY(0); transition-delay: 0.12s; }
.hr-stagger-children.hr-in-view > *:nth-child(3)  { opacity: 1; transform: translateY(0); transition-delay: 0.19s; }
.hr-stagger-children.hr-in-view > *:nth-child(4)  { opacity: 1; transform: translateY(0); transition-delay: 0.26s; }
.hr-stagger-children.hr-in-view > *:nth-child(5)  { opacity: 1; transform: translateY(0); transition-delay: 0.33s; }
.hr-stagger-children.hr-in-view > *:nth-child(6)  { opacity: 1; transform: translateY(0); transition-delay: 0.40s; }
.hr-stagger-children.hr-in-view > *:nth-child(7)  { opacity: 1; transform: translateY(0); transition-delay: 0.47s; }
.hr-stagger-children.hr-in-view > *:nth-child(8)  { opacity: 1; transform: translateY(0); transition-delay: 0.54s; }

/* ── Shimmer Loading ── */
.hr-shimmer {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.03) 0%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.03) 100%
  );
  background-size: 200% auto;
  animation: hr-shimmer 2s linear infinite;
}

/* ── Floating Icon ── */
.hr-float-anim {
  animation: hr-float 3.5s ease-in-out infinite;
}

/* ── Pulse CTA ── */
.hr-pulse-anim {
  animation: hr-pulse-glow 2.5s ease-in-out infinite;
}

/* ── Page Load ── */
.hr-page-in {
  animation: hr-fade-in 0.4s ease both;
}

/* ── Hover Lift ── */
.hr-hover-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hr-hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.3);
}

/* ── Tilt on hover (JS handles CSS vars) ── */
.hr-tilt {
  transform-style: preserve-3d;
  transition: transform 0.2s ease;
}

/* ── Number counter ── */
.hr-count-up {
  display: inline-block;
}

/* ── Orange underline grow ── */
.hr-heading-line {
  position: relative;
  display: inline-block;
}
.hr-heading-line::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0;
  height: 3px;
  width: 0;
  background: var(--hr-gradient-accent);
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.hr-heading-line.hr-in-view::after { width: 100%; }

/* ── Hamburger transitions ── */
.hr-hamburger.hr-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hr-hamburger.hr-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hr-hamburger.hr-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Result card fade-in ── */
.hr-result-card {
  animation: hr-fade-up 0.4s ease both;
}
.hr-result-card:nth-child(1) { animation-delay: 0.05s; }
.hr-result-card:nth-child(2) { animation-delay: 0.12s; }
.hr-result-card:nth-child(3) { animation-delay: 0.19s; }

/* ── Quiz option press ── */
.hr-quiz-option:active {
  transform: scale(0.98);
}

/* ── Scroll progress bar ── */
.hr-scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--hr-gradient-accent);
  z-index: 10001;
  width: 0%;
  transition: width 0.1s linear;
}

/* ── Smooth page transitions ── */
.hr-page-transition {
  animation: hr-fade-in 0.35s ease both;
}

/* ── Image hover zoom ── */
.hr-img-zoom {
  overflow: hidden;
}
.hr-img-zoom img {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.hr-img-zoom:hover img {
  transform: scale(1.06);
}

/* ── Teal accent pill ── */
.hr-badge-teal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(26, 140, 140, 0.12);
  border: 1px solid rgba(34, 176, 176, 0.25);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hr-teal-light);
}

/* ── Responsive motion preference ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
