/**
 * Readability, accessibility and spacing overrides, loaded after main.min.css.
 * main.min.css has no source in this repo, so tweaks live here instead.
 */

:root {
	/* #039be5 is the original brand blue: 3.1:1 on white, so it is kept for
	   large shapes only. #0277bd (4.8:1) carries text and white-on-blue. */
	--jbejam-blue: #039be5;
	--jbejam-blue-deep: #0277bd;
	--jbejam-blue-darker: #01579b;
	--jbejam-ink: #263238;
	--jbejam-text: #37474f;
	--jbejam-muted: #455a64;
}

/* Typeface: Inter (see fonts.css) in place of main.min.css's Roboto. */
html,
body {
	font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

button,
input,
select,
textarea {
	font-family: inherit;
}

/* main.min.css sets every paragraph to weight 300, which is too thin in Inter. */
body p {
	font-weight: 400;
}

/* Text links: the brand blue fails WCAG AA for small text on white. */
a {
	color: var(--jbejam-blue-deep);
}

a:focus,
a:hover {
	color: var(--jbejam-blue-darker);
}

/* Header band and nav: white text on the deeper blue passes AA. */
html,
body {
	background-image: linear-gradient(to bottom, var(--jbejam-blue-deep) 400px, white 400px);
}

.navigation,
#mobileNavigation {
	background-color: var(--jbejam-blue-deep);
}

/* Nav labels: Inter's black weight is heavy at this size. */
.navigation .top-bar-right ul:first-of-type > li > a {
	font-weight: 700;
	letter-spacing: .06em;
}

/* Show titles exactly as typed (main.min.css capitalizes every word). */
.intro h1 {
	text-transform: none;
	font-weight: 500;
	letter-spacing: -.02em;
}

/* Front page intro: name, greeting and a solid call to action. */
.intro .intro-name {
	font-size: 2.75rem;
	font-weight: 600;
	color: var(--jbejam-ink);
}

.intro .lead {
	max-width: 36rem;
	margin: 1.25rem auto 0;
	color: var(--jbejam-muted);
}

.intro .button.cta {
	margin-top: 1.75rem;
	border: 0;
	background-color: var(--jbejam-blue-deep);
	color: white;
}

.intro .button.cta:focus,
.intro .button.cta:hover {
	background-color: var(--jbejam-blue-darker);
	color: white;
}

/* Body copy: darker and regular weight instead of light grey-blue. */
.entry-content p,
.entry-content li {
	color: var(--jbejam-text);
	font-weight: 400;
	font-size: 1.0625rem;
	line-height: 1.7;
}

/* Links in running text need more than color to stand out (WCAG 1.4.1). */
.entry-content p a,
.entry-content li a {
	text-decoration: underline;
	text-underline-offset: .15em;
}

.entry-content ul,
.entry-content ol {
	margin-left: 1.25rem;
}

.entry-content li + li {
	margin-top: .375rem;
}

/* Section headings: heavier, keeping main.min.css's desktop size. */
.entry-content h2,
.entry-content h3 {
	font-size: 1.625rem;
	font-weight: 600;
	letter-spacing: -.015em;
	color: var(--jbejam-ink);
	text-transform: capitalize;
}

/* Thin accent bar in the site blue to the left of each heading. */
.entry-content h2,
.entry-content h3 {
	padding-left: .75rem;
	border-left: 3px solid var(--jbejam-blue);
	line-height: 1.2;
}

/*
 * Vertical rhythm. main.min.css spaces every block 24px apart via
 * `body:not(.home) .main>article>*+*`, and paragraphs are inline-block so
 * margins never collapse; these selectors outrank it. Spacing is top-only:
 * headings sit far from the previous section and close to their own text.
 */
.main > .entry-content.column > * {
	margin-top: 0;
	margin-bottom: 0;
}

.main > .entry-content.column > * + * {
	margin-top: 1rem;
}

.main > .entry-content.column > * + h2,
.main > .entry-content.column > * + h3 {
	margin-top: 2.5rem;
}

.main > .entry-content.column > h2 + *,
.main > .entry-content.column > h3 + * {
	margin-top: .75rem;
}

/* Sample summary: excerpt as lead, role as a small label. */
.sample-summary {
	margin-bottom: 2rem;
}

.sample-summary .lead {
	color: var(--jbejam-muted);
	margin-bottom: .75rem;
}

