/* Gradient Factor
   Type: EB Garamond (variable, self-hosted), OpenType small caps and old-style figures.
   Palette: paper, ink, one oxblood accent. */

@font-face {
	font-family: "EB Garamond";
	src: url("../fonts/ebgaramond-roman.woff2") format("woff2-variations"),
	     url("../fonts/ebgaramond-roman.woff2") format("woff2");
	font-weight: 400 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "EB Garamond";
	src: url("../fonts/ebgaramond-italic.woff2") format("woff2-variations"),
	     url("../fonts/ebgaramond-italic.woff2") format("woff2");
	font-weight: 400 800;
	font-style: italic;
	font-display: swap;
}

:root {
	--paper: #f3efe6;
	--paper-2: #ebe5d8;
	--ink: #1c1b18;
	--ink-2: #4a463e;
	--muted: #6f695d;
	--rule: #d6cfbf;
	--accent: #8a2e1c;

	--serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

	--pad: max(1.25rem, env(safe-area-inset-left), env(safe-area-inset-right));
	--gutter: clamp(1.25rem, 5vw, 3.5rem);
	--max: 76rem;
	--space: clamp(4rem, 3rem + 5vw, 8.5rem);
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: 1.5rem;
}
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--serif);
	font-size: clamp(1.125rem, 1.02rem + 0.35vw, 1.3125rem);
	line-height: 1.5;
	font-kerning: normal;
	font-variant-ligatures: common-ligatures;
	font-variant-numeric: oldstyle-nums proportional-nums;
	font-feature-settings: "kern", "liga", "onum";
	font-synthesis: none;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	hanging-punctuation: first last;
}

::selection { background: var(--accent); color: var(--paper); }

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

p, ul, ol, address, h1, h2, h3 { margin: 0; }

h1, h2, h3 { font-weight: 400; text-wrap: balance; }
p { text-wrap: pretty; }

a {
	color: inherit;
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	text-decoration-color: var(--rule);
	transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

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

.skip {
	position: absolute;
	left: 1rem;
	top: -4rem;
	padding: .5rem .9rem;
	background: var(--ink);
	color: var(--paper);
	z-index: 10;
}
.skip:focus { top: 1rem; }

.wrap {
	width: 100%;
	max-width: calc(var(--max) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

/* Small caps label, used for section names and metadata. */
.eyebrow,
.colophon__label,
.nav a,
.brand__name {
	font-variant-caps: all-small-caps;
	font-variant-numeric: lining-nums;
	letter-spacing: 0.1em;
}
.eyebrow {
	font-size: 1em;
	color: var(--muted);
	font-weight: 500;
}

/* ---------- Masthead ---------- */

.masthead { padding-top: max(1.5rem, env(safe-area-inset-top)); }
.masthead__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 2rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--ink);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: .7rem;
	text-decoration: none;
	color: var(--ink);
}
.brand:hover { color: var(--ink); }
.mark { width: 1.35rem; height: 1.35rem; fill: currentColor; flex: none; }
.brand__name {
	font-size: 1.2em;
	font-weight: 500;
	letter-spacing: 0.12em;
	line-height: 1;
	padding-bottom: .12em;
}

.nav { display: flex; gap: 1.6rem; }
.nav a {
	text-decoration: none;
	color: var(--ink-2);
	font-size: 1.02em;
}
.nav a:hover { color: var(--accent); }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(3rem, 1.5rem + 6vw, 6.5rem) var(--space); }
.hero__title {
	margin-top: 1.25rem;
	max-width: 17ch;
	font-size: clamp(2.5rem, 1.1rem + 5.6vw, 6rem);
	line-height: 1.02;
	letter-spacing: -0.012em;
	font-weight: 400;
}
.hero__title em { color: var(--accent); font-style: italic; }

.hero__body {
	margin-top: clamp(2rem, 1.5rem + 2vw, 3.25rem);
	max-width: 34rem;
	display: grid;
	gap: 2rem;
	font-size: 1.08em;
	color: var(--ink-2);
}
@media (min-width: 52em) {
	/* Line the intro up with the text column of the sections below. */
	.hero__body { margin-left: calc(max(9rem, (100% - 3rem) / 5) + 3rem); }
}
.hero__links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.75rem;
}

.button,
.primitives-form__submit {
	display: inline-flex;
	align-items: center;
	gap: .6em;
	padding: .7em 1.35em .78em;
	background: var(--ink);
	color: var(--paper);
	border: 1px solid var(--ink);
	border-radius: 0;
	font: inherit;
	font-size: 1em;
	line-height: 1.1;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}
