/* ============================================================
   Walter Whitaker — Resume site
   Plain CSS. Mobile-first base, desktop layout via media query.
   ============================================================ */

:root {
	--page-bg: #f4f5f7;
	--card: #0b0b0d;
	--panel: #141417;
	--panel-2: #1a1a1e;
	--tile: #1d1d22;
	--border: rgba(255, 255, 255, 0.07);
	--border-strong: rgba(255, 255, 255, 0.14);
	--text: #f5f5f6;
	--text-muted: #9a9aa3;
	--text-faint: #6f6f78;

	--radius-card: 30px;
	--radius-panel: 22px;
	--radius-tile: 15px;

	--maxw: 1060px;
	--gap: 14px;

	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--font);
	color: var(--text);
	background: var(--card);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	display: flex;
	justify-content: center;
}

a {
	color: inherit;
	text-decoration: none;
}

a:focus-visible,
button:focus-visible {
	outline: 2px solid var(--border-strong);
	outline-offset: 2px;
	border-radius: 6px;
}

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

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

/* ---------- Shell ---------- */

.resume {
	width: 100%;
	max-width: var(--maxw);
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-card);
	padding: 14px;
	display: grid;
	gap: var(--gap);
	box-shadow: 0 30px 80px rgba(15, 17, 25, 0.18);
	align-self: center;
}

.col {
	display: flex;
	flex-direction: column;
	gap: var(--gap);
	min-width: 0;
}

.panel {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius-panel);
	padding: 22px;
}

/* ---------- Avatar ---------- */

.avatar {
	margin: 0;
	border-radius: var(--radius-panel);
	overflow: hidden;
	background: var(--panel-2);
	aspect-ratio: 1 / 1;
}

.avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.avatar.is-fallback {
	display: grid;
	place-items: center;
}

.avatar.is-fallback img {
	display: none;
}

.avatar.is-fallback::after {
	content: attr(data-initials);
	font-size: clamp(48px, 18vw, 96px);
	font-weight: 800;
	letter-spacing: -0.04em;
	color: var(--text-faint);
}

/* ---------- Identity ---------- */

.identity__name {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.03em;
}

.identity__role {
	margin: 6px 0 0;
	color: var(--text-muted);
	font-size: 15px;
	font-weight: 500;
}

.identity__bio {
	margin: 16px 0 0;
	color: var(--text-muted);
	font-size: 14px;
	line-height: 1.6;
}

.contact {
	margin: 20px 0 0;
	padding: 18px 0 0;
	border-top: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.contact__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
}

.contact__row dt {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--text);
}

.contact__row dd {
	margin: 0;
	font-size: 13.5px;
	color: var(--text-muted);
	text-align: right;
	word-break: break-word;
}

.contact__row a {
	transition: color 0.15s ease;
}

.contact__row a:hover {
	color: var(--text);
}

/* ---------- Social row ---------- */

.social {
	list-style: none;
	display: flex;
	gap: 10px;
	margin: 18px 0 0;
	padding: 0;
}

