/* QAIL 2026 — Base styles.
 * Modern reset + html/body defaults using design tokens.
 * Honors prefers-reduced-motion for theme/state transitions.
 */

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

html {
	-webkit-text-size-adjust: 100%;
	-moz-tab-size: 4;
	tab-size: 4;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	margin: 0;
	background-color: var(--bg);
	color: var(--text);
	font-family: var(--ff-sans);
	font-size: var(--fs-body);
	line-height: var(--lh-base);
	transition:
		background-color var(--dur-theme) var(--ease-state),
		color            var(--dur-theme) var(--ease-state);
}

img, picture, video, canvas, svg {
	display: block;
	max-width: 100%;
}

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

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

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

a:hover {
	text-decoration: underline;
}

p, h1, h2, h3, h4, h5, h6 {
	margin: 0;
	overflow-wrap: break-word;
}

ul, ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

code, pre, kbd, samp {
	font-family: var(--ff-mono);
	font-size: var(--fs-mono-sm);
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: var(--radius-sm);
}

/* Reduced motion: instant theme + state transitions */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Containers */
.qail-container {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--space-5);
}

.qail-container-narrow {
	width: 100%;
	max-width: var(--container-narrow-max);
	margin-inline: auto;
	padding-inline: var(--space-5);
}

/* Section rhythm */
.qail-section {
	padding-block: var(--space-9);
}

@media (max-width: 767px) {
	.qail-section {
		padding-block: var(--space-7);
	}
}

/* Visually hidden but available to AT */
.qail-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
