/* ==========================================================================
   TONES: the 10 colours a template, routine, test or user can have.
   Mirrors TONES in fontanalyzer/looks.py; keep the two in sync.

   Put `tone t-<key>` on an element and use these variables inside it:
     --tone-bg      very light thumb background
     --tone-row     card / row background (white in light mode, tinted in dark)
     --tone-thumb   thumb background on cards (same as --tone-bg in light mode)
     --tone-line    outline and dividing lines
     --tone-solid   solid square behind a category icon (dark mode only; neutral in light)
     --tone-ink     icon colour on --tone-solid
     --hand-fill / --hand-accent / --hand-line   the three colours of a hand illustration
   Every tone is one OKLCH formula: only the hue (--h) changes, and Stone has
   its chroma (--c) lowered, so all ten are equally light.
   ========================================================================== */

.tone, .av { --c: 1; --h: 300; }
.t-lilac { --h: 300; } .t-sky { --h: 245; } .t-teal { --h: 200; } .t-mint { --h: 165; } .t-sage { --h: 130; }
.t-butter { --h: 95; } .t-apricot { --h: 65; } .t-coral { --h: 30; } .t-rose { --h: 355; } .t-stone { --h: 80; --c: .25; }

.tone {
	--tone-bg: oklch(97.5% calc(.022 * var(--c)) var(--h));
	--tone-row: var(--bgminus-color, #fff);
	--tone-thumb: var(--tone-bg);
	--tone-line: oklch(90% calc(.04 * var(--c)) var(--h));
	--tone-solid: var(--bg-color, #eee);
	--tone-ink: var(--bgnegative-color, #111);
	--hand-fill: oklch(92% calc(.06 * var(--c)) var(--h));
	--hand-accent: oklch(82% calc(.1 * var(--c)) var(--h));
	--hand-line: oklch(46% calc(.12 * var(--c)) var(--h));
}
/* user avatars: initials on a tone */
.av {
	display: inline-grid; place-items: center; flex: none;
	width: 1.75rem; height: 1.75rem; border-radius: 50%;
	font-size: .66rem; font-weight: 700; letter-spacing: .02em; line-height: 1;
	background: oklch(91% calc(.065 * var(--c)) var(--h));
	color: oklch(34% calc(.1 * var(--c)) var(--h));
}
.av.sm { width: 1.3rem; height: 1.3rem; font-size: .55rem; }
.av.lg { width: 2.6rem; height: 2.6rem; font-size: .9rem; }

@media (prefers-color-scheme: dark) {
	.tone {
		--tone-bg: oklch(24% calc(.03 * var(--c)) var(--h));
		--tone-row: oklch(17% calc(.022 * var(--c)) var(--h));
		--tone-thumb: oklch(27% calc(.045 * var(--c)) var(--h));
		--tone-line: oklch(40% calc(.07 * var(--c)) var(--h));
		--tone-solid: oklch(74% calc(.14 * var(--c)) var(--h));
		--tone-ink: oklch(14% calc(.03 * var(--c)) var(--h));
		--hand-fill: oklch(33% calc(.055 * var(--c)) var(--h));
		--hand-accent: oklch(52% calc(.09 * var(--c)) var(--h));
		--hand-line: oklch(87% calc(.08 * var(--c)) var(--h));
	}
	.av { background: oklch(38% calc(.07 * var(--c)) var(--h)); color: oklch(93% calc(.05 * var(--c)) var(--h)); }
}

/* The four standard templates: the hand in the highlight colours (stroke, fill, nails).
   Tone "standard" is CSS only, set by looks.VIEW_LEVEL_LOOKS, never picked by people.
   .tone.t-standard outranks the dark-mode .tone block above. */
.t-standard { --h: 300; }
.tone.t-standard {
	--hand-line: var(--highlight-color);
	--hand-fill: var(--highlightminusminus-color);
	--hand-accent: var(--highlightminus-color);
}

/* an inlined hand scales with its box */
.hand { display: block; }
.hand svg { display: block; width: 100%; height: auto; }

.visuallyHidden {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
