/*
 * Duncan Shields — site styles
 * 1. Tokens
 * 2. Reset and document
 * 3. Accessibility
 * 4. Typography
 * 5. Layout
 * 6. Header
 * 7. Homepage
 * 8. Standard pages
 * 9. Footer
 * 10. WordPress content
 * 11. Responsive, reduced motion and print
 */

/* 1. Tokens */
:root {
	--color-ink: #20201d;
	--color-paper: #f2efe8;
	--color-muted: #69675f;
	--color-rule: #cbc6ba;
	--color-accent: #8c3927;
	--font-display: "Young Serif", Georgia, serif;
	--font-body: "Instrument Sans", Arial, sans-serif;
	--body-size: clamp(1.0625rem, 0.98rem + 0.25vw, 1.25rem);
	--body-leading: 1.55;
	--body-measure: 42rem;
	--body-color: var(--color-ink);
	--site-gutter: clamp(1.25rem, 3.5vw, 3.5rem);
	--content-width: 45rem;
	--wide-width: 82rem;
	--section-space: clamp(3.5rem, 6vw, 6rem);
	--section-space-small: clamp(2.25rem, 3.5vw, 3.5rem);
	--heading-space: clamp(1.75rem, 3vw, 3rem);
	--paragraph-space: 1.05em;
	--header-height: 4.5rem;
	--column-gap: clamp(2rem, 5vw, 5rem);
	--content-edge: max(var(--site-gutter), calc((100% - var(--wide-width)) / 2));
}

/* 2. Reset and document */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scrollbar-gutter: stable;
}

body {
	margin: 0;
	background: var(--color-paper);
	color: var(--color-ink);
	font-family: var(--font-body);
	font-size: var(--body-size);
	line-height: var(--body-leading);
	-webkit-font-smoothing: antialiased;
}

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

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

/* 3. Accessibility */
.skip-link {
	position: fixed;
	top: 1rem;
	left: 1rem;
	z-index: 100;
	padding: 0.75rem 1rem;
	background: var(--color-ink);
	color: var(--color-paper);
	font-family: var(--font-body);
	font-size: 0.875rem;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: translateY(0);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

:focus-visible {
	outline: 3px solid var(--color-accent);
	outline-offset: 4px;
}

/* 4. Typography */
h1,
h2,
h3,
p {
	margin-top: 0;
}

p {
	max-width: var(--body-measure);
	margin-bottom: var(--paragraph-space);
	color: var(--body-color);
	font-size: var(--body-size);
	font-weight: 400;
	line-height: var(--body-leading);
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
}

a:hover {
	color: var(--color-accent);
}

.site-title,
.primary-menu,
.note-preview time,
.site-footer {
	font-family: var(--font-body);
}

.external-link-indicator {
	display: inline-block;
	margin-inline-start: 0.15em;
	font-size: 0.85em;
}

/* 5. Layout */
.site-main {
	min-height: 60vh;
}

.section-shell,
.site-header__inner,
.site-footer__inner {
	width: min(calc(100% - (2 * var(--site-gutter))), var(--wide-width));
	margin-inline: auto;
}

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

/* 6. Header */
.site-header {
	border-bottom: 1px solid var(--color-rule);
}

.site-header__inner {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 2rem;
	min-height: var(--header-height);
	padding-block: 1rem;
}

.site-title {
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
}

.primary-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.6rem clamp(1rem, 2.5vw, 2.5rem);
	margin: 0;
	padding: 0;
	font-size: 0.8125rem;
	list-style: none;
}

.primary-menu a {
	text-decoration: none;
}

.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a {
	text-decoration: underline;
	text-underline-offset: 0.35em;
}

/* 7. Homepage */
.home-hero {
	position: relative;
	display: grid;
	overflow: hidden;
	min-height: clamp(32rem, 72vh, 44rem);
	align-items: center;
	padding: var(--section-space) var(--site-gutter);
	isolation: isolate;
}

