/* ===== CSS VARIABLES (DESIGN TOKENS) ===== */
:root {
    /* --- COLOR SYSTEM --- */
    --brand-primary: #342254;
    --brand-secondary: #E03535;
    --brand-tertiary: #258F58;
    
    --base-white: #FFFFFF;
    --base-bg-light: #F4F6F8;
    
    --text-dark: #010101;
    --text-body: #716F6F;
    
    /* --- TYPOGRAPHY SYSTEM --- */
    --font-heading: "gotham", sans-serif;
    --font-body: 'Nunito Sans', sans-serif;

    /* Fluid Type Scale */
    --text-h1: clamp(2.5rem, 2rem + 3vw, 5rem);
    --text-h2: clamp(1.75rem, 1.5rem + 2vw, 3rem);
    
    /* Fixed Type Sizes */
    --text-body-size: 1.125rem;   /* 18px */
    --text-nav-size: 1rem;        /* 16px */
    --text-small: 0.875rem;       /* 14px */
    --text-xsmall: 0.75rem;       /* 12px */
    
    /* --- LAYOUT SYSTEM --- */
    --container-width: 1280px;
    --frame-gap: 20px;
    --mobile-padding: 1.5rem;     /* 24px */
    --desktop-padding: 2rem;      /* 32px */
    
    /* --- COMPONENT SIZING --- */
    --dot-size: 20px;
    --border-radius: 8px;
    --border-radius-pill: 50px;
    
    /* --- SPACING SCALE --- */
    --space-xs: 0.5rem;   /* 8px */
    --space-sm: 1rem;     /* 16px */
    --space-md: 1.5rem;   /* 24px */
    --space-lg: 2rem;     /* 32px */
    --space-xl: 3rem;     /* 48px */
    --space-2xl: 4rem;    /* 64px */
    --space-3xl: 6rem;    /* 96px */
    
    /* --- TRANSITIONS --- */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.4s ease;
    
    /* --- SHADOWS --- */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    
    /* --- Z-INDEX LAYERS --- */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal: 400;
    --z-popover: 500;
    --z-tooltip: 600;
}

/* ===== CSS RESET & BASE STYLES ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===== ROOT ELEMENT STYLES ===== */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== BODY STYLES ===== */
body {
    background-color: var(--brand-primary);
    font-family: var(--font-body);
    font-size: var(--text-body-size);
    font-weight: 700; /* According to your CRITICAL UPDATE */
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Changed from stretch for better control */
    min-height: 100vh;
}

/* ===== GLOBAL ELEMENT STYLES ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-base);
}

button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Focus Visible Styles */
:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Selection Styles */
::selection {
    background-color: rgba(52, 34, 84, 0.2); /* brand-primary with opacity */
    color: var(--text-dark);
}

/* ===== LAYOUT CONTAINERS ===== */

/* Page Wrapper - The White Content Box */
.page-wrapper {
    background-color: var(--base-white);
    width: 100%;
    max-width: calc(100% - (var(--frame-gap) * 2));
    margin: var(--frame-gap) auto;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* Main Container - Mobile First */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding-left: var(--mobile-padding);
    padding-right: var(--mobile-padding);
}

/* Desktop Container Adjustments */
@media (min-width: 768px) {
    .container {
        padding-left: var(--desktop-padding);
        padding-right: var(--desktop-padding);
    }
}

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

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Text Center */
.text-center {
    text-align: center;
}

/* Text Left */
.text-left {
    text-align: left;
}

/* Flex Center */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== COMPONENT STYLES ===== */

/* Global Pill Button - Base Style */
.btn--pill {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: var(--brand-primary);
    color: var(--base-white);
    padding: 0.8rem 2.5rem;
    border-radius: var(--border-radius-pill);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--text-body-size);
    text-transform: capitalize;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    min-height: 44px; /* Touch target */
}

/* Button Hover State */
.btn--pill:hover {
    background-color: #453875; /* Darker brand-primary */
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Button Focus State */
.btn--pill:focus-visible {
    outline: 2px solid var(--base-white);
    outline-offset: 3px;
}

/* Button Active State */
.btn--pill:active {
    transform: translateY(0);
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background-color: white !important;
        font-weight: normal !important;
    }
    
    .page-wrapper {
        box-shadow: none !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    
    .btn--pill {
        background-color: black !important;
        color: white !important;
        border: 1px solid black !important;
    }
    
    .no-print {
        display: none !important;
    }
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: high) {
    :root {
        --brand-primary: #000080; /* Navy blue for better contrast */
        --text-body: #000000;
    }
    
    .btn--pill {
        border: 2px solid var(--base-white);
    }
}