/* Timing for Animate.css. The motion itself comes from animate.min.css. */

:root {
  --animate-duration: 0.9s;
}

.stat strong {
  display: inline-block;
  min-width: 2.6ch;
  font-variant-numeric: tabular-nums;
}

.hero-bottom span {
  display: inline-block;
}

/* Scroll-driven blocks stay invisible until their Animate.css entrance runs. */
.is-waiting {
  opacity: 0;
  visibility: hidden;
}

.animate__animated {
  visibility: visible;
}

/* Images: wipe + slow zoom-out reveal on scroll (down reveals from the bottom, up from the top). */
@keyframes motionImgReveal {
  from {
    clip-path: inset(100% 0 0 0);
    transform: scale(1.18);
  }
  to {
    clip-path: inset(0 0 0 0);
    transform: scale(1);
  }
}

@keyframes motionImgRevealUp {
  from {
    clip-path: inset(0 0 100% 0);
    transform: scale(1.18);
  }
  to {
    clip-path: inset(0 0 0 0);
    transform: scale(1);
  }
}

.animate__animated.motion-img-reveal,
.animate__animated.motion-img-reveal-up {
  --animate-duration: 1.1s;
  animation-duration: var(--animate-duration);
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: 1;
  animation-fill-mode: both;
}

.animate__animated.motion-img-reveal {
  animation-name: motionImgReveal;
}

.animate__animated.motion-img-reveal-up {
  animation-name: motionImgRevealUp;
}

/* Images: hover motion. */
.card img,
.role-summary img,
.industry-grid img,
.banner-link img,
.brand img {
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.7s ease;
  will-change: transform;
}

.card > a {
  overflow: hidden;
}

.card:hover img {
  transform: scale(1.07);
}

.blogs .card:hover img {
  filter: saturate(1.2) contrast(1.05);
}

.brand:hover img {
  transform: scale(1.1) rotate(-4deg);
}

.industry-grid article:hover img {
  transform: scale(1.12) rotate(-6deg);
}

.role-summary img:hover {
  transform: scale(1.05) rotate(1.5deg);
}

.banner-link:hover img {
  transform: scale(1.02);
  filter: brightness(1.08);
}

/* Portraits float gently once they are on screen. */
@keyframes motionFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.hero-portrait > img,
.education-intro img {
  animation: motionFloat 6s ease-in-out 1s infinite;
}

/* Decorative shapes (assets/images/shapes) injected by motion.js. */
.has-shapes {
  position: relative;
  overflow: hidden;
}

.has-shapes > :not(.shape-layer) {
  position: relative;
  z-index: 1;
}

.shape-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  will-change: transform;
}

.shape > img {
  width: 100%;
  height: auto;
  display: block;
}

.shape.shape-bg {
  inset: 0;
  width: 100%;
  height: 100%;
}

.shape.shape-bg > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sparkle tucked against section headings; curly arrow pointing at the contact heading. */
.section h2 {
  position: relative;
}

.h2-spark {
  position: absolute;
  left: -1.4rem;
  top: -1.3rem;
  width: 34px;
  pointer-events: none;
  animation: shapeTwinkle 3.4s ease-in-out infinite;
}

.h2-arrow {
  position: absolute;
  right: -7.5rem;
  top: -1.5rem;
  width: 96px;
  pointer-events: none;
  filter: invert(1);
  opacity: 0.8;
  animation: shapeSway 6s ease-in-out infinite;
}

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

@keyframes shapeSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shapeSway {
  0%,
  100% {
    transform: rotate(-8deg) translateX(0);
  }
  50% {
    transform: rotate(8deg) translateX(10px);
  }
}

@keyframes shapeDrift {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(26px);
  }
}

@keyframes shapeTwinkle {
  0%,
  100% {
    transform: scale(0.75) rotate(0deg);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.15) rotate(25deg);
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .shape.shape-lg {
    display: none;
  }
  /* Smaller, quieter shapes so they sit behind the stacked mobile text. */
  .shape:not(.shape-bg) > img {
    width: 70%;
    opacity: 0.45 !important;
  }
}

@media (max-width: 991px) {
  .h2-arrow {
    display: none;
  }
}
