/* ==========================================================================
   Base — reset, design tokens, typography, dark mode
   ========================================================================== */

@font-face {
	font-family: 'Vazirmatn';
	src: url('../fonts/vazirmatn/Vazirmatn[wght].woff2') format('woff2-variations'),
	     url('../fonts/vazirmatn/Vazirmatn[wght].woff2') format('woff2');
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

:root {
	--color-navy: #1f2459;
	--color-navy-deep: #141838;
	--color-teal: #3ad3b1;
	--color-coral: #f08775;
	--color-surface: #f7f8fb;
	--color-surface-2: #eef0f6;
	--color-border: #e6e8ef;
	--color-muted: #6b7088;
	--color-ink: #1a1f3a;

	--color-bg: #ffffff;
	--color-fg: var(--color-ink);
	--color-card-bg: #ffffff;
	--color-link: var(--color-navy);
	--color-link-hover: var(--color-teal);

	--shadow-soft: 0 1px 2px rgba(20, 24, 56, 0.06);
	--shadow-card: 0 12px 32px -12px rgba(20, 24, 56, 0.18);

	--font-sans: 'Vazirmatn', Tahoma, system-ui, -apple-system, sans-serif;
	--font-mono: 'Vazirmatn', ui-monospace, SFMono-Regular, Consolas, monospace;

	--radius-sm: 8px;
	--radius-md: 14px;
	--radius-lg: 22px;
	--radius-full: 999px;

	--container-max: 1120px;
	--container-narrow: 760px;

	color-scheme: light;
}

html.dark {
	--color-bg: #0f1226;
	--color-fg: #e9eaf3;
	--color-card-bg: #171b3a;
	--color-surface: #141838;
	--color-surface-2: #1b204a;
	--color-border: #2a2f5c;
	--color-muted: #9ba0c4;
	--color-link: #8fe3d0;
	--color-link-hover: var(--color-teal);
	--shadow-card: 0 12px 32px -12px rgba(0, 0, 0, 0.55);
	color-scheme: dark;
}

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

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

@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;
		scroll-behavior: auto !important;
	}
}

body {
	margin: 0;
	background: var(--color-bg);
	color: var(--color-fg);
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	transition: background-color .25s ease, color .25s ease;
}

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

a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); }

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .6em;
	font-weight: 800;
	line-height: 1.35;
	color: var(--color-fg);
}

p { margin: 0 0 1em; }

ul, ol { margin: 0 0 1em; padding-inline-start: 1.4em; }

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

/* Focus visibility for accessibility */
:focus-visible {
	outline: 3px solid var(--color-teal);
	outline-offset: 2px;
	border-radius: 4px;
}

.skip-link {
	position: absolute;
	right: 1rem;
	top: -60px;
	background: var(--color-navy-deep);
	color: #fff;
	padding: .75rem 1.25rem;
	border-radius: var(--radius-sm);
	z-index: 1000;
	transition: top .2s ease;
}
.skip-link:focus { top: 1rem; color: #fff; }

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