/*
 * Vitalforce Core, base layer.
 *
 * Element defaults built only from tokens. There is not a single literal
 * colour, font size or spacing value in this file, and there should never be
 * one. If a value is missing, add the token, do not hardcode it here.
 */

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

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

@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;
		scroll-behavior: auto !important;
	}
}

body {
	margin: 0;
	/*
	 * Positioned, so that the header, which is an absolutely positioned
	 * container with a 92px offset, measures that offset from the body and
	 * not from the viewport. Without this the WordPress admin bar, which
	 * pushes the whole body down 32px for anyone logged in, left the header
	 * where it was: 32px too high, half across the last division card when
	 * the accordion was open. Visitors never saw it; the people reviewing
	 * the site always did.
	 */
	position: relative;
	background: var(--vf-color-surface);
	color: var(--vf-color-ink-500);
	font-family: var(--vf-font-body);
	font-size: var(--vf-size-body-l);
	line-height: var(--vf-leading-body-l);
	font-weight: var(--vf-weight-regular);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

/* Display and section headings all use the display face at its own weight. */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 var(--vf-space-3);
	font-family: var(--vf-font-display);
	font-weight: var(--vf-weight-regular);
	color: var(--vf-color-ink-700);
	/*
	 * Deliberately not `text-wrap: balance`.
	 *
	 * Balancing is a good default for headlines nobody has art directed, and the
	 * wrong one here: every headline in these layouts breaks where the designers
	 * chose, either as an explicit break in the copy or as a measure. Balance
	 * silently overrides both, and it does it in a way that looks like a
	 * spacing bug rather than a wrapping setting. "Your supplement concept, /
	 * ready to launch." came out as "Your supplement / concept, ready to
	 * launch." for exactly this reason.
	 */
	text-wrap: wrap;
}

h1 {
	font-size: var(--vf-size-display-xl);
	line-height: var(--vf-leading-display-xl);
}

h2 {
	font-size: var(--vf-size-display-l);
	line-height: var(--vf-leading-display-l);
	color: var(--vf-color-ink-900);
}

h3 {
	font-size: var(--vf-size-heading-m);
	line-height: var(--vf-leading-heading-m);
}

h4,
h5,
h6 {
	font-size: var(--vf-size-body-l);
	line-height: var(--vf-leading-body-l);
	font-family: var(--vf-font-body);
	font-weight: var(--vf-weight-semibold);
}

p {
	margin: 0 0 var(--vf-space-3);
	text-wrap: pretty;
}

p:last-child {
	margin-bottom: 0;
}

a {
	color: var(--vf-color-primary);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

a:hover {
	text-decoration: none;
}

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

ul,
ol {
	margin: 0 0 var(--vf-space-3);
	padding-inline-start: var(--vf-space-3);
}

figure {
	margin: 0;
}

hr {
	border: 0;
	border-top: 1px solid var(--vf-color-border);
	margin: var(--vf-space-6) 0;
}

small {
	font-size: var(--vf-size-caption);
	line-height: var(--vf-leading-caption);
}

/*
 * Focus. The layouts do not design a focus state, so this is a system
 * decision: a two-token ring that reads on both light and dark surfaces.
 * Never remove it without replacing it.
 */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--vf-color-focus);
	outline-offset: 2px;
	border-radius: var(--vf-radius-card);
}

/* Skip link, required for keyboard users and cheap to provide. */
.vf-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	padding: var(--vf-space-2) var(--vf-space-3);
	background: var(--vf-color-primary);
	color: var(--vf-color-on-dark);
	border-radius: 0 0 var(--vf-radius-card) 0;
	font-family: var(--vf-font-display);
	text-decoration: none;
}

.vf-skip-link:focus {
	left: 0;
}

/* ---------------------------------------------------------------------------
 * Layout primitives
 * ------------------------------------------------------------------------ */

.vf-container {
	width: 100%;
	max-width: calc(var(--vf-layout-container) + (var(--vf-layout-gutter) * 2));
	margin-inline: auto;
	padding-inline: var(--vf-layout-gutter);
}

@media (max-width: 1280px) {
	.vf-container {
		padding-inline: var(--vf-layout-gutter-lg);
	}
}

@media (max-width: 1024px) {
	.vf-container {
		padding-inline: var(--vf-layout-gutter-md);
	}
}

@media (max-width: 768px) {
	.vf-container {
		padding-inline: var(--vf-layout-gutter-sm);
	}
}

.vf-section {
	padding-block: var(--vf-space-16);
}

@media (max-width: 1024px) {
	.vf-section {
		padding-block: var(--vf-space-10);
	}
}

@media (max-width: 768px) {
	.vf-section {
		padding-block: var(--vf-space-8);
	}
}

/* The three column card grid: 487 + 30 + 487 + 30 + 487 = 1520. */
.vf-grid-3 {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--vf-layout-grid-gap);
}

@media (max-width: 1024px) {
	.vf-grid-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.vf-grid-3 {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------------------------------------------------------------------------
 * Buttons
 *
 * Four variants, all 60px tall and fully rounded, matching the layouts.
 * ------------------------------------------------------------------------ */

.vf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--vf-space-1);
	min-height: var(--vf-layout-button-h);
	padding: 0 var(--vf-space-4);
	border: 1px solid transparent;
	border-radius: var(--vf-radius-pill);
	font-family: var(--vf-font-display);
	font-size: var(--vf-size-body-l);
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--vf-motion-base) var(--vf-motion-ease),
		color var(--vf-motion-base) var(--vf-motion-ease),
		border-color var(--vf-motion-base) var(--vf-motion-ease),
		transform var(--vf-motion-fast) var(--vf-motion-ease);
}

.vf-btn:active {
	transform: translateY(1px);
}

.vf-btn--primary {
	background: var(--vf-color-primary);
	color: var(--vf-color-on-dark);
}

.vf-btn--primary:hover {
	background: var(--vf-color-primary-deep);
	color: var(--vf-color-on-dark);
}

.vf-btn--inverse {
	background: var(--vf-color-surface);
	color: var(--vf-color-primary);
}

.vf-btn--inverse:hover {
	background: var(--vf-color-surface-tint);
	color: var(--vf-color-primary);
}

.vf-btn--outline {
	background: transparent;
	border-color: var(--vf-color-on-dark);
	color: var(--vf-color-on-dark);
}

.vf-btn--outline:hover {
	background: var(--vf-color-on-dark);
	color: var(--vf-color-primary);
}

/* Screen reader only, used for accessible names on icon-only controls. */
.vf-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
