/* Element defaults. */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: 5rem;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: var(--step-0);
	font-weight: 400;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
	margin: 0 0 var(--s-3);
	font-family: var(--font-display);
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -0.01em;
	overflow-wrap: normal;
}

h1 {
	font-size: var(--step-3);
}

h2 {
	font-size: var(--step-2);
}

h3 {
	font-size: var(--step-1);
	font-weight: 700;
	line-height: 1.2;
}

p {
	margin: 0 0 var(--s-4);
}

a {
	color: var(--brand-text);
	text-underline-offset: 0.15em;
}

a:hover {
	text-decoration-thickness: 2px;
}

img,
svg {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

ul,
ol {
	padding-left: 1.25rem;
}

table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	padding: var(--s-3);
	border-bottom: 1px solid var(--border);
	text-align: left;
	vertical-align: top;
}

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

:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
	border-radius: 2px;
}

::placeholder {
	color: var(--muted);
	opacity: 1;
}

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

input:not([type="checkbox"], [type="radio"], [type="submit"], [type="hidden"]),
select,
textarea {
	width: 100%;
	min-height: var(--tap);
	padding: var(--s-2) var(--s-3);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	background: var(--surface-2);
	font-size: var(--step-0); /* 16px stops phones zooming in on focus */
}

input[type="checkbox"],
input[type="radio"] {
	width: 1.25rem;
	height: 1.25rem;
	margin: 0;
	flex: none;
	accent-color: var(--brand-text);
}

label {
	font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 1ms !important;
		transition-duration: 1ms !important;
		scroll-behavior: auto !important;
	}
}

/* Gujarati and Devanagari letters reach above and below the line: more room, and no squeezed headings or buttons. */
html[lang^="gu"] body,
html[lang^="hi"] body {
	line-height: 1.65;
}

html[lang^="gu"] :is(h1, h2, h3, .btn, button),
html[lang^="hi"] :is(h1, h2, h3, .btn, button) {
	line-height: 1.35;
	letter-spacing: 0;
}
