/* ============================================================
   Bastion v0.3 — base resets + typography (light-first)
   ============================================================ */

@layer reset {
	*, *::before, *::after { box-sizing: border-box; }
	html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
	body, h1, h2, h3, h4, h5, h6, p, ul, ol, dl, blockquote, figure, pre { margin: 0; }
	img, picture, svg, video, canvas { max-width: 100%; height: auto; display: block; }
	button, input, select, textarea { font: inherit; color: inherit; }
	::selection { background: var(--c-accent); color: #fff; }

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

@layer base {
	body {
		min-height: 100vh;
		font-family: var(--font-sans);
		font-size:   var(--fs-base);
		line-height: var(--lh-base);
		color:       var(--c-text);
		background:  var(--c-canvas);
		-webkit-font-smoothing: antialiased;
		text-rendering: optimizeLegibility;
		font-feature-settings: "ss01", "cv11";
	}

	h1, h2, h3, h4, h5, h6 {
		font-family: var(--font-sans);
		font-weight: 700;
		line-height: var(--lh-tight);
		letter-spacing: -0.022em;
		color: var(--c-text);
	}
	h1 { font-size: clamp(2.25rem, 1.6rem + 2.5vw, 3.5rem); }
	h2 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem); }
	h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); }
	h4 { font-size: var(--fs-lg); }

	p { margin: 0 0 var(--space-4); color: var(--c-text-muted); }
	p:last-child { margin-bottom: 0; }

	a {
		color: var(--c-accent);
		text-decoration: none;
		transition: color var(--motion-fast) var(--ease-base);
	}
	a:hover { color: var(--c-accent-strong); }

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

	code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.92em; }
	:not(pre) > code {
		background: var(--c-sunken);
		color: var(--c-accent-strong);
		padding: 0.15em 0.45em;
		border-radius: 4px;
		border: 1px solid var(--c-border-subtle);
		font-size: 0.88em;
	}

	pre {
		overflow-x: auto;
		padding: var(--space-5);
		background: #0f172a;
		color: #f1f5f9;
		border-radius: var(--radius);
		line-height: 1.55;
		font-size: var(--fs-sm);
	}

	hr {
		border: 0;
		border-top: 1px solid var(--c-border-subtle);
		margin: var(--space-7) 0;
	}

	blockquote {
		margin: var(--space-5) 0;
		padding: var(--space-4) var(--space-5);
		background: var(--c-accent-soft);
		border-left: 4px solid var(--c-accent);
		border-radius: 0 var(--radius) var(--radius) 0;
		color: var(--c-text);
		font-style: italic;
	}

	/* a11y skip-link */
	.bastion-skip {
		position: absolute; left: -9999px; top: 0;
		background: var(--c-accent); color: #fff;
		padding: var(--space-2) var(--space-4);
		font-weight: 600; z-index: 9999;
	}
	.bastion-skip:focus { left: var(--space-3); top: var(--space-3); }

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

	/* Page shell */
	.site-content {
		min-height: 60vh;
	}
}
