/* ============================================
   DONG TIN JEWELRY — Custom Styles
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(4, 120, 87, 0.2);
    color: #064e3b;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fdf9f0;
}

::-webkit-scrollbar-thumb {
    background: #047857;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #065f46;
}

/* --- Hero Animations --- */
.hero-eyebrow {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.3s;
}

.hero-headline {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards 0.5s;
}

.hero-subtext {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.7s;
}

.hero-ctas {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.9s;
}

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

/* --- Scroll Indicator --- */
.scroll-line {
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); }
}

/* --- Marquee --- */
.marquee-track {
    animation: marquee 30s linear infinite;
}

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

.marquee-item {
    flex-shrink: 0;
}

/* --- Section Animations --- */
.section-eyebrow,
.section-title,
.collection-card,
.service-card,
.visit-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-eyebrow.visible,
.section-title.visible,
.collection-card.visible,
.service-card.visible,
.visit-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.collection-card:nth-child(1) { transition-delay: 0.05s; }
.collection-card:nth-child(2) { transition-delay: 0.1s; }
.collection-card:nth-child(3) { transition-delay: 0.15s; }
.collection-card:nth-child(4) { transition-delay: 0.2s; }
.collection-card:nth-child(5) { transition-delay: 0.25s; }
.collection-card:nth-child(6) { transition-delay: 0.3s; }

.service-card:nth-child(1) { transition-delay: 0.05s; }
.service-card:nth-child(2) { transition-delay: 0.1s; }
.service-card:nth-child(3) { transition-delay: 0.15s; }
.service-card:nth-child(4) { transition-delay: 0.2s; }
.service-card:nth-child(5) { transition-delay: 0.25s; }
.service-card:nth-child(6) { transition-delay: 0.3s; }

/* --- Navigation --- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* --- Mobile Menu --- */
.menu-line {
    transition: all 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: translateX(10px);
}

#menuBtn.active .menu-line:nth-child(3) {
    width: 6;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Mobile Links --- */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#mobileMenu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobileMenu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* --- CTA Buttons --- */
.cta-primary {
    position: relative;
    overflow: hidden;
}

.cta-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.cta-primary:hover::before {
    left: 100%;
}

/* --- Collection Cards --- */
.collection-card {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* --- Navbar Scroll State --- */
.nav-scrolled {
    background-color: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(4, 120, 87, 0.1);
}

.nav-scrolled .nav-link {
    color: #064e3b;
}

.nav-scrolled .menu-line {
    background-color: #064e3b;
}

.nav-scrolled .logo-text {
    color: #064e3b;
}

/* --- Back to Top --- */
#backToTop {
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

#backToTop.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

#backToTop:not(.visible) {
    transform: translateY(10px);
}

/* --- Form Focus States --- */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* --- 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;
    }
}

/* --- Print Styles --- */
@media print {
    nav, #backToTop, .marquee-track {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
