/* Tarnside: a picture library's card index, as a Yeti theme. White bond
   cards on a blue-grey blotter in light; indigo carbon duplicates on
   blue-black in dark. Pale blue feint rules, one red head rule, violet
   endorsing ink for actions and stamps. Square corners, one-pixel rules. */

/* Repeats Yeti's layer order, so the element rules at the end land in the
   right place whichever file loads first. */
@layer yeti.reset, yeti.base, yeti.theme, yeti.layouts, yeti.components, yeti.utilities;

:root {
	/* A working index: a compact base and a quiet ratio. */
	--yeti-base-min: 0.9375rem;
	--yeti-base-max: 1rem;
	--yeti-ratio-min: 1.15;
	--yeti-ratio-max: 1.2;

	/* A news grotesque for the interface; a typewriter for whatever was
	   typed onto a card. */
	--yeti-font-sans: "Libre Franklin", system-ui, sans-serif;
	--yeti-font-mono: "Courier Prime", ui-monospace, monospace;
	--yeti-weight-normal: 400;
	--yeti-weight-strong: 600;
	--yeti-weight-bold: 700;

	/* Inks: violet endorsing ink, a red and a green stamp pad, and paper
	   and carbon that lean the same way. */
	--yeti-hue-primary: 300;
	--yeti-hue-neutral: 268;
	--yeti-hue-alert: 25;
	--yeti-hue-success: 152;
	--yeti-chroma: 0.15;

	/* The blotter, the card, and the well a print sits in. */
	--yeti-color-surface: light-dark(oklch(0.905 0.014 252), oklch(0.165 0.03 282));
	--yeti-color-surface-raised: light-dark(oklch(0.988 0.003 252), oklch(0.235 0.045 284));
	--yeti-color-surface-sunken: light-dark(oklch(0.855 0.018 252), oklch(0.12 0.028 282));

	/* Ribbon black on bond; pale lavender on carbon. */
	--yeti-color-text: light-dark(oklch(0.22 0.025 282), oklch(0.91 0.028 290));
	--yeti-color-text-muted: light-dark(oklch(0.42 0.03 275), oklch(0.74 0.035 288));

	/* The feint, and the heavier rule of a printed box. */
	--yeti-color-border: light-dark(oklch(0.74 0.055 245), oklch(0.40 0.06 278));
	--yeti-color-border-strong: light-dark(oklch(0.50 0.06 255), oklch(0.62 0.06 282));

	/* Nothing is rounded and nothing floats. */
	--yeti-radius-sm: 0;
	--yeti-radius-md: 0;
	--yeti-radius-lg: 0;
	--yeti-radius-full: 0;
	--yeti-badge-radius: 0;
	--yeti-shadow-sm: none;
	--yeti-shadow-md: none;
	--yeti-card-border: var(--yeti-color-border-strong);
	--yeti-control-border: var(--yeti-color-border-strong);
	--yeti-control-surface: var(--yeti-color-surface-raised);
}