.home-hero__media,
.home-hero--has-image::after {
	position: absolute;
	inset: 0;
}

.home-hero__media {
	z-index: -2;
}

.home-hero--has-image::after {
	z-index: -1;
	background: transparent;
	content: "";
	opacity: 0;
}

.home-hero__image {
	position: absolute;
	top: 0;
	left: 70%;
	display: block;
	width: auto;
	max-width: none;
	height: 100%;
	transform: translateX(-50%);
}

.home-hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
	width: min(100%, var(--wide-width));
	margin-inline: auto;
}

.home-premise {
	grid-column: 1;
	max-width: none;
	margin-bottom: 0;
	font-family: var(--font-display);
	font-size: clamp(1.75rem, 3.7vw, 4rem);
	font-weight: 400;
	letter-spacing: -0.035em;
	line-height: 0.98;
}

.home-premise__statement,
.home-premise__statement--split > span {
	display: block;
}

.home-premise__statement {
	white-space: nowrap;
}

.home-premise__statement + .home-premise__statement {
	margin-top: 0.14em;
}

.home-introduction {
	padding-block: var(--section-space);
	border-block: 1px solid var(--color-rule);
}

.home-point-of-view {
	display: grid;
	place-items: center;
	padding-block: var(--section-space-small);
	border-bottom: 1px solid var(--color-rule);
}

.home-point-of-view .measure {
	width: min(calc(100% - (2 * var(--site-gutter))), 64rem);
	margin-inline: 0;
}

.home-point-of-view p {
	max-width: none;
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(1.5rem, 2.6vw, 2.35rem);
	letter-spacing: -0.03em;
	line-height: 1.15;
}

.home-point-of-view p + p {
	margin-top: 0.1em;
}

.prose--lead,
.home-introduction > .measure > p {
	font-size: clamp(1.35rem, 2vw, 1.75rem);
	line-height: 1.45;
}

.prose--lead > *:last-child {
	margin-bottom: 0;
}

.chapter-list,
.recent-notes {
	padding-block: var(--section-space);
}

.chapter-list > .section-shell {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(1.5rem, 3vw, 3rem);
	align-items: stretch;
}

.chapter-link {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding-block: var(--section-space-small);
	border-top: 1px solid var(--color-rule);
}

.chapter-link h2 {
	max-width: none;
	margin-bottom: 1rem;
	font-family: var(--font-display);
	font-size: clamp(1.35rem, 2.1vw, 2.5rem);
	font-weight: 400;
	letter-spacing: -0.035em;
	line-height: 1.05;
	white-space: nowrap;
}

.chapter-link h2 a {
	text-decoration: none;
}

.chapter-link > p {
	max-width: var(--body-measure);
	margin-bottom: 0;
	flex: 1;
}

.chapter-link__arrow {
	display: inline-block;
	margin-top: 2rem;
	font-size: 1.25rem;
	line-height: 1;
	text-decoration: none;
}

