/*
 * Base: reset, typography, links, focus, accessibility helpers, brand primitives.
 */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: var(--space-5);
}

body {
	margin: 0;
	background: var(--c-paper);
	color: var(--c-graphite);
	font-family: var(--font-sans);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

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

svg {
	flex-shrink: 0;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 var(--space-4);
	color: var(--c-graphite);
	font-weight: 600;
	text-wrap: balance;
}

h1,
.t-display {
	font-size: var(--fs-display);
	line-height: var(--lh-display);
	letter-spacing: var(--ls-display);
}

h2,
.t-h2 {
	font-size: var(--fs-h2);
	line-height: var(--lh-h2);
	letter-spacing: var(--ls-h2);
	font-weight: 600;
}

h3,
.t-h3 {
	font-size: var(--fs-h3);
	line-height: var(--lh-h3);
	letter-spacing: var(--ls-h3);
	font-weight: 500;
}

h4,
h5,
h6 {
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	font-weight: 600;
}

p,
ul,
ol,
dl,
blockquote,
figure,
table {
	margin: 0 0 var(--space-4);
}

.t-body {
	font-size: var(--fs-body);
	line-height: var(--lh-body);
}

.t-small {
	font-size: var(--fs-small);
	line-height: var(--lh-small);
}

.t-label {
	font-size: var(--fs-label);
	line-height: var(--lh-label);
	font-weight: 500;
}

.t-soft {
	color: var(--c-graphite-soft);
}

/* Numbers, sizes, prices, dates, step numbers: IBM Plex Sans Condensed Italic, Medium at 15 and 22 px, Regular at 13 px. */
.t-measure,
.t-measure-l,
.t-measure-s {
	font-family: var(--font-measure);
	word-spacing: var(--ws-measure);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.t-measure {
	font-size: var(--fs-measure);
	line-height: var(--lh-measure);
}

.t-measure-l {
	font-size: var(--fs-measure-l);
	line-height: var(--lh-measure-l);
}

.t-measure-s {
	font-size: var(--fs-measure-s);
	line-height: var(--lh-measure-s);
	font-weight: 400;
}

/* Links */
a {
	color: var(--c-ink);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--c-ink-hover);
	text-decoration-thickness: 2px;
}

/* Focus: always visible, ink. */
:focus-visible {
	outline: var(--focus-ring);
	outline-offset: 2px;
}

/*
 * Graphite bands: ink on graphite is 1.6:1, so the ring turns white there,
 * and back to ink inside the white form cards those bands hold.
 */
.site-footer,
.bti-wizard-banner,
.pg-dark,
.home-wizard {
	--focus-ring: 2px solid var(--c-sheet);
}

.home-wizard__form,
.pg-order__form,
.bti-order-form {
	--focus-ring: 2px solid var(--c-ink);
}

::selection {
	background: var(--c-ink-tint);
	color: var(--c-graphite);
}

/* Accessibility helpers */
.screen-reader-text,
.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;
}

.skip-link {
	position: absolute;
	top: var(--space-2);
	left: var(--space-2);
	z-index: 1000;
	padding: var(--space-3) var(--space-4);
	background: var(--c-ink);
	color: var(--c-sheet);
	font-size: var(--fs-button);
	line-height: var(--lh-button);
	font-weight: 500;
	text-decoration: none;
	border-radius: var(--radius);
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
	color: var(--c-sheet);
	outline-color: var(--c-graphite);
}

/*
 * Dimension line (bti_dimension_line()): ticks at both ends, a 1 px line and an
 * measure-font label in the middle. Horizontal stretches to its container's width.
 */
.bti-dim {
	display: flex;
	align-items: center;
	color: var(--c-graphite);
	font-family: var(--font-measure);
	word-spacing: var(--ws-measure);
	font-size: var(--fs-measure);
	font-weight: 500;
	line-height: var(--lh-measure);
}

.bti-dim__tick {
	display: block;
	width: 10px;
	height: 16px;
}

.bti-dim__line {
	flex: 1 1 0;
	min-width: 8px;
	height: 1px;
	background: currentColor;
}

.bti-dim__label {
	flex: none;
	padding: 0 var(--space-2);
	white-space: nowrap;
}

.bti-dim--v {
	flex-direction: column;
	height: 100%;
	min-height: 120px;
	width: max-content;
}

.bti-dim--v .bti-dim__tick {
	transform: rotate(90deg);
	margin: -3px 0;
}

.bti-dim--v .bti-dim__line {
	width: 1px;
	min-width: 0;
	height: auto;
	min-height: 8px;
}

.bti-dim--v .bti-dim__label {
	padding: var(--space-2) 0;
}

@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;
	}
}
