/* ============================================
   D K Urban Living — Custom Styles
   ============================================ */

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

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

body {
    overflow-x: hidden;
}

/* Selection Color */
::selection {
    background-color: #c94f2c;
    color: #fdfbf7;
}

/* ============================================
   Navbar
   ============================================ */
.nav-link {
    position: relative;
}

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

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

/* Navbar background on scroll */
#navbar.scrolled {
    background-color: rgba(253, 251, 247, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(74, 47, 35, 0.08);
}

#navbar.scrolled .nav-text-color {
    color: #4a2f23;
}

#navbar.scrolled .nav-sub-text {
    color: #9a6848;
}

#navbar.scrolled .nav-link {
    color: #6d422e;
}

#navbar.scrolled .nav-link:hover {
    color: #c94f2c;
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-nav-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#mobile-menu.open .mobile-nav-link {
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.open .mobile-nav-link:nth-child(1) { transition-delay: 0.05s; }
#mobile-menu.open .mobile-nav-link:nth-child(2) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-nav-link:nth-child(3) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-nav-link:nth-child(4) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-nav-link:nth-child(5) { transition-delay: 0.25s; }
#mobile-menu.open .mobile-nav-link:nth-child(6) { transition-delay: 0.3s; }

/* Hamburger animation */
#mobile-menu-btn[aria-expanded="true"] #menu-icon-open span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

#mobile-menu-btn[aria-expanded="true"] #menu-icon-open span:nth-child(2) {
    opacity: 0;
}

#mobile-menu-btn[aria-expanded="true"] #menu-icon-open span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 1.25rem;
}

#mobile-menu-btn[aria-expanded="true"] #menu-icon-open {
    display: none;
}

#mobile-menu-btn[aria-expanded="true"] #menu-icon-close {
    display: flex;
}

/* ============================================
   Service Cards
   ============================================ */
.service-card {
    position: relative;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, #f3c0b0 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

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

/* ============================================
   Scroll Reveal Animations
   (Progressive Enhancement — only when JS runs)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    .reveal-offset {
        transform: translateY(40px);
    }

    .reveal-scale {
        transform: scale(0.95);
    }

    .reveal-left {
        transform: translateX(-40px);
    }

    .reveal-right {
        transform: translateX(40px);
    }
}

/* Fallback: if JS doesn't run, content is still visible */
@media not all and (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Form Styles
   ============================================ */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: #c9ab91;
}

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

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

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

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

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

/* ============================================
   Focus Visible for Accessibility
   ============================================ */
*:focus-visible {
    outline: 2px solid #c94f2c;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #c94f2c;
    outline-offset: 2px;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 767px) {
    .font-serif {
        line-height: 1.15;
    }
}

@media (min-width: 768px) {
    /* Subtle parallax-like effect on hero via CSS only */
    #top {
        perspective: 1px;
    }
}
