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

html {
	direction: rtl;
	scroll-behavior: smooth;
	background: var(--dp-color-canvas);
}

body {
	margin: 0;
	background: var(--dp-color-canvas);
	color: var(--dp-color-ink);
	font-family: var(--dp-font-sans);
	font-size: var(--dp-text-base);
	line-height: var(--dp-leading-base);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

body,
button,
input,
select,
textarea {
	font-family: var(--dp-font-sans);
}

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

a {
	color: var(--dp-color-brand);
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--dp-color-brand-hover);
}

button,
a,
input,
select,
textarea {
	transition:
		color var(--dp-motion-fast) ease,
		background-color var(--dp-motion-fast) ease,
		border-color var(--dp-motion-fast) ease,
		box-shadow var(--dp-motion-fast) ease;
}

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

::selection {
	background: var(--dp-color-accent-soft);
	color: var(--dp-color-ink);
}

h1,
h2,
h3,
h4,
p {
	margin-block-start: 0;
}

h1,
h2,
h3,
h4 {
	line-height: var(--dp-leading-tight);
	letter-spacing: -0.02em;
}

h1 { font-size: var(--dp-text-3xl); }
h2 { font-size: var(--dp-text-2xl); }
h3 { font-size: var(--dp-text-xl); }
h4 { font-size: var(--dp-text-lg); }

p,
li {
	max-width: 72ch;
}

.dp-container {
	width: min(calc(100% - 2rem), var(--dp-container));
	margin-inline: auto;
}

.dp-reading {
	width: min(100%, var(--dp-reading));
}

.dp-main {
	min-height: 50vh;
}

.dp-content {
	padding-block: var(--dp-space-8) var(--dp-space-16);
}

.dp-skip-link {
	position: fixed;
	inset-block-start: var(--dp-space-3);
	inset-inline-start: var(--dp-space-3);
	z-index: 9999;
	transform: translateY(-200%);
	padding: var(--dp-space-3) var(--dp-space-4);
	border-radius: var(--dp-radius-md);
	background: var(--dp-color-ink);
	color: #fff;
	font-weight: 700;
}

.dp-skip-link:focus {
	transform: translateY(0);
}

.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;
}

@media (min-width: 48rem) {
	.dp-container {
		width: min(calc(100% - 3rem), var(--dp-container));
	}
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
