/*
 * FinanceCT design tokens.
 * Warm paper, dark ink and a single moss brand color. Income and expense use
 * desaturated earthy tones and are always paired with a sign (+ / −).
 * Contrast ratios noted against --color-paper.
 */
:root {
    /* Surfaces */
    --color-paper: #F4F2EE;
    --color-surface: #FBFAF8;
    --color-surface-raised: #FFFFFF;
    --color-sidebar: #EFECE6;
    --color-muted-bg: #ECE8E1;
    --color-hover-bg: #EFECE6;

    /* Lines */
    --color-line: #E3DFD8;
    --color-line-soft: #EAE6DF;
    --color-line-strong: #D9D4CB;

    /* Text */
    --color-ink: #1C1B19;           /* 15.4:1 */
    --color-ink-2: #3D3A36;         /* 10.1:1 */
    --color-text-muted: #57534E;    /* 6.8:1 */
    --color-text-subtle: #6F6A64;   /* 4.8:1, captions only, never on --color-muted-bg */

    /* Brand */
    --color-brand: #2F4F3E;         /* 8.1:1 */
    --color-brand-hover: #1F3A2C;
    --color-brand-soft: #E8EDE9;
    --color-brand-soft-text: #2F3B33;
    --color-on-brand: #FFFFFF;
    --color-accent: #C9A66B;

    /* Space indicators: all exceed AA (4.5:1) on paper, surface and sidebar. */
    --color-space-0: #2F4F3E;
    --color-space-1: #734B86;
    --color-space-2: #285E7B;
    --color-space-3: #914325;

    /* Semantic */
    --color-income: #2F6B4F;        /* 5.6:1 */
    --color-income-soft: #E1EBE4;
    --color-expense: #A4452C;       /* 5.4:1 */
    --color-expense-soft: #F5E6E0;
    --color-category-bar: #8A5A44;
    --color-warning: #8A5A00;       /* 5.3:1; 4.8:1 on --color-muted-bg */

    /* Overlays and inverse */
    --color-overlay: rgba(28, 27, 25, .32);
    --color-inverse-bg: #1C1B19;
    --color-inverse-text: #F4F2EE;
    --color-inverse-accent: #C9A66B;  /* 7.5:1 on inverse bg */
    --color-inverse-danger: #E8A58F;  /* 8.4:1 on inverse bg */

    /* Typography */
    --font-sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

    --text-xs: 0.6875rem;   /* 11 */
    --text-sm: 0.75rem;     /* 12 */
    --text-md: 0.8125rem;   /* 13 */
    --text-base: 0.875rem;  /* 14 */
    --text-input: 0.9375rem;/* 15 */
    --text-lg: 1rem;        /* 16 */
    --text-xl: 1.625rem;    /* 26 */
    --text-2xl: 2.125rem;   /* 34 */
    --text-display: 3.25rem;/* 52 */

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

    --leading-tight: 1.1;
    --leading-normal: 1.5;
    --tracking-eyebrow: .08em;

    /* Spacing (4/8 scale) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-14: 56px;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 999px;

    /* Shadows (minimal) */
    --shadow-hairline: 0 1px 0 var(--color-line);
    --shadow-pop: 0 12px 32px rgba(28, 27, 25, .14);
    --shadow-sheet: -24px 0 48px rgba(28, 27, 25, .12);
    --shadow-sheet-bottom: 0 -16px 40px rgba(28, 27, 25, .14);
    --shadow-fab: 0 8px 20px rgba(47, 79, 62, .35);
    --shadow-seg: 0 1px 2px rgba(28, 27, 25, .12);

    /* Focus */
    --focus-ring: 2px solid var(--color-brand);
    --focus-offset: 2px;
    --focus-halo: 0 0 0 3px rgba(47, 79, 62, .18);

    /* Controls */
    --control-h: 40px;
    --control-h-lg: 44px;
    --control-h-sm: 32px;

    /* Layout */
    --sidebar-w: 248px;
    --bottom-nav-h: 64px;
    --content-max: 1180px;
    --page-gutter: clamp(16px, 4vw, 56px);

    /* Motion */
    --duration-fast: 120ms;
    --duration-base: 200ms;
    --ease-out: cubic-bezier(.2, .8, .2, 1);

    /* Layers */
    --z-nav: 20;
    --z-sheet: 40;
    --z-toast: 50;
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --duration-fast: 0ms;
        --duration-base: 0ms;
    }
}
