/* teamjohnston.net
 *
 * One page, no JavaScript. The palette runs light into a single dusk moment at "Off the
 * clock", then settles into deep pine for contact and footer. Light sections invert in dark
 * mode; the dusk and pine sections are already dark and stay as they are.
 *
 * Sections are full-bleed so their backgrounds reach the viewport edges; the content column
 * is centered by the inline padding: max(1.4rem, 50vw - 530px) is a 1060px column with a
 * 1.4rem minimum gutter, with no wrapper element needed.
 */

:root {
	--bg: #fbfaf7;
	--ink: #1c211e;
	--muted: #66706b;
	--line: #e3e2da;
	--accent: #1e5c4b;
	--on-accent: #fdfdfb;

	/* The dusk gradient and the pine ground are fixed, not themed. */
	--dusk-top: #1d2739;
	--dusk-mid: #2b3a52;
	--dusk-low: #48597a;
	--dusk-glow: #8b7f88;
	--pine: #1a2620;
	--pine-deep: #14211a;
	--pine-ink: #e7e9e2;
	--pine-muted: #9faea5;
	--mint: #8fd0b4;

	--gutter: max(1.4rem, calc(50vw - 530px));
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #141715;
		--ink: #e6e9e3;
		--muted: #98a29b;
		--line: #2a2f2b;
		--accent: #6fbfa0;
		--on-accent: #10241c;
	}
}

* {
	margin: 0;
	box-sizing: border-box;
}

body {
	background: var(--bg);
	color: var(--ink);
	font-family: "Avenir Next", "Helvetica Neue", -apple-system, BlinkMacSystemFont,
		"Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.6;
}

/* Smooth scrolling for in-page navigation only. Scoped to :focus-within so a fresh page load
 * jumps straight to its fragment: the contact form's redirect lands on /?sent=1#contact, and
 * an unscoped rule animated that landing from the top of the page, a visible glide where the
 * visitor should just still be looking at the contact section. Clicking a nav link focuses
 * the link, which is what turns the smoothness on for the case it is meant for. */
@media (prefers-reduced-motion: no-preference) {
	html:focus-within {
		scroll-behavior: smooth;
	}
}

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

img {
	max-width: 100%;
}

/* Navigation */

.nav {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.4rem 1.5rem;
	padding: 1.1rem var(--gutter);
	font-size: 0.78rem;
}

.nav-mark {
	font-weight: 600;
	letter-spacing: 0.02em;
}

.nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.6rem;
	list-style: none;
	padding: 0;
}

.nav a {
	color: var(--muted);
	text-decoration: none;
}

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

/* Hero */

.hero {
	padding: 4.5rem var(--gutter) 3.8rem;
	display: grid;
	grid-template-columns: minmax(0, 46rem) auto;
	gap: 3rem;
	align-items: center;
	justify-content: start;
}

/* The headshot is deliberately subordinate to the headline: modest scale, quiet ring. The
 * same face reappears at the contact section, where the decision to reach out is made. */
.hero-photo {
	width: clamp(120px, 16vw, 210px);
	height: auto;
	aspect-ratio: 1;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid var(--line);
	justify-self: end;
}

.kicker {
	font-size: 0.72rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--accent);
	font-weight: 600;
	margin-bottom: 1.2rem;
}

h1 {
	font-size: clamp(2.2rem, 5vw, 3.5rem);
	line-height: 1.06;
	font-weight: 600;
	letter-spacing: -0.022em;
	text-wrap: balance;
}

.hero-lead {
	margin-top: 1.3rem;
	font-size: 1.05rem;
	line-height: 1.65;
	color: var(--muted);
	max-width: 56ch;
}

.hero-cta {
	margin-top: 1.8rem;
	display: flex;
	gap: 1.2rem;
	align-items: center;
	flex-wrap: wrap;
}

