@font-face {
	font-family: "Outfit";
	src: url("/assets/fonts/outfit.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Instrument Serif";
	src: url("/assets/fonts/instrument-italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

:root {
	/* Typography */
	--ff-sans: "outfit", system-ui, sans-serif;
	--ff-serif: "instrument serif", georgia, serif;
	--fs-xs: clamp(0.8333rem, 0.8164rem + 0.0751vw, 0.884rem);
	--fs-s: clamp(1rem, 0.9167rem + 0.3704vw, 1.25rem);
	--fs-m: clamp(1.2rem, 1.0108rem + 0.8407vw, 1.7675rem);
	--fs-l: clamp(1.44rem, 1.0869rem + 1.5693vw, 2.4992rem);
	--fs-xl: clamp(1.728rem, 1.126rem + 2.6755vw, 3.5339rem);
	--fs-3xl: clamp(2.4883rem, 0.9625rem + 6.7813vw, 7.0657rem);
	--fs-5xl: clamp(3.5832rem, 0.0685rem + 15.6208vw, 14.1272rem);
	/* Spacing: single steps */
	--s-s: clamp(1rem, 0.9167rem + 0.3704vw, 1.25rem);
	--s-m: clamp(1.5rem, 1.375rem + 0.5556vw, 1.875rem);
	--s-xl: clamp(3rem, 2.75rem + 1.1111vw, 3.75rem);
	/* Spacing: custom pairs */
	--s-s-xl: clamp(1rem, 0.0833rem + 4.0741vw, 3.75rem);
	--s-xl-3xl: clamp(3rem, 1.5rem + 6.6667vw, 7.5rem);
	/* Colors: Surfaces */
	--color-bg: #f3f0e9;
	--color-bg-inverse: #232721;
	--color-surface: #fff;
	--color-backdrop: rgb(0 0 0 / 0.3);
	/* Colors: Text */
	--color-text: #232721;
	--color-text-muted: #6b6d62;
	--color-text-inverse: #f3f0e9;
	/* Colors: Lines */
	--color-border: #d3d0c7;
	--color-border-bold: #232721;
	/* Colors: Brand */
	--color-accent: #a44739;
	/* layout */
	--page-width: 90rem;
	--page-gutter: var(--s-s);
	--prose-width: 54ch;
	--heading-width: 12ch;
}

/*  Reset */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* Trim the extra leading above/below text so spacing is optically even */
:where(h1, h2, h3, .eyebrow, dt, button, th, td, nav a, .button a, .trim-children > *, #pop > *) {
	text-box: trim-both cap alphabetic;
}

/******* Base Elements **************/

html {
	font-family: var(--ff-sans);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

body {
	background: var(--color-bg);
	color: var(--color-text);
	margin-block: var(--s-s);
}

/* Headings */

h1,
h2,
h3 {
	font-weight: 700;
	line-height: 1;
	text-wrap: balance;
}

h1 {
	font-size: var(--fs-5xl);
	letter-spacing: -0.03em;
	text-transform: uppercase;
	font-weight: 800;
}

h2,
.h2 {
	font-size: var(--fs-3xl);
	letter-spacing: -0.03em;
	font-weight: 700;
	text-transform: none;
}

h3,
.h3 {
	font-size: var(--fs-l);
}

/* Text */

p,
li {
	font-size: var(--fs-s);
}

a {
	color: inherit;
	font-weight: 700;
	text-underline-offset: 5px;
}

blockquote {
	font-family: var(--ff-serif);
	font-size: var(--fs-xl);
	line-height: 1.1;
	max-inline-size: 40ch;
	margin-inline: auto;
	text-wrap: balance;
}

sup {
	font-size: 0.75em;
	line-height: 0;
	vertical-align: super;
}

/* Lists */

ul {
	list-style: none;
}

ol {
	list-style-position: inside;
}

/* Media */

img {
	display: block;
	width: 100%;
	height: auto;
}

svg {
	display: block;
}

/* Interactive */

button {
	font: inherit;
	color: inherit;
}

:where(a[href], button, label, summary) {
	cursor: pointer;
}

/* Details / accordions */

details {
	padding-block: var(--s-s);
	border-block-start: 1px solid var(--color-border);
}

details:last-of-type {
	border-block-end: 1px solid var(--color-border);
}

details * + * {
	margin-block-start: var(--s-s);
}

details :not(summary) {
	color: var(--color-text-muted);
	max-inline-size: var(--prose-width);
}

summary {
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-s);
	font-size: var(--fs-s);
}

summary::after {
	content: "+";
}

details[open] summary::after {
	content: "-";
}

/* Dialogs */

dialog {
	margin: auto;
	border: none;
	background-color: var(--color-bg);
	color: var(--color-text);
	max-inline-size: min(90vw, 28rem);
}

dialog::backdrop {
	background: var(--color-backdrop);
}

dialog form {
	padding: var(--s-m);
}

dialog h2 {
	font-size: var(--fs-l);
}

/* Forms */

:where(input, textarea) {
	border: 1px solid var(--color-border);
	padding: var(--s-s);
	background: var(--color-surface);
	width: 100%;
	font: inherit;
}

:focus-visible {
	border-color: var(--color-border-bold);
	outline: 1px solid var(--color-border-bold);
}

textarea {
	min-height: 8lh;
	max-height: 16lh;
	field-sizing: content;
	resize: none;
}

label {
	display: block;
	font-size: var(--fs-s);
}

/* Add Error colors to invalid warnings */
:where(input, textarea):user-invalid {
	border-color: var(--color-accent);
}

form button {
	background: var(--color-accent);
	padding: var(--s-s);
	color: var(--color-text-inverse);
	border: none;
	text-transform: uppercase;
	font-weight: 700;
	letter-spacing: 0.03em;
}

[data-status]:empty {
	display: none;
}

/* Tables */

table {
	border-spacing: 0;
	text-align: left;
	width: 100%;
	font-size: var(--fs-xs);
}

thead th {
	border-block-end: 1px solid var(--color-border-bold);
}

tbody th,
tbody td {
	border-block-end: 1px solid var(--color-border);
}

th,
td {
	padding: var(--s-s);
}

tbody td {
	color: var(--color-text-muted);
}

thead th:first-child,
tbody th {
	position: sticky;
	left: 0;
	z-index: 2;
	background-color: var(--color-bg);
	padding-inline-start: 0;
}

/****** COMPONENTS ******/

/* Header + Navigation */

header {
	border-block-end: 1px solid var(--color-border);
	padding-block-end: var(--s-s);
}

nav {
	display: flex;
	gap: var(--s-s);
	font-weight: 700;
	font-size: var(--fs-xs);
}

nav :is(a, button) {
	text-transform: uppercase;
}

nav a {
	text-decoration: none;
}

nav button {
	border: 0;
	background: transparent;
	anchor-name: --popover;
}

nav button::after {
	content: "\2193"; /* down arrow */
	display: inline-block;
	padding-inline-start: 0.1em;
}

/* Nav popover */

#pop {
	background-color: var(--color-bg);
	border: none;
	padding: var(--s-s);
	position-anchor: --popover;
	top: anchor(bottom);
	left: anchor(left);
	margin-block-start: var(--s-s);
	margin-inline-start: calc(var(--s-s) * -1);
	font-size: var(--fs-xs);
}

#pop a {
	text-transform: uppercase;
	text-decoration: none;
}

#pop p {
	font-size: var(--fs-xs);
	font-weight: 400;
}

