/* ======================================================================= */
/*                  BASE DESIGN TOKENS & GLOBAL UTILITIES                  */
/* ======================================================================= */

/* Import Google Fonts with fallback for offline use */
@import url('https://fonts.googleapis.com/css2?family=Amaranth:wght@400;700&family=Roboto:wght@300;400;700&display=swap');

:root {
    --primary-color: #00aaff;
    --secondary-color: #0077b6;
    --background-color: #ffffff;
    --surface-color: #f8f9fa;
    --text-color: #212529;
    --text-muted-color: #6c757d;
    --border-color: #dee2e6;
    
    /* Responsive breakpoints */
    --mobile-breakpoint: 768px;
    --tablet-breakpoint: 992px;
    --desktop-breakpoint: 1200px;
}

/* Performance optimization: Fix any potential CSS loading issues */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { 
    scroll-behavior: smooth; 
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Clean font declarations - remove conflicts */
body, html {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings use Amaranth font */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Amaranth', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: var(--primary-color);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--primary-color);
}

/* CONSISTENT SECTION STYLING */
section {
    padding: clamp(2rem, 5vw, 3rem) 0;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-subtitle {
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--text-muted-color);
    max-width: 800px;
    margin: -1.5rem auto 3rem;
    line-height: 1.6;
}

p { 
    margin-bottom: 1rem; 
    line-height: 1.6;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

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

a:hover {
    text-decoration: underline;
}

/* CONSISTENT BUTTON STYLING */
.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    /* Enhanced mobile touch targets */
    min-height: 44px;
    touch-action: manipulation;
}

.cta-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    text-decoration: none;
}

/* LOGO DISPLAY CONSISTENCY */
.logo-display-container {
    text-align: center;
    padding: 2rem 0;
    background-color: var(--background-color);
}

.logo-display-container img {
    height: clamp(60px, 8vw, 90px);
    max-width: 230px;
    margin: 0 auto;
    display: block;
}

/* FEATURE GRID CONSISTENCY */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background-color: var(--background-color);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.feature-card .feature-icon {
    width: clamp(50px, 8vw, 60px);
    height: clamp(50px, 8vw, 60px);
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--primary-color);
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    margin-bottom: 1rem;
    text-align: center;
}

.feature-card p {
    font-size: clamp(0.9rem, 2vw, 1rem);
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

/* Responsive design improvements */
@media screen and (max-width: 1200px) {
    .container {
        max-width: 95%;
        padding: 0 1.5rem;
    }
}

@media screen and (max-width: 992px) {
    .container {
        padding: 0 1rem;
        max-width: 95%;
    }
    
    .feature-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media screen and (max-width: 768px) {
    .container {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    section {
        padding: 2rem 0;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    h1 {
        font-size: clamp(1.8rem, 4vw, 2.2rem);
    }
    
    h2 {
        font-size: clamp(1.6rem, 4vw, 2rem);
    }
    
    h3 {
        font-size: clamp(1.1rem, 3vw, 1.3rem);
    }
}

/* Enhanced iPhone responsiveness */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 0.8rem;
    }
    
    .feature-card {
        padding: 1.5rem 1rem;
    }
    
    body {
        font-size: 16px; /* Prevent zoom on iPhone */
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    h1 {
        font-size: clamp(1.5rem, 5vw, 2rem);
        line-height: 1.2;
    }
    
    h2 {
        font-size: clamp(1.4rem, 4vw, 1.8rem);
        line-height: 1.3;
    }
    
    p {
        font-size: 16px; /* Prevent zoom on iPhone */
        line-height: 1.5;
    }
    
    .cta-button {
        width: 100%;
        max-width: none;
        padding: 1rem;
        font-size: 16px; /* Prevent zoom on iPhone */
        margin: 0.5rem 0;
        min-height: 48px; /* Better touch target */
    }
}

/* iPhone specific optimizations */
@media screen and (max-width: 414px) {
    .container {
        padding: 0 0.5rem;
    }
    
    section {
        padding: 1.5rem 0;
    }
    
    .feature-card {
        padding: 1.2rem 0.8rem;
    }
    
    .feature-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .feature-card p {
        font-size: 14px;
        line-height: 1.4;
    }
}

/* iPhone SE and smaller devices */
@media screen and (max-width: 375px) {
    .container {
        padding: 0 0.3rem;
    }
    
    .feature-card {
        padding: 1rem 0.6rem;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .section-subtitle {
        font-size: 14px;
        margin-bottom: 1rem;
    }
}

/* Utility class for hidden visually */
.visually-hidden {
    position: absolute !important;
    height: 1px; 
    width: 1px; 
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
    border: 0;
}

/* Add utility class for reduced-top-gap */
.section-reduced-top-gap {
    padding-top: 1.2rem !important;
}

/* Performance optimization: Preload critical fonts */
@font-face {
    font-family: 'Roboto';
    font-display: swap;
}

@font-face {
    font-family: 'Amaranth';
    font-display: swap;
}