/* ─── Base & Typography ─── */
@layer base {
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    html {
        scroll-behavior: smooth;
    }

    body {
        overflow-x: hidden;
    }

    ::selection {
        background: rgba(201, 168, 76, 0.3);
        color: #f1f5f9;
    }

    ::-webkit-scrollbar {
        width: 8px;
    }

    ::-webkit-scrollbar-track {
        background: #080e18;
    }

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

    ::-webkit-scrollbar-thumb:hover {
        background: #2d5a65;
    }
}

/* ─── Animations ─── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scrollLine {
    0%, 100% {
        opacity: 0.4;
        transform: scaleY(0.5);
        transform-origin: top;
    }
    50% {
        opacity: 1;
        transform: scaleY(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fadeUp {
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scrollLine {
    animation: scrollLine 2s ease-in-out infinite;
}

/* ─── Scroll Reveal ─── */
.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.revealed {
    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; }

/* ─── Navigation ─── */
.nav-link {
    position: relative;
}

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

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

.nav-link:hover {
    color: #e8d5a0 !important;
}

/* ─── Navbar Scroll State ─── */
.navbar-scrolled {
    background: rgba(8, 14, 24, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(201, 168, 76, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

.menu-line {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 1.25rem;
}

.mobile-link {
    transition: color 0.3s ease, transform 0.3s ease;
}

.mobile-link:hover {
    transform: scale(1.05);
}

/* ─── Service Cards ─── */
.service-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(201, 168, 76, 0.05);
}

/* ─── Buttons ─── */
button[type="submit"],
a[href="#contact"],
a[href="tel:8287432400"] {
    position: relative;
    overflow: hidden;
}

button[type="submit"]::before,
a[href="#contact"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

button[type="submit"]:hover::before,
a[href="#contact"]:hover::before {
    left: 100%;
}

/* ─── Form Elements ─── */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

select {
    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='%2394a3b8' 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;
}

/* ─── Gold Gradient Divider ─── */
.gold-divider {
    background: linear-gradient(90deg, transparent, #c9a84c, transparent);
    height: 1px;
}

/* ─── Responsive Adjustments ─── */
@media (max-width: 768px) {
    .font-serif {
        line-height: 1.2;
    }
}

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

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

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