.section-heading > a {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.section-heading {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 2rem;
	margin-bottom: var(--heading-space);
}

.section-heading h2 {
	margin-bottom: 0;
	font-size: clamp(1.5rem, 2.5vw, 2.25rem);
	font-weight: 500;
	letter-spacing: -0.02em;
}

.notes-list {
	border-top: 1px solid var(--color-rule);
}

.note-preview {
	display: grid;
	grid-template-columns: minmax(8rem, 1fr) minmax(0, 3fr);
	gap: var(--column-gap);
	padding-block: clamp(1.75rem, 3vw, 2.75rem);
	border-bottom: 1px solid var(--color-rule);
}

.note-preview time {
	grid-column: 1;
	grid-row: 1 / span 2;
	color: var(--color-muted);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.note-preview h3 {
	grid-column: 2;
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(1.6rem, 2.5vw, 2.5rem);
	font-weight: 400;
	line-height: 1.1;
}

.note-preview h3 a {
	text-decoration: none;
}

.note-preview p {
	grid-column: 2;
	margin: 0.75rem 0 0;
	color: var(--color-muted);
	font-size: var(--body-size);
	line-height: var(--body-leading);
}

/* 7a. Career scrapbook */
.chapter-header {
	width: min(calc(100% - (2 * var(--site-gutter))), var(--content-width));
	margin-inline: var(--content-edge) auto;
	padding-block: var(--section-space) var(--section-space-small);
}

.chapter-header .page-title {
	margin-bottom: var(--heading-space);
}

.timeline-list {
	position: relative;
	padding-block: 0 var(--section-space);
}

.timeline-list::before {
	position: absolute;
	top: 0;
	bottom: var(--section-space);
	left: 50%;
	width: 1px;
	background: var(--color-rule);
	content: "";
	transform: translateX(-50%);
}

.timeline-entry {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: var(--column-gap);
	padding: var(--section-space) 0;
	border-top: 1px solid var(--color-rule);
}

.timeline-entry--odd .timeline-entry__body {
	grid-column: 1;
	padding-inline-end: calc(var(--column-gap) / 2);
	text-align: right;
}

.timeline-entry__marker {
	position: absolute;
	top: calc(var(--section-space) + 0.3rem);
	left: 50%;
	width: 0.65rem;
	height: 0.65rem;
	border: 1px solid var(--color-accent);
	border-radius: 50%;
	background: var(--color-paper);
	transform: translateX(-50%);
}

.timeline-entry--even .timeline-entry__body {
	grid-column: 2;
	grid-row: 1;
	padding-inline-start: calc(var(--column-gap) / 2);
}

.timeline-entry--odd .timeline-entry__media {
	grid-column: 2;
	grid-row: 1;
}

.timeline-entry--even .timeline-entry__media {
	grid-column: 1;
	grid-row: 1;
}

.timeline-entry__period,
.timeline-entry__meta,
.single-note__header > time,
.note-navigation__label {
	color: var(--color-muted);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.timeline-entry__period {
	margin: 0;
}

.timeline-entry__body h2 {
	margin: 1.25rem 0 1.5rem;
	font-family: var(--font-display);
	font-size: clamp(1.6rem, 3vw, 3.25rem);
	font-weight: 400;
	letter-spacing: -0.035em;
	line-height: 1;
	text-wrap: balance;
}

.timeline-entry__meta {
	margin: 0 0 1.5rem;
}

.timeline-entry__body .prose {
	max-width: var(--body-measure);
}

.timeline-entry--odd .timeline-entry__body .prose {
	margin-inline-start: auto;
}

.timeline-entry__link,
.chapter-outro {
	margin: 2rem 0 0;
	font-size: 0.9rem;
}

.timeline-entry__media {
	max-width: 54rem;
	margin: 0;
	align-self: center;
}

.timeline-entry__media--placeholder {
	display: grid;
	min-height: clamp(13rem, 24vw, 25rem);
	place-items: center;
	border: 1px dashed var(--color-rule);
	background: rgba(203, 198, 186, 0.22);
	color: var(--color-muted);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-align: center;
	text-transform: uppercase;
}

.timeline-entry__media img {
	width: 100%;
	max-height: 36rem;
	object-fit: cover;
}

.js .timeline-entry {
	opacity: 0;
	transform: translateY(1rem);
	transition: opacity 650ms ease-out, transform 650ms ease-out;
}

.js .timeline-entry.is-visible {
	opacity: 1;
	transform: none;
}

/* 7b. Notes and chapter reading */
.notes-archive,
.single-note {
	padding-block: var(--section-space);
}

.notes-archive .page-header {
	padding-bottom: var(--section-space-small);
}

.notes-archive .note-preview h2 {
	grid-column: 2;
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(1.8rem, 3vw, 3rem);
	font-weight: 400;
	letter-spacing: -0.03em;
	line-height: 1.05;
}

.single-note__header > time {
	display: block;
	margin-bottom: 2rem;
}

.single-note__header .page-title {
	margin-bottom: 2rem;
}

.single-note__excerpt {
	max-width: 38rem;
	margin-bottom: 0;
	font-size: clamp(1.25rem, 2vw, 1.6rem);
	line-height: 1.45;
}

.single-note__media {
	margin-top: var(--section-space);
	margin-bottom: var(--section-space);
}

.single-note__media img {
	width: 100%;
	max-height: 48rem;
	object-fit: cover;
}

.note-navigation {
	display: flex;
	justify-content: space-between;
	gap: 2rem;
	margin-top: var(--section-space);
	padding-top: 1.5rem;
	border-top: 1px solid var(--color-rule);
}

.note-navigation a {
	display: grid;
	gap: 0.5rem;
	max-width: 20rem;
	font-family: var(--font-display);
	font-size: 1.35rem;
	line-height: 1.1;
	text-decoration: none;
}

.note-navigation a:last-child {
	text-align: right;
}

.note-navigation__label {
	font-family: var(--font-body);
	font-size: 0.7rem;
}

/* 8. Standard pages */
.standard-page {
	padding-block: var(--section-space);
}

.page-header,
.standard-page .prose {
	width: min(calc(100% - (2 * var(--site-gutter))), var(--content-width));
	margin-inline: var(--content-edge) auto;
}

.page-title {
	margin-bottom: var(--heading-space);
	font-family: var(--font-display);
	font-size: clamp(2.5rem, 4.5vw, 4.75rem);
	font-weight: 400;
	letter-spacing: -0.04em;
	line-height: 0.98;
	overflow-wrap: break-word;
	text-wrap: balance;
}

.standard-page .prose > *:last-child {
	margin-bottom: 0;
}

.prose {
	max-width: var(--body-measure);
	color: var(--body-color);
	font-size: var(--body-size);
	font-weight: 400;
	line-height: var(--body-leading);
}

.prose p {
	max-width: none;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

.prose--lead {
	font-size: clamp(1.35rem, 2vw, 1.75rem);
	line-height: 1.45;
}

.business-owner-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: var(--column-gap);
	width: min(calc(100% - (2 * var(--site-gutter))), var(--wide-width));
	margin-inline: auto;
}

.business-owner-copy .page-header,
.business-owner-copy .prose {
	width: min(100%, var(--content-width));
	margin-inline: 0;
}

.business-owner-copy .page-header {
	padding-top: 0;
}

.business-owner-media {
	margin: 0;
	align-self: start;
}

.business-owner-media img {
	width: 100%;
	max-height: 46rem;
	object-fit: cover;
}

.prose blockquote {
	margin: clamp(2.5rem, 5vw, 4rem) 0;
	padding-inline-start: 1.25rem;
	border-inline-start: 1px solid var(--color-accent);
	font-family: var(--font-display);
	font-size: clamp(1.5rem, 2.8vw, 2.5rem);
	line-height: 1.12;
}

.contact-page .prose {
	max-width: var(--body-measure);
}

.contact-form {
	width: min(calc(100% - (2 * var(--site-gutter))), var(--content-width));
	margin: var(--section-space-small) auto 0 var(--content-edge);
}

.contact-form__field {
	display: grid;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.contact-form label {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.contact-form input,
.contact-form textarea {
	width: 100%;
	padding: 0.8rem 0;
	border: 0;
	border-bottom: 1px solid var(--color-rule);
	border-radius: 0;
	background: transparent;
	color: var(--color-ink);
}

.contact-form textarea {
	min-height: 10rem;
	resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
	border-color: var(--color-accent);
	outline: none;
}

.contact-form button {
	padding: 0;
	border: 0;
	border-bottom: 1px solid currentColor;
	background: transparent;
	color: var(--color-ink);
	cursor: pointer;
	font-weight: 600;
}

.contact-form button:hover {
	color: var(--color-accent);
}

.contact-form__notice {
	margin-bottom: 2rem;
	padding: 1rem;
	border: 1px solid var(--color-rule);
}

.contact-form__trap {
	position: absolute;
	left: -9999px;
}

/* 9. Footer */
.site-footer {
	border-top: 1px solid var(--color-rule);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
}

.site-footer__inner {
	display: flex;
	justify-content: space-between;
	gap: 1.5rem;
	padding-block: 2rem;
}

.site-footer p {
	margin: 0;
}

.site-footer__name {
	font-weight: 700;
	text-transform: uppercase;
}

.site-footer a {
	text-decoration: none;
}

.site-footer__meta {
	color: var(--color-muted);
}

/* 10. WordPress content */
.alignwide {
	max-width: var(--wide-width);
	margin-inline: auto;
}

.alignfull {
	width: 100%;
}

.wp-caption-text {
	color: var(--color-muted);
	font-family: var(--font-body);
	font-size: 0.75rem;
}

/* 11. Responsive, reduced motion and print */
@media (max-width: 64rem) {
	.chapter-list > .section-shell {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0 clamp(1.25rem, 4vw, 2.5rem);
	}
}

@media (max-width: 48rem) {
	.site-header__inner {
		display: block;
	}

	.primary-menu {
		justify-content: flex-start;
		margin-top: 1rem;
	}

	.home-hero {
		min-height: 70vh;
	}

	.timeline-list::before {
		left: 0;
	}

	.timeline-entry,
	.timeline-entry:nth-child(even) {
		grid-template-columns: 1fr;
		gap: 1.5rem;
		padding-inline: 2rem 0;
	}

	.timeline-entry__marker {
		left: -0.3rem;
	}

	.timeline-entry__media {
		grid-column: 1;
	}

	.timeline-entry--odd .timeline-entry__body,
	.timeline-entry--even .timeline-entry__body {
		grid-column: 1;
		grid-row: auto;
		padding-inline: 0;
		text-align: left;
	}

	.timeline-entry--odd .timeline-entry__media,
	.timeline-entry--even .timeline-entry__media {
		grid-column: 1;
		grid-row: auto;
	}

	.timeline-entry--odd .timeline-entry__body .prose {
		margin-inline-start: 0;
	}

	.business-owner-layout {
		grid-template-columns: 1fr;
		gap: var(--section-space-small);
	}

	.business-owner-media {
		grid-row: 2;
	}

	.business-owner-copy {
		grid-row: 1;
	}

	.note-preview {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.note-preview time,
	.note-preview h3,
	.note-preview p {
		grid-column: 1;
		grid-row: auto;
	}

	.note-preview h3 {
		margin-top: 0.75rem;
	}

	.note-navigation {
		display: grid;
	}

	.note-navigation a:last-child {
		text-align: left;
	}
}

@media (max-width: 40rem) {
	.home-hero__inner {
		display: block;
	}

	.home-hero__image {
		left: 84%;
	}

	.home-premise {
		max-width: 60%;
		font-size: clamp(1.375rem, 5.5vw, 1.75rem);
	}

	.home-premise__statement {
		white-space: normal;
		text-wrap: balance;
	}
}

@media (max-width: 36rem) {
	.chapter-list > .section-shell {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.chapter-link h2 {
		white-space: normal;
	}
}

@media (max-width: 32rem) {
	.primary-menu {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.section-heading,
	.site-footer__inner {
		display: block;
	}

	.section-heading > a {
		display: inline-block;
		margin: -2rem 0 2.5rem;
	}

	.site-footer__meta {
		margin-top: 0.5rem;
	}
}

@media (max-width: 19rem) {
	.home-premise__statement,
	.chapter-link h2 {
		white-space: normal;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}

	.js .timeline-entry {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

@media print {
	.site-header,
	.site-footer,
	.skip-link {
		display: none;
	}

	body,
	.recent-notes {
		background: #fff;
		color: #000;
	}

	.home-hero {
		min-height: 0;
	}
}