#pop::backdrop {
	background: var(--color-backdrop);
}

#pop:popover-open {
	display: flex;
	flex-direction: column;
	gap: var(--s-m);
}

/* Button */

.button a {
	display: inline-block;
	background-color: var(--color-bg);
	color: var(--color-text);
	padding: var(--s-s);
	text-decoration: none;
	font-size: var(--fs-xs);
}

/* Eyebrow */

.eyebrow {
	color: var(--color-text-muted);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

/* Signup form */

.signup {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-s);
	max-inline-size: var(--prose-width);
}

.signup input {
	flex: 1 1 16rem;
	inline-size: auto;
}

/* Specs grid */

.grid-specs {
	display: grid;
	gap: var(--s-s);
	grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
	max-inline-size: var(--prose-width);
}

.grid-specs li p:first-of-type {
	font-size: var(--fs-xs);
	color: var(--color-text-muted);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.grid-specs li p:last-of-type {
	font-weight: 700;
}

/****** LAYOUTS ******/

/* Card grid: cards max out at 690px in both column modes to simplify image size presets */

.grid-cards {
	--card-min: 350px;
	--card-max: 690px;
	--gap: var(--s-xl);
	--column-min: min(100%, max(var(--card-min), calc((100% - var(--gap)) / 2 - 1px)));
	display: grid;
	gap: var(--gap);
	grid-template-columns: repeat(auto-fit, minmax(var(--column-min), 1fr));
	justify-items: start;
}

.grid-cards > * {
	max-inline-size: var(--card-max);
}

/* Grid Split: 50% split screen layout */

.grid-split {
	--split-min: 22rem;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--split-min)), 1fr));
}