/* bridge: Web Awesome follows Yeti */
:root {
	--wa-font-family-body: var(--yeti-font-sans);
	--wa-font-family-heading: var(--yeti-font-heading);
	--wa-font-family-code: var(--yeti-font-mono);
	--wa-font-size-m: var(--yeti-text-md);
	--wa-font-weight-semibold: var(--yeti-weight-strong);
	--wa-font-weight-bold: var(--yeti-weight-bold);

	--wa-color-surface-default: var(--yeti-color-surface);
	--wa-color-surface-raised: var(--yeti-color-surface-raised);
	--wa-color-surface-lowered: var(--yeti-color-surface-sunken);
	--wa-color-surface-border: var(--yeti-color-border);
	--wa-color-text-normal: var(--yeti-color-text);
	--wa-color-text-quiet: var(--yeti-color-text-muted);
	--wa-color-text-link: var(--yeti-link-color);
	--wa-color-focus: var(--yeti-color-focus);
	--wa-form-control-border-color: var(--yeti-control-border);
	--wa-form-control-background-color: var(--yeti-control-surface);
	--wa-form-control-placeholder-color: var(--yeti-color-text-muted);

	--wa-color-brand-fill-quiet: var(--yeti-color-primary-subtle);
	--wa-color-brand-fill-normal: var(--yeti-color-primary-soft);
	--wa-color-brand-fill-loud: var(--yeti-color-primary);
	--wa-color-brand-border-quiet: var(--yeti-color-primary-soft);
	--wa-color-brand-border-normal: var(--yeti-color-primary-soft);
	--wa-color-brand-border-loud: var(--yeti-color-primary);
	--wa-color-brand-on-quiet: var(--yeti-color-primary-text);
	--wa-color-brand-on-normal: var(--yeti-color-primary-text);
	--wa-color-brand-on-loud: var(--yeti-on-primary);

	--wa-color-neutral-fill-quiet: var(--yeti-color-neutral-subtle);
	--wa-color-neutral-fill-normal: var(--yeti-color-neutral-soft);
	--wa-color-neutral-fill-loud: var(--yeti-color-neutral);
	--wa-color-neutral-border-quiet: var(--yeti-color-neutral-soft);
	--wa-color-neutral-border-normal: var(--yeti-color-neutral-soft);
	--wa-color-neutral-border-loud: var(--yeti-color-neutral);
	--wa-color-neutral-on-quiet: var(--yeti-color-neutral-text);
	--wa-color-neutral-on-normal: var(--yeti-color-neutral-text);
	--wa-color-neutral-on-loud: var(--yeti-on-neutral);

	--wa-color-success-fill-quiet: var(--yeti-color-success-subtle);
	--wa-color-success-fill-normal: var(--yeti-color-success-soft);
	--wa-color-success-fill-loud: var(--yeti-color-success);
	--wa-color-success-border-quiet: var(--yeti-color-success-soft);
	--wa-color-success-border-normal: var(--yeti-color-success-soft);
	--wa-color-success-border-loud: var(--yeti-color-success);
	--wa-color-success-on-quiet: var(--yeti-color-success-text);
	--wa-color-success-on-normal: var(--yeti-color-success-text);
	--wa-color-success-on-loud: var(--yeti-on-success);

	--wa-color-warning-fill-quiet: var(--yeti-color-warning-subtle);
	--wa-color-warning-fill-normal: var(--yeti-color-warning-soft);
	--wa-color-warning-fill-loud: var(--yeti-color-warning);
	--wa-color-warning-border-quiet: var(--yeti-color-warning-soft);
	--wa-color-warning-border-normal: var(--yeti-color-warning-soft);
	--wa-color-warning-border-loud: var(--yeti-color-warning);
	--wa-color-warning-on-quiet: var(--yeti-color-warning-text);
	--wa-color-warning-on-normal: var(--yeti-color-warning-text);
	--wa-color-warning-on-loud: var(--yeti-on-warning);

	--wa-color-danger-fill-quiet: var(--yeti-color-alert-subtle);
	--wa-color-danger-fill-normal: var(--yeti-color-alert-soft);
	--wa-color-danger-fill-loud: var(--yeti-color-alert);
	--wa-color-danger-border-quiet: var(--yeti-color-alert-soft);
	--wa-color-danger-border-normal: var(--yeti-color-alert-soft);
	--wa-color-danger-border-loud: var(--yeti-color-alert);
	--wa-color-danger-on-quiet: var(--yeti-color-alert-text);
	--wa-color-danger-on-normal: var(--yeti-color-alert-text);
	--wa-color-danger-on-loud: var(--yeti-on-alert);

	--wa-border-radius-s: var(--yeti-radius-sm);
	--wa-border-radius-m: var(--yeti-radius-md);
	--wa-border-radius-l: var(--yeti-radius-lg);
	--wa-border-width-s: var(--yeti-border-width);
	--wa-form-control-border-radius: var(--yeti-control-radius);
	--wa-form-control-height: var(--yeti-control-size);
	--wa-form-control-label-font-weight: var(--yeti-weight-strong);
}
wa-button::part(base) { border-radius: var(--yeti-button-radius); }
/* end bridge */

/* Element rules, in the theme layer: below layouts and components, so they
   never reach a component's own parts. */
@layer yeti.theme {
	/* The parts of the browser nobody drew still belong to the desk. */
	html {
		scrollbar-color: var(--yeti-color-border-strong) transparent;
		caret-color: var(--yeti-color-primary);
	}

	::selection {
		background-color: var(--yeti-color-primary-soft);
		color: var(--yeti-color-text);
	}
}
