/* =========================================
   1. DESIGN TOKENS & VARIABLES
   ========================================= */
:root {
    /* Colors - Light Mode (Default) */
    --bg-background: #ffffff;
    --bg-muted: #f8fafc;
    /* Slate 50 */
    --bg-card: #ffffff;

    --color-text: #0f172a;
    /* Slate 900 */
    --color-text-muted: #64748b;
    /* Slate 500 */
    --color-text-inverted: #ffffff;

    --color-primary: #0f172a;
    /* Slate 900 (Black/Dark Blue) */
    --color-primary-hover: #334155;
    --color-primary-foreground: #ffffff;

    --color-secondary: #f1f5f9;
    /* Slate 100 */
    --color-secondary-hover: #e2e8f0;
    --color-secondary-foreground: #0f172a;

    --color-accent: #2563eb;
    /* Blue 600 */
    --color-border: #e2e8f0;
    /* Slate 200 */
    --color-input: #e2e8f0;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);
    /* Optional pairing */

    /* Spacing Scale */
    --space-1: 0.25rem;
    /* 4px */
    --space-2: 0.5rem;
    /* 8px */
    --space-3: 0.75rem;
    /* 12px */
    --space-4: 1rem;
    /* 16px */
    --space-6: 1.5rem;
    /* 24px */
    --space-8: 2rem;
    /* 32px */
    --space-12: 3rem;
    /* 48px */
    --space-16: 4rem;
    /* 64px */
    --space-24: 6rem;
    /* 96px */

    /* Border Radius */
    --radius-sm: 0.375rem;
    /* 6px */
    --radius-md: 0.5rem;
    /* 8px */
    --radius-lg: 0.75rem;
    /* 12px */
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Layout */
    --container-width: 1280px;
    --header-height: 4rem;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-background);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-text);
    line-height: 1.2;
    margin-bottom: var(--space-4);
    font-weight: 700;
}

h1 {
    font-size: 3rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2.25rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--space-4);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

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

/* =========================================
   3. UTILITY CLASSES
   ========================================= */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.section {
    padding: var(--space-16) 0;
}

.section--muted {
    background-color: var(--bg-muted);
}

.section--sm {
    padding: var(--space-8) 0;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

.grid-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-4 {
    gap: var(--space-4);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.font-bold {
    font-weight: 700;
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.mb-12 {
    margin-bottom: var(--space-12);
}

/* =========================================
   4. COMPONENT CLASSES
   ========================================= */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

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

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

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

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

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

.btn--outline:hover {
    background-color: var(--bg-muted);
    border-color: var(--color-text);
}

.btn--ghost {
    background-color: transparent;
    color: var(--color-text);
}

.btn--ghost:hover {
    background-color: var(--bg-muted);
}

.btn--lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge--primary {
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
}

.badge--outline {
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

/* Inputs */
.input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-input);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background-color: var(--bg-background);
    transition: border-color 0.2s;
}

.input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.1);
}

/* =========================================
   5. LAYOUT COMPONENTS (Header/Footer)
   ========================================= */

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-text);
}

.nav-links {
    display: none;
    gap: var(--space-6);
    list-style: none;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-text);
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
        align-items: center;
    }

    .mobile-menu-btn {
        display: none;
    }
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--bg-background);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4);
    display: none;
    /* Toggled via JS */
    flex-direction: column;
    gap: var(--space-4);
}

.mobile-menu.is-open {
    display: flex;
}

/* Footer */
.footer {
    background-color: var(--bg-background);
    border-top: 1px solid var(--color-border);
    padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.footer-col h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer-links a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--color-text);
}

.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}