.btn {
	display: inline-block;
	font-size: 0.85rem;
	font-weight: 600;
	font-family: inherit;
	padding: 0.65rem 1.3rem;
	border: 0;
	border-radius: 3px;
	background: var(--accent);
	color: var(--on-accent);
	text-decoration: none;
	cursor: pointer;
}

.btn-ghost {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--accent);
	text-decoration: none;
}

/* Sections */

.section-label {
	font-size: 0.72rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--muted);
	font-weight: 600;
	padding: 2.6rem var(--gutter) 1.1rem;
}

.prose {
	padding: 0 var(--gutter);
}

.prose p {
	color: var(--muted);
	line-height: 1.7;
	max-width: 72ch;
}

.prose p + p {
	margin-top: 0.9rem;
}

.prose strong {
	color: var(--ink);
	font-weight: 600;
}

/* Now: three engagements */

.now {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1px;
	background: var(--line);
	border-block: 1px solid var(--line);
	margin-top: 0.4rem;
	padding-inline: calc(var(--gutter) - 1.4rem);
}

.now article {
	background: var(--bg);
	padding: 1.6rem 2rem 1.9rem 1.4rem;
}

.now article:first-child {
	padding-left: 1.4rem;
}

.role {
	font-size: 0.72rem;
	color: var(--accent);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin-bottom: 0.55rem;
}

.now h3 {
	font-size: 0.98rem;
	font-weight: 600;
}

.now article p:last-child {
	font-size: 0.86rem;
	line-height: 1.6;
	color: var(--muted);
	margin-top: 0.5rem;
}

/* Work with me */

.offers {
	padding: 0 var(--gutter);
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
}

.offers h3 {
	font-size: 0.95rem;
	font-weight: 600;
}

.offers h3::before {
	content: "";
	display: block;
	width: 2rem;
	height: 2px;
	background: var(--accent);
	margin-bottom: 0.8rem;
}

.offers p {
	font-size: 0.86rem;
	line-height: 1.6;
	color: var(--muted);
	margin-top: 0.5rem;
}

/* Experience timeline */

.timeline {
	padding: 0 var(--gutter);
}

.tl-row {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 1.5rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--line);
}

.tl-row:last-of-type {
	border-bottom: 0;
}

.tl-date {
	font-size: 0.8rem;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
	padding-top: 0.12rem;
}

.tl-role {
	font-size: 0.96rem;
	font-weight: 600;
}

.tl-co {
	color: var(--accent);
	font-weight: 500;
}

.tl-desc {
	font-size: 0.86rem;
	color: var(--muted);
	margin-top: 0.18rem;
	line-height: 1.6;
}

.tl-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 2rem;
	align-items: baseline;
	padding: 1.3rem var(--gutter) 0;
	font-size: 0.84rem;
	color: var(--muted);
}

.tl-foot strong {
	color: var(--ink);
	font-weight: 600;
}

.tl-foot a {
	color: var(--accent);
	text-decoration: none;
	font-weight: 500;
}

/* Off the clock: the one dusk moment */

.offclock {
	position: relative;
	overflow: hidden;
	margin-top: 3rem;
	background: linear-gradient(180deg, var(--dusk-top) 0%, var(--dusk-mid) 48%,
		var(--dusk-low) 80%, var(--dusk-glow) 100%);
	color: #eceae2;
	padding: 1rem 0 7rem;
}

.offclock .section-label {
	color: #b9bfc9;
}

.offclock-grid {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 2.5rem;
	align-items: start;
	position: relative;
	z-index: 2;
	padding: 0 var(--gutter);
}

.offclock-copy p {
	max-width: 58ch;
	line-height: 1.7;
	color: #d9d9d2;
}

.offclock-copy p + p {
	margin-top: 0.9rem;
}

.snaps {
	position: relative;
	height: 260px;
}

.snap {
	position: absolute;
	width: 62%;
	aspect-ratio: 4 / 3;
	border: 6px solid #f2f0e9;
	border-bottom-width: 26px;
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
	background: #22302a;
}

