/* ==========================================================================
   framework.css — design tokens, reset, container, utilities

   Loaded FIRST. Everything else depends on these variables + resets.
   ========================================================================== */

:root {
    /* Surface */
    --bg-canvas:        #ffffff;
    --bg-surface:       #f9fafb;
    --bg-surface-2:     #f3f4f6;
    --bg-surface-3:     #e9ebee;

    /* Border */
    --border:           #e2e5ea;
    --border-subtle:    #edf0f3;
    --border-focus:     #4f6ef7;

    /* Brand */
    --brand:            #4f6ef7;
    --brand-hover:      #3d5ce8;
    --brand-dark:       #2d49d4;
    --brand-muted:      rgba(79, 110, 247, 0.08);

    /* Semantic */
    --success:          #16a34a;
    --success-muted:    rgba(22, 163, 74, 0.08);
    --danger:           #dc2626;
    --danger-muted:     rgba(220, 38, 38, 0.08);
    --warning:          #d97706;
    --warning-muted:    rgba(217, 119, 6, 0.08);

    /* Text */
    --text-primary:     #111827;
    --text-secondary:   #374151;
    --text-muted:       #727272;
    --text-link:        #4f6ef7;
    --text-link-hover:  #3d5ce8;

    /* Nav */
    --nav-height:       64px;
    --nav-bg:           #ffffff;
    --nav-border:       #e2e5ea;

    /* Typography */
    --font-sans:        'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:        'JetBrains Mono', 'Fira Code', monospace;

    --text-xs:          0.6875rem;
    --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;

    --weight-normal:    400;
    --weight-medium:    500;
    --weight-semibold:  600;
    --weight-bold:      700;

    /* Spacing */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Radius */
    --radius-sm:    4px;
    --radius-md:    8px;
    --radius-lg:    12px;
    --radius-xl:    16px;
    --radius-full:  9999px;

    /* Shadow */
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:    0 8px 32px rgba(0,0,0,0.10);
    --shadow-glow:  0 0 0 3px rgba(79, 110, 247, 0.20);

    /* Transition */
    --ease:             cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast:    120ms;
    --duration-base:    180ms;

    /* Layout */
    --container-max:    1200px;
    --container-pad:    var(--space-6);

    /* Z-index */
    --z-nav:        100;
    --z-dropdown:   200;
    --z-modal:      300;
    --z-toast:      400;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--weight-normal);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease);
}
a:hover { color: var(--text-link-hover); }

img, svg { display: block; max-width: 100%; }

input, button, select, textarea {
    font: inherit;
    color: inherit;
}

button { cursor: pointer; }
ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--weight-bold);
    line-height: 1.25;
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   3. Container
   -------------------------------------------------------------------------- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
    width: 100%;
}

.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: var(--text-sm); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

.flex         { display: flex; }
.flex-1       { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.w-full { width: 100%; }
.truncate {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