.grid-split > img {
	block-size: 100%;
	object-fit: cover;
	object-position: center;
}

/* Sidebar */

.sidebar {
	--sidebar-align: start;
	--sidebar-content-min: 50%;
	display: flex;
	flex-wrap: wrap;
	align-items: var(--sidebar-align);
	gap: var(--s-xl);
}

.sidebar > :first-child {
	flex-basis: 40%;
	flex-grow: 1;
}

.sidebar > :last-child {
	flex-basis: 0;
	flex-grow: 1;
	min-inline-size: min(100%, var(--sidebar-content-min));
}

.sidebar--center {
	--sidebar-align: center;
}

/* Switcher: 3 across on wide screens, 1 on narrow; 4+ items always stack */

.switcher-3 {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-xl);
}

.switcher-3 > * {
	flex-grow: 1;
	flex-basis: calc((44rem - 100%) * 999);
}

.switcher-3 > :nth-last-child(n + 4),
.switcher-3 > :nth-last-child(n + 4) ~ * {
	flex-basis: 100%;
}

/* Zig-zag: photo alternates left/right on wide screens */

.zig-zag {
	--zig-zag-image: 60%;
	--zig-zag-text-min: 20ch;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s-s-xl);
}

.zig-zag > :first-child {
	flex-basis: var(--zig-zag-image);
	flex-grow: 1;
	min-inline-size: 0;
}

.zig-zag > :last-child {
	flex-basis: var(--zig-zag-text-min);
	flex-grow: 1;
	min-inline-size: min(100%, var(--zig-zag-text-min));
	max-inline-size: var(--prose-width);
}

.zig-zag:nth-child(even) {
	flex-direction: row-reverse;
}

/****** UTILITIES ******/

/* Layout: horizontal */

.container {
	width: min(calc(100% - 2 * var(--page-gutter)), var(--page-width));
	margin-inline: auto;
}

.px-xl {
	padding-inline: var(--s-s-xl);
}

.heading-width {
	max-inline-size: var(--heading-width);
}

.prose-width {
	max-inline-size: var(--prose-width);
}

.text-center {
	text-align: center;
}

.full-bleed {
	max-inline-size: 112.5rem;
}

.flex-between {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--s-xl);
	align-items: center;
}

.overflow-auto {
	overflow-x: auto;
}

/* Layout: vertical */

.flow > * + *,
.stack-m-deep * + *,
.stack-m > * + * {
	margin-block-start: var(--s-m);
}

.py-xl {
	padding-block: var(--s-xl);
}

.py-xl-3xl {
	padding-block: var(--s-xl-3xl);
}

.overline {
	border-block-start: 1px solid var(--color-border);
	padding-block-start: var(--s-xl-3xl);
}

.stack-s > * + * {
	margin-block-start: var(--s-s);
}

.stack-xl > * + * {
	margin-block-start: var(--s-xl);
}

.stack-xl-3xl > * + * {
	margin-block-start: var(--s-xl-3xl);
}

/* Text */

.accent {
	color: var(--color-accent);
}

.fs-xs {
	font-size: var(--fs-xs);
}

.fs-m {
	font-size: var(--fs-m);
}

.fs-xl {
	font-size: var(--fs-xl);
}

.serif {
	font-family: var(--ff-serif);
	font-style: italic;
	font-weight: 400;
}

.muted {
	color: var(--color-text-muted);
}

/* Color themes */

.bg-accent {
	background-color: var(--color-accent);
	color: var(--color-text-inverse);
}

.color-inverse {
	background-color: var(--color-bg-inverse);
	color: var(--color-text-inverse);
}

.color-inverse .eyebrow,
.bg-accent .eyebrow {
	color: var(--color-text-inverse);
}

/* Accessibility */

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
