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

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

body {
    margin: 0;
    overflow-x: hidden;
}

/* Scroll indicator animation */
@keyframes scrollIndicator {
    0% { transform: translateY(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(200%); opacity: 0; }
}

.animate-scroll-indicator {
    animation: scrollIndicator 1.5s ease-in-out infinite;
}

/* Bounce slow */
@keyframes bounceSlow {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -8px); }
}

.animate-bounce-slow {
    animation: bounceSlow 2s ease-in-out infinite;
}

/* Card glow effect */
.card-glow:hover .card-glow-border {
    box-shadow: 0 0 40px rgba(212, 168, 67, 0.15);
}

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

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

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

/* Fallback: always show content if JS is disabled */
@media not all and (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* Navbar transition */
#site-header.scrolled {
    background: rgba(2, 44, 34, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(212, 168, 67, 0.1), 0 4px 30px rgba(0, 0, 0, 0.3);
}

#site-header.scrolled .nav-link {
    color: rgba(253, 248, 236, 0.85);
}

/* Mobile menu */
#mobile-menu.open {
    opacity: 1;
    pointer-events: auto;
}

#mobile-menu.closed {
    opacity: 0;
    pointer-events: none;
}

/* Menu icon animation */
#menu-btn[aria-expanded="true"] .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

#menu-btn[aria-expanded="true"] .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#menu-btn[aria-expanded="true"] .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Smooth focus styles */
a:focus-visible, button:focus-visible {
    outline: 2px solid #d4a843;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Selection color */
::selection {
    background: rgba(212, 168, 67, 0.3);
    color: #fdf8ec;
}

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

::-webkit-scrollbar-track {
    background: #022c22;
}

::-webkit-scrollbar-thumb {
    background: rgba(212, 168, 67, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 168, 67, 0.5);
}

/* Form styles */
input, textarea {
    background: rgba(253, 248, 236, 0.05);
    border: 1px solid rgba(253, 248, 236, 0.15);
    color: #fdf8ec;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder, textarea::placeholder {
    color: rgba(253, 248, 236, 0.35);
}

input:focus, textarea:focus {
    outline: none;
    border-color: rgba(212, 168, 67, 0.6);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.1);
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 100;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: #065f46;
    border: 1px solid rgba(212, 168, 67, 0.4);
    color: #d1fae5;
}
