/* =============================================================================
   DIGITALWEBTONICS — animations.css
   All keyframes and animation classes
   ============================================================================= */


/* =============================================================================
   1. KEYFRAMES
   ============================================================================= */

/* --- Fade in up — base reveal motion --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Fade in — opacity only --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- Line draw — hero accent line grows left to right --- */
@keyframes lineDrawIn {
  from { width: 0; }
  to   { width: 48px; }
}

/* --- Scroll indicator bob — 3px vertical loop --- */
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(3px); }
}

/* --- Blog skeleton shimmer --- */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* --- Marquee scroll — tech stack rows --- */
@keyframes marqueeLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes marqueeRight {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* --- Process line draw — horizontal connector --- */
@keyframes processLineDraw {
  from { width: 0; }
  to   { width: 100%; }
}


/* =============================================================================
   2. PAGE LOAD SEQUENCE — Hero entrance
   ============================================================================= */

/* All elements start invisible via JS class .page-loaded on body */

/* Logo */
.nav__logo {
  animation: fadeInUp 0.5s ease 0.1s both;
}

/* Nav links — staggered */
.nav__link:nth-child(1) { animation: fadeIn 0.4s ease 0.30s both; }
.nav__link:nth-child(2) { animation: fadeIn 0.4s ease 0.34s both; }
.nav__link:nth-child(3) { animation: fadeIn 0.4s ease 0.38s both; }
.nav__link:nth-child(4) { animation: fadeIn 0.4s ease 0.42s both; }
.nav__link:nth-child(5) { animation: fadeIn 0.4s ease 0.46s both; }

.nav__cta {
  animation: fadeIn 0.4s ease 0.50s both;
}

/* Hero eyebrow label */
.hero__label {
  animation: fadeIn 0.4s ease 0.6s both;
}

/* Accent line draws in */
.hero__accent-line {
  animation: lineDrawIn 0.6s ease 0.65s both;
}

/* Hero H1 — line 1 */
.hero__h1-line1 {
  animation: fadeInUp 0.8s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)) 0.9s both;
}

/* Hero H1 — scramble word (line 2) */
.hero__h1-line2 {
  animation: fadeInUp 0.8s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)) 1.0s both;
}

/* Hero H1 — line 3 */
.hero__h1-line3 {
  animation: fadeInUp 0.8s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)) 1.05s both;
}

/* Hero H1 — line 4 */
.hero__h1-line4 {
  animation: fadeInUp 0.8s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)) 1.1s both;
}

/* Hero subtext */
.hero__sub {
  animation: fadeIn 0.6s ease 1.4s both;
}

/* Hero CTA buttons */
.hero__cta {
  animation: fadeInUp 0.6s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)) 1.7s both;
}

/* Scroll indicator */
.hero__scroll-indicator {
  animation: fadeIn 0.5s ease 2.0s both;
}

/* Scroll indicator chevron bobs */
.hero__scroll-chevron {
  animation: bob 2s ease-in-out 2.5s infinite;
}


/* =============================================================================
   3. TECH STACK MARQUEE
   ============================================================================= */

.marquee {
  overflow: hidden;
  width: 100%;
}

.marquee__track {
  display: flex;
  align-items: center;
  gap: 48px;
  width: max-content;
  will-change: transform;
}

.marquee--left .marquee__track {
  animation: marqueeLeft 30s linear infinite;
}

.marquee--right .marquee__track {
  animation: marqueeRight 30s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

/* Reduced motion — disable marquee scroll */
@media (prefers-reduced-motion: reduce) {
  .marquee--left .marquee__track,
  .marquee--right .marquee__track {
    animation: none;
  }
}


/* =============================================================================
   4. BLOG SKELETON SHIMMER
   ============================================================================= */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    var(--bg-elevated) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2.4s ease-in-out infinite;
}


/* =============================================================================
   5. PROCESS SECTION — Step connector line
   ============================================================================= */

.process__connector {
  height: 1px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}

.process__connector::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 1.2s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
}

.process__connector.animated::after {
  width: 100%;
}


/* =============================================================================
   6. HOVER TRANSITIONS — Card & button states
   ============================================================================= */

/* --- Cards --- */
.card {
  transition: border-color 0.3s ease,
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
  border-color: var(--border-mid);
  transform: translateY(-3px);
}

/* --- Product card — left border accent on hover --- */
.product-card {
  transition: border-left-color 0.3s ease,
              border-left-width 0.3s ease;
}

.product-card:hover {
  border-left-color: var(--accent);
  border-left-width: 2px;
}

/* --- Portfolio card image overlay --- */
.portfolio-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(124, 92, 252, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.portfolio-card:hover .portfolio-card__overlay {
  opacity: 1;
}

.portfolio-card__overlay-text {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fff;
}


/* =============================================================================
   7. NAV HAMBURGER — Open state
   ============================================================================= */

.nav__hamburger.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav__hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}


/* =============================================================================
   8. PORTFOLIO FILTER TABS
   ============================================================================= */

.filter-tab {
  transition: color 0.25s ease, border-color 0.25s ease;
}

.filter-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* --- Portfolio items hide/show --- */
.portfolio-card {
  transition: opacity 0.4s ease, transform 0.4s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
}

.portfolio-card.hidden {
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
  position: absolute;
}


/* =============================================================================
   9. REDUCED MOTION — Global override
   ============================================================================= */

@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;
  }

  .hero__scroll-chevron {
    animation: none;
  }
}
