/* Ema's portfolio. Slate from our roof renders, steel text. Wood is kept for the few things you act on:
   the slider line, the buttons and the focus ring. */
:root {
	--night: #1b2027; /* page */
	--deck: #262d36;
	--steel: #c3cad2;
	--steel-dim: #a0a9b3; /* 7:1 on the page colour */
	--chalk: #eef1f4;
	--wood: #bf8b47;
	--wood-hi: #d6a35e;
	--display: "Big Shoulders Display", "Arial Narrow", sans-serif;
	--text: "Archivo", system-ui, sans-serif;
}

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: 24px;
}

body {
	margin: 0;
	background: var(--night);
	color: var(--steel);
	font: 400 1.125rem/1.56 var(--text); /* 18px on 28px */
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: var(--chalk);
	text-decoration-color: var(--steel-dim);
	text-underline-offset: 0.2em;
}

:focus-visible {
	outline: 3px solid var(--wood-hi);
	outline-offset: 3px;
}

.wrap {
	width: min(1440px, 100% - 48px);
	margin-inline: auto;
}

.skip {
	position: absolute;
	left: 12px;
	top: -60px;
	padding: 8px 14px;
	background: var(--chalk);
	color: var(--night);
	z-index: 10;
}
.skip:focus {
	top: 12px;
}

/* header */
.bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 0;
}
.brand {
	font: 800 1.6rem/1 var(--display);
	color: var(--chalk);
	text-decoration: none;
	letter-spacing: 0.01em;
}
.bar nav {
	display: flex;
	gap: 26px;
	font-weight: 500;
}
.bar nav a {
	text-decoration: none;
	color: var(--steel);
	padding: 10px 0; /* 44 px tall tap target */
}
.bar nav a:hover,
.bar .nav-contact {
	color: var(--chalk);
}

/* type */
h1,
h2,
h3 {
	font-family: var(--display);
	color: var(--chalk);
	margin: 0;
	text-wrap: balance;
}
h1 {
	font-weight: 800;
	font-size: clamp(3rem, 4.6vw, 4.6rem); /* capped so the headline keeps to three lines in the hero column */
	line-height: 1;
	max-width: 12ch; /* room for the looser tracking */
	letter-spacing: 0.012em;
}
h2 {
	font-weight: 700;
	font-size: clamp(2rem, 3.4vw, 2.8rem);
	line-height: 1.1;
	letter-spacing: 0.012em;
	margin-bottom: 22px;
	max-width: 24ch;
}
h3 {
	font-weight: 700;
	font-size: 1.6rem;
	line-height: 1.1;
}
p {
	margin: 0 0 1em;
	max-width: 62ch;
}

/* hero: text left, the slider right, both inside the first screen of a 1366x768 laptop */
.hero {
	display: grid;
	grid-template-columns: minmax(300px, 1fr) 2.6fr;
	gap: 48px;
	align-items: center;
	padding: 10px 0 40px;
}
.lede {
	font-size: 1.2rem;
	max-width: 34ch;
	margin: 22px 0 26px;
}
.cta {
	display: inline-flex;
	align-items: center;
	min-height: 50px;
	padding: 0 24px;
	border-radius: 4px;
	background: var(--wood);
	color: var(--night);
	font: 600 1.05rem/1 var(--text);
	text-decoration: none;
}
.cta:hover {
	background: var(--wood-hi);
}
.act {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 18px;
}
.act-handle {
	color: var(--steel-dim);
}
.act-handle b {
	color: var(--chalk);
	font-weight: 600;
}
.act .copied {
	flex-basis: 100%;
}
.act .copied:empty {
	display: none;
}
.terms {
	font-size: 0.92rem;
	color: var(--steel-dim);
	max-width: 36ch;
	margin: 16px 0 0;
}
.ba-hero {
	/* width follows the free height, so the picture, its labels and the caption stay above the fold */
	width: min(100%, calc((100svh - 220px) * 1.55));
	justify-self: end;
}

