/* ===== Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #FAF7F0;
  color: #2A2A2A;
  -webkit-font-smoothing: antialiased;
}

::selection { background-color: #C41E3A; color: #fff; }

/* ===== Utility ===== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Navbar ===== */
#navbar.scrolled {
  background-color: rgba(250, 247, 240, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #C41E3A;
  transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }

#mobileMenu.show { display: block; }

/* Mobile bars animation */
.mobile-bar:nth-child(1).open { transform: translateY(6px) rotate(45deg); }
.mobile-bar:nth-child(2).open { opacity: 0; }
.mobile-bar:nth-child(3).open { transform: translateY(-6px) rotate(-45deg); }

/* ===== Hero ===== */
.rotating-cw  { animation: spin-cw  30s linear infinite; }
.rotating-ccw { animation: spin-ccw 25s linear infinite; }
.rotating-cw-fast { animation: spin-cw 20s linear infinite; }

@keyframes spin-cw  { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spin-ccw { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }

.floating-dot {
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(-12px); opacity: 1; }
}

.bounce-y {
  animation: bounce-y 2s ease-in-out infinite;
}
@keyframes bounce-y {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(8px); }
}

.scroll-dot {
  animation: scroll-dot 1.5s ease-in-out infinite;
}
@keyframes scroll-dot {
  0%, 100% { cy: 7; }
  50%      { cy: 14; }
}

/* ===== Scroll Animations ===== */
.fade-in-up, .fade-in-left, .fade-in-right {
  opacity: 0;
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-in-up   { transform: translateY(30px); }
.fade-in-left { transform: translateX(-40px); }
.fade-in-right { transform: translateX(40px); }
.fade-in-up.visible, .fade-in-left.visible, .fade-in-right.visible {
  opacity: 1;
  transform: translate(0);
}

/* Hover effects */
.btn-primary {
  transition: all 0.3s ease;
}
.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(196, 30, 58, 0.25);
}
.btn-primary:active {
  transform: scale(0.98);
}

/* Feature card hover */
.feature-card:hover .w-14 {
  background-color: #C41E3A;
  color: #fff;
}

/* Toy card hover */
.toy-card:hover > div { box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1); }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
