/**
 * Base styles.
 *
 * Holds mobile-first, low-specificity defaults for common HTML elements.
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	background: var(--bws-color-bg);
	scroll-behavior: smooth;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bws-color-bg);
	color: var(--bws-color-text);
	font-family: var(--bws-font-sans);
	font-size: var(--bws-font-size-md);
	font-weight: var(--bws-font-weight-regular);
	line-height: var(--bws-line-height-body);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

.bws-site {
	background: var(--bws-color-bg);
}

::selection {
	background: var(--bws-color-selection-bg);
	color: var(--bws-color-selection-text);
}

:where(h1, h2, h3, h4, h5, h6) {
	margin: 0 0 var(--bws-space-3);
	color: var(--bws-color-text);
	font-weight: var(--bws-font-weight-bold);
	line-height: var(--bws-line-height-heading);
}

h1 {
	font-size: var(--bws-font-size-3xl);
	letter-spacing: 0;
}

h2 {
	font-size: var(--bws-font-size-2xl);
}

h3 {
	font-size: var(--bws-font-size-xl);
}

h4 {
	font-size: var(--bws-font-size-lg);
}

h5,
h6 {
	font-size: var(--bws-font-size-md);
}

p {
	margin: 0 0 var(--bws-space-3);
	color: var(--bws-color-text-soft);
}

a {
	color: var(--bws-color-primary);
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.18em;
	transition: color var(--bws-transition-fast);
}

a:hover {
	color: var(--bws-color-primary-hover);
}

img {
	display: block;
	height: auto;
	max-width: 100%;
}

button,
input,
select,
textarea {
	font: inherit;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
	border: 0;
	border-radius: var(--bws-radius-md);
	cursor: pointer;
}

button:disabled,
[type="button"]:disabled,
[type="reset"]:disabled,
[type="submit"]:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

input,
select,
textarea {
	width: 100%;
	border: var(--bws-border-subtle);
	border-radius: var(--bws-radius-md);
	background: var(--bws-color-surface-muted);
	color: var(--bws-color-text);
	padding: 0.72rem 0.875rem;
	transition:
		border-color var(--bws-transition-fast),
		box-shadow var(--bws-transition-fast),
		background-color var(--bws-transition-fast);
}

textarea {
	min-height: 8rem;
	resize: vertical;
}

input::placeholder,
textarea::placeholder {
	color: var(--bws-color-muted);
	opacity: 1;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 0;
	box-shadow: var(--bws-shadow-focus);
}

:where(input, select, textarea):focus {
	border-color: var(--bws-color-focus);
	background: var(--bws-color-surface);
}
