*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scrollbar-gutter: stable;
	scroll-behavior: smooth;
	/* Fixed chrome clearance: sticky desktop header above, floating dock
	   below. Keeps anchors and keyboard focus from landing underneath. */
	scroll-padding-top: 5rem;
	scroll-padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

body {
	margin: 0;
	background-color: var(--ew-bg);
	color: var(--ew-text);
	font-family: var(--ew-font-body);
	/* Raised on 23/10/2026: smaller descriptions were hard to read. rem
	   units keep the browser's own text-size setting in charge. */
	font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
	line-height: 1.6;
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
	transition:
		background-color 220ms var(--ew-motion-ease),
		color 220ms var(--ew-motion-ease);
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
	display: block;
}

h1,
h2,
h3,
h4 {
	font-family: var(--ew-font-display);
	font-weight: 600;
	color: inherit;
	margin: 0 0 var(--ew-space-xs);
	text-wrap: balance;
	overflow-wrap: anywhere;
}

h1 {
	font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);
	line-height: 1.04;
	letter-spacing: -0.02em;
	max-width: 24ch;
}

h2 {
	font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
	line-height: 1.08;
	letter-spacing: -0.015em;
	max-width: 24ch;
}

h3 {
	font-size: clamp(1.375rem, 1.15rem + 0.8vw, 1.75rem);
	line-height: 1.2;
}

p {
	margin: 0 0 1.25em;
	max-width: var(--ew-reading-measure);
}

a {
	color: var(--ew-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

a:hover {
	color: color-mix(in srgb, var(--ew-link) 78%, var(--ew-text));
}

:focus-visible {
	outline: 2px solid var(--ew-action);
	outline-offset: 3px;
	border-radius: 2px;
	/* Keep the focused control clear of the fixed dock. */
	scroll-margin-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

input,
textarea,
select {
	caret-color: var(--ew-action);
}

::selection {
	background-color: var(--ew-deep-green);
	color: var(--ew-on-brand);
}

/* During the ambient drag the selection colours ride the contrast-locked
   palette (deep-green trends toward white), so selection inverts to the
   text/surface pair, which stays AA by construction. */
html[data-ew-ambient="true"] ::selection {
	background-color: var(--ew-ink);
	color: var(--ew-bg);
}

@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;
	}
}

.ew-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	background-color: var(--ew-bg);
	color: var(--ew-action);
	padding: 0.75rem 1.25rem;
	border: var(--ew-line-width) solid var(--ew-action);
	font-weight: 600;
	text-decoration: none;
}

.ew-skip-link:focus {
	left: 0.5rem;
	top: 0.5rem;
}

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	clip-path: none;
	display: block;
	height: auto;
	width: auto;
}

/* Editorial layouts keep uploaded media within the reading column. */
.ew-editorial-article {
	max-width: 80ch;
	overflow-wrap: anywhere;
}

.ew-editorial-article__image,
.ew-editorial-article__body img {
	max-width: 100%;
	height: auto;
}

.ew-editorial-article__body > * + * {
	margin-block-start: 1.25em;
}

.ew-editorial-article dt {
	font-weight: 700;
}

.ew-editorial-article dd {
	margin-inline-start: 0;
	margin-block-end: 1em;
}

.ew-home-preview-notice {
	position: fixed;
	inset: auto 1rem 6rem;
	z-index: 1000;
	padding: 1rem;
	background: #f2eee4;
	color: #16281c;
	border: 1px solid currentColor;
	box-shadow: 0 .5rem 2rem rgb(0 0 0 / 15%);
}