.button:hover,
.primitives-form__submit:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.textlink { font-style: italic; color: var(--ink); }

/* ---------- Sections ---------- */

.section { padding-block: var(--space); }
.section .wrap { position: relative; }
.section .wrap::before {
	content: "";
	position: absolute;
	top: calc(-1 * var(--space));
	left: max(var(--gutter), env(safe-area-inset-left));
	right: max(var(--gutter), env(safe-area-inset-right));
	border-top: 1px solid var(--rule);
}

.section__grid { display: grid; gap: 1.5rem; }
.section__head .eyebrow { position: sticky; top: 1.5rem; }

@media (min-width: 52em) {
	.section__grid {
		grid-template-columns: minmax(9rem, 1fr) 4fr;
		gap: 3rem;
	}
}

/* Services */
.services {
	list-style: none;
	padding: 0;
	display: grid;
	gap: 2.75rem;
	counter-reset: none;
}
.service {
	display: grid;
	grid-template-columns: 2.5rem 1fr;
	column-gap: .75rem;
	align-items: baseline;
}
.service__num {
	grid-row: span 2;
	font-style: italic;
	color: var(--accent);
	font-size: 1.15em;
}
.service__title {
	font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
	line-height: 1.1;
	font-style: italic;
	margin-bottom: .6rem;
}
.service p { color: var(--ink-2); max-width: 34rem; }

@media (min-width: 64em) {
	.services { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
	.service { display: block; }
	.service__num { display: block; margin-bottom: .5rem; }
	.service p { font-size: .97em; }
}

/* Clients */
.prose > * + * { margin-top: 1.1em; }
.lede {
	font-size: clamp(1.6rem, 1.15rem + 1.6vw, 2.6rem);
	line-height: 1.18;
	max-width: 24ch;
	letter-spacing: -0.005em;
}
.section__body.prose > p:not(.lede) { max-width: 34rem; color: var(--ink-2); margin-top: 1.5em; }

/* Contact */
.section--contact { background: var(--paper-2); }
.section--contact .wrap::before { display: none; }

.contact { display: grid; gap: 2.5rem; }
.contact__title {
	font-size: clamp(1.9rem, 1.3rem + 2vw, 3.1rem);
	line-height: 1.08;
	font-style: italic;
	margin-bottom: 1rem;
}
.contact__intro p { color: var(--ink-2); max-width: 26rem; }

@media (min-width: 70em) {
	.contact { grid-template-columns: 1fr 1.35fr; gap: 4rem; align-items: start; }
}

/* ---------- Form (Soflyy Primitives) ---------- */

.primitives-form { display: grid; gap: 1.6rem; }
.primitives-form [hidden] { display: none !important; }
.primitives-form__step { display: grid; gap: 1.6rem; }
.primitives-form__step:not(.primitives-form__step--active) { display: none; }

@media (min-width: 36em) {
	.primitives-form__step { grid-template-columns: 1fr 1fr; column-gap: 2rem; }
	.primitives-field--checkboxes,
	.primitives-field--textarea,
	.primitives-field[data-field="company"] { grid-column: 1 / -1; }
}

.primitives-field { display: grid; gap: .35rem; min-width: 0; }

.primitives-field__label {
	font-variant-caps: all-small-caps;
	letter-spacing: 0.1em;
	font-weight: 500;
	color: var(--ink-2);
	font-size: .98em;
}
.primitives-field--required > .primitives-field__label::after {
	content: " *";
	color: var(--accent);
	letter-spacing: 0;
}

.primitives-field input[type="text"],
.primitives-field input[type="email"],
.primitives-field textarea {
	width: 100%;
	font: inherit;
	font-size: max(1em, 16px);
	color: var(--ink);
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--ink-2);
	border-radius: 0;
	padding: .3rem 0 .45rem;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .15s ease;
}
.primitives-field textarea {
	border: 1px solid var(--ink-2);
	padding: .65rem .8rem;
	min-height: 9.5rem;
	resize: vertical;
	line-height: 1.45;
}
.primitives-field input:focus,
.primitives-field textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 1px 0 0 var(--accent);
}
.primitives-field textarea:focus { box-shadow: inset 0 0 0 1px var(--accent); }

.primitives-field__description {
	order: -1;
	font-size: .85em;
	font-style: italic;
	color: var(--muted);
	margin-top: -.3rem;
}
/* Keep the label above the description. */
.primitives-field__label { order: -2; }

