/* Lewis Heath — portfolio */

:root {
	--bg: #07060B;
	--surface: #12101B;
	--text: #F4F3F8;
	--text-soft: #D9D6E3;
	--text-dim: #B3AFC2;
	--text-muted: #A9A4BA;
	--line: #2A2638;
	--line-strong: #3A3550;
	--accent: #A78BFA;
	--ink: #07060B;

	--font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-display: "Barlow Condensed", "Arial Narrow", sans-serif;

	--ease: cubic-bezier(0.16, 1, 0.3, 1);

	--gutter: 48px;
	--max: 1320px;
	/* Left/right padding for full-bleed sections, so their text lines up with .wrap content */
	--edge: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
}

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

html {
	background: var(--bg);
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

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

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

a {
	color: inherit;
}

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

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

.wrap {
	width: 100%;
	max-width: var(--max);
	margin: 0 auto;
	padding-left: var(--gutter);
	padding-right: var(--gutter);
}

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

.skip-link {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 10;
	padding: 10px 16px;
	background: var(--accent);
	color: var(--ink);
	font-weight: 600;
	text-decoration: none;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

/* Shared pieces */

.cover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.scrim {
	position: absolute;
	inset: 0;
}

.scrim--hero {
	background: linear-gradient(180deg, rgba(7, 6, 11, 0.6) 0%, rgba(7, 6, 11, 0.15) 35%, rgba(7, 6, 11, 0.94) 100%);
}

.scrim--game {
	background: linear-gradient(180deg, rgba(7, 6, 11, 0.65) 0%, rgba(7, 6, 11, 0) 30%, rgba(7, 6, 11, 0.95) 100%);
}

.label {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-family: var(--font-body);
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.label__bar {
	width: 32px;
	height: 3px;
	background: var(--accent);
}

.label--muted { color: var(--text-muted); }
.label--muted .label__bar { background: var(--line-strong); }
.label--ink .label__bar { background: var(--ink); }

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 52px;
	padding: 0 26px;
	border: 2px solid #FFFFFF;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.2s, color 0.2s;
}

.button:hover {
	background: #FFFFFF;
	color: var(--ink);
}

.arrow {
	display: inline-block;
	transition: transform 0.3s var(--ease);
}

a:hover .arrow,
a:focus-visible .arrow {
	transform: translate(3px, -3px);
}

/* Hero */

.hero {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: max(640px, 100vh);
	min-height: max(640px, 100svh);
	overflow: hidden;
}

.nav {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px 28px;
	padding: 28px var(--edge);
	font-weight: 500;
	font-size: 15px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.nav a {
	position: relative;
	padding: 6px 0;
	text-decoration: none;
}

/* Underline that slides in from the left */
.nav a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.35s var(--ease);
}

.nav a:hover::after,
.nav a:focus-visible::after {
	transform: scaleX(1);
}

.hero__content {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin-top: auto;
	padding: 0 var(--edge) 88px;
}

.hero__content > * {
	max-width: 1180px;
}

.hero__name {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: clamp(64px, 11vw, 168px);
	line-height: 0.84;
	text-transform: uppercase;
}

.hero__role {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: clamp(36px, 4.6vw, 66px);
	line-height: 1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--accent);
}

.hero__intro {
	max-width: 64ch;
	font-size: 20px;
	color: var(--text-soft);
}

/* What I do */

.what {
	display: flex;
	flex-direction: column;
	gap: 40px;
	padding-top: 96px;
	padding-bottom: 96px;
}

.what__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 40px 32px;
}

.what__item {
	flex: 1 1 260px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding-top: 20px;
	border-top: 3px solid var(--accent);
}

.what__num {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 18px;
	color: var(--accent);
}

.what__title {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 40px;
	line-height: 0.95;
	text-transform: uppercase;
}

.what__desc {
	color: var(--text-dim);
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	border: 1px solid var(--line-strong);
	font-size: 15px;
	font-weight: 500;
}

.ue {
	padding: 1px 5px;
	background: var(--accent);
	color: var(--ink);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-decoration: none;
}

.ue-note {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--text-muted);
}

/* Games */

.game {
	position: relative;
	display: flex;
	flex-direction: column;
	/* The image's own 16:9 shape where it fits, never taller than the window */
	min-height: clamp(720px, 56.25vw, 100vh);
	min-height: clamp(720px, 56.25vw, 100svh);
	overflow: hidden;
}

.game__top {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 32px var(--edge);
}

.game__count {
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--accent);
	text-shadow: 0 1px 10px rgba(7, 6, 11, 0.9), 0 0 2px rgba(7, 6, 11, 0.8);
}

.game__status {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 8px 14px;
	background: rgba(7, 6, 11, 0.85);
	border: 1px solid var(--accent);
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.dot {
	position: relative;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent);
}

/* Soft "live" pulse */
.dot::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--accent);
	animation: ping 2.2s var(--ease) infinite;
}

.game__body {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin-top: auto;
	padding: 0 var(--edge) 56px;
}

.game__title {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: clamp(72px, 13vw, 196px);
	line-height: 0.82;
	text-transform: uppercase;
}

.game__title--long {
	font-size: clamp(56px, 10vw, 152px);
	line-height: 0.84;
}

.game__row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px 40px;
}

.game__desc {
	flex: 1 1 420px;
	max-width: 54ch;
	font-size: 19px;
	color: #E6E3EE;
}

.game__meta {
	flex: 0 1 auto;
	display: flex;
	flex-wrap: wrap;
	gap: 12px 40px;
}

.game__meta dt {
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--accent);
}

