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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    overflow-x: hidden;
}

/* ─── Selection ─── */
::selection {
    background: rgba(212, 160, 23, 0.3);
    color: #f5f0f8;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #070310;
}
::-webkit-scrollbar-thumb {
    background: #542c60;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #d4a017;
}

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

    /* Page load reveal */
    .animate-reveal #hero {
        animation: heroReveal 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }

    @keyframes heroReveal {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }

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

    @keyframes scrollPulse {
        0%, 100% { opacity: 0.4; transform: scaleY(1); }
        50% { opacity: 1; transform: scaleY(1.2); }
    }
}

/* Fallback: always visible if no JS or reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ─── Navbar ─── */
#navbar {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background: rgba(7, 3, 16, 0.92);
    backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(212, 160, 23, 0.1), 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: linear-gradient(90deg, #d4a017, #fbbf24);
    transition: width 0.3s ease;
}

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

.nav-link:hover {
    color: #fbbf24;
}

/* ─── Mobile Menu ─── */
#mobile-menu.open {
    opacity: 1 !important;
    pointer-events: all !important;
}

.mobile-link {
    position: relative;
}

/* ─── Service Cards ─── */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4a017, transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.service-card:hover::before {
    opacity: 1;
}

/* ─── Input Focus States ─── */
input:focus, select:focus, textarea:focus {
    border-color: rgba(212, 160, 23, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.1) !important;
}

/* ─── Gold Accent Dividers ─── */
.gold-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 160, 23, 0.3), transparent);
}

/* ─── Button Hover Glow ─── */
button:hover, a:hover {
    /* handled inline via Tailwind */
}

/* ─── Image Aspect Ratios ─── */
img {
    max-width: 100%;
    height: auto;
}

/* ─── Smooth Image Loading ─── */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ─── Custom Select Arrow ─── */
select.appearance-none {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d4a017' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ─── Focus Visible ─── */
:focus-visible {
    outline: 2px solid #d4a017;
    outline-offset: 2px;
}
