/* ============================================================
   PORTFOLIO ANIMATIONS
   Grain · Hero entrance · Marquee · Card reveals · Hover FX
   ============================================================ */

/* ── Grain texture overlay on hero ─────────────────────────── */
.masthead {
  position: relative;
  overflow: hidden;
}
.masthead::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}
.masthead .container {
  position: relative;
  z-index: 1;
}

/* ── Hero: "PRODUCT DESIGN" label fade in ───────────────────── */
.hero-label {
  opacity: 0;
  animation: heroFadeIn 0.45s ease 0.15s forwards;
}

/* ── Hero: photo column wipe-in (curtain rising) ────────────── */
.hero-photo-col {
  clip-path: inset(0 0 100% 0);
  animation: heroImageReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

@keyframes heroImageReveal {
  to { clip-path: inset(0 0 0% 0); }
}

/* ── Hero: headline word-by-word slide up ───────────────────── */
.hero-word {
  display: inline-block;
  overflow: hidden;
  /* extra bottom padding prevents descenders from clipping */
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
  vertical-align: top;
}
.hero-word-inner {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
}
#hero-headline.hero-animate .hero-word-inner {
  animation: wordSlideUp 0.72s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes wordSlideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ── Hero: block fade-up (for headlines with child elements) ── */
.hero-block-fadein {
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}

/* ── Hero: sub-description fade up ─────────────────────────── */
.hero-subtext {
  opacity: 0;
  transform: translateY(14px);
  animation: heroFadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

@keyframes heroFadeIn  { to { opacity: 1; } }
@keyframes heroFadeUp  { to { opacity: 1; transform: translateY(0); } }

/* ── Marquee skills band ────────────────────────────────────── */
.marquee-section {
  overflow: hidden;
  background-color: #FAFAFA;
  border-top: 1px solid #E5E7EB;
  padding: 0.65rem 0;
  user-select: none;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 32s linear infinite;
}
.marquee-track:hover {
  animation-play-state: paused;
}
.marquee-item {
  white-space: nowrap;
  padding: 0 0.5rem;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #9CA3AF;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.marquee-item::before {
  content: '·';
  color: #B45309;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Case study cards: image clip-path reveal on scroll ─────── */
.case-study-thumb-container {
  overflow: hidden;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
}
.scroll-reveal.revealed .case-study-thumb-container {
  clip-path: inset(0 0 0% 0);
}

/* ── Case study cards: hover lift ──────────────────────────── */
#case-studies .mb-5 > .row {
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}
#case-studies .mb-5:hover > .row {
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

/* ── "View Case Study" link: slide right on hover ───────────── */
a.view-cs-link {
  display: inline-block !important;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
a.view-cs-link:hover {
  transform: translateX(5px);
}

/* ── "Let's Connect" button: shimmer on hover ───────────────── */
.looking-for-connect-btn {
  position: relative;
  overflow: hidden;
}
.looking-for-connect-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.3s ease;
}
.looking-for-connect-btn:hover::after {
  background: rgba(255, 255, 255, 0.13);
}

/* ── Respect reduced-motion preference ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-label,
  .hero-word-inner,
  .hero-subtext,
  .hero-block-fadein {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .marquee-track {
    animation: none !important;
  }
  .case-study-thumb-container {
    clip-path: none !important;
    transition: none !important;
  }
  #case-studies .mb-5 > .row {
    transition: none !important;
  }
}
