/**
 * SMM Fame design-system foundations.
 *
 * Loaded after the legacy theme and account styles so these canonical tokens
 * are the single presentation-layer source of truth during the staged refresh.
 */

:root {
	color-scheme: light;

	/* Canonical brand and semantic colours. */
	--smm-primary: #6d28d9;
	--smm-primary-dark: #4c1d95;
	--smm-primary-light: #ede9fe;
	--smm-accent: #8b5cf6;
	--smm-page-background: #f8f7ff;
	--smm-soft-background: #f3f0ff;
	--smm-surface: #ffffff;
	--smm-text: #11132b;
	--smm-muted: #626981;
	--smm-border: #e4e1ef;
	--smm-success: #15803d;
	--smm-warning: #b45309;
	--smm-danger: #b42336;

	/* Eight-pixel layout rhythm. */
	--smm-space-1: 8px;
	--smm-space-2: 16px;
	--smm-space-3: 24px;
	--smm-space-4: 32px;
	--smm-space-5: 40px;
	--smm-space-6: 48px;
	--smm-space-8: 64px;
	--smm-space-10: 80px;
	--smm-space-12: 96px;

	/* Type, shape, elevation, and motion. */
	--smm-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	--smm-font-size-sm: 0.875rem;
	--smm-font-size-xs: 0.75rem;
	--smm-radius-sm: 14px;
	--smm-radius-md: 18px;
	--smm-radius-lg: 24px;
	--smm-shadow-sm: 0 6px 20px rgba(39, 24, 82, 0.06);
	--smm-shadow-md: 0 18px 48px rgba(39, 24, 82, 0.09);
	--smm-focus-color: #6d28d9;
	--smm-focus-ring: 0 0 0 4px rgba(109, 40, 217, 0.18);
	--smm-transition-fast: 160ms ease;
	--smm-container: 1240px;
	--smm-reading-width: 760px;

	/* Legacy aliases retained while existing templates migrate by phase. */
	--smm-ink: var(--smm-text);
	--smm-ink-2: #242746;
	--smm-purple: var(--smm-primary);
	--smm-purple-dark: var(--smm-primary-dark);
	--smm-lavender: var(--smm-soft-background);
	--smm-mint: #eaf8ef;
	--smm-green: var(--smm-success);
	--smm-white: var(--smm-surface);
	--smm-radius: var(--smm-radius-md);
	--smm-shadow: var(--smm-shadow-md);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 96px;
	-webkit-text-size-adjust: 100%;
}

body {
	min-width: 0;
	margin: 0;
	background: var(--smm-page-background);
	color: var(--smm-text);
	font-family: var(--smm-font-sans);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Keep the active SMM Fame theme full width even if preview tooling injects a generic body constraint. */
body.smm-fame-theme-layout {
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
}

main,
header,
footer,
nav,
section,
article,
aside,
form {
	min-width: 0;
}

img,
svg {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

button,
input,
select,
textarea {
	font: inherit;
}

button,
a {
	-webkit-tap-highlight-color: transparent;
}

a {
	color: var(--smm-primary);
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.18em;
	transition: color var(--smm-transition-fast);
}

a:hover {
	color: var(--smm-primary-dark);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-top: 0;
	color: var(--smm-text);
	font-weight: 750;
	letter-spacing: -0.035em;
	line-height: 1.12;
	text-wrap: balance;
}

p,
li,
dd {
	overflow-wrap: break-word;
}

::selection {
	background: var(--smm-primary-light);
	color: var(--smm-primary-dark);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--smm-focus-color);
	outline-offset: 3px;
}

.site-container {
	width: min(var(--smm-container), calc(100% - 48px));
	margin-inline: auto;
}

.narrow-container {
	width: min(var(--smm-reading-width), 100%);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	z-index: 100000;
	top: var(--smm-space-2);
	left: var(--smm-space-2);
	width: auto;
	height: auto;
	padding: 12px 18px;
	clip: auto;
	clip-path: none;
	border-radius: var(--smm-radius-sm);
	background: var(--smm-surface);
	box-shadow: var(--smm-shadow-md), var(--smm-focus-ring);
	color: var(--smm-text);
}

.skip-link {
	position: fixed !important;
}

@media (max-width: 1024px) {
	:root {
		--smm-space-10: 72px;
		--smm-space-12: 80px;
	}
}

@media (max-width: 640px) {
	.site-container {
		width: min(var(--smm-container), calc(100% - 32px));
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
