/* ==========================================
   BASE STYLES - BlackHorseProjects
   ========================================== */

/* CSS Custom Properties / Design Tokens */
:root {
    /* Primary Colors */
    --color-primary: #C5A880;
    --color-primary-light: rgba(197, 168, 128, 0.15);
    --color-primary-dark: #a68a5b;
    
    /* Secondary Colors - Deep Navy (replacing red) */
    --color-secondary: #1a2634;
    --color-secondary-light: #2d3d4f;
    --color-secondary-dark: #0f1820;
    
    /* Accent Colors */
    --color-accent: #8B4513;
    --color-accent-light: rgba(139, 69, 19, 0.1);
    
    /* Neutral Colors */
    --color-white: #ffffff;
    --color-black: #0a0a0a;
    --color-background: #faf9f7;
    --color-card-bg: #ffffff;
    --color-border: #e8e5e0;
    
    /* Text Colors */
    --color-text: #2d3436;
    --color-text-light: #636e72;
    --color-text-muted: #9ca3af;
    
    /* Status Colors */
    --color-success: #10b981;
    --color-error: #ef4444;
    
    /* Typography */
    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    --text-7xl: 4.5rem;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    --spacing-4xl: 6rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-warm: 0 10px 40px rgba(197, 168, 128, 0.15);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* Z-index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal: 400;
    --z-tooltip: 500;
}

/* ==========================================
   CSS RESET & BASE
   ========================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent iOS overscroll bounce when not needed */
    overscroll-behavior-y: none;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* Smooth momentum scrolling on iOS */
    -webkit-overflow-scrolling: touch;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-secondary);
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: var(--spacing-md);
}

strong, b {
    font-weight: 600;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.main-content {
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    min-height: 48px; /* Minimum touch target for accessibility */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-secondary);
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-secondary);
    color: var(--color-white);
    border-color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Active state for touch devices */
.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}

.btn-outline:hover {
    background-color: var(--color-white);
    color: var(--color-secondary);
    transform: translateY(-2px);
}

.btn-outline:active {
    transform: translateY(0);
    background-color: rgba(255, 255, 255, 0.9);
}

.btn-large {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: var(--text-lg);
    min-height: 56px;
}

/* Sections */
.section {
    padding: var(--spacing-4xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-3xl);
}

.section-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    background-color: var(--color-primary-light);
    border-radius: var(--radius-full);
    margin-bottom: var(--spacing-md);
}

.section-title {
    margin-bottom: var(--spacing-md);
}

.section-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    margin: 0 auto var(--spacing-lg);
    border-radius: var(--radius-full);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Fade-in Animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   RESPONSIVE TYPOGRAPHY & MOBILE ENHANCEMENTS
   ========================================== */

@media (max-width: 1024px) {
    :root {
        --text-5xl: 2.5rem;
        --text-6xl: 3rem;
        --text-7xl: 3.5rem;
    }
}

@media (max-width: 768px) {
    :root {
        --text-4xl: 2rem;
        --text-5xl: 2.25rem;
        --text-6xl: 2.5rem;
        --text-7xl: 3rem;
    }
    
    .section {
        padding: var(--spacing-3xl) 0;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Disable hover transforms on touch devices for better UX */
    @media (hover: none) {
        .btn:hover {
            transform: none;
        }
        
        .btn-primary:hover {
            background-color: var(--color-primary);
            color: var(--color-secondary);
            border-color: var(--color-primary);
        }
        
        .btn-outline:hover {
            background-color: transparent;
            color: var(--color-white);
        }
    }
    
    /* Ensure buttons are full width in flex containers on mobile */
    .hero-cta .btn,
    .cta-content .btn {
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    :root {
        --text-3xl: 1.5rem;
        --text-4xl: 1.75rem;
        --text-5xl: 2rem;
        --text-6xl: 2.25rem;
        --text-7xl: 2.5rem;
    }
    
    /* Slightly more compact spacing on small phones */
    .section {
        padding: var(--spacing-2xl) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-2xl);
    }
    
    /* Ensure readable text on small screens */
    body {
        font-size: var(--text-base);
        line-height: 1.7;
    }
    
    /* Full-width buttons on small phones */
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-large {
        padding: var(--spacing-md) var(--spacing-xl);
        font-size: var(--text-base);
    }
}

/* Safe area padding for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
    .main-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Smooth scrolling with reduced motion support */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .btn,
    .service-card,
    .testimonial-card,
    .team-card,
    .approach-card,
    .value-card {
        transition: none;
    }
}
