/* ============================================
   PORTFOLIO — ANIMATIONS CSS
   Scroll reveals, parallax, hover states,
   staggered entrances, and micro-interactions
   ============================================ */

/* =====================
   REVEAL BASE STATES
   Elements start hidden; JS adds .visible
   ===================== */
.reveal-up {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Visible state */
.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible,
.reveal-scale.visible {
  opacity: 1;
  transform: none;
}

/* =====================
   STAGGER DELAYS
   ===================== */
.delay-0  { transition-delay: 0ms; }
.delay-1  { transition-delay: 120ms; }
.delay-2  { transition-delay: 240ms; }
.delay-3  { transition-delay: 360ms; }
.delay-4  { transition-delay: 480ms; }
.delay-5  { transition-delay: 600ms; }

/* Auto-stagger children inside grids */
.photo-grid .photo-card:nth-child(1) { transition-delay: 0ms; }
.photo-grid .photo-card:nth-child(2) { transition-delay: 100ms; }
.photo-grid .photo-card:nth-child(3) { transition-delay: 200ms; }
.photo-grid .photo-card:nth-child(4) { transition-delay: 300ms; }

.jump-grid .jump-card:nth-child(1) { transition-delay: 0ms; }
.jump-grid .jump-card:nth-child(2) { transition-delay: 150ms; }
.jump-grid .jump-card:nth-child(3) { transition-delay: 300ms; }

.bonus-grid .bonus-card:nth-child(1) { transition-delay: 0ms; }
.bonus-grid .bonus-card:nth-child(2) { transition-delay: 120ms; }
.bonus-grid .bonus-card:nth-child(3) { transition-delay: 240ms; }

.quotes-grid .quote-card:nth-child(1) { transition-delay: 0ms; }
.quotes-grid .quote-card:nth-child(2) { transition-delay: 100ms; }
.quotes-grid .quote-card:nth-child(3) { transition-delay: 200ms; }

.composition-rules .rule-card:nth-child(1) { transition-delay: 0ms; }
.composition-rules .rule-card:nth-child(2) { transition-delay: 100ms; }
.composition-rules .rule-card:nth-child(3) { transition-delay: 200ms; }

/* =====================
   HERO ANIMATIONS
   ===================== */
@keyframes hero-fade-in {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow { animation: hero-fade-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both; }
.hero-title   { animation: hero-fade-in 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both; }
.hero-subtitle{ animation: hero-fade-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both; }
.hero-cta     { animation: hero-fade-in 1s cubic-bezier(0.16, 1, 0.3, 1) 1s both; }
.hero-stats   { animation: hero-fade-in 1s cubic-bezier(0.16, 1, 0.3, 1) 1.2s both; }
.hero-scroll-hint { animation: hero-fade-in 1s cubic-bezier(0.16, 1, 0.3, 1) 1.5s both; }

/* Hero title lines stagger */
.hero-title-line {
  display: block;
  clip-path: inset(0 100% 0 0);
  animation: title-slide-in 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-title-line:nth-child(1) { animation-delay: 0.4s; }
.hero-title-line:nth-child(2) { animation-delay: 0.6s; }
.hero-title-line:nth-child(3) { animation-delay: 0.8s; }

@keyframes title-slide-in {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

/* =====================
   PARALLAX LAYERS
   (applied via JS on scroll)
   ===================== */
.parallax-slow { will-change: transform; }
.parallax-med  { will-change: transform; }
.parallax-fast { will-change: transform; }

/* =====================
   PHOTO CARD HOVER
   ===================== */
.photo-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.photo-card:hover {
  transform: translateY(-6px);
  z-index: 2;
}

/* Image reveal on load — fade in when ready */
.photo-img {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.photo-img.loaded {
  opacity: 1;
}

/* =====================
   SECTION NUMBER FLOAT
   ===================== */
.project-number {
  animation: number-drift 8s ease-in-out infinite;
}
@keyframes number-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* =====================
   NAV SCROLL INDICATOR
   ===================== */
.nav-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 200;
  width: 0%;
  transition: width 0.1s linear;
}

/* =====================
   STAT NUMBER COUNT-UP
   ===================== */
.stat-num {
  display: inline-block;
  transition: transform 0.3s;
}
.stat-num.pop {
  animation: stat-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes stat-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* =====================
   MARQUEE PAUSE ON HOVER
   ===================== */
.marquee-strip:hover .marquee-track {
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* =====================
   WATER RIPPLE HOVER
   ===================== */
.water-frame {
  transition: box-shadow 0.4s;
}
.water-frame:hover {
  box-shadow: 0 0 60px rgba(200, 169, 122, 0.15);
}

/* =====================
   HONEY SCALE HOVER
   ===================== */
.honey-card {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.honey-card:hover {
  transform: translateY(-8px) !important;
}

/* =====================
   QUOTE CARD HOVER
   ===================== */
.quote-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s,
              border-color 0.3s;
}
.quote-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
  border-left-color: var(--accent-dark);
}

/* =====================
   RULE CARD HOVER
   ===================== */
.rule-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s,
              border-color 0.3s;
  cursor: default;
}
.rule-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0,0,0,0.07);
  border-color: var(--accent);
}
.rule-card:hover .rule-icon {
  animation: rule-icon-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes rule-icon-bounce {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3) rotate(-5deg); }
  100% { transform: scale(1); }
}

/* =====================
   Q&A ACCORDION ANIMATION
   ===================== */
.qa-question {
  position: relative;
  overflow: hidden;
}
.qa-question::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.qa-item.open .qa-question::after {
  transform: scaleX(1);
}

/* =====================
   SECTION TRANSITIONS
   Smooth color bg shift
   ===================== */
@keyframes section-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* =====================
   CONTACT CIRCLES PULSE
   ===================== */
.contact-circle {
  animation: circle-pulse 6s ease-in-out infinite;
}
.c1 { animation-delay: 0s; }
.c2 { animation-delay: 2s; }
.c3 { animation-delay: 4s; }
@keyframes circle-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

/* =====================
   GRAIN OVERLAY FLICKER
   (hero bg noise texture)
   ===================== */
.grain {
  animation: grain-drift 8s steps(1) infinite,
             grain-flicker 0.08s steps(1) infinite;
}
@keyframes grain-flicker {
  0%   { opacity: 0.35; }
  33%  { opacity: 0.42; }
  66%  { opacity: 0.38; }
  100% { opacity: 0.40; }
}

/* =====================
   MOBILE MENU LINK HOVER
   ===================== */
.mobile-nav-link {
  position: relative;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              color 0.3s;
}
.mobile-nav-link:hover {
  transform: translateX(16px);
}

/* =====================
   LIGHTBOX ANIMATION
   ===================== */
.lightbox-inner {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.5s;
  transform: scale(0.9);
  opacity: 0;
}
.lightbox.open .lightbox-inner {
  transform: scale(1);
  opacity: 1;
}

/* =====================
   BONUS CARD HOVER
   ===================== */
.bonus-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s;
}
.bonus-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(0,0,0,0.08);
}
.bonus-card:hover .bonus-icon {
  animation: icon-spin 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes icon-spin {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(-15deg) scale(1.2); }
  100% { transform: rotate(0deg) scale(1); }
}

