/* ==========================================================================
   MSM Tools — Base
   Design tokens, reset, typography, animation primitives.
   Consolidated from the original 12 inline <style> blocks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts (vendored, no CDN)
   -------------------------------------------------------------------------- */
@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url('../fonts/inter-var-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
		U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
		U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
	/*
	 * Brand channels are kept as a bare RGB triplet as well as a hex value,
	 * so every translucent brand tint in the stylesheets can be expressed as
	 * rgba(var(--msm-brand-rgb), alpha) and follow a customised colour.
	 */
	--msm-brand-rgb: 13, 124, 109;
	--msm-brand-2-rgb: 14, 133, 116;
	--msm-brand: rgb(var(--msm-brand-rgb));
	--msm-brand-2: rgb(var(--msm-brand-2-rgb));
	--msm-brand-soft: rgba(var(--msm-brand-rgb), 0.08);
	--msm-brand-hover: #0b6357;
	--msm-gradient-angle: 67deg;
	--msm-gradient: linear-gradient(var(--msm-gradient-angle), var(--msm-brand) 0%, var(--msm-brand-2) 100%);

	/*
	 * Text that sits on top of a brand fill. Light mode's brand is dark
	 * enough for white; dark mode's is not, so this is a paired token
	 * rather than a literal #fff at every call site.
	 */
	--msm-on-brand: #ffffff;

	/*
	 * Status colours. These are deliberately outside the brand ramp: an
	 * error tinted with the brand reads as an accent, not a warning.
	 */
	--msm-danger: #b42222;
	--msm-danger-soft: rgba(180, 34, 34, 0.1);
	--msm-success: #007c42;
	--msm-success-soft: rgba(0, 124, 66, 0.12);

	--bg-body: #faf9f7;
	--bg-surface: #ffffff;
	--bg-surface-alt: #f5f4f1;
	--text-primary: #1c1917;
	--text-secondary: #57534e;
	--text-muted: #78716c;
	--text-nav: #44403c;
	--link-hover: var(--msm-brand);

	--card-bg: rgba(255, 255, 255, 0.75);
	--card-solid: #ffffff;
	--card-border: rgba(231, 229, 228, 0.9);
	--card-border-soft: rgba(255, 255, 255, 0.3);

	--shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
	--shadow-hover: 0 30px 50px -18px rgba(var(--msm-brand-rgb), 0.2);
	--shadow-pop: 0 12px 36px rgba(0, 0, 0, 0.18);

	--nav-bg: rgba(255, 255, 255, 0.7);
	--nav-height: 72px;
	--footer-bg: #ffffff;
	--input-bg: #ffffff;

	--radius: 28px;
	--radius-md: 16px;
	--radius-sm: 12px;
	--transition: 0.25s ease;
	--container: 1280px;
}

body.dark {
	/*
	 * Dark mode gets its own brand. #0d7c6d is legible on white and
	 * illegible on #0c0a09, so inheriting it would have sunk every link
	 * and icon in the dark theme.
	 */
	--msm-brand-rgb: 45, 212, 191;
	--msm-brand-2-rgb: 94, 234, 212;
	--msm-brand-hover: #5eead4;
	--msm-on-brand: #0c0a09;

	--msm-danger: #f87171;
	--msm-danger-soft: rgba(248, 113, 113, 0.15);
	--msm-success: #4ade80;
	--msm-success-soft: rgba(74, 222, 128, 0.15);

	--bg-body: #0c0a09;
	--bg-surface: #1c1917;
	--bg-surface-alt: #292524;
	--text-primary: #fafaf9;
	--text-secondary: #a8a29e;
	--text-muted: #948d88;
	--text-nav: #d6d3d1;

	--card-bg: rgba(28, 25, 23, 0.8);
	--card-solid: #1c1917;
	--card-border: #3f3b38;
	--card-border-soft: rgba(255, 255, 255, 0.05);

	--shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
	--shadow-hover: 0 30px 50px -18px rgba(var(--msm-brand-rgb), 0.3);
	--shadow-pop: 0 14px 40px rgba(0, 0, 0, 0.7);

	--nav-bg: rgba(12, 10, 9, 0.85);
	--footer-bg: #171412;
	--input-bg: #292524;
}

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
	margin: 0;
	padding: 0;
}

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	background: var(--bg-body);
	color: var(--text-primary);
	line-height: 1.6;
	padding-top: var(--nav-height);
	overflow-x: hidden;
	transition: background 0.3s, color 0.3s;
	-webkit-font-smoothing: antialiased;
}

