/*
 * Every value the app's CSS draws with: nothing is hardcoded anywhere else.
 *
 * The first half is the We Invest brand's, as wire-design-system 0.84.0 defined it, cut down to what this app uses:
 * the app's own from here on, changed here when it needs to change. Components read the semantic layer (text,
 * background, border, feedback) rather than the palette where one fits. The second half is what the brand does not
 * define: the score scale, surfaces, stacking.
 */
:root {
	/* Palette */
	--amber-50: #fef6e7;
	--amber-100: #fce9be;
	--amber-300: #f4bf5c;
	--amber-600: #c9870b;
	--base-white: #ffffff;
	--blue-50: #eaf2fe;
	--blue-100: #cadffc;
	--blue-600: #205bc4;
	--blue-gray-50: #f2f6f9;
	--blue-gray-300: #8bb5dd;
	--blue-gray-400: #5c89b4;
	--blue-gray-900: #172c40;
	--gray-50: #f8fafb;
	--gray-100: #f1f4f6;
	--gray-200: #e4e8ec;
	--gray-300: #cfd6dc;
	--gray-400: #a9b3bc;
	--gray-600: #5a6670;
	--gray-700: #434d56;
	--green-50: #e8f7ee;
	--green-100: #c7ebd4;
	--green-400: #3dba73;
	--green-600: #16864b;
	--green-700: #116b3c;
	--red-50: #fdecec;
	--red-100: #f9cfcf;
	--red-300: #e97676;
	--red-600: #be2a2a;
	--turquoise-50: #e9fcfc;
	--turquoise-500: #21cfd3;
	--turquoise-600: #1892a2;
	--turquoise-700: #027686;
	--turquoise-800: #194f5f;

	/* Spacing and borders */
	--border-1: 1px;
	--border-2: 2px;
	--space-1: 4px;
	--space-2: 8px;
	--space-3: 12px;
	--space-4: 16px;
	--space-5: 20px;
	--space-6: 24px;
	--space-8: 32px;
	--space-10: 40px;
	--space-16: 64px;
	--space-20: 80px;

	/*
	 * Type. Inter is not shipped with the app: the layout loads it from Google Fonts, upright and italic. Peer notes are
	 * set in italic to mark them as somebody speaking, and without the real italic the browser slants the upright, which
	 * is exactly the tell to avoid.
	 */
	--font-family-sans: Inter, system-ui, -apple-system, sans-serif;
	--font-line-height-4xl: 44px;
	--font-line-height-base: 24px;
	--font-line-height-lg: 28px;
	--font-line-height-sm: 20px;
	--font-line-height-xl: 28px;
	--font-line-height-xs: 16px;
	--font-size-2xl: 24px;
	--font-size-4xl: 36px;
	--font-size-base: 16px;
	--font-size-lg: 18px;
	--font-size-sm: 14px;
	--font-size-xl: 20px;
	--font-size-xs: 12px;
	--font-weight-medium: 500;
	--font-weight-regular: 400;
	--font-weight-semibold: 600;

	/* Radii and effects */
	--radius-full: 9999px;
	--radius-lg: 12px;
	--radius-md: 8px;
	--radius-sm: 4px;
	--radius-xl: 16px;
	--focus-ring: 0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 4px rgba(33, 207, 211, 1);
	--shadow-md: 0px 0px 0px 1px rgba(0, 0, 0, 0.05), 0px 2px 4px 0px rgba(23, 44, 64, 0.06), 0px 4px 8px 0px rgba(23, 44, 64, 0.1);

	/* Semantic layer: what a colour is for */
	--background-accent-subtle: var(--turquoise-50);
	--background-page: var(--base-white);
	--background-sunken: var(--gray-50);
	--background-surface: var(--base-white);
	--border-default: var(--gray-200);
	--border-focus: var(--turquoise-500);
	--border-strong: var(--gray-300);
	--border-subtle: var(--gray-100);
	--feedback-error-bg: var(--red-50);
	--feedback-error-border: var(--red-100);
	--feedback-error-fg: var(--red-600);
	--feedback-info-bg: var(--blue-50);
	--feedback-info-border: var(--blue-100);
	--feedback-info-fg: var(--blue-600);
	--feedback-success-bg: var(--green-50);
	--feedback-success-border: var(--green-100);
	--feedback-success-fg: var(--green-600);
	--feedback-warning-bg: var(--amber-50);
	--feedback-warning-border: var(--amber-100);
	--feedback-warning-fg: var(--amber-600);
	--interactive-primary-bg: var(--blue-gray-900);
	--interactive-primary-fg: var(--base-white);
	--text-disabled: var(--gray-400);
	--text-link: var(--turquoise-700);
	--text-primary: var(--blue-gray-900);
	--text-secondary: var(--gray-700);
	--text-tertiary: var(--gray-600);
}

