/* 🎨 Default (Light Theme) */
:root {
  --background: #fdfdfd;
  --foreground: #ffffff;
  --thirdary: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --button-hover: #e5e7eb;
  --button-hero: #111827;
  --button-hero-hover: #374151;
  --quick-stats-bg: #ffffff;
  --bg-project-card: #ffffff;
  --text-project-card: #fdfdfd;
}

/* 🌙 Dark Theme (khi có class .dark ở <html>) */
.dark {
  --background: #0a0a0a;
  --foreground: #121212;
  --thirdary: #171717;
  --text-primary: #ececec;
  --text-secondary: #a1a1aa;
  --button-hover: #262626;
  --button-hero: #ffffff;
  --button-hero-hover: #e5e5e5;
  --quick-stats-bg: #171717;
  --bg-project-card: #171717;
  --text-project-card: #0a0a0a;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--background);
  color: var(--text-primary);
  font-family: 'Be Vietnam Pro', 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ✨ Animasi cursor blink */
@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0; }
}

.animate-cursor {
  animation: blink 1.2s infinite;
}

/* 🎈 Animasi floating */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.floating {
  animation: float 4s ease-in-out infinite;
}

/* 🔄 Infinite Scroll cho Mobile */
@keyframes infinite-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.animate-infinite-scroll {
  animation: infinite-scroll 28s linear infinite;
  width: max-content;
}

.animate-infinite-scroll:hover {
  animation-play-state: paused;
}

/* 📜 Marquee Velocity Text */
@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

@keyframes marquee-reverse {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0%); }
}

.animate-marquee {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}

.animate-marquee-reverse {
  display: flex;
  width: max-content;
  animation: marquee-reverse 28s linear infinite;
}

.animate-marquee:hover,
.animate-marquee-reverse:hover {
  animation-play-state: paused;
}

/* 🌟 Reveal on scroll animations */
.reveal-fade-up, 
.reveal-fade-down, 
.reveal-fade-left, 
.reveal-fade-right, 
.reveal-fade {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-fade-up {
  transform: translateY(35px);
}

.reveal-fade-down {
  transform: translateY(-35px);
}

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

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

.reveal-fade {
  transform: translateY(0);
}

.reveal-visible {
  opacity: 1 !important;
  transform: translate(0, 0) !important;
}

/* ✂️ Line clamp */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 🌈 Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
  transition: background 0.3s ease;
}

.dark ::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #52525b;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background: #3f3f46;
}

/* 🔮 Morphicons micro-interaction enhancement */
.morph-icon-btn {
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease, color 0.3s ease;
}
.morph-icon-btn:active {
  transform: scale(0.92);
}