.sample-role {
	margin: 0;
	color: var(--jbejam-blue-deep);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

/* Project screenshot, shown right after the summary. */
.sample-shot {
	margin: 0 0 2.5rem;
}

.sample-shot img {
	display: block;
	width: 100%;
	height: auto;
}

/* When the screenshot links to the live site: a blue frame and a slight lift on hover/focus. */
.sample-shot a {
	display: block;
}

.sample-shot a img {
	outline: 1px solid #eceff1;
	transition: outline-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.sample-shot a:focus img,
.sample-shot a:hover img {
	outline-color: var(--jbejam-blue);
	transform: translate(-2px, -2px);
	box-shadow: 7px 7px rgba(84, 110, 122, .12);
}

/* "Next project" link at the end of a sample. */
.sample-next {
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid #eceff1;
	text-align: right;
}

.sample-next a {
	display: inline-block;
}

.sample-next-label {
	display: block;
	color: var(--jbejam-muted);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.sample-next-title {
	display: block;
	margin-top: .25rem;
	font-size: 1.375rem;
}

/*
 * Portfolio cards: equal heights, one brand tint instead of four rotating
 * colors, and a visible title and role under each screenshot.
 */
.sample > a {
	display: block;
}

/* Same 16:10 frame for every screenshot, bleeding off the card's bottom. */
.sample figure {
	max-height: none;
	padding-bottom: 0;
}

.sample .thumbnail {
	display: block;
	aspect-ratio: 16 / 10;
	height: auto;
	object-fit: cover;
	object-position: top;
}

.row .sample:nth-child(n) figure:before,
.row .sample:nth-child(n) .thumbnail-background:before {
	color: rgba(2, 119, 189, .8);
}

.row .sample:nth-child(n) .details {
	color: var(--jbejam-blue-darker);
}

/* The overlay now holds only the summary, so drop its title divider. */
.sample .details:after {
	display: none;
}

/* Keyboard users get the same hover reveal. */
.sample:focus-within .details {
	transform: translateY(0);
}

.sample:focus-within .details .body {
	opacity: 1;
	transform: translateX(0);
}

.sample-meta {
	padding: .875rem .25rem 0;
}

.sample-meta .sample-title {
	margin: 0 0 .25rem;
	color: var(--jbejam-ink);
	font-size: 1.125rem;
	font-weight: 600;
	letter-spacing: -.01em;
	transition: color 300ms ease-in-out;
}

.sample > a:focus .sample-title,
.sample > a:hover .sample-title {
	color: var(--jbejam-blue-deep);
}

@media (max-width: 61.9em) {
	/* main.min.css pins the overlay open here; the caption covers it now. */
	.sample .details {
		display: none;
	}
}

/* Mobile menu trigger is a real <button> now; strip default button styles. */
button.hamburger {
	padding: 0;
	border: 0;
	background: none;
}

#mobileNavigation > .hamburger {
	width: 1.5rem;
	height: 1.5rem;
}

/* Skip link: hidden until focused. */
.skip-link {
	position: absolute;
	top: .5rem;
	left: .5rem;
	z-index: 100;
	padding: .75rem 1rem;
	background: white;
	color: var(--jbejam-blue-darker);
	font-weight: 700;
	transform: translateY(-200%);
}

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

/* Visible keyboard focus everywhere (white on the blue nav band). */
a:focus-visible,
button:focus-visible {
	outline: 3px solid var(--jbejam-blue-deep);
	outline-offset: 2px;
}

.navigation:not(.inverse) a:focus-visible,
.navigation:not(.inverse) button:focus-visible {
	outline-color: white;
}

@media screen and (max-width: 39.9375em) {
	.main {
		padding: 1.25rem;
	}
}

@media (max-width: 47.9em) {
	.intro .intro-name {
		font-size: 2.25rem;
	}

	/* Full-screen mobile menu links: 300 is too thin in Inter. */
	#navigation a {
		font-weight: 500;
	}

	/* The open mobile menu is white, so focus rings go back to blue. */
	#navigation a:focus-visible {
		outline-color: var(--jbejam-blue-deep);
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*:before,
	*:after {
		transition: none !important;
		animation: none !important;
	}
}


/*
 * Screenshot gallery (used on the Phantasoft sample): three columns on
 * desktop, two on phones, a short last row centered, captions below.
 */
.gallery {
	--gallery-gap: .5em;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--gallery-gap);
}

.gallery figure {
	width: calc(50% - var(--gallery-gap) / 2);
	margin: 0;
}

@media (min-width: 600px) {
	.gallery figure {
		width: calc(33.333% - var(--gallery-gap) * 2 / 3);
	}
}

.gallery a {
	display: block;
}

/* Frame thumbnails like the main screenshot so light edges don't fade into the page. */
.gallery img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid #eceff1;
	box-shadow: 5px 5px rgba(84, 110, 122, .07);
	transition: border-color .2s ease;
}

.gallery a:focus img,
.gallery a:hover img {
	border-color: var(--jbejam-blue);
	cursor: zoom-in;
}

.gallery figcaption {
	padding: .5rem 0 0;
	color: var(--jbejam-text);
	font-size: .9375rem;
	line-height: 1.5;
	text-align: center;
}

/* Give the gallery the same breathing room as a section, not a list item. */
.main > .entry-content.column > * + .gallery {
	margin-top: 2rem;
}

/*
 * Lightbox: a <dialog> created by main.js that shows a gallery image at full
 * size. Without JavaScript, the thumbnail links simply open the image file.
 */
.lightbox {
	max-width: 95vw;
	max-height: 95vh;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.lightbox::backdrop {
	background: rgba(38, 50, 56, .85);
}

.lightbox img {
	display: block;
	max-width: 90vw;
	max-height: 80vh;
	width: auto;
	height: auto;
	margin: 0 auto;
	background: white;
}

.lightbox p {
	margin: .75rem 0 0;
	color: white;
	font-size: 1rem;
	text-align: center;
}

.lightbox-close {
	position: absolute;
	top: -2.75rem;
	right: 0;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	background: none;
	color: white;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}

.lightbox-close:focus-visible {
	outline-color: white;
}
