/* Custom styles for China Star */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus styles */
:focus-visible {
    outline: 2px solid #0f766e;
    outline-offset: 2px;
}

/* Reveal animations — progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered delays */
    .reveal:nth-child(2) { transition-delay: 0.1s; }
    .reveal:nth-child(3) { transition-delay: 0.2s; }
    .reveal:nth-child(4) { transition-delay: 0.3s; }
}

/* Ensure content is visible without JS */
.no-js .reveal {
    opacity: 1;
    transform: none;
}

/* Navbar */
#navbar {
    background: rgba(250, 250, 247, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
}

#navbar.scrolled {
    background: rgba(250, 250, 247, 0.97);
    border-bottom-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

.nav-link {
    position: relative;
}

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

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

/* Mobile menu */
#mobile-menu {
    z-index: 30;
}

#mobile-menu.open {
    transform: translateX(0);
}

#mobile-menu.closed {
    transform: translateX(100%);
}

/* Hamburger animation */
#menu-toggle[aria-expanded="true"] #bar1 {
    transform: rotate(45deg) translate(5px, 5px);
}

#menu-toggle[aria-expanded="true"] #bar2 {
    opacity: 0;
}

#menu-toggle[aria-expanded="true"] #bar3 {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 1.5rem;
}

.mobile-nav-link {
    font-family: 'Playfair Display', Georgia, serif;
}

/* Back to top */
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Image hover effects */
.reveal img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Button hover lift */
button, a {
    transition: all 0.3s ease;
}

/* Selection color */
::selection {
    background: #0f766e;
    color: white;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Print styles */
@media print {
    #navbar, #back-to-top, #mobile-menu {
        display: none !important;
    }

    body {
        color: #000;
        background: white;
    }

    section {
        page-break-inside: avoid;
    }
}