.game__meta dd {
	margin-top: 2px;
	font-weight: 600;
}

/* Career, education, skills */

.panels {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	padding-top: 104px;
	padding-bottom: 104px;
}

.panel {
	flex: 1 1 280px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 28px;
	background: var(--surface);
}

.panel--wide {
	flex: 2 1 400px;
	gap: 4px;
}

.panel__title {
	margin-bottom: 8px;
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 36px;
	line-height: 1.1;
	text-transform: uppercase;
}

.panel__big {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: 60px;
	line-height: 0.9;
	text-transform: uppercase;
	color: var(--accent);
}

.panel__strong { font-weight: 600; }
.panel__muted { color: var(--text-muted); }

.career li {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 2px 16px;
	padding: 12px 0;
	border-top: 1px solid var(--line);
}

.career li span:first-child { font-weight: 600; }
.career li span:last-child { color: var(--text-muted); }

.skills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 6px;
}

.skills li {
	padding: 6px 14px;
	border: 1px solid var(--line-strong);
}

.skills .skills__main {
	border-color: var(--accent);
	color: var(--accent);
	font-weight: 600;
}

/* Contact */

.contact {
	background: var(--accent);
	color: var(--ink);
}

.contact__inner {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding-top: 48px;
	padding-bottom: 32px;
}

.contact__links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 32px;
	font-size: 20px;
	font-weight: 600;
}

.contact__links a {
	padding-bottom: 3px;
	text-decoration: none;
	background: linear-gradient(currentColor, currentColor) left bottom / 100% 2px no-repeat;
	transition: background-size 0.35s var(--ease);
}

.contact__links a:hover {
	background-size: 35% 2px;
}

.contact__links a:focus-visible {
	outline-color: var(--ink);
}

.contact__copy {
	margin-top: 8px;
	padding-top: 20px;
	border-top: 2px solid var(--ink);
	font-size: 14px;
	font-weight: 500;
}

/* Small screens */

@media (max-width: 720px) {
	:root { --gutter: 24px; }

	/* Narrow screens crop the sides of each image, so keep its subject in view */
	.cover { object-position: var(--focus-x, 50%) 50%; }

	.nav {
		justify-content: flex-start;
		gap: 4px 20px;
		padding-top: 20px;
		font-size: 14px;
	}

	.hero__content { padding-bottom: 56px; }
	.hero__intro { font-size: 18px; }

	.what { padding-top: 72px; padding-bottom: 72px; }
	.what__title { font-size: 36px; }

	.game { min-height: max(600px, 85vh); min-height: max(600px, 85svh); }
	.scrim--game {
		background: linear-gradient(180deg, rgba(7, 6, 11, 0.65) 0%, rgba(7, 6, 11, 0.1) 22%, rgba(7, 6, 11, 0.9) 55%, rgba(7, 6, 11, 0.97) 100%);
	}
	.game__top { padding-top: 24px; padding-bottom: 24px; }
	.game__body { padding-bottom: 40px; }
	.game__desc { font-size: 17px; }

	.panels { padding-top: 72px; padding-bottom: 72px; }
}

/* Motion
   Only applies when JavaScript is running (html.js), so the page is fully
   visible without it. Turned off entirely for reduced-motion users below. */

@keyframes fade-up {
	from { opacity: 0; transform: translateY(32px); }
	to { opacity: 1; transform: none; }
}

@keyframes fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes settle {
	from { transform: scale(1.08); }
	to { transform: none; }
}

@keyframes ping {
	0% { transform: scale(1); opacity: 0.7; }
	80%, 100% { transform: scale(3); opacity: 0; }
}

/* Opening section plays on load */
.js .hero > .cover {
	animation: settle 2.8s var(--ease) both;
}

.js .nav {
	animation: fade-in 1.2s 0.8s both;
}

.js .hero__content > * {
	animation: fade-up 1.1s var(--ease) both;
}

.js .hero__content > :nth-child(1) { animation-delay: 0.2s; }
.js .hero__content > :nth-child(2) { animation-delay: 0.32s; }
.js .hero__content > :nth-child(3) { animation-delay: 0.46s; }
.js .hero__content > :nth-child(4) { animation-delay: 0.6s; }

/* Everything else reveals as it scrolls into view */
.js [data-reveal] {
	opacity: 0;
	transform: translateY(32px);
	transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
	transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-visible {
	opacity: 1;
	transform: none;
}

/* Game sections: the image eases back while the text rises in */
.js .game[data-reveal] {
	opacity: 1;
	transform: none;
}

.js .game .cover {
	transform: scale(1.1);
	transition: transform 1.8s var(--ease);
}

.js .game .game__top,
.js .game .game__title,
.js .game .game__row {
	opacity: 0;
	transform: translateY(36px);
	transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.js .game.is-visible .cover { transform: none; }
.js .game.is-visible .game__top { opacity: 1; transform: none; transition-delay: 0.1s; }
.js .game.is-visible .game__title { opacity: 1; transform: none; transition-delay: 0.2s; }
.js .game.is-visible .game__row { opacity: 1; transform: none; transition-delay: 0.35s; }

@media (prefers-reduced-motion: reduce) {
	.js .hero > .cover,
	.js .nav,
	.js .hero__content > *,
	.js [data-reveal],
	.js .game .cover,
	.js .game .game__top,
	.js .game .game__title,
	.js .game .game__row {
		opacity: 1 !important;
		transform: none !important;
		animation: none !important;
		transition: none !important;
	}

	.dot::after,
	.nav a::after,
	.arrow,
	.contact__links a,
	.button {
		animation: none;
		transition: none;
	}
}
