/**
 * base.css
 * Reset + base typography + accessibility primitives.
 * Consumes tokens from variables.css only — no literal colors/sizes here.
 */

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

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

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
	margin: 0;
}

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

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

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

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

a {
	color: inherit;
	text-decoration: none;
}

table {
	border-collapse: collapse;
	width: 100%;
}

/* ---------------------------------------------------------------
 * Base document
 * ------------------------------------------------------------- */
html, body {
	background-color: var(--color-bg);
}

body {
	color: var(--color-text);
	font-family: var(--font-sans);
	font-size: var(--font-size-body);
	line-height: var(--line-height-body);
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

/* ---------------------------------------------------------------
 * Typography
 * ------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
	font-weight: 600;
	line-height: var(--line-height-heading);
	letter-spacing: -0.02em;
	color: var(--color-text);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: 1.125rem; font-weight: 500; }
h5, h6 { font-size: 1rem; font-weight: 500; }

p {
	color: var(--color-text-secondary);
}

p + p {
	margin-top: var(--space-3);
}

small, .text-small {
	font-size: var(--font-size-small);
}

.text-muted {
	color: var(--color-text-muted);
}

.text-secondary {
	color: var(--color-text-secondary);
}

.eyebrow {
	font-size: var(--font-size-small);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-text-secondary);
}

a:not([class]) {
	text-decoration: underline;
	text-decoration-color: var(--color-border);
	text-underline-offset: 3px;
	transition: color var(--duration-base) var(--ease-standard);
}

a:not([class]):hover {
	color: var(--color-text-secondary);
}

/* ---------------------------------------------------------------
 * Selection
 * ------------------------------------------------------------- */
::selection {
	background-color: var(--color-text);
	color: var(--color-bg);
}

/* ---------------------------------------------------------------
 * Accessibility primitives (§22)
 * ------------------------------------------------------------- */
.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;
}

.skip-link {
	position: fixed;
	top: -100px;
	left: var(--space-3);
	z-index: var(--z-toast);
	background-color: var(--color-accent);
	color: var(--color-accent-text);
	padding: var(--space-2) var(--space-3);
	border-radius: var(--radius-sm);
	transition: top var(--duration-base) var(--ease-standard);
}

.skip-link:focus {
	top: var(--space-3);
	position: fixed;
}

/* Consistent, visible focus ring across every interactive element. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
	border-radius: var(--radius-sm);
}

/* Remove the default focus ring only when :focus-visible is supported and
   not matched — keeps mouse clicks free of a visible ring without ever
   removing keyboard focus indication. */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
	outline: none;
}