.primitives-field__options {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem 1.6rem;
	padding-top: .3rem;
}
.primitives-field__option {
	display: inline-flex;
	align-items: center;
	gap: .55rem;
	cursor: pointer;
}
.primitives-field__option input {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	width: 1rem;
	height: 1rem;
	border: 1px solid var(--ink-2);
	background: transparent;
	display: grid;
	place-content: center;
	cursor: pointer;
	flex: none;
	transform: translateY(.05em);
}
.primitives-field__option input::before {
	content: "";
	width: .55rem;
	height: .55rem;
	background: var(--accent);
	transform: scale(0);
	transition: transform .12s ease;
}
.primitives-field__option input:checked::before { transform: scale(1); }
.primitives-field__option input:checked { border-color: var(--accent); }

.primitives-field__error {
	font-size: .9em;
	font-style: italic;
	color: var(--accent);
}
.primitives-field.is-invalid input,
.primitives-field.is-invalid textarea { border-color: var(--accent); }

.primitives-form__nav { display: flex; align-items: center; gap: 1rem; }
.primitives-form__submit:disabled { opacity: .6; cursor: progress; }
.primitives-form.is-submitting .primitives-form__submit::after { content: "…"; }

.primitives-form__message {
	font-size: 1.15em;
	font-style: italic;
	padding: 1.25rem 0;
	border-top: 1px solid var(--ink);
	border-bottom: 1px solid var(--ink);
}
.primitives-form__message--error { color: var(--accent); border-color: var(--accent); }

/* ---------- Legal pages ---------- */

.doc { padding-block: clamp(3rem, 2rem + 5vw, 6.5rem) var(--space); }
.doc .prose { max-width: 38rem; }
.doc__title {
	font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem);
	line-height: 1.05;
	margin-top: .75rem;
}
.doc__meta { color: var(--muted); font-style: italic; margin-top: .75rem !important; }
.doc .prose h2 {
	font-size: 1.35em;
	font-style: italic;
	margin-top: 2.2em;
}
.doc .prose ul { padding-left: 1.2em; }
.doc .prose li + li { margin-top: .35em; }
.doc .prose address { font-style: normal; }

/* ---------- Footer ---------- */

.colophon {
	background: var(--ink);
	color: #d9d3c5;
	padding-top: clamp(3.5rem, 2.5rem + 4vw, 6rem);
	padding-bottom: max(2rem, env(safe-area-inset-bottom));
	font-size: .94em;
}
.colophon a { color: var(--paper); text-decoration-color: #5d584e; }
.colophon a:hover { color: var(--paper); text-decoration-color: var(--paper); }
.colophon address { font-style: normal; }

.colophon__grid {
	display: grid;
	gap: 2.25rem 2rem;
	grid-template-columns: 1fr;
}
@media (min-width: 34em) {
	.colophon__grid { grid-template-columns: repeat(2, 1fr); }
	.colophon__brand { grid-column: 1 / -1; }
}
@media (min-width: 60em) {
	.colophon__grid { grid-template-columns: 2fr 1.2fr 1fr; }
	.colophon__brand { grid-column: auto; }
}

.brand--footer { color: var(--paper); text-decoration: none; }
.brand--footer:hover { color: var(--paper); }
.colophon__brand p { margin-top: 1.1rem; max-width: 19rem; font-style: italic; color: #b9b2a3; }

.colophon__label {
	font-size: 1em;
	font-weight: 500;
	color: #948d7e;
	margin-bottom: .6rem;
}
.colophon__links { list-style: none; padding: 0; }
.colophon__links li + li { margin-top: .3rem; }

.colophon__base {
	margin-top: clamp(3rem, 2rem + 3vw, 4.5rem);
	padding-top: 1.25rem;
	border-top: 1px solid #3a3731;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: .4rem 2rem;
	font-size: .88em;
	color: #948d7e;
}

/* ---------- Small and short screens ---------- */

@media (max-width: 26em) {
	.nav { gap: 1.1rem; }
	.brand__name { font-size: 1.1em; }
}

/* Landscape phones and the folded outer screen turned sideways: keep the hero compact. */
@media (max-height: 30em) and (orientation: landscape) {
	.hero { padding-top: 2.5rem; }
	.hero__title { font-size: clamp(2.2rem, 1rem + 4vw, 3.6rem); max-width: 22ch; }
	.section__head .eyebrow { position: static; }
}
