/**
 * Design Bible v1.0 tokens — Modern Literary Enchantment.
 * Semantic custom properties; world keys remap --mh-world-*.
 */

:root {
	/* Core Michelle palette */
	--mh-midnight-ink: #11141C;
	--mh-deep-ink: #1B202B;
	--mh-book-paper: #F3EEE4;
	--mh-soft-parchment: #DDD3C2;
	--mh-antique-gold: #B79A62;
	--mh-inkwell-plum: #604956;
	--mh-ink-text: #25242A;
	--mh-paper-text: #EEE9E0;

	/* World palettes (raw, referenced by context) */
	--mh-vespera-accent: #766D91;
	--mh-vespera-soft: #C8C4D5;
	--mh-vespera-glow: #A9674D;
	--mh-moonlight-accent: #8396A8;
	--mh-moonlight-soft: #A8BDB4;
	--mh-moonlight-glow: #D5B477;

	/* Semantic surfaces */
	--mh-color-bg: var(--mh-book-paper);
	--mh-color-bg-subtle: var(--mh-soft-parchment);
	--mh-color-bg-inverse: var(--mh-midnight-ink);
	--mh-color-bg-inverse-subtle: var(--mh-deep-ink);
	--mh-color-text: var(--mh-ink-text);
	--mh-color-text-inverse: var(--mh-paper-text);
	--mh-color-accent: var(--mh-antique-gold);
	--mh-color-accent-personal: var(--mh-inkwell-plum);
	--mh-color-border: var(--mh-soft-parchment);
	--mh-color-selection-bg: var(--mh-inkwell-plum);
	--mh-color-selection-text: var(--mh-paper-text);

	/* Form feedback — readable, never gold-only */
	--mh-color-danger: #8a2f3a;
	--mh-color-danger-soft: #f3d8d4;
	--mh-color-success: #2f5340;
	--mh-color-success-soft: #d7e4d8;

	/* World context (Michelle default). Worlds remap these. */
	--mh-world-accent: var(--mh-antique-gold);
	--mh-world-soft: var(--mh-soft-parchment);
	--mh-world-glow: var(--mh-antique-gold);
	--mh-world-symbol: "✦";

	/* Typography */
	--mh-font-display: "Cormorant Garamond", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--mh-font-body: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--mh-leading-display: 1.15;
	--mh-leading-body: 1.7;
	--mh-leading-ui: 1.4;
	--mh-measure-reading: 72ch;
	--mh-tracking-label: 0.12em;
	--mh-tracking-meta: 0.06em;

	/* Responsive type scale (Design Bible desktop ranges) */
	--mh-size-hero: clamp(2.5rem, 1.8rem + 2.4vw, 4rem);
	--mh-size-h1: clamp(2.125rem, 1.6rem + 1.8vw, 3.5rem);
	--mh-size-h2: clamp(1.875rem, 1.45rem + 1.3vw, 2.75rem);
	--mh-size-h3: clamp(1.625rem, 1.35rem + 0.9vw, 2.125rem);
	--mh-size-h4: clamp(1.375rem, 1.2rem + 0.55vw, 1.75rem);
	--mh-size-lead: clamp(1.1875rem, 1.12rem + 0.25vw, 1.3125rem);
	--mh-size-body: clamp(1.0625rem, 1.03rem + 0.15vw, 1.125rem);
	--mh-size-meta: clamp(0.8125rem, 0.8rem + 0.08vw, 0.875rem);
	--mh-size-ui: clamp(0.875rem, 0.85rem + 0.12vw, 1rem);

	/* Spacing rhythm: 4 → 8 → 12 → 16 → 24 → 32 → 48 → 64 → 96 → 128 → 160 */
	--mh-space-4: 0.25rem;
	--mh-space-8: 0.5rem;
	--mh-space-12: 0.75rem;
	--mh-space-16: 1rem;
	--mh-space-24: 1.5rem;
	--mh-space-32: 2rem;
	--mh-space-48: 3rem;
	--mh-space-64: 4rem;
	--mh-space-96: 6rem;
	--mh-space-128: 8rem;
	--mh-space-160: 10rem;
	--mh-section-space: clamp(4rem, 3rem + 4vw, 8rem);
	--mh-gutter: clamp(1rem, 0.6rem + 2vw, 2rem);

	/* Widths */
	--mh-width-reading: 46.25rem; /* 740px */
	--mh-width-editorial: 73.75rem; /* 1180px */
	--mh-width-immersive: 87.5rem; /* 1400px */
	--mh-width-composition: 78.75rem; /* 1260px */
	--mh-grid-columns: 12;
	--mh-grid-gap: var(--mh-space-24);

	/* Shape */
	--mh-radius-subtle: 3px;
	--mh-radius-control: 3px;
	--mh-border-hairline: 1px solid var(--mh-color-border);
	--mh-border-accent: 1px solid var(--mh-color-accent);

	/* Focus — visible on light and dark */
	--mh-focus-color: var(--mh-antique-gold);
	--mh-focus-ink: var(--mh-ink-text);
	--mh-focus-width: 2px;
	--mh-focus-offset: 3px;
	--mh-focus-ring: 0 0 0 var(--mh-focus-width) var(--mh-focus-color);
	--mh-focus-ring-ink: 0 0 0 4px var(--mh-book-paper), 0 0 0 6px var(--mh-ink-text);

	/* Motion */
	--mh-duration-fast: 180ms;
	--mh-duration-standard: 220ms;
	--mh-duration-reveal: 400ms;
	--mh-duration-lunar: 1800ms;
	--mh-ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
	--mh-ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
	--mh-motion-distance: 3px;
	--mh-hover-scale: 1.02;
	--mh-lunar-duration: var(--mh-duration-lunar);

	/* Header */
	--mh-header-height: 4.5rem;
	--mh-header-height-compact: 3.5rem;
	--mh-touch: 2.75rem;

	/* z-index */
	--mh-z-header: 40;
	--mh-z-nav: 50;
	--mh-z-skip: 80;
	--mh-z-lunar: 60;
}

/* World contextual remaps — future worlds add a block here. */
[data-mh-world="vespera"] {
	--mh-world-accent: var(--mh-vespera-accent);
	--mh-world-soft: var(--mh-vespera-soft);
	--mh-world-glow: var(--mh-vespera-glow);
	--mh-world-symbol: "✦";
}

[data-mh-world="moonlight-market"] {
	--mh-world-accent: var(--mh-moonlight-accent);
	--mh-world-soft: var(--mh-moonlight-soft);
	--mh-world-glow: var(--mh-moonlight-glow);
	--mh-world-symbol: "☾";
}

[data-mh-world="michelle"] {
	--mh-world-accent: var(--mh-antique-gold);
	--mh-world-soft: var(--mh-soft-parchment);
	--mh-world-glow: var(--mh-antique-gold);
	--mh-world-symbol: "✦";
}
