/* Base styles and custom utilities */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

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

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

::-webkit-scrollbar-thumb {
    background: #d4a574;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c49464;
}

/* Navbar transition states */
.navbar-light .nav-brand,
.navbar-light .nav-link {
    color: #292524 !important;
}

.navbar-dark .nav-brand,
.navbar-dark .nav-link {
    color: #fef7f0 !important;
}

.navbar-dark .nav-link:hover {
    color: #e05228 !important;
}

.navbar-light .nav-link:hover {
    color: #e05228 !important;
}

.navbar-light .mobile-link {
    color: #292524 !important;
}

.navbar-dark .mobile-link {
    color: #fef7f0 !important;
}

/* Hero animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.3s;
}

.hero-title {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.5s;
}

.hero-desc {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.7s;
}

.hero-cta {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.9s;
}

/* Scroll reveal animations */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal[data-reveal] {
    opacity: 0;
    transform: translateY(40px);
}

.scroll-reveal[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal[data-reveal="left"] {
    opacity: 0;
    transform: translateX(-40px);
}

.scroll-reveal[data-reveal="left"].revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal[data-reveal="right"] {
    opacity: 0;
    transform: translateX(40px);
}

.scroll-reveal[data-reveal="right"].revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animation delays */
.scroll-reveal[data-reveal] {
    transition-delay: 0.1s;
}

.scroll-reveal:nth-child(2)[data-reveal] {
    transition-delay: 0.2s;
}

.scroll-reveal:nth-child(3)[data-reveal] {
    transition-delay: 0.3s;
}

.scroll-reveal:nth-child(4)[data-reveal] {
    transition-delay: 0.4s;
}

.scroll-reveal:nth-child(5)[data-reveal] {
    transition-delay: 0.5s;
}

.scroll-reveal:nth-child(6)[data-reveal] {
    transition-delay: 0.6s;
}

/* Service card hover effects */
.service-card {
    position: relative;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #e05228;
    transition: width 0.4s ease;
}

.service-card:hover::after {
    width: 100%;
}

/* Thin line animations */
@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: 2.5rem;
    }
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #e05228;
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero-subtitle,
    .hero-title,
    .hero-desc,
    .hero-cta {
        animation: none;
        opacity: 1;
    }

    .scroll-reveal {
        opacity: 1;
        transform: none;
    }

    .service-card img,
    .scroll-reveal img {
        transition: none;
    }
}

/* Selection color */
::selection {
    background: #f9c4b0;
    color: #6d2316;
}

/* Form input autofill styling */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #fafaf5 inset !important;
    -webkit-text-fill-color: #292524 !important;
}

/* Loading state for button */
button:active {
    transform: scale(0.98);
}

/* Image lazy loading fade */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

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