/**
 * Reset and element defaults.
 */

@layer reset {
	*,
	*::before,
	*::after {
		box-sizing: border-box;
	}

	* {
		margin: 0;
	}

	html {
		-webkit-text-size-adjust: 100%;
		scroll-behavior: smooth;
		scroll-padding-top: calc(var(--dyt-header-height) + var(--dyt-space-5));
	}

	@media (prefers-reduced-motion: reduce) {
		html {
			scroll-behavior: auto;
		}
	}

	img,
	picture,
	svg,
	video,
	canvas {
		display: block;
		max-width: 100%;
		height: auto;
	}

	input,
	button,
	textarea,
	select {
		font: inherit;
		color: inherit;
	}

	button {
		background: none;
		border: 0;
		cursor: pointer;
	}

	ul[class],
	ol[class] {
		list-style: none;
		padding: 0;
	}

	table {
		border-collapse: collapse;
		width: 100%;
	}
}

@layer base {
	body {
		background-color: var(--dyt-bg);
		color: var(--dyt-text);
		font-family: var(--dyt-font-sans);
		font-size: var(--dyt-text-base);
		line-height: var(--dyt-leading-normal);
		font-synthesis-weight: none;
		-webkit-font-smoothing: antialiased;
		text-rendering: optimizeLegibility;
		overflow-x: hidden;
	}

	body.dyt-nav-open {
		overflow: hidden;
	}

	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		font-weight: var(--dyt-heading-weight, 600);
		line-height: var(--dyt-leading-tight);
		letter-spacing: var(--dyt-tracking-tight);
		text-wrap: balance;
	}

	h1 {
		font-size: var(--dyt-text-4xl);
	}

	h2 {
		font-size: var(--dyt-text-3xl);
	}

	h3 {
		font-size: var(--dyt-text-2xl);
	}

	h4 {
		font-size: var(--dyt-text-xl);
	}

	p,
	li {
		text-wrap: pretty;
	}

	a {
		color: inherit;
		text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
		text-underline-offset: 0.2em;
		transition: color var(--dyt-duration-fast) var(--dyt-ease);
	}

	a:hover {
		color: var(--dyt-brand-soft);
	}

	:focus-visible {
		outline: 2px solid var(--dyt-brand-soft);
		outline-offset: 3px;
		border-radius: var(--dyt-radius-sm);
	}

	::selection {
		background: color-mix(in srgb, var(--dyt-brand) 40%, transparent);
		color: var(--dyt-text);
	}

	hr {
		border: 0;
		border-top: 1px solid var(--dyt-border);
		margin-block: var(--dyt-space-8);
	}

	/* Prose: the one place editor HTML is allowed to set its own rhythm. */
	.dyt-prose {
		color: var(--dyt-text-secondary);
		font-size: var(--dyt-body-size, var(--dyt-text-lg));
		line-height: var(--dyt-leading-relaxed);
	}

	.dyt-prose > * + * {
		margin-top: var(--dyt-space-5);
	}

	.dyt-prose h2,
	.dyt-prose h3,
	.dyt-prose h4 {
		color: var(--dyt-text);
		margin-top: var(--dyt-space-8);
	}

	.dyt-prose ul,
	.dyt-prose ol {
		padding-left: 1.25em;
	}

	.dyt-prose li + li {
		margin-top: var(--dyt-space-2);
	}

	.dyt-prose a {
		color: var(--dyt-brand-soft);
		text-decoration: underline;
	}

	.dyt-prose img,
	.dyt-prose figure {
		border-radius: var(--dyt-radius);
		overflow: hidden;
	}

	.dyt-prose blockquote {
		border-left: 2px solid var(--dyt-brand);
		padding-left: var(--dyt-space-5);
		font-size: var(--dyt-text-xl);
		color: var(--dyt-text);
	}

	.dyt-prose code {
		font-family: var(--dyt-font-mono);
		font-size: 0.9em;
		background: var(--dyt-bg-inset);
		padding: 0.15em 0.4em;
		border-radius: var(--dyt-radius-sm);
	}

	.dyt-prose pre {
		background: var(--dyt-bg-inset);
		border: 1px solid var(--dyt-border);
		border-radius: var(--dyt-radius);
		padding: var(--dyt-space-5);
		overflow-x: auto;
	}
}

@layer utilities {
	.dyt-sr-only {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.dyt-skip-link {
		position: absolute;
		top: -100%;
		left: var(--dyt-space-4);
		z-index: var(--dyt-z-modal);
		padding: var(--dyt-space-3) var(--dyt-space-5);
		background: var(--dyt-brand);
		color: #fff;
		border-radius: var(--dyt-radius-sm);
		text-decoration: none;
	}

	.dyt-skip-link:focus {
		top: var(--dyt-space-4);
	}

	.dyt-balance {
		text-wrap: balance;
	}

	.dyt-gradient-text {
		background: var(--dyt-gradient);
		-webkit-background-clip: text;
		background-clip: text;
		color: transparent;
	}

	[hidden] {
		display: none !important;
	}
}
