/* Base: reset, typography, layout primitives.
   Direction-aware via logical properties — no separate RTL stylesheet. */

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

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

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

body {
	margin: 0;
	background-color: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	font-weight: var(--fw-regular);
	line-height: var(--lh-body);
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-block: 0 var(--space-4);
	color: var(--color-heading);
	font-family: var(--font-heading);
	font-weight: var(--fw-heading);
	line-height: var(--lh-heading);
	text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-h6); }

p,
ul,
ol,
figure,
blockquote {
	margin-block: 0 var(--space-4);
	margin-inline: 0;
}

ul,
ol {
	padding-inline-start: 1.25em;
}

img,
svg,
video {
	display: block;
	max-inline-size: 100%;
	block-size: auto;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--ease);
}

a:hover {
	color: var(--link-hover, var(--color-heading));
}

:focus-visible {
	outline: 2px solid var(--color-focus);
	outline-offset: 3px;
}

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

strong,
b {
	font-weight: var(--fw-semibold);
}

/* Guard against decorative overhangs widening the page (RTL scrolls to the left). */
main {
	overflow-x: clip;
}

/* Layout primitives */

.container {
	inline-size: 100%;
	max-inline-size: calc(var(--container) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.container--wide {
	max-inline-size: calc(var(--container-wide) + 2 * var(--gutter));
}

.container--text {
	max-inline-size: calc(var(--container-text) + 2 * var(--gutter));
}

.section {
	padding-block: var(--space-section);
}

.section--surface {
	background-color: var(--color-surface);
}

.section--dark {
	--link-hover: #fff;
	background-color: var(--color-dark);
	color: var(--color-on-dark);
	--color-heading: var(--color-on-dark);
	--color-focus: var(--color-on-dark);
}

/* Accessibility helpers */

.screen-reader-text {
	position: absolute !important;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed;
	inset-block-start: var(--space-4);
	inset-inline-start: var(--space-4);
	z-index: 1000;
	inline-size: auto;
	block-size: auto;
	padding: var(--space-3) var(--space-5);
	clip-path: none;
	background: var(--color-btn-bg);
	color: var(--color-btn-text);
}
