/* ========================================
   Theradynamics Physical Rehab
   Custom Styles
   ======================================== */

/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

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

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

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

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

/* Selection */
::selection {
    background: #d4633c;
    color: white;
}

/* ========================================
   Section Labels & Titles
   ======================================== */
.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #d4633c;
    position: relative;
    padding-left: 2rem;
}

.section-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 2px;
    background: #d4633c;
}

.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 700;
    color: #2c1e14;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.section-desc {
    font-size: 1.1rem;
    color: #3d2b1f;
    line-height: 1.7;
    opacity: 0.7;
}

/* ========================================
   Navigation
   ======================================== */
.nav-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: #d4633c;
    transition: width 0.3s ease;
}

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

/* Navbar Scroll State */
.navbar-scrolled {
    background: rgba(254, 253, 248, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(44, 30, 20, 0.08);
}

.navbar-scrolled .nav-text {
    color: #2c1e14;
}

.navbar-scrolled .nav-link {
    color: #3d2b1f;
}

/* ========================================
   Hero Section
   ======================================== */
.hero-content {
    opacity: 0;
    transform: translateY(40px);
    animation: heroReveal 1s ease forwards;
}

.hero-stats {
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 1s ease 0.4s forwards;
}

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Indicator */
.scroll-indicator {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(8px);
        opacity: 0.5;
    }
}

/* ========================================
   Service Cards
   ======================================== */
.service-card {
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.5s ease;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #d4633c, #e07c5c);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* ========================================
   Approach Steps
   ======================================== */
.approach-step {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.approach-step.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Step connector lines (desktop) */
@media (min-width: 1024px) {
    .approach-step:not(:last-child)::after {
        content: '';
        position: absolute;
        top: 40px;
        right: -1.5rem;
        width: calc(100%);
        height: 2px;
        background: linear-gradient(90deg, #f5cfc0, transparent);
        z-index: -1;
    }
}

/* ========================================
   Testimonial Cards
   ======================================== */
.testimonial-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.5s ease;
}

.testimonial-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.testimonial-card:hover {
    box-shadow: 0 20px 60px rgba(212, 99, 60, 0.1);
}

/* ========================================
   Mobile Menu
   ======================================== */
.mobile-nav-link {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

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

/* ========================================
   Back to Top
   ======================================== */
#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .section-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }
    
    .hero-stats {
        gap: 1.5rem !important;
    }
    
    .hero-stats > div {
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
        padding-left: 0 !important;
        padding-top: 1.5rem !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;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    nav, #back-to-top, .scroll-indicator {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .service-card, .testimonial-card, .approach-step {
        opacity: 1;
        transform: none;
    }
}