/*
 * The score scale, and what else the brand does not define.
 *
 * Deliberately thin. The 1-5 score scale is NOT a new palette: it composes the --feedback-*
 * triples above, which happen to land on the same green / blue / grey / amber / red the
 * team already reads in the Notion database. A 5 looks like a 5 to someone who has never
 * opened this app.
 */
:root {
	/* 5 — Exceptional */
	--score-5-bg: var(--feedback-success-bg);
	--score-5-border: var(--feedback-success-border);
	--score-5-fg: var(--feedback-success-fg);

	/* 4 — Exceeds expectations */
	--score-4-bg: var(--feedback-info-bg);
	--score-4-border: var(--feedback-info-border);
	--score-4-fg: var(--feedback-info-fg);

	/* 3 — Meets expectations. Neutral on purpose: the common case must not shout. */
	--score-3-bg: var(--gray-50);
	--score-3-border: var(--gray-200);
	--score-3-fg: var(--text-secondary);

	/* 2 — Below expectations */
	--score-2-bg: var(--feedback-warning-bg);
	--score-2-border: var(--feedback-warning-border);
	--score-2-fg: var(--feedback-warning-fg);

	/* 1 — Needs improvement */
	--score-1-bg: var(--feedback-error-bg);
	--score-1-border: var(--feedback-error-border);
	--score-1-fg: var(--feedback-error-fg);

	/*
	 * Solid marks for the score meter.
	 *
	 * The --score-*-bg triples above are page backgrounds; at five pixels tall they
	 * disappear. These are the same five meanings at full strength, and they are the only
	 * place the scale is drawn as colour without its number beside it. That is allowed on
	 * a meter, which reports a record, and not on the ladder, where somebody is still
	 * deciding what is true.
	 */
	--score-5-mark: var(--green-400);
	--score-4-mark: var(--blue-gray-300);
	--score-3-mark: var(--gray-400);
	--score-2-mark: var(--amber-300);
	--score-1-mark: var(--red-300);
	--score-none-mark: var(--gray-200);

	/*
	 * The app's own stacking order. Nothing else stacks (no portal, no modal, no tooltip),
	 * so these stay in single digits and are named rather than guessed at.
	 */
	--z-focus: 1;
	--z-sticky: 2;

	/*
	 * Surfaces.
	 *
	 * A sheet on a tinted ground, not a field of cards. The ground is blue-gray-50 rather
	 * than a neutral grey: the tint is the brand's own hue, and it is what lets a plain
	 * white sheet read as an object without a shadow under it.
	 */
	/*
	 * The lift shadow, and the two reasons it is not --shadow-md.
	 *
	 * Every brand shadow opens with `0 0 0 1px rgba(0,0,0,.05)`: a one pixel spread
	 * ring that reads as a border. Right for a card on a page, wrong for a row raised
	 * inside a bordered sheet, where it lands a pixel in from the sheet's own border.
	 *
	 * And the spread is negative here so the shadow pools below the row rather than around
	 * it. A lift is a vertical move; a shadow that also bleeds sideways settles onto the
	 * sheet's left and right borders and thickens them, which is what made a raised row
	 * read as a duplicated one.
	 */
	--app-lift: 0 1px 2px -1px rgba(23, 44, 64, 0.14), 0 8px 14px -6px rgba(23, 44, 64, 0.28);

	--app-ground: var(--blue-gray-50);
	--app-sheet: var(--background-surface);
	--app-sheet-radius: var(--radius-xl);
	--app-rule: var(--border-default);
	--app-hairline: var(--gray-100);

	/* An indicator that still owes a written note. Same amber as "below expectations",
	   because that is usually why the note is owed. */
	--note-owed-bg: var(--feedback-warning-bg);
	--note-owed-border: var(--feedback-warning-fg);
	--note-owed-fg: var(--feedback-warning-fg);
}