/* before/after */
figure {
	margin: 0;
	min-width: 0;
}
figcaption {
	font-size: 0.95rem;
	padding-top: 6px;
	max-width: 64ch;
}
.ba-frame {
	position: relative;
	aspect-ratio: var(--ar);
	overflow: hidden;
	background: var(--deck);
	touch-action: pan-y; /* vertical swipes still scroll the page on phones */
	cursor: ew-resize;
	user-select: none;
	--pos: 50%;
}
.ba-frame img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}
.ba-after {
	clip-path: inset(0 0 0 var(--pos));
}
.ba-frame::after {
	/* the dividing line */
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--pos);
	width: 2px;
	margin-left: -1px;
	background: var(--wood);
	pointer-events: none;
}
.ba-handle {
	/* a 44 px box on the line holds the keyboard focus ring; inside it, a slim grip */
	position: absolute;
	top: 50%;
	left: var(--pos);
	width: 44px;
	height: 64px;
	margin: -32px 0 0 -22px;
	border-radius: 6px;
	pointer-events: none;
}
.ba-handle::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 12px;
	height: 54px;
	margin: -27px 0 0 -6px;
	border-radius: 4px;
	background: linear-gradient(90deg, transparent 3px, rgb(27 32 39 / 0.45) 3px 4px, transparent 4px 8px, rgb(27 32 39 / 0.45) 8px 9px, transparent 9px), var(--wood);
	box-shadow: 0 0 0 2px rgb(27 32 39 / 0.5);
}
.ba-range {
	/* keyboard and screen-reader control; the pointer drag is handled in main.js */
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}
.ba-frame:has(.ba-range:focus-visible) .ba-handle {
	outline: 3px solid var(--wood-hi);
	outline-offset: 0;
}
.ba-legend {
	display: flex;
	justify-content: space-between;
	padding-top: 7px;
	font-size: 0.9rem;
	line-height: 1.2;
	color: var(--steel);
}
.ba-legend .drag {
	color: var(--chalk);
}

/* sections: space alone separates them */
.block {
	padding: 56px 0;
}

/* projects: picture on one side, the brief and what I did on the other */
.feature {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	gap: 48px;
	align-items: center;
}
.feature + .feature {
	margin-top: 64px;
}
.flip {
	grid-template-columns: 1fr 1.6fr;
}
.flip figure {
	order: 2;
}
.feature-text h3 {
	font-size: 1.5rem;
	margin-bottom: 12px;
}
.feature-text p {
	max-width: 46ch;
}

/* what you can hold me to + scope and paying */
.cols {
	display: grid;
	grid-template-columns: 1.3fr 1fr;
	gap: 72px;
	align-items: start;
}
.hold {
	list-style: none;
	margin: 0;
	padding: 0;
	max-width: 56ch;
}
.hold li {
	padding: 16px 0;
	border-top: 1px solid rgba(195, 202, 210, 0.16);
}
.hold li:last-child {
	border-bottom: 1px solid rgba(195, 202, 210, 0.16);
}
.hold strong {
	display: block;
	margin-bottom: 2px;
}
.hold strong,
.side strong {
	color: var(--chalk);
	font-weight: 600;
}
.side {
	padding-top: 10px;
}
.side h3 {
	font-size: 1.35rem;
	margin: 0 0 6px;
}
.side p {
	max-width: 48ch;
	margin-bottom: 26px;
}
.about {
	font-size: 0.95rem;
	color: var(--steel-dim);
}

/* stills: grouped by the kind of work; each row keeps every picture at its own shape */
.gallery-hint {
	color: var(--steel-dim);
	margin-top: -10px;
}
.group {
	margin-top: 44px;
}

.group-note {
	color: var(--steel-dim);
	margin: 6px 0 14px;
}
.row {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}
.row + .row {
	margin-top: 18px;
}
.row figure {
	flex: 2 1 0; /* grow in proportion to width / height: 2.0 here, so the pictures in a row line up */
}
.row .w23 {
	flex-grow: 2.33;
}
.row .w27 {
	flex-grow: 2.66;
}
.row figcaption {
	font-size: 0.95rem;
}
.more {
	display: none; /* phones only: the rest of a group opens on request, so the page stays short */
}
.zoom {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: var(--deck);
	cursor: zoom-in;
}
.zoom img {
	width: 100%;
	transition: filter 0.2s ease;
}
.zoom:hover img {
	filter: brightness(1.08);
}