.snap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Where the frames overlap, the photo with the face sits in front. */
.snap-one {
	top: 0;
	left: 0;
	transform: rotate(-3.5deg);
	z-index: 2;
}

.snap-two {
	top: 56px;
	right: 0;
	transform: rotate(2.5deg);
}

.ridges {
	position: absolute;
	inset: auto 0 0 0;
	z-index: 1;
	display: block;
	width: 100%;
}

/* Contact, on the pine ground */

.contact {
	background: var(--pine);
	color: var(--pine-ink);
	padding: 1rem 0 3.6rem;
}

.contact .section-label {
	color: var(--pine-muted);
}

.contact-grid {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 3rem;
	padding: 0 var(--gutter);
}

.person {
	display: flex;
	gap: 1.3rem;
	align-items: center;
	margin-bottom: 1.2rem;
}

.headshot {
	width: 84px;
	height: 84px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid #35473c;
	display: block;
}

.contact-heading {
	font-size: 1.5rem;
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.25;
	text-wrap: balance;
}

.contact-lead {
	color: #b9c4bc;
	line-height: 1.65;
	font-size: 0.95rem;
	max-width: 44ch;
}

.contact-direct {
	margin-top: 1.6rem;
	font-size: 0.9rem;
}

.contact-direct a {
	color: var(--mint);
	text-decoration: none;
	font-weight: 500;
}

.contact-direct span {
	color: #7d8a80;
	margin: 0 0.6rem;
}

/* The form */

form {
	display: grid;
	gap: 0.8rem;
}

.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.8rem;
}

form label {
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--pine-muted);
	font-weight: 600;
}

form input,
form textarea {
	width: 100%;
	margin-top: 0.3rem;
	background: #223028;
	border: 1px solid #35473c;
	border-radius: 4px;
	padding: 0.6rem 0.75rem;
	color: var(--pine-ink);
	font: inherit;
	font-size: 0.9rem;
	letter-spacing: normal;
	text-transform: none;
}

form textarea {
	resize: vertical;
	min-height: 90px;
}

form input:focus-visible,
form textarea:focus-visible {
	outline: 2px solid var(--mint);
	outline-offset: 1px;
}

form .btn {
	background: var(--mint);
	color: var(--pine-deep);
	justify-self: start;
}

.form-note {
	font-size: 0.9rem;
	line-height: 1.55;
	padding: 0.7rem 0.9rem;
	border-radius: 4px;
	margin-bottom: 0.9rem;
}

.form-sent {
	background: #223028;
	border: 1px solid var(--mint);
}

.form-problem {
	background: #33261f;
	border: 1px solid #c99b7a;
}

/* The honeypot. Off-screen rather than display:none, because a field with no layout box is
 * one some browsers decline to submit at all, which would leave the trap unsprung. */
.trap {
	position: absolute;
	left: -9999px;
	top: auto;
}

/* Footer continues the pine into ground */

.footer {
	background: var(--pine-deep);
	color: #7d8a80;
	font-size: 0.78rem;
	padding: 1.2rem var(--gutter);
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.footer a {
	color: var(--pine-muted);
	text-decoration: none;
}

/* Small screens */

@media (max-width: 760px) {
	.now,
	.offers,
	.form-row,
	.contact-grid,
	.offclock-grid,
	.hero {
		grid-template-columns: 1fr;
	}

	/* On a phone the photo leads, small, above the kicker. */
	.hero {
		gap: 1.6rem;
	}

	.hero-photo {
		order: -1;
		width: 104px;
		justify-self: start;
	}

	.now {
		padding-inline: 0;
	}

	.now article,
	.now article:first-child {
		padding: 1.4rem;
	}

	.tl-row {
		grid-template-columns: 1fr;
		gap: 0.15rem;
	}

	.snaps {
		height: auto;
		display: grid;
		gap: 1.4rem;
		padding-bottom: 0.5rem;
	}

	.snap {
		position: static;
		width: 88%;
	}
}
