/* =========================================================
   TAYLOR REIS — PORTFOLIO
   Animations
========================================================= */

/* =========================================================
   01. KEYFRAMES
========================================================= */

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

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

@keyframes fadeRight {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes statusPulse {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }

  70% {
    transform: scale(1.7);
    opacity: 0;
  }

  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

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

@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes terminalBlink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

/* =========================================================
   02. HERO REVEAL
========================================================= */

.hero-r {
  opacity: 0;

  transform: translateY(20px);

  animation: fadeUp 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-r-d1 {
  animation-delay: 100ms;
}

.hero-r-d2 {
  animation-delay: 180ms;
}

.hero-r-d3 {
  animation-delay: 260ms;
}

.hero-r-d4 {
  animation-delay: 340ms;
}

.hero-r-d5 {
  animation-delay: 420ms;
}

/* =========================================================
   03. SCROLL REVEAL
========================================================= */

.aos {
  opacity: 0;

  transform: translateY(24px);

  transition:
    opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);

  will-change: opacity, transform;
}

.aos.visible {
  opacity: 1;

  transform: translateY(0);
}

.aos.d1 {
  transition-delay: 80ms;
}

.aos.d2 {
  transition-delay: 160ms;
}

.aos.d3 {
  transition-delay: 240ms;
}

.aos.d4 {
  transition-delay: 320ms;
}

/* =========================================================
   04. STATUS INDICATOR
========================================================= */

.status-dot::after {
  animation: statusPulse 2s ease-out infinite;
}

/* =========================================================
   05. STACK CARDS
========================================================= */

.stack-card {
  animation: scaleIn 400ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stack-card:nth-child(1) {
  animation-delay: 0ms;
}

.stack-card:nth-child(2) {
  animation-delay: 60ms;
}

.stack-card:nth-child(3) {
  animation-delay: 120ms;
}

.stack-card:nth-child(4) {
  animation-delay: 180ms;
}

.stack-card:nth-child(5) {
  animation-delay: 240ms;
}

.stack-card:nth-child(6) {
  animation-delay: 300ms;
}

/* =========================================================
   06. PROJECT CARDS
========================================================= */

.project-card {
  animation: scaleIn 400ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.project-card:nth-child(1) {
  animation-delay: 0ms;
}

.project-card:nth-child(2) {
  animation-delay: 80ms;
}

.project-card:nth-child(3) {
  animation-delay: 160ms;
}

.project-card:nth-child(4) {
  animation-delay: 240ms;
}

.project-card:nth-child(5) {
  animation-delay: 320ms;
}

.project-card:nth-child(6) {
  animation-delay: 400ms;
}

/* =========================================================
   07. PROJECT IMAGE LOADING
========================================================= */

.project-image img {
  opacity: 0;

  transition:
    opacity 400ms ease,
    transform 500ms ease;
}

.project-image img.loaded {
  opacity: 1;
}

/* =========================================================
   08. SKELETON
========================================================= */

.skeleton {
  position: relative;

  overflow: hidden;

  background: linear-gradient(90deg, rgba(128, 128, 128, 0.06) 25%, rgba(128, 128, 128, 0.12) 50%, rgba(128, 128, 128, 0.06) 75%);

  background-size: 200% 100%;

  animation: skeletonLoading 1.5s ease-in-out infinite;
}

/* =========================================================
   PROJECT SKELETON
========================================================= */

.project-skeleton {
  overflow: hidden;

  border: 1px solid var(--color-border);

  border-radius: var(--radius-lg);

  background: var(--color-surface);
}

.project-skeleton-image {
  aspect-ratio: 16 / 10;
}

.project-skeleton-content {
  padding: 1.5rem;
}

.project-skeleton-title {
  width: 55%;

  height: 18px;

  margin-bottom: 1rem;

  border-radius: 5px;
}

.project-skeleton-text {
  width: 100%;

  height: 10px;

  margin-bottom: 0.5rem;

  border-radius: 4px;
}

.project-skeleton-text:last-child {
  width: 70%;
}

/* =========================================================
   STACK SKELETON
========================================================= */

.stack-card-skeleton {
  animation: fadeIn 250ms ease both;
}

/* =========================================================
   EXPERIENCE SKELETON
========================================================= */

.experience-card-skeleton {
  animation: fadeIn 250ms ease both;
}

/* =========================================================
   09. LOADER
========================================================= */

.loader {
  width: 24px;

  height: 24px;

  border: 2px solid rgba(128, 128, 128, 0.15);

  border-top-color: var(--color-primary);

  border-radius: 50%;

  animation: spin 700ms linear infinite;
}

/* =========================================================
   10. TERMINAL CURSOR
========================================================= */

.terminal-cursor {
  display: inline-block;

  width: 6px;

  height: 14px;

  margin-left: 3px;

  vertical-align: middle;

  background: var(--color-primary);

  animation: terminalBlink 1s steps(1) infinite;
}

/* =========================================================
   11. PROJECT DETAIL MODAL
========================================================= */

#project-detail-modal {
  opacity: 0;

  pointer-events: none;

  transition: opacity 200ms ease;
}

#project-detail-modal:not(.hidden) {
  opacity: 1;

  pointer-events: auto;
}

#project-detail-modal > div:last-child {
  transform: translateY(15px) scale(0.98);

  transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

#project-detail-modal:not(.hidden) > div:last-child {
  transform: translateY(0) scale(1);
}

/* =========================================================
   12. TOAST
========================================================= */

.toast.show {
  animation: fadeUp 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* =========================================================
   13. GITHUB DATA
========================================================= */

.github-stat-value.loaded {
  animation: fadeUp 450ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* =========================================================
   14. GITHUB LANGUAGES
========================================================= */

#github-languages > * {
  animation: scaleIn 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

#github-languages > *:nth-child(2) {
  animation-delay: 50ms;
}

#github-languages > *:nth-child(3) {
  animation-delay: 100ms;
}

#github-languages > *:nth-child(4) {
  animation-delay: 150ms;
}

#github-languages > *:nth-child(5) {
  animation-delay: 200ms;
}

#github-languages > *:nth-child(6) {
  animation-delay: 250ms;
}

/* =========================================================
   15. EXPERIENCE
========================================================= */

.experience-card {
  animation: fadeUp 550ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.experience-card:nth-child(1) {
  animation-delay: 0ms;
}

.experience-card:nth-child(2) {
  animation-delay: 80ms;
}

.experience-card:nth-child(3) {
  animation-delay: 160ms;
}

.experience-card:nth-child(4) {
  animation-delay: 240ms;
}

.experience-card:nth-child(5) {
  animation-delay: 320ms;
}

/* =========================================================
   16. TECHNOLOGY TAGS
========================================================= */

.tech-tag {
  transition:
    color var(--transition-fast),
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

/* =========================================================
   17. ACCESSIBILITY — REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .hero-r,
  .aos,
  .project-card,
  .stack-card,
  .github-stat-value,
  .experience-card,
  #github-languages > *,
  .toast,
  #project-detail-modal,
  #project-detail-modal > div:last-child {
    opacity: 1 !important;

    transform: none !important;

    animation: none !important;

    transition: none !important;
  }

  .status-dot::after {
    animation: none !important;
  }

  .loader {
    animation: none !important;
  }

  .skeleton {
    animation: none !important;
  }

  .terminal-cursor {
    animation: none !important;
  }

  .project-image img {
    opacity: 1;

    transition: none !important;
  }
}
