/* ==========================================================================
   Résumé — one stylesheet for screen and print.
   Plain modern CSS (custom properties + native nesting); no build step.
   ========================================================================== */

@page {
	size: letter;
	margin: 0.5in 0.55in;
}

/* ---- Tokens ------------------------------------------------------------- */

:root {
	--accent: #cc7a17;        /* bullets, rules (decorative only: 3.3:1 on white) */
	--accent-strong: #a85d12; /* section headings — 4.9:1 on white */
	--accent-deep: #9a521b;   /* name, job titles — 5.8:1 on white */
	--ink: #26221e;
	--ink-muted: #5f574f;
	--rule: color-mix(in oklab, var(--accent) 40%, transparent);
	--paper: #ffffff;
	--canvas: #f3eee7;
	--shadow: 0 1px 2px rgb(60 40 20 / 0.06), 0 12px 40px -12px rgb(60 40 20 / 0.18);

	/* Verdana: wide, open, very legible at small sizes. DejaVu Sans (from Bitstream Vera) is the closest
	   metric match where Verdana is not installed; CI installs the real font before building the PDF. */
	--font: Verdana, "DejaVu Sans", "Bitstream Vera Sans", Geneva, sans-serif;

	font-size: 12.5px;
}

@media screen and (prefers-color-scheme: dark) {
	:root {
		--accent: #d98a2b;
		--accent-strong: #f0b060;
		--accent-deep: #f4bd78;
		--ink: #ece6df;
		--ink-muted: #b3a89c;
		--paper: #1f1b18;
		--canvas: #151210;
		--shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 40px -12px rgb(0 0 0 / 0.6);
	}
}

/* ---- Base --------------------------------------------------------------- */

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

body {
	margin: 0;
	background: var(--canvas);
	color: var(--ink);
	font-family: var(--font);
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul,
dl,
dd {
	margin: 0;
}

ul {
	padding: 0;
	list-style: none;
}

a {
	color: inherit;
	text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent);
	text-underline-offset: 0.2em;

	&:hover {
		color: var(--accent-strong);
		text-decoration-color: currentColor;
	}

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

time,
.meta,
.dates {
	font-variant-numeric: tabular-nums;
}

/* One separator style everywhere: a muted middle dot */
.sep {
	margin-inline: 0.35em;
	color: var(--ink-muted);
}

.aside {
	color: var(--ink-muted);
	font-weight: 400;
}

/* ---- Page (the "sheet of paper") ---------------------------------------- */

.page {
	max-width: 9in;
	margin: clamp(0px, 4vw, 3rem) auto;
	padding: clamp(1.5rem, 6vw, 0.65in);
	background: var(--paper);
	box-shadow: var(--shadow);
	border-radius: 4px;
}

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

.masthead {
	display: flex;
	align-items: flex-start;
	gap: 1rem;

	.identity {
		flex: 1;
		min-width: 0;
	}

	h1 {
		color: var(--accent-deep);
		font-size: 2.1rem;
		font-weight: 600;
		letter-spacing: -0.01em;
		line-height: 1.1;
	}

	.contact {
		display: flex;
		flex-wrap: wrap;
		margin-top: 0.3rem;
		color: var(--ink-muted);
		font-size: 0.95rem;

		li + li::before {
			content: "·";
			margin-inline: 0.5em;
		}

		a {
			text-decoration: none;

			&:hover {
				text-decoration: underline;
			}
		}
	}
}

.download {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.4em 0.8em;
	border: 1px solid var(--rule);
	border-radius: 999px;
	color: var(--accent-strong);
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 150ms ease;

	svg {
		width: 1.1em;
		height: 1.1em;
		fill: none;
		stroke: currentColor;
		stroke-width: 2.25;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	&:hover {
		background: color-mix(in oklab, var(--accent) 12%, transparent);
	}
}

.summary {
	margin-top: 0.75rem;
	text-wrap: pretty;
}

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

section {
	margin-top: 1.15rem;

	> h2 {
		margin-bottom: 0.5rem;
		padding-bottom: 0.2rem;
		border-bottom: 1px solid var(--rule);
		color: var(--accent-strong);
		font-size: 1.05rem;
		font-weight: 650;
		letter-spacing: 0.08em;
		text-transform: uppercase;
	}
}

/* An employer or school: name left, place/dates right, then bullets */
.entry {
	break-inside: avoid;

	& + & {
		margin-top: 0.65rem;
	}

	> header {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		justify-content: space-between;
		column-gap: 1rem;
	}

	h3 {
		font-size: 1.05rem;
		font-weight: 700;
	}

	.meta {
		color: var(--ink-muted);
		font-size: 0.9rem;
	}

	> ul {
		margin-top: 0.15rem;
	}
}

/* One job title within an employer, with its own bullets */
.role {
	margin-top: 0.2rem;

	& + & {
		margin-top: 0.45rem;
	}

	> ul {
		margin-top: 0.1rem;
	}
}

.role-title {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	color: var(--accent-deep);
	font-weight: 600;

	.dates {
		color: var(--ink-muted);
		font-size: 0.9rem;
		font-weight: 400;
		white-space: nowrap;
	}
}

/* Bulleted lists: a small amber dot hanging in the margin.
   Kept in normal flow (no position: absolute/relative) on purpose: positioned
   elements are painted in a later pass, which scrambles the PDF's text order
   and confuses applicant-tracking systems that parse it. */
.entry > ul > li,
.role > ul > li,
.skill-group li {
	padding-left: 0.95rem;

	&::before {
		content: "";
		display: inline-block;
		width: 0.3rem;
		height: 0.3rem;
		margin-left: -0.8rem;
		margin-right: 0.5rem;
		border-radius: 50%;
		background: var(--accent);
		vertical-align: 0.2em;
	}

	& + li {
		margin-top: 0.08rem;
	}
}

/* ---- Skills ------------------------------------------------------------- */

.skills {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.2rem 1.25rem;

	dt {
		font-weight: 600;
	}
}

/* Skill groups: short bulleted columns, easy to scan top-to-bottom.
   An even grid (not space-between flex) keeps wrapped rows aligned at mid widths, and keeps
   the last column away from the right edge, where PDF text extractors lump it in with the
   right-aligned dates. */
.skill-columns {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
	gap: 0.75rem 1.5rem;
	margin-top: 0.75rem;
}

.skill-group {
	h3 {
		margin-bottom: 0;
		font-size: 1rem;
		font-weight: 700;
	}

	/* nested items (AWS → EC2, S3) get a hollow ring instead of a dot */
	ul ul {
		margin-top: 0.08rem;

		li::before {
			background: none;
			border: 1px solid var(--accent);
		}
	}
}

/* ---- Certifications ----------------------------------------------------- */

.credentials {
	margin-top: 0.45rem;

	li {
		display: flex;
		justify-content: space-between;
		gap: 1rem;

		> :first-child {
			font-weight: 600;
		}

		time,
		.value {
			color: var(--ink-muted);
			font-size: 0.9rem;
			white-space: nowrap;
		}
	}
}

/* ---- Small screens ------------------------------------------------------ */

@media (max-width: 40rem) {
	.masthead {
		h1 {
			font-size: 1.7rem;
		}

		/* stack contact details instead of wrapping mid-row with stray separators */
		.contact {
			flex-direction: column;

			li + li::before {
				content: none;
			}
		}
	}

	.skills {
		grid-template-columns: 1fr;

		dd + dt {
			margin-top: 0.4rem;
		}
	}

	.skill-columns {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	/* dates flow inline after the title instead of hanging on their own line */
	.role-title {
		display: block;

		.dates {
			margin-left: 0.4em;
		}
	}
}

/* ---- Print / PDF -------------------------------------------------------- */

@media print {
	:root {
		font-size: 8pt;
	}

	body {
		background: none;
		line-height: 1.45;
	}

	.page {
		max-width: none;
		margin: 0;
		padding: 0;
		box-shadow: none;
		border-radius: 0;
	}

	.screen-only {
		display: none !important;
	}

	a {
		text-decoration: none;
	}

	section > h2 {
		break-after: avoid;
	}

	/* The small print size leaves room to spare: spread sections so the page feels balanced */
	section {
		margin-top: 1.5rem;

		> h2 {
			margin-bottom: 0.55rem;
		}
	}

	.summary {
		margin-top: 1rem;
	}

	.entry + .entry {
		margin-top: 0.8rem;
	}

	.role + .role {
		margin-top: 0.7rem;
	}
}
