:root {
	--grid-gap: 28px;
}

/* responsive layout */
@media screen and (max-width: 600px) {
	#quick-links, #showcase-nav {
		display: none !important;
	}
}

/* top navbar */
#quick-links ul {
	display: flex;
	flex-flow: row nowrap;
	justify-content: center;
}

#quick-links li {
	font-size: 1.5rem;
	padding: 1rem 2rem;
}

#quick-links li a:hover,  #showcase-nav li a:focus {
	text-decoration: underline;
}

/* parallax */
.parallax-wrapper {
	contain: paint;
	display: grid;
	grid-template-areas: "stack";
}

.parallax-wrapper > * {
	grid-area: stack;
}

#parallax-background {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--colour-bg);
}

#parallax-img {
	mix-blend-mode: screen;
}

main {
	display: flex;
	flex-flow: row nowrap;
}

/* main page content */
#content {
	flex-grow: 1; /* horizontal growth */ 
}

header {
	margin-left: var(--grid-gap);
	min-height: 80vh;
	padding: var(--grid-gap) 0;
	font-size: 24px;
	display: flex;
	flex-flow: column nowrap;
	justify-content: flex-end;
}

header img {
	border-radius: 50%;
	max-width: 20rem;
}

header p {
	margin: 0.5em 0;
}

@media screen and (max-width: 600px) {
	header {
		font-size: 20px;
	}
}

/* side navbar to go between card sections */
#showcase-nav {
	margin: 80vh 2rem 0 2rem;
	font-size: 2rem;
	align-self: flex-start;
	position: sticky;
	top: 0;
	display: flex;
	flex-flow: column nowrap;
}

#showcase-nav li {
	margin-bottom: 1rem;
}

#showcase-nav li a:hover,  #showcase-nav li a:focus {
	text-decoration: underline;
	transform: translateX(0.5rem);
}

@media screen and (prefers-reduced-motion: no-preference) {
	#showcase-nav li a {
		transition: transform 500ms var(--transition-exp);
	}
}

/* scroll animations (elements transition into view when they enter the viewport for the first time) */
@media screen and (prefers-reduced-motion: no-preference) and (scripting: enabled) {
	.scroll-hidden {
		opacity: 0;
		transform: translateY(20px);
	}

	.scroll-show {
		opacity: 1;
	}

	.scroll-animate {
		transition: opacity 1s, transform 1s;
	}

	.text-card.scroll-animate {
		transition-delay: 0.5s;
	}

	.text-card.scroll-animate:nth-child(2) {
		transition-delay: 1s;
	}

	.text-card.scroll-animate:nth-child(3) {
		transition-delay: 1.5s;
	}
}

/* ------------------- */
/* card section styles */
/* ------------------- */

/* wrapper for card sections */
.section-wrapper {
	container: card-section / inline-size;  /* container queries implemented with JavaScript */
}

/* card section */
section {
	outline: rgba(255, 255, 255, 0.3) solid 1px;
	padding: 0 var(--grid-gap);
	margin-bottom: var(--grid-gap);
	font-size: 1.5rem;
	overflow: hidden;
	border-radius: 0 0.3em 0.3em 0;
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(5px) saturate(200%);
}

/* section title and description */
.section-header {
	padding: 1rem 0;
}

/* ----------- */
/* card styles */
/* ----------- */

/* grid display that contains all the card elements */
.card-container {
	display: flex;
	flex-flow: row wrap;
}

.text-card-container {
	display: flex;
	flex-flow: column nowrap;
	margin-bottom: var(--grid-gap);
}

/* block element representing an individual card */
.card {
	--perspective: 500px;
	--rotateX: 0;
	--rotateY: 0;
	--scale: 1;

	outline: white solid 1px;
	aspect-ratio: 3/2;
	position: relative;
	border-radius: 0.3em;
	overflow: hidden;
	background-size: cover;
	flex: 1 0 300px;
	max-width: 400px;
	margin: 0 var(--grid-gap) var(--grid-gap) 0;
}

.text-card {
	position: relative;
	margin: 0.5em 0;
}

/* the title, description, and link for the card */
.card-content {
	--card-title-height: 0rem;
	--card-title-padding: 1rem;

	position: absolute;
	bottom: 0;
	padding: var(--card-title-padding);
	background: linear-gradient(
			rgba(0, 0, 0, 0),
			rgba(0, 0, 0, 0.4) 10%,
			rgba(0, 0, 0, 1)
	);
	color: white;
}

/* card title */
.card-title {
	position: relative;
	padding-bottom: 1rem;
}

/* card title underline */
.card-title::after {
	content: "";
	position: absolute;
	left: calc(var(--card-title-padding) * -1);
	bottom: 0.7rem;
	height: 2px;
	width: calc(100% + var(--card-title-padding));
	background: var(--colour-fg);
}

/* card button */
.card-link {
	display: inline-block;
	background: var(--colour-accent);
	padding: 0.3em 0.8em;
	border-radius: 0.25em;
	color: white;
}

/* only do these animations if the primary pointing device can hover and animations are enabled */
@media screen and (hover) and (prefers-reduced-motion: no-preference) {
	/* scale and rotate when hover (rotations controlled by JavaScript */
	.card {
		transition: transform 300ms ease-out;
		transform: perspective(var(--perspective)) rotateX(var(--rotateX)) rotateY(var(--rotateY)) scale(var(--scale));
	}

	.card:hover, .card:focus-within {
		--scale: 1.03;
	}

	/* animate underline for title */
	.card-title::after {
		transform: scaleX(0);
		transform-origin: left;
		transition: transform 500ms ease;
	}

	.card:hover .card-title::after, .card:focus-within .card-title::after {
		transform: scaleX(1);
	}

	/* content moves up on hover */
	.card-content {
		transform: translateY(calc(100% - var(--card-title-height) - var(--card-title-padding)));
		transition: transform 500ms ease;
	}

	.card:hover .card-content, .card:focus-within .card-content {
		transform: translateY(0);
	}

	/* remove jitter when the card comes into focus via keyboard navigation */
	.card:focus-within .card-content {
		transition-duration: 0ms;
	}
}

footer {
	padding: 1rem;
	font-size: 1.2rem;
	color: var(--colour-accent);
}