/* contact */
.contact {
	padding: 64px 0 72px;
}
.contact .cta {
	margin-top: 8px;
}
.contact h2 {
	font-size: clamp(2.6rem, 6vw, 4.6rem);
	font-weight: 800;
	max-width: none;
}
.handle {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin-top: 22px;
}
.handle-label {
	font-size: 0.95rem;
}
.handle-name {
	font: 600 1.5rem/1 var(--text);
	color: var(--chalk);
}
.copy {
	/* second choice next to the Discord button: outlined, not filled */
	font: 600 1rem/1 var(--text);
	color: var(--chalk);
	background: transparent;
	border: 2px solid var(--wood);
	border-radius: 4px;
	padding: 11px 18px;
	min-height: 44px;
	cursor: pointer;
}
.copy:hover {
	border-color: var(--wood-hi);
}
.copied {
	font-size: 0.95rem;
}

.foot {
	padding: 8px 0 40px;
	font: 700 1.1rem/1 var(--display);
	color: var(--steel-dim);
}

/* lightbox */
.lightbox {
	border: 0;
	padding: 0;
	background: transparent;
	max-width: min(1600px, 94vw);
	max-height: 94vh;
	color: var(--steel);
}
.lightbox::backdrop {
	background: rgb(15 18 22 / 0.92);
}
.lightbox img {
	max-height: 84vh;
	width: auto;
	margin-inline: auto;
}
.lb-caption {
	margin: 10px auto 0;
	text-align: center;
}
.lightbox form {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 8px;
}
.lb-close {
	font: 600 0.95rem/1 var(--text);
	color: var(--chalk);
	background: var(--deck);
	border: 0;
	border-radius: 4px;
	padding: 12px 16px;
	min-height: 44px;
	cursor: pointer;
}

/* tablets: the hero and the avenue stack */
@media (max-width: 1000px) {
	.hero,
	.feature {
		grid-template-columns: 1fr;
		gap: 0;
	}
	.hero-text {
		display: contents; /* its children join the hero grid, so the picture can sit between the pitch and the button */
	}
	.hero h1 { order: 1; }
	.lede { order: 2; }
	.act { order: 3; }
	.terms { order: 4; }
	.ba-hero { order: 5; }
	h1 {
		font-size: clamp(3rem, 9vw, 5.4rem);
	}
	.lede {
		max-width: 46ch;
		margin: 20px 0 24px;
	}
	.terms {
		max-width: 46ch;
		margin-bottom: 32px;
	}
	.ba-hero {
		justify-self: start;
		width: 100%;
	}
	.cols {
		grid-template-columns: 1fr;
		gap: 24px;
	}
	.flip {
		grid-template-columns: 1fr;
	}
	.flip figure {
		order: 0;
	}
	.feature + .feature {
		margin-top: 48px;
	}
	.feature-text {
		padding-top: 30px;
	}
}

/* phones */
@media (max-width: 760px) {
	.wrap {
		width: calc(100% - 32px);
	}
	.bar nav a:not(.nav-contact) {
		display: none;
	}
	.hero {
		padding-bottom: 24px;
	}
	.cta {
		width: 100%;
		justify-content: center;
	}
	.act {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}
	.block {
		padding: 48px 0;
	}
	.row {
		flex-direction: column;
		gap: 22px;
	}
	.row + .row {
		margin-top: 22px;
	}
	.row figure {
		flex: none;
		width: 100%;
	}
	.group:not(.open) .extra {
		display: none;
	}
	.more {
		display: block;
		width: 100%;
		min-height: 48px;
		margin-top: 18px;
		font: 600 1rem/1 var(--text);
		color: var(--chalk);
		background: var(--deck);
		border: 0;
		border-radius: 4px;
		cursor: pointer;
	}
	.contact {
		padding: 48px 0 56px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	.zoom img {
		transition: none;
	}
}
