/*
 * Capstone Demo Bank design tokens.
 *
 * Every colour, type, spacing, radius, shadow and motion value used by the
 * child theme is defined here once as a CSS custom property.
 * Documented in docs/design-system.md. Contrast ratios are WCAG 2.2 figures.
 */

:root {
	/* ---------- Colour: Pine (primary) ---------- */
	--cdb-pine-50:  #EEF5F2;
	--cdb-pine-100: #D5E6DF;
	--cdb-pine-200: #ABCDBF;
	--cdb-pine-300: #7AAE9A;
	--cdb-pine-400: #4E8C76;
	--cdb-pine-500: #2F6F5A;
	--cdb-pine-600: #235946;
	--cdb-pine-700: #1B4739;
	--cdb-pine-800: #14372C; /* brand primary */
	--cdb-pine-900: #0E2A22;
	--cdb-pine-950: #081A15;

	/* ---------- Colour: Brass (accent) ---------- */
	--cdb-brass-50:  #FBF6EC;
	--cdb-brass-100: #F4E8CC;
	--cdb-brass-200: #E9D09A;
	--cdb-brass-300: #D9B26A; /* accent on dark */
	--cdb-brass-400: #C39447; /* brand accent: keystone */
	--cdb-brass-500: #B3833A;
	--cdb-brass-600: #95692C; /* lightest brass allowed as text on white */
	--cdb-brass-700: #7A5625;
	--cdb-brass-800: #5C411D;
	--cdb-brass-900: #3F2D15;

	/* ---------- Colour: Stone (warm neutrals) ---------- */
	--cdb-white:     #FFFFFF;
	--cdb-stone-25:  #FCFAF6;
	--cdb-ivory:     #FAF7F2; /* page background */
	--cdb-stone-100: #EFE9DF;
	--cdb-stone-200: #E1D9CC;
	--cdb-stone-300: #C9BFB0;
	--cdb-stone-400: #A39888;
	--cdb-stone-500: #7E7465;
	--cdb-stone-600: #5F574B;
	--cdb-stone-700: #463F36;
	--cdb-stone-800: #2E2A24;
	--cdb-ink:       #1C1915; /* body text */

	/* ---------- Colour: Status ---------- */
	--cdb-success:    #2E7D4F;
	--cdb-success-bg: #E6F2EA;
	--cdb-warning:    #9A5B0B;
	--cdb-warning-bg: #FBF0DD;
	--cdb-danger:     #B3261E;
	--cdb-danger-bg:  #FBE9E7;
	--cdb-info:       #2B6CB0;
	--cdb-info-bg:    #E8F0FA;

	/* ---------- Colour: Semantic roles ---------- */
	--cdb-color-bg:             var(--cdb-ivory);
	--cdb-color-surface:        var(--cdb-white);
	--cdb-color-surface-muted:  var(--cdb-stone-100);
	--cdb-color-surface-inverse:var(--cdb-pine-900);
	--cdb-color-text:           var(--cdb-ink);
	--cdb-color-text-muted:     var(--cdb-stone-600);
	--cdb-color-text-subtle:    var(--cdb-stone-500);
	--cdb-color-text-inverse:   var(--cdb-ivory);
	--cdb-color-heading:        var(--cdb-pine-800);
	--cdb-color-link:           var(--cdb-pine-600);
	--cdb-color-link-hover:     var(--cdb-pine-800);
	--cdb-color-accent:         var(--cdb-brass-400);
	--cdb-color-accent-text:    var(--cdb-brass-700);
	--cdb-color-border:         var(--cdb-stone-200);
	--cdb-color-border-strong:  var(--cdb-stone-300);
	--cdb-color-focus:          var(--cdb-brass-500);
	--cdb-color-demo-bg:        var(--cdb-brass-100);
	--cdb-color-demo-text:      var(--cdb-brass-900);

	/* ---------- Typography ---------- */
	--cdb-font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
	--cdb-font-body:    'Public Sans', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--cdb-font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

	/* Fluid scale, ratio ~1.25 (major third). Min at 360px, max at 1280px. */
	--cdb-text-xs:   0.8125rem;                               /* 13px */
	--cdb-text-sm:   0.9375rem;                               /* 15px */
	--cdb-text-base: 1.0625rem;                               /* 17px */
	--cdb-text-lg:   clamp(1.125rem, 1.08rem + 0.2vw, 1.25rem);  /* 18 → 20 */
	--cdb-text-xl:   clamp(1.25rem, 1.17rem + 0.35vw, 1.5rem);   /* 20 → 24 */
	--cdb-text-2xl:  clamp(1.5rem, 1.35rem + 0.65vw, 1.875rem);  /* 24 → 30 */
	--cdb-text-3xl:  clamp(1.75rem, 1.5rem + 1.1vw, 2.375rem);   /* 28 → 38 */
	--cdb-text-4xl:  clamp(2.125rem, 1.7rem + 1.9vw, 3.25rem);   /* 34 → 52 */
	--cdb-text-5xl:  clamp(2.5rem, 1.8rem + 3.1vw, 4.375rem);    /* 40 → 70 */

	--cdb-leading-tight:  1.12;
	--cdb-leading-snug:   1.3;
	--cdb-leading-normal: 1.6;

	--cdb-tracking-tight:   -0.02em;
	--cdb-tracking-normal:  0;
	--cdb-tracking-eyebrow: 0.12em;

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

	--cdb-measure: 68ch; /* max line length for body copy */

	/* ---------- Spacing (4px base) ---------- */
	--cdb-space-0:  0;
	--cdb-space-1:  0.25rem;  /* 4 */
	--cdb-space-2:  0.5rem;   /* 8 */
	--cdb-space-3:  0.75rem;  /* 12 */
	--cdb-space-4:  1rem;     /* 16 */
	--cdb-space-5:  1.25rem;  /* 20 */
	--cdb-space-6:  1.5rem;   /* 24 */
	--cdb-space-8:  2rem;     /* 32 */
	--cdb-space-10: 2.5rem;   /* 40 */
	--cdb-space-12: 3rem;     /* 48 */
	--cdb-space-16: 4rem;     /* 64 */
	--cdb-space-20: 5rem;     /* 80 */
	--cdb-space-24: 6rem;     /* 96 */
	--cdb-space-32: 8rem;     /* 128 */

	/* Section rhythm: vertical padding for page bands */
	--cdb-section-y:    clamp(4rem, 2.8rem + 5vw, 7.5rem);
	--cdb-section-y-sm: clamp(2.5rem, 2rem + 2.5vw, 4rem);

	/* ---------- Layout ---------- */
	--cdb-container:        1240px;
	--cdb-container-narrow: 820px;
	--cdb-gutter:           clamp(1rem, 0.6rem + 1.8vw, 2rem);
	--cdb-header-height:    76px;

	/* ---------- Radii ---------- */
	--cdb-radius-xs:   4px;   /* tags, inputs inner */
	--cdb-radius-sm:   8px;   /* buttons, inputs */
	--cdb-radius-md:   12px;  /* small cards, menus */
	--cdb-radius-lg:   18px;  /* cards */
	--cdb-radius-xl:   28px;  /* hero media, feature panels */
	--cdb-radius-pill: 999px;

	/* ---------- Shadows (tinted with pine-950, never pure black) ---------- */
	--cdb-shadow-xs: 0 1px 2px rgb(8 26 21 / 0.06);
	--cdb-shadow-sm: 0 1px 2px rgb(8 26 21 / 0.05), 0 2px 6px rgb(8 26 21 / 0.06);
	--cdb-shadow-md: 0 2px 4px rgb(8 26 21 / 0.04), 0 8px 20px rgb(8 26 21 / 0.08);
	--cdb-shadow-lg: 0 4px 8px rgb(8 26 21 / 0.04), 0 18px 40px rgb(8 26 21 / 0.12);
	--cdb-shadow-xl: 0 8px 16px rgb(8 26 21 / 0.06), 0 32px 64px rgb(8 26 21 / 0.16);
	--cdb-shadow-focus: 0 0 0 3px var(--cdb-ivory), 0 0 0 5px var(--cdb-color-focus);

	/* ---------- Borders ---------- */
	--cdb-border-width: 1px;
	--cdb-border: var(--cdb-border-width) solid var(--cdb-color-border);

	/* ---------- Icons ---------- */
	--cdb-icon-sm: 18px;
	--cdb-icon-md: 24px;
	--cdb-icon-lg: 32px;
	--cdb-icon-stroke: 1.75;

	/* ---------- Motion ---------- */
	--cdb-ease-out:      cubic-bezier(0.22, 1, 0.36, 1);
	--cdb-ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
	--cdb-duration-fast: 120ms;
	--cdb-duration-base: 200ms;
	--cdb-duration-slow: 360ms;

	/* ---------- Layers ---------- */
	--cdb-z-base:     1;
	--cdb-z-sticky:   100;
	--cdb-z-dropdown: 200;
	--cdb-z-overlay:  300;
	--cdb-z-modal:    400;
	--cdb-z-banner:   500;
}

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