a {
	text-decoration: none;
	color: inherit;
}

ul,
ol {
	list-style: none;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

img {
	display: block;
}

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

button {
	background: none;
	border: none;
	cursor: pointer;
}

:focus-visible {
	outline: 2px solid var(--msm-brand);
	outline-offset: 2px;
}

/* Accessibility helpers */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: -100px;
	left: 16px;
	z-index: 100000;
	padding: 12px 20px;
	border-radius: 0 0 12px 12px;
	background: var(--msm-brand);
	color: var(--msm-on-brand);
	font-weight: 600;
	transition: top 0.2s ease;
}

.skip-link:focus {
	top: 0;
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.container {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 24px;
}

.section {
	padding: 70px 0;
}

.section-header {
	text-align: center;
	margin-bottom: 48px;
}

.section-header h2 {
	font-size: 2.4rem;
	font-weight: 700;
	letter-spacing: -0.5px;
}

.section-header p {
	color: var(--text-secondary);
	max-width: 560px;
	margin: 12px auto 0;
}

/* --------------------------------------------------------------------------
   Icons (SVG sprite)
   -------------------------------------------------------------------------- */
.msm-icon {
	display: inline-block;
	width: 1em;
	height: 1em;
	vertical-align: -0.125em;
	fill: currentColor;
	flex-shrink: 0;
}

.msm-icon-gradient {
	background: var(--msm-gradient);
	-webkit-background-clip: text;
	background-clip: text;
}

/* --------------------------------------------------------------------------
   Gradient helpers
   -------------------------------------------------------------------------- */
.gradient-text {
	background: var(--msm-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.gradient-icon {
	color: var(--msm-brand);
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(40px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes zoomIn {
	from {
		opacity: 0;
		transform: scale(0.8);
	}

	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes msmFloat {
	0% {
		transform: translate(0, 0) scale(1);
	}

	100% {
		transform: translate(24px, -30px) scale(1.08);
	}
}

@keyframes msmPopIn {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.animate-on-scroll {
	opacity: 0;
	transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
		transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
	opacity: 1;
}

.fade-up {
	transform: translateY(40px);
}

.fade-up.visible {
	transform: translateY(0);
}

.fade-in {
	transform: scale(0.9);
}

.fade-in.visible {
	transform: scale(1);
}

.slide-left {
	transform: translateX(-40px);
}

.slide-left.visible {
	transform: translateX(0);
}

.slide-right {
	transform: translateX(40px);
}

.slide-right.visible {
	transform: translateX(0);
}

.zoom-in {
	transform: scale(0.85);
}

.zoom-in.visible {
	transform: scale(1);
}

/* Floating decorative shapes */
.floating-shape {
	position: absolute;
	border-radius: 50%;
	opacity: 0.2;
	pointer-events: none;
	z-index: 1;
	animation: msmFloat 12s infinite alternate ease-in-out;
}

.shape1 {
	width: 180px;
	height: 180px;
	background: var(--msm-brand);
	top: -30px;
	left: -40px;
}

.shape2 {
	width: 260px;
	height: 260px;
	background: var(--msm-brand-2);
	right: -40px;
	bottom: -60px;
	animation-duration: 18s;
}

.shape3 {
	width: 120px;
	height: 120px;
	background: var(--msm-brand);
	top: 30%;
	right: 10%;
	opacity: 0.15;
	animation-duration: 14s;
}

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

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

	.animate-on-scroll {
		opacity: 1;
		transform: none;
	}
}
