/*
  Base layer: minimal reset + accessibility primitives.

  These pages dequeue the theme's and page builders' CSS, so there is no reset
  underneath us — everything the page relies on is declared here.

  The accessibility rules are WCAG 2.2 AA requirements, not styling choices.
  Do not remove them without an accessibility review.
*/

/* ------------------------------------------------------------ Minimal reset */

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

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

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--text-body-md);
	line-height: var(--lh-body);
	color: var(--text-body);
	background: var(--surface-page);
	-webkit-font-smoothing: antialiased;
}

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

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

h1,
h2,
h3,
h4 {
	font-family: var(--font-display);
	font-weight: var(--weight-bold);
}

a {
	color: var(--link);
}

/* -------------------------------------------------- Accessibility primitives */

/* 2.4.7 Focus Visible — 3px ring on every interactive element. Never replace
   this with a colour-only change (1.4.1 Use of Color). */
*:focus-visible {
	outline: 3px solid var(--focus-ring);
	outline-offset: 2px;
	border-radius: var(--radius-sm);
}

/* Ring flips to the blue tint on dark surfaces so it stays visible
   (1.4.11 Non-text Contrast). */
.brave-section--dark *:focus-visible,
.brave-hero *:focus-visible {
	outline-color: var(--focus-ring-on-dark);
}

@keyframes brave-fade-up {
	from {
		opacity: 0;
		transform: translateY(var(--reveal-shift));
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* 2.3.3 Animation from Interactions — honour the OS reduced-motion setting. */
@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;
	}
}

/* Visually hidden, still announced by screen readers. */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset( 50% );
	white-space: nowrap;
	border: 0;
}

/* 2.4.1 Bypass Blocks — the template renders this as the first focusable
   element. Visible only on keyboard focus. */
.brave-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	padding: var(--space-3) var(--space-4);
	background: var(--surface-page);
	color: var(--ink);
	font-weight: var(--weight-semibold);
	text-decoration: underline;
}

.brave-skip-link:focus {
	left: var(--space-3);
	top: var(--space-3);
}

/* 2.5.8 Target Size (Minimum) — 44px minimum hit area on controls. */
button,
[type='button'],
[type='submit'] {
	min-height: var(--touch-target);
}
