/* ===================================
   Thera Plex — Custom Styles
   =================================== */

/* Base */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
    background: #D4522E;
    color: #FDF8F0;
}

/* ===================================
   Navbar
   =================================== */
.nav-logo-text {
    transition: color 0.3s ease;
}

.nav-link {
    position: relative;
}

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

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

/* Scrolled state */
nav.scrolled {
    background: rgba(253, 248, 240, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(61, 43, 31, 0.06);
}

nav.scrolled .nav-logo-text {
    color: #3D2B1F;
}

nav.scrolled .nav-link {
    color: #5C4033;
}

/* ===================================
   Mobile Menu
   =================================== */
#mobileMenu.open {
    opacity: 1 !important;
    pointer-events: all !important;
}

.menu-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 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) {
    width: 24px;
    margin-right: 0;
    transform: rotate(-45deg) translate(4px, -4px);
}

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

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

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

/* ===================================
   Scroll Reveal
   =================================== */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Default state for reduced motion or no-JS: always visible */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Typography refinements
   =================================== */
h1, h2, h3 {
    text-wrap: pretty;
}

p {
    text-wrap: pretty;
}

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

/* ===================================
   Image optimization
   =================================== */
img {
    max-width: 100%;
    height: auto;
}

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

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

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

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

/* ===================================
   Print styles
   =================================== */
@media print {
    nav, #contactForm, button {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
