/* ============================================
   DR. CHAOMING CHEN — STREATOR, IL
   Custom Styles & Design System
   ============================================ */

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

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

body {
    margin: 0;
    overflow-x: hidden;
}

::selection {
    background: rgba(184, 88, 67, 0.2);
    color: inherit;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdf9f3;
}
::-webkit-scrollbar-thumb {
    background: #e8c4ba;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #b85843;
}

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

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

#mobile-menu.closed {
    opacity: 0 !important;
    pointer-events: none !important;
}

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

.menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
.menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: translateX(8px);
}
.menu-btn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 20px;
    margin-left: 0;
}

/* ---- Smooth Section Transitions ---- */
section {
    position: relative;
}

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

/* ---- Editorial Accents ---- */
.section-accent-line {
    height: 2px;
    width: 60px;
    background: linear-gradient(90deg, #b85843, #e8c4ba);
    border-radius: 1px;
}

/* ---- Card Hover Effects ---- */
.service-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ---- Button Ripple Effect ---- */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:active::after {
    width: 200px;
    height: 200px;
}

/* ---- Testimonial Card ---- */
.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #b85843, #e8c4ba, #b85843);
    border-radius: 2px 2px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* ---- Form Input Transitions ---- */
.form-input {
    transition: border-color 0.3s ease, 
                box-shadow 0.3s ease,
                background-color 0.3s ease;
}

.form-input:focus {
    background-color: #fefdfb;
}

/* ---- Responsive Typography ---- */
@media (max-width: 640px) {
    .font-serif {
        font-size: clamp(2rem, 8vw, 3rem);
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .font-serif {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }
}

@media (min-width: 1025px) {
    .font-serif {
        font-size: clamp(3rem, 5vw, 5rem);
    }
}

/* ---- Print Styles ---- */
@media print {
    nav, #contact, .btn-primary, button {
        display: none !important;
    }
    
    body {
        color: #1c1917;
        background: white;
    }
    
    .font-serif {
        color: #1c1917 !important;
    }
}

/* ---- 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;
    }
}

/* ---- High Contrast Mode ---- */
@media (prefers-contrast: high) {
    .bg-terra-500 {
        background-color: #843d2f !important;
    }
    
    .text-terra-500 {
        color: #843d2f !important;
    }
    
    .border-terra-200 {
        border-color: #dbaa96 !important;
    }
}

/* ---- Landscape Mobile ---- */
@media (max-height: 500px) and (orientation: landscape) {
    #top {
        min-height: auto;
        padding-top: 6rem;
        padding-bottom: 3rem;
    }
    
    .lg\:col-span-7, .lg\:col-span-5 {
        flex: 1;
    }
}