/* =====================
   NAV LINK ACTIVE STATE
   (section in view)
   ===================== */
.nav-link.active {
  color: var(--text-dark);
}
.nav-link.active::after {
  transform: scaleX(1);
}


/* =====================
   SCROLL PROGRESS BAR
   ===================== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(to right, var(--accent), var(--accent-2));
  z-index: 9999;
  width: 0%;
  transition: width 0.05s linear;
  pointer-events: none;
}

/* =====================
   PAGE LOAD OVERLAY
   ===================== */
.page-loader {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 24px;
}
.loader-text {
  font-family: var(--font-display);
  font-size: 48px; font-style: italic;
  color: var(--text);
  letter-spacing: -0.02em;
}
.loader-bar {
  width: 200px; height: 1px;
  background: var(--border);
  position: relative; overflow: hidden;
}
.loader-bar::after {
  content: '';
  position: absolute; left: -100%; top: 0;
  width: 100%; height: 100%;
  background: var(--accent);
  animation: loader-sweep 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}
@keyframes loader-sweep {
  from { left: -100%; }
  to   { left: 0%; }
}
.page-loader.done {
  animation: loader-exit 0.6s cubic-bezier(0.7, 0, 1, 1) 0.2s both;
}
@keyframes loader-exit {
  from { clip-path: inset(0 0 0 0); }
  to   { clip-path: inset(0 0 100% 0); }
}


/* =====================
   JUMP CARD FLOAT ANIM
   ===================== */
.jump-card:nth-child(1) { animation: float-1 6s ease-in-out infinite; }
.jump-card:nth-child(2) { animation: float-2 7s ease-in-out infinite 1s; }
.jump-card:nth-child(3) { animation: float-3 5.5s ease-in-out infinite 0.5s; }

@keyframes float-1 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(0.3deg); }
}
@keyframes float-2 {
  0%, 100% { transform: translateY(var(--offset, 30px)) rotate(0deg); }
  50% { transform: translateY(calc(var(--offset, 30px) - 14px)) rotate(-0.3deg); }
}
@keyframes float-3 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(0.2deg); }
}

/* Pause float on hover */
.jump-card:hover {
  opacity: 0;
  transition: opacity 0.6s ease;
  transform: translateY(-8px) !important;
}

/* =====================
   SECTION LABEL FADE
   ===================== */
.section-label-vertical {
  opacity: 0;
  animation: label-fade-in 1s ease 0.5s both;
}
@keyframes label-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* =====================
   DIVIDER DOT PULSE
   ===================== */
.divider-dot {
  animation: dot-pulse 3s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.6; }
}

/* =====================
   MEDIA — REDUCED MOTION
   ===================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal-up, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1;
    transform: none;
  }
}
