

/* ==========================================================================
   ANIMATION SYSTEM — SCROLL REVEAL, MICRO-INTERACTIONS & ENTRANCE EFFECTS
   Perfectly tuned to the Warm Cream / Espresso design system.
   ========================================================================== */

/* --------------------------------------------------------------------------
   SCROLL REVEAL — BASE STATES (before intersection)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.reveal-left {
  transform: translateX(-32px);
}

.reveal.reveal-right {
  transform: translateX(32px);
}

.reveal.reveal-scale {
  transform: scale(0.94) translateY(12px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Stagger delays */
.reveal-stagger > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger > *:nth-child(2) { transition-delay: 0.13s; }
.reveal-stagger > *:nth-child(3) { transition-delay: 0.21s; }
.reveal-stagger > *:nth-child(4) { transition-delay: 0.29s; }
.reveal-stagger > *:nth-child(5) { transition-delay: 0.37s; }
.reveal-stagger > *:nth-child(6) { transition-delay: 0.45s; }
.reveal-stagger > *:nth-child(7) { transition-delay: 0.53s; }
.reveal-stagger > *:nth-child(8) { transition-delay: 0.61s; }
.reveal-stagger > *:nth-child(n+9) { transition-delay: 0.69s; }

/* --------------------------------------------------------------------------
   HERO ENTRANCE SEQUENCE
   -------------------------------------------------------------------------- */
