/**
 * base.css — resets and element defaults.
 * Loads after tokens.css; consumes --fn-* custom properties only.
 */

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

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

body {
	margin: 0;
	background: var(--fn-bg);
	color: var(--fn-ink);
	font-family: var(--fn-font-sans);
	font-size: var(--fn-fs-body);
	line-height: 1.62;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	font-family: var(--fn-font-sans);
	color: var(--fn-ink);
	font-weight: 700;
	text-wrap: balance;
}

p {
	margin: 0 0 1em;
}

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

a {
	color: var(--fn-accent-ink);
}

button, input, textarea, select {
	font-family: inherit;
	font-size: 100%;
	color: inherit;
}

button {
	cursor: pointer;
}

ul, ol {
	margin: 0;
	padding: 0;
}

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

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

/* One focus rule for the entire theme — never redefined per component,
   never removed. Appears only for keyboard users via :focus-visible. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--fn-accent);
	outline-offset: 2px;
	border-radius: 3px;
}

.fn-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.fn-skip-link {
	position: absolute;
	top: -100px;
	left: var(--fn-space-4);
	z-index: 1000;
	background: var(--fn-ink);
	color: var(--fn-bg);
	padding: var(--fn-space-3) var(--fn-space-4);
	border-radius: var(--fn-radius-sm);
	font-weight: 700;
	font-size: var(--fn-fs-small);
	text-decoration: none;
	transition: top 0.15s ease;
}

.fn-skip-link:focus {
	top: var(--fn-space-4);
}

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