.social__link {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 11px;
	color: var(--text-muted);
	background: var(--panel-2);
	border: 1px solid var(--border);
	transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.social__link:hover {
	color: var(--text);
	background: var(--tile);
	transform: translateY(-1px);
}

/* ---------- Resume button ---------- */

.resume-btn {
	margin-top: 22px;
	width: 100%;
	min-height: 50px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font: inherit;
	font-size: 14.5px;
	font-weight: 600;
	color: #ffffff;
	background: transparent;
	border: 1px solid #ffffff;
	border-radius: 999px; /* pill */
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.resume-btn:hover {
	background: rgba(255, 255, 255, 0.1);
}

.resume-btn svg {
	color: #ffffff;
}

/* ---------- Panel titles ---------- */

.panel__title {
	margin: 0 0 20px;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: -0.01em;
}

/* ---------- Experience ---------- */

.exp-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 26px;
}

.exp__company {
	margin: 0;
	font-size: 13px;
	color: var(--text-muted);
	font-weight: 500;
}

.exp__role {
	margin: 3px 0 0;
	font-size: 15.5px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.exp__summary {
	margin: 9px 0 0;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--text-muted);
	max-width: 64ch;
}

.exp__dates {
	margin: 10px 0 0;
	font-size: 12.5px;
	color: var(--text-faint);
}

/* Subtle, overlay-style scrollbar that looks the same in every browser/OS. */
.exp-list {
	scrollbar-width: thin; /* Firefox */
	scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.exp-list::-webkit-scrollbar {
	width: 8px;
}
.exp-list::-webkit-scrollbar-track {
	background: transparent;
}
.exp-list::-webkit-scrollbar-thumb {
	background-color: rgba(255, 255, 255, 0.16);
	border-radius: 999px;
	border: 2px solid transparent;
	background-clip: padding-box;
}
.exp-list::-webkit-scrollbar-thumb:hover {
	background-color: rgba(255, 255, 255, 0.28);
	background-clip: padding-box;
}

/* ---------- Stack ---------- */

.stack__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.stack__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.stack__tile {
	width: 58px;
	height: 58px;
	display: grid;
	place-items: center;
	border-radius: var(--radius-tile);
	background: var(--tile);
	border: 1px solid var(--border);
	color: var(--brand, var(--text));
}

.stack__tile--text {
	font-size: 19px;
	font-weight: 800;
	letter-spacing: -0.04em;
}

.stack__tile--sm {
	font-size: 15px;
}

.stack__name {
	display: block;
	font-size: 12px;
	color: var(--text-muted);
}

/* ============================================================
   DESKTOP — two-column resume card (matches screenshot 1)
   ============================================================ */

@media (min-width: 880px) {
	/* Lock the page: the window never scrolls, only the roles list does. */
	html,
	body {
		height: 100%;
		overflow: hidden;
	}

	body {
		align-items: stretch;
	}

	/* Fill the whole viewport exactly, edge to edge, and grow with the screen. */
	.resume {
		max-width: none;
		width: 100%;
		height: 100vh;
		border: none;
		border-radius: 0;
		box-shadow: none;
		align-items: stretch;
		grid-template-columns: minmax(320px, 23vw) 1fr;
		gap: clamp(14px, 1.3vw, 26px);
		padding: clamp(14px, 1.3vw, 26px);
	}

	/* Columns must be allowed to shrink so their content fits the locked height. */
	.col {
		min-height: 0;
	}

	/* Cap the portrait so the sidebar can never exceed the viewport height. */
	.avatar {
		flex: 0 0 auto;
		max-height: 40vh;
	}

	.panel {
		padding: clamp(22px, 1.9vw, 40px);
	}

	/* Bio is sidebar-only on mobile; desktop card stays clean like the ref */
	.identity__bio {
		display: none;
	}

	/* Lock the card to the viewport so the experience list scrolls inside it. */
	.resume {
		height: 100vh;
	}

	/* Panels stretch to fill their column's full height. */
	.identity,
	.experience {
		flex: 1;
	}

	/* Identity is a column so the Download button sits at the very bottom. */
	.identity {
		display: flex;
		flex-direction: column;
		min-height: 0;
	}

	.resume-btn {
		margin-top: auto;
	}

	/* Experience: fixed title, scrollable list with a subtle custom scrollbar. */
	.experience {
		display: flex;
		flex-direction: column;
		min-height: 0;
		/* Trim the right padding so the scrollbar sits 8px from the panel edge. */
		padding-right: 8px;
	}

	/* Keep the title aligned with the body despite the trimmed panel padding. */
	.experience .panel__title {
		padding-right: clamp(14px, 1.9vw, 32px);
	}

	.exp-list {
		flex: 1;
		min-height: 0;
		overflow-y: auto;
		gap: clamp(26px, 2.2vw, 44px);
		/* Gap between the text and the scrollbar (scrollbar itself is at 8px). */
		padding-right: clamp(14px, 1.9vw, 32px);
	}

	/* Stack panel: "Stack" label sits to the left of the icon row. */
	.stack {
		display: flex;
		align-items: center;
		gap: clamp(20px, 2.4vw, 48px);
	}
	.stack__title {
		margin: 0;
		flex-shrink: 0;
	}
	.stack__grid {
		flex: 1;
		gap: clamp(20px, 2.2vw, 40px);
	}

	/* Fluid type so content scales up on larger displays. */
	.identity__name {
		font-size: clamp(24px, 1.7vw, 34px);
	}
	.identity__role {
		font-size: clamp(15px, 1.05vw, 19px);
	}
	.contact__row dt,
	.contact__row dd {
		font-size: clamp(13.5px, 0.92vw, 16px);
	}
	.panel__title {
		font-size: clamp(17px, 1.2vw, 23px);
	}
	.exp__company {
		font-size: clamp(13px, 0.85vw, 15px);
	}
	.exp__role {
		font-size: clamp(15.5px, 1.05vw, 20px);
	}
	.exp__summary {
		font-size: clamp(13.5px, 0.95vw, 16.5px);
		max-width: 70ch;
	}
	.exp__dates {
		font-size: clamp(12.5px, 0.82vw, 14.5px);
	}
	.stack__tile {
		width: clamp(58px, 4.4vw, 80px);
		height: clamp(58px, 4.4vw, 80px);
	}
}

/* ============================================================
   MOBILE — condensed single column (matches screenshot 2 flow)
   ============================================================ */

@media (max-width: 879px) {
	/* Full screen width — no narrow centered card on mobile/tablet. */
	.resume {
		grid-template-columns: 1fr;
		max-width: none;
		width: 100%;
	}

	/* Centered 200x200 portrait that tucks slightly into the panel below. */
	.avatar {
		width: 200px;
		height: 200px;
		margin: 6px auto -36px;
		border-radius: 26px;
		position: relative;
		z-index: 2;
		border: 4px solid var(--card);
	}

	/* Make room for the overlapping avatar and center the header. */
	.identity {
		padding-top: 50px;
		text-align: center;
	}

	.social {
		justify-content: center;
	}

	/* Reorder to: header → bio → skills → experience */
	.identity {
		order: 1;
	}
	.stack {
		order: 2;
	}
	.experience {
		order: 3;
	}

	.identity__name {
		font-size: 22px;
	}

	/* Stack becomes a labelled "Skills" grid like the reference */
	.stack__grid {
		gap: 14px;
	}

	.stack__item {
		width: calc((100% - 28px) / 3);
	}

	.stack__tile {
		width: 100%;
		height: 64px;
	}

	/* Experience becomes a vertical timeline */
	.exp-list {
		position: relative;
		padding-left: 22px;
		gap: 28px;
	}

	.exp-list::before {
		content: "";
		position: absolute;
		left: 4px;
		top: 6px;
		bottom: 6px;
		width: 1px;
		background: var(--border-strong);
	}

	.exp {
		position: relative;
	}

	.exp::before {
		content: "";
		position: absolute;
		left: -22px;
		top: 5px;
		width: 9px;
		height: 9px;
		border-radius: 50%;
		background: var(--text-faint);
		box-shadow: 0 0 0 4px var(--panel);
	}
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

/* ============================================================
   PRINT — clean light resume for "Download Resume" (Save as PDF)
   ============================================================ */

@media print {
	body {
		background: #fff;
		color: #000;
		padding: 0;
	}

	.resume {
		max-width: none;
		box-shadow: none;
		border: none;
		background: #fff;
		color: #000;
		display: block;
		padding: 0;
	}

	.panel,
	.avatar {
		background: #fff;
		border: 1px solid #ddd;
		break-inside: avoid;
	}

	.identity__name,
	.identity__role,
	.exp__role,
	.panel__title {
		color: #000;
	}

	.identity__bio,
	.exp__company,
	.exp__summary,
	.exp__dates,
	.contact__row dd {
		color: #333;
	}

	.identity__bio {
		display: block;
	}

	.social,
	.resume-btn {
		display: none;
	}
}