@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes hero-card-drop {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-pill-badge           { animation: hero-fade-up 0.45s 0.02s both cubic-bezier(0.16,1,0.3,1); }
.hero-title                { animation: hero-fade-up 0.5s 0.08s both cubic-bezier(0.16,1,0.3,1); }
.hero-tagline              { animation: hero-fade-up 0.5s 0.14s both cubic-bezier(0.16,1,0.3,1); }
.hero-specialization-strip { animation: hero-fade-up 0.5s 0.20s both cubic-bezier(0.16,1,0.3,1); }
.hero-actions              { animation: hero-fade-up 0.5s 0.25s both cubic-bezier(0.16,1,0.3,1); }
.hero-metrics              { animation: hero-fade-up 0.5s 0.30s both cubic-bezier(0.16,1,0.3,1); }
.hero-visual               { animation: hero-card-drop 0.6s 0.10s both cubic-bezier(0.34,1.56,0.64,1); }

/* --------------------------------------------------------------------------
   AMBIENT FLOATING BACKGROUND BLOBS (Hero)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(90px);
}

.hero::before {
  width: 520px;
  height: 520px;
  top: -100px;
  right: -80px;
  background: radial-gradient(circle, rgba(245,158,11,0.09) 0%, transparent 70%);
  animation: blob-drift 10s ease-in-out infinite alternate;
}

.hero::after {
  width: 380px;
  height: 380px;
  bottom: -60px;
  left: -100px;
  background: radial-gradient(circle, rgba(245,158,11,0.06) 0%, transparent 70%);
  animation: blob-drift 13s 2s ease-in-out infinite alternate-reverse;
}

.hero .container {
  position: relative;
  z-index: 1;
}

@keyframes blob-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(28px, 18px) scale(1.08); }
}

/* --------------------------------------------------------------------------
   HERO CARD PARALLAX TILT
   -------------------------------------------------------------------------- */
.hero-card {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.hero-card:hover {
  box-shadow: 0 32px 60px -12px rgba(41,35,30,0.22), 0 0 0 1px rgba(245,158,11,0.2);
}

/* --------------------------------------------------------------------------
   METRIC NUMBER SHIMMER
   -------------------------------------------------------------------------- */
.metric-number {
  background: linear-gradient(90deg, var(--text-main) 0%, #F59E0B 50%, var(--text-main) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer-text 4s linear infinite;
}

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

/* --------------------------------------------------------------------------
   HIGHLIGHT TEXT — GRADIENT FLOW ANIMATION
   -------------------------------------------------------------------------- */
.hero-title .highlight-text {
  background: linear-gradient(120deg, #2E2721 0%, #F59E0B 40%, #FFB13B 60%, #2E2721 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-flow 6s linear infinite;
}

@keyframes gradient-flow {
  0%   { background-position: 0% center; }
  100% { background-position: 250% center; }
}

/* --------------------------------------------------------------------------
   PROJECT CARDS — HOVER LIFT & IMAGE ZOOM
   -------------------------------------------------------------------------- */
.insta-project-card {
  transition:
    transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.insta-project-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 45px -10px rgba(41,35,30,0.18),
    0 0 0 1.5px rgba(245,158,11,0.28);
}

.project-photo {
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.insta-project-card:hover .project-photo {
  transform: scale(1.045);
}

.card-demo-badge {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.insta-project-card:hover .card-demo-badge {
  transform: translateY(-2px) scale(1.06);
}

/* --------------------------------------------------------------------------
   SKILL BARS — ANIMATED FILL ON SCROLL
   -------------------------------------------------------------------------- */
.skill-bar-fill {
  width: 0 !important;
  transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.skill-bar-fill.bar-animated {
  width: var(--bar-width, 80%) !important;
}

/* --------------------------------------------------------------------------
   SECTION HEADERS — UNDERLINE DRAW
   -------------------------------------------------------------------------- */
.section-title {
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  height: 3px;
  width: 0;
  margin-top: 0.45rem;
  background: linear-gradient(90deg, var(--primary-accent), var(--bright-accent), transparent);
  border-radius: 9999px;
  transition: width 0.9s 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-header.is-visible .section-title::after {
  width: 72px;
}

/* --------------------------------------------------------------------------
   NAV LINKS — UNDERLINE SLIDE
   -------------------------------------------------------------------------- */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--primary-accent);
  border-radius: 9999px;
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 55%;
}

/* --------------------------------------------------------------------------
   GLASS PANELS — SHIMMER HOVER BORDER
   -------------------------------------------------------------------------- */
.glass-panel {
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    rgba(245,158,11,0) 0%,
    rgba(245,158,11,0.07) 50%,
    rgba(245,158,11,0) 100%
  );
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}

.glass-panel:hover::before {
  opacity: 1;
  animation: shimmer-panel 1.4s ease forwards;
}

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

/* --------------------------------------------------------------------------
   SPEC PILLS — HOVER LIFT
   -------------------------------------------------------------------------- */
.spec-pill {
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.spec-pill:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

/* --------------------------------------------------------------------------
   BADGE LIVE — RIPPLE EFFECT
   -------------------------------------------------------------------------- */
@keyframes live-ripple {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5), 0 0 6px #22C55E; }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0), 0 0 10px rgba(34,197,94,0.7); }
}

.badge-live::before {
  animation: live-ripple 2s infinite;
}

/* --------------------------------------------------------------------------
   TERMINAL CURSOR BLINK
   -------------------------------------------------------------------------- */
.terminal-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--primary-accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink-cursor 1.1s step-end infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* --------------------------------------------------------------------------
   FLOATING CHIP — GENTLE BOUNCE
   -------------------------------------------------------------------------- */
.floating-chip {
  animation: chip-bounce 4s ease-in-out infinite;
}

@keyframes chip-bounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%       { transform: translateY(-6px) rotate(1deg); }
}

/* --------------------------------------------------------------------------
   QUICK CONTACT BUTTONS — SLIDE ON HOVER
   -------------------------------------------------------------------------- */
.quick-contact-btn {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.quick-contact-btn:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 20px rgba(41,35,30,0.1);
}

/* --------------------------------------------------------------------------
   FOOTER SOCIAL ICONS — SPIN ON HOVER
   -------------------------------------------------------------------------- */
.footer-socials .btn:hover svg {
  animation: spin-once 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes spin-once {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(-20deg) scale(1.15); }
  100% { transform: rotate(0deg) scale(1); }
}

/* --------------------------------------------------------------------------
   MOBILE DOCK ACTIVE — BOUNCE ICON
   -------------------------------------------------------------------------- */
.mobile-dock-link.active svg {
  animation: dock-bounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dock-bounce {
  0%   { transform: translateY(0) scale(1); }
  40%  { transform: translateY(-5px) scale(1.15); }
  100% { transform: translateY(0) scale(1); }
}

/* --------------------------------------------------------------------------
   SKILL SCROLL CARDS — LIFT HOVER
   -------------------------------------------------------------------------- */
.skill-scroll-card {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease;
}

.skill-scroll-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px -8px rgba(41,35,30,0.14);
}

/* --------------------------------------------------------------------------
   AI PILL TABS — SCALE ON ACTIVE
   -------------------------------------------------------------------------- */
.ai-pill-btn {
  transition:
    background 0.22s ease,
    color 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-pill-btn.active {
  transform: scale(1.05);
}

/* --------------------------------------------------------------------------
   CURSOR GLOW (Desktop only)
   -------------------------------------------------------------------------- */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,0.055) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: transform 0.14s ease-out;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   GLASS TABS — ACTIVE SCALE
   -------------------------------------------------------------------------- */
.glass-tab-btn {
  position: relative;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.22s ease;
}

.glass-tab-btn.active {
  transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   CONTACT FORM — FOCUS GLOW
   -------------------------------------------------------------------------- */
.form-input:focus,
.form-textarea:focus {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18) !important;
  transition: box-shadow 0.25s ease;
}

/* --------------------------------------------------------------------------
   SUBMIT BUTTON — RIPPLE
   -------------------------------------------------------------------------- */
#btn-submit-contact {
  position: relative;
  overflow: hidden;
}

#btn-submit-contact::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.25);
  border-radius: inherit;
  transform: scale(0);
  opacity: 0;
}

#btn-submit-contact:active::after {
  animation: btn-ripple 0.5s ease forwards;
}

@keyframes btn-ripple {
  0%   { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* --------------------------------------------------------------------------
   REDUCED MOTION ACCESSIBILITY
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .reveal, .hero-pill-badge, .hero-title, .hero-tagline,
  .hero-specialization-strip, .hero-actions, .hero-metrics, .hero-visual,
  .floating-chip, .cursor-glow, .metric-number,
  .hero-title .highlight-text, .insta-project-card, .project-photo,
  .spec-pill, .glass-panel::before, .skill-bar-fill, .terminal-cursor,
  .hero::before, .hero::after {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
