/* ===== Custom Styles for CNC Cabinetry N Closets ===== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom selection color */
::selection {
    background: #b91c4c;
    color: #fff;
}

/* ===== Geometric Background Shapes ===== */
.geo-shape {
    position: absolute;
    opacity: 0.08;
    pointer-events: none;
}

.geo-circle-1 {
    width: 600px;
    height: 600px;
    background: #f9a8d4;
    border-radius: 50%;
    top: -200px;
    right: -100px;
    animation: float-slow 20s ease-in-out infinite;
}

.geo-circle-2 {
    width: 300px;
    height: 300px;
    background: #fbcfe8;
    border-radius: 50%;
    bottom: 10%;
    left: 5%;
    animation: float-slow 15s ease-in-out infinite reverse;
}

.geo-circle-3 {
    width: 500px;
    height: 500px;
    background: #f9a8d4;
    border-radius: 50%;
    top: -150px;
    left: -150px;
    opacity: 0.05;
    animation: float-slow 25s ease-in-out infinite;
}

.geo-circle-4 {
    width: 400px;
    height: 400px;
    background: #b91c4c;
    border-radius: 50%;
    bottom: -100px;
    right: -100px;
    opacity: 0.1;
    animation: float-slow 18s ease-in-out infinite reverse;
}

.geo-rect-1 {
    width: 200px;
    height: 200px;
    background: #f9a8d4;
    top: 40%;
    right: 15%;
    transform: rotate(45deg);
    opacity: 0.06;
    animation: spin-slow 30s linear infinite;
}

.geo-rect-2 {
    width: 120px;
    height: 120px;
    background: #fbcfe8;
    bottom: 20%;
    left: 10%;
    transform: rotate(20deg);
    opacity: 0.05;
    animation: spin-slow 25s linear infinite reverse;
}

.geo-rect-3 {
    width: 180px;
    height: 180px;
    background: #f9a8d4;
    top: 20%;
    right: -50px;
    transform: rotate(30deg);
    opacity: 0.05;
    animation: spin-slow 35s linear infinite;
}

.geo-rect-4 {
    width: 150px;
    height: 150px;
    background: #b91c4c;
    top: 10%;
    left: 5%;
    transform: rotate(-15deg);
    opacity: 0.06;
    animation: spin-slow 20s linear infinite reverse;
}

.geo-triangle {
    width: 0;
    height: 0;
    border-left: 100px solid transparent;
    border-right: 100px solid transparent;
    border-bottom: 173px solid #f9a8d4;
    top: 60%;
    left: 20%;
    opacity: 0.04;
    animation: float-slow 22s ease-in-out infinite;
}

/* ===== Animations ===== */
@keyframes float-slow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(2deg); }
    66% { transform: translateY(10px) rotate(-1deg); }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== Navbar ===== */
#navbar {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(253, 248, 245, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#navbar.scrolled {
    background: rgba(253, 248, 245, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

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

#mobile-menu.open .mobile-link {
    animation: slideIn 0.4s ease forwards;
    opacity: 0;
}

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

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

/* Mobile menu button animation */
#mobile-menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
#mobile-menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}
#mobile-menu-btn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 1.5rem;
}

/* ===== Service Cards ===== */
.service-card {
    transform: translateY(0);
}

.service-card:hover {
    transform: translateY(-4px);
}

/* ===== Gallery Items ===== */
.gallery-item {
    overflow: hidden;
}

/* ===== Process Steps ===== */
.process-step {
    position: relative;
}

.process-step::after {
    content: '';
    position: absolute;
    top: 24px;
    right: -24px;
    width: 48px;
    height: 2px;
    background: linear-gradient(to right, #f9a8d4, transparent);
    display: none;
}

@media (min-width: 1024px) {
    .process-step:not(:last-child)::after {
        display: block;
    }
}

/* ===== Scroll Reveal Animations ===== */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Reduced motion preference */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger children */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger.revealed > *:nth-child(6) { transition-delay: 0.5s; }

@media (prefers-reduced-motion: no-preference) {
    .reveal-stagger > * {
        opacity: 0;
        transform: translateY(20px);
    }
    .reveal-stagger.revealed > * {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FDF8F5;
}
::-webkit-scrollbar-thumb {
    background: #b91c4c;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9f1842;
}

/* ===== Focus Styles ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #b91c4c;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== Form Select Arrow ===== */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' 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 12px center;
    background-size: 16px;
    padding-right: 40px;
}
