/* ===== McGinity Textiles — 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 {
    background-color: #6B1D2A;
    color: #FDF9F5;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #6B1D2A;
}

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

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-tag {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

h1 {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

h1 p {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero p {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero .flex {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.hero .mt-12 {
    animation: fadeInUp 0.8s ease-out 1s both;
}

.hero img {
    animation: slideInRight 1s ease-out 0.3s both;
}

/* --- Scroll Reveal (below fold only) --- */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    }

    .reveal[data-reveal] {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    }

    .reveal-left[data-reveal] {
        opacity: 0;
        transform: translateX(-30px);
        transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    }

    .reveal-right[data-reveal] {
        opacity: 0;
        transform: translateX(30px);
        transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    }
}

/* No JS fallback — content is always visible */
@media not all and (prefers-reduced-motion: no-preference) {
    .reveal[data-reveal],
    .reveal-left[data-reveal],
    .reveal-right[data-reveal] {
        opacity: 1;
        transform: none;
    }
}

/* --- Navbar --- */
#navbar.scrolled {
    background-color: rgba(253, 249, 245, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(107, 29, 42, 0.08);
}

#navbar.scrolled #nav-logo-text {
    color: #6B1D2A;
}

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

#mobile-menu.open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

#mobile-menu.open .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 1.5rem;
}

.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

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

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

/* --- Service Cards --- */
.service-card {
    transition: transform 0.4s ease, background-color 0.4s ease, border-color 0.4s ease;
}

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

/* --- Process Steps --- */
.process-step {
    transition: transform 0.3s ease;
}

.process-step:hover {
    transform: translateY(-4px);
}

/* --- Gallery --- */
.gallery-item {
    overflow: hidden;
    position: relative;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(107, 29, 42, 0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* --- Back to Top --- */
#back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

#back-to-top:not(.visible) {
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(10px);
}

#back-to-top.visible {
    transform: translateY(0);
}

/* --- Form Styles --- */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 29, 42, 0.1);
}

/* --- Print Styles --- */
@media print {
    #navbar, #back-to-top, #mobile-menu-btn {
        display: none !important;
    }

    body {
        color: #1A1510;
        background: white;
    }

    section {
        page-break-inside: avoid;
    }
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .hero-tag {
        font-size: 11px;
    }

    h1 {
        font-size: 2.5rem !important;
    }

    @media (min-width: 768px) {
        h1 {
            font-size: 3.5rem !important;
        }
    }

    @media (min-width: 1024px) {
        h1 {
            font-size: 4.5rem !important;
        }
    }
}

/* --- Focus Visible --- */
*:focus-visible {
    outline: 2px solid #6B1D2A;
    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;
    }
}
