/*
 * Reset + element defaults.
 *
 * Uses tokens only — no hardcoded colours. See tokens.css.
 */

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

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

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	/*
	 * Kill every hover transition at the token, so no component has to remember
	 * to handle reduced-motion itself.
	 */
	:root {
		--tt-speed: 0s;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

body {
	margin: 0;
	/*
	 * Sideways-scroll backstop.
	 *
	 * `clip` — NOT `hidden`. `overflow-x: hidden` on body silently makes the
	 * sticky header `position: fixed`-behaving in some engines and kills
	 * `position: sticky` outright; `clip` crops the overflow without creating a
	 * scroll container, so sticky survives.
	 *
	 * This is a safety net for a stray wide element, not a fix. Anything that
	 * actually overflows still has to be fixed where it lives — a clipped page
	 * hides content off-screen instead of showing a scrollbar, which is a worse
	 * bug than the one it papers over.
	 */
	overflow-x: clip;
	background: var(--tt-bg-body);
	color: var(--tt-text);
	font-family: var(--tt-font);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
	margin: 0 0 var(--tt-s3);
	line-height: 1.25;
	font-weight: 700;
}

p {
	margin: 0 0 var(--tt-s4);
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	color: var(--tt-accent);
}

/* Images default to responsive. Tube pages are almost entirely images. */
img,
video {
	max-width: 100%;
	height: auto;
	display: block;
}

button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
}

ul,
ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Visible keyboard focus. Never remove without replacing. */
:focus-visible {
	outline: 2px solid var(--tt-accent);
	outline-offset: 2px;
}

/* Screen-reader-only text */
.tt-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;
}

.tt-container {
	width: 100%;
	max-width: var(--tt-maxw);
	margin-inline: auto;
	padding-inline: var(--tt-gutter);
}
