/* Calvert's Glass — Custom Styles */

/* Smooth scrolling for the whole page */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #040b16;
}
::-webkit-scrollbar-thumb {
    background: #1e3a5f;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #b8860b;
}

/* Selection color */
::selection {
    background: rgba(184, 134, 11, 0.3);
    color: #f0c217;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid #f0c217;
    outline-offset: 2px;
}

/* Prevent layout shift on images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Gold gradient text utility */
.gold-gradient {
    background: linear-gradient(135deg, #b8860b 0%, #f0c217 50%, #d4a017 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Gold gradient background utility */
.gold-gradient-bg {
    background: linear-gradient(135deg, #b8860b 0%, #f0c217 50%, #d4a017 100%);
}

/* Gold divider line */
.gold-line {
    background: linear-gradient(90deg, transparent 0%, #b8860b 50%, #f0c217 100%);
    height: 2px;
}

/* Service card hover effect */
.service-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s ease,
                border-color 0.4s ease;
}
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(184, 134, 11, 0.08);
    border-color: rgba(184, 134, 11, 0.2);
}

/* CTA button hover */
.cta-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.cta-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cta-button:hover::before {
    opacity: 1;
}
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(184, 134, 11, 0.35);
}

/* Gallery item hover */
.gallery-item {
    overflow: hidden;
    border-radius: 4px;
}
.gallery-item img {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-item:hover img {
    transform: scale(1.1);
}
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(4, 11, 22, 0.8) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    border-radius: 4px;
}
.gallery-item:hover .gallery-overlay {
    opacity: 1;
}
.gallery-overlay span {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
}

/* Mobile menu transitions */
#mobile-menu {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-link {
    transition: color 0.3s ease;
}
.mobile-link:hover {
    color: #f0c217;
}

/* Form select dropdown styling */
select option {
    background: #0f172a;
    color: #e2e8f0;
}

/* Navbar scroll state */
.nav-scrolled {
    background: rgba(4, 11, 22, 0.97) !important;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(184, 134, 11, 0.2);
}

/* Nav link underline animation */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #b8860b, #f0c217);
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* Reveal animation for scroll-triggered elements */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Only apply reveal animations when motion is preferred */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(40px);
    }
    .reveal.visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure content is visible even without JS */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
