/* IMPORTS */

@import 'reset.css';
@import 'setup.css';
@import 'fonts.css';




/* PAGE TRANSITIONS */

/* Swap pages instantly: the browser keeps the old page on screen until the new one
   is ready, then switches with no fade and no blank flash. (Chrome, Edge, Safari;
   other browsers just navigate normally.) */
@view-transition {
	navigation: auto;
}

::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
	animation: none;
}




/* VARIABLES */

:root {
	--neutral-0: 		#FFFFFF;
	--neutral-20:		#FAFAFA;
	--neutral-30:		#F7F7F7;
	--neutral-50:		#F2F2F2;
	--neutral-100:		#E5E5E5;
	--neutral-200: 	#CCCCCC;
	--neutral-300: 	#B2B2B2;
	--neutral-400: 	#999999;
	--neutral-500:		#808080;
	--neutral-600:		#666666;
	--neutral-600:		#4D4D4D;
	--neutral-800:		#333333;
	--neutral-900:		#1A1A1A;
	--neutral-1000:	#000000;

	--pink:					#e31593;
	--muted:					#6b6b6b;
	--selected:				hsl(340, 65%, 93%);
	--hover:					hsl(340, 60%, 96.5%);
	--border: 				hsl(29, 12%, 70%);
	--padding-inline: 	1rem;

	--ink: 					var(--neutral-600);
	--shadow: 				var(--neutral-300);
	--max-width: 1200px;

	--bg: 					hsl(29, 80%, 97%);
	--bg-lighter: 			hsl(29, 70%, 99%);

	--gradient: linear-gradient(
		90deg,
		oklch(66% 0.21 25),  /* red */
		oklch(66% 0.21 60),  /* orange */
		oklch(66% 0.21 85),  /* yellow */
		oklch(66% 0.21 140), /* green */
		oklch(66% 0.21 250), /* blue */
		oklch(66% 0.21 280), /* indigo */
		oklch(66% 0.21 320), /* violet */
		oklch(66% 0.21 25)   /* red again */
	);

	--dark-gradient: linear-gradient(
		95deg,
		oklch(99% 0.03 25),  /* red */
		oklch(99% 0.03 60),  /* orange */
		oklch(99% 0.03 85),  /* yellow */
		oklch(99% 0.03 140), /* green */
		oklch(99% 0.03 250), /* blue */
		oklch(99% 0.03 280), /* indigo */
		oklch(99% 0.03 320), /* violet */
		oklch(99% 0.03 25)   /* red again */
	);
}

body {
	background-color: var(--bg);
	color: var(--ink);
	max-width: 100vw;
}

inner-column {
	max-width: var(--max-width);
	margin-inline: auto;
}



/* COMPONENTS */

/* Pill button — Work filters, "Show More" on About.
   The selected state comes from the markup's meaning rather than an extra class:
   aria-current="page" on links, and an open <details> for its <summary>. */
.pill {
	display: inline-block;
	padding: .5rem 1.2rem;
	border: 1px solid var(--border);
	border-radius: 1rem;
	background-color: var(--bg-lighter);
	color: var(--ink);
	font-family: "Red Hat", sans-serif;
	font-size: 1rem;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 150ms;

	&:hover {
		background-color: var(--hover);
	}

	/* selected (stays the same on hover) */
	&[aria-current="page"],
	details[open] > & {
		background-color: var(--selected);
	}
}

/* a <summary> pill drops the browser's disclosure triangle */
summary.pill {
	list-style: none;

	&::-webkit-details-marker {
		display: none;
	}
}



@keyframes rainbow-move-reverse {
	0% {
		background-position: 200% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}

rainbow-wrapper {
	background-image: var(--gradient);
	background-size: 200vw 100%;
	background-clip: text;
	-webkit-background-clip: text;
	animation: rainbow-move 10s linear infinite;
	/* set in base.njk so the rainbow carries on across pages instead of restarting */
	animation-delay: var(--rainbow-delay, 0s);
	position: relative;
}

/* decorative rainbow asterisk in the top-left corner of the header */
.corner-star {
	position: absolute;
	top: .25rem;
	left: .75rem;
	font-family: "Fraunces", serif;
	font-weight: 700;
	font-size: 2rem;
	line-height: 1;
	color: transparent; /* lets the rainbow show through, like the name */
	user-select: none;

	/* hidden on phones, where it crowds the one-line name */
	@media (max-width: 619px) {
		display: none;
	}
}

header{

	background-color: var(--bg-lighter);

	@media (min-width: 1006px) {
		inner-column {
			display: flex;
			gap: 3rem;
			align-items: baseline;
			justify-content: space-between;
			padding-bottom: 2rem;
		}
	}

	.title {
		padding-inline: var(--padding-inline);

		.name {
			/* TWO LINES */
			font-size: 6.25rem;
			/* ONE LINE */
			/* font-size: 3.25rem; */

			padding-top: 2rem;
			padding-bottom: .2rem;
			color: transparent;

		}

		.roles {

			padding-left: .3rem;
			font-size: 1rem;
			display: flex;

			p{
				position: relative;
				white-space: nowrap;
				flex-shrink: 0;

				&:not(:last-child)::after {
					display: inline-flex;
					width: 2rem;
					height: 1lh;
					align-items: center;
					justify-content: center;
					content: "*";
					position: relative;
					top: .2lh;
				}
			}
		}
	}
	.site-nav {
		padding-inline: var(--padding-inline);
		padding-block: 2rem;
		display: flex;
		gap: 95px;

		a.active {
			font-weight: 600;
			color: transparent;
		}
	}

	/* phones: name on one line, sized to fit; smaller nav */
	@media (max-width: 619px) {
		.title .name {
			font-size: 13.25vw;
			line-height: 1.1;
			white-space: nowrap;
			padding-top: 1.75rem;
		}

		.site-nav {
			padding-block: 1rem 1.25rem;
			gap: 1.75rem;

			a {
				font-size: 1.5rem;
			}
		}
	}

}

/* the wave is stretched past the window edges (scaleX below); clip it sideways so pages don't scroll horizontally */
.header-hr-wrap {
	overflow-x: clip;
}

.header-hr {
	min-height: 2rem;

	transform: scaleX(1.2) scaleY(2);

	path {
		stroke: var(--bg-lighter);
	}

	#rainbow-gradient {
		 animation: rainbow-move 10s linear infinite;
	}
}

main.work {
	padding-top: 3rem;

	section + section {
		padding-top: 3rem;
	}

	/* phones: no filters — the page goes straight to Featured / Other Projects */
	@media (max-width: 619px) {
		.filter {
			display: none;
		}

		.filter + section {
			padding-top: 0;
		}
	}

	.filter {

		inner-column {
			display: flex;
			flex-direction: column;
			gap: 1rem;
		}

		.filter-container {
			display: flex;
			flex-direction: column;
			padding-inline: var(--padding-inline);

			@media (min-width: 640px) {
				flex-direction: row;
				gap: 1rem;
			}
		}

		p {
			margin-top: calc(.5rem + 1px);
			margin-bottom: calc(.5rem + 1px);
		}

		.filter-buttons {
			display: flex;
			align-items: center;
			flex-wrap: wrap;
			gap: .5rem;

			.x-out a {
				font-size: 1.5rem;
				font-weight: 500;
				padding: .25rem;
				border-radius: 50%;
				transition: background-color 150ms;

				@media (min-width: 620px) {
					padding: .5rem .5rem;
				}

				/* same hover as the filter pills */
				&:hover {
					background-color: var(--hover);
				}
				
				svg {
					height: 1lh;
					width: 1lh;
					fill: none;  /* Remove the fill */
					stroke: #000000;  /* Add stroke color */
					stroke-width: 8;  /* Now this will work */
				}
			}

			.hide a {
				opacity: 0;
				border: initial;
			}
		}
	}

	.work-section{
		h1 {
			padding-inline: var(--padding-inline);
			padding-bottom: 2rem;
		}
	}

	.work-grid {
		display: grid;
		grid-template-columns: 1fr;
		gap: .75em; /* 12px */
		padding-inline: .75em; /* 12px */
		padding-bottom: 4rem;

		@media (min-width: 620px) {
			padding-inline: var(--padding-inline);
		}

		.project-card {

			background-color: var(--bg-lighter);
			padding: .75em; /* 12px, matches the grid margin on mobile */
			position: relative;

			@media (min-width: 620px) {
				padding-block: 3rem;
				padding-inline: var(--padding-inline);
			}

			border: 1px solid var(--border);
			border-radius: 4px;

			transition: box-shadow 300ms ease;

			&:hover {
				/* box-shadow: 8px 8px var(--shadow); */
				.card-title::after {
					transform: translate3d(0, 0, 0);
				}
			}

			picture {
				img {
					aspect-ratio: 8 / 5;
					object-fit: cover;
				}
			}
			text-content {
				display: flex;
				flex-direction: column;
				gap: 1rem;
				padding-top: 1.5rem;
				title-date {
					display: flex;
					justify-content: space-between;
					align-items: baseline;
					column-gap: 1rem;

					.card-link {
						&::after{
							content: '';
							position: absolute;
							top: 0;
							bottom: 0;
							left: 0;
							right: 0;
						}
					}

					.card-title {
						font-size: 1.5rem;
						font-family: "Spectral";
						line-height: 1.15;
						position: relative;
						overflow: hidden;

						&::after{
							content: '';
							position: absolute;
							bottom: 0;
							left: 0;
							width: 100%;
							height: 1px;
							background-color: black;
							opacity: 1;
							transform: translate3d(-100%, 0, 0);
							transition: opacity 300ms, transform 300ms;
						}
					}

					.date {
						min-width: fit-content;
					}
				}

			}

		}
	}


}

main.about {
	padding-block: 3rem 4rem;

	inner-column {
		padding-inline: var(--padding-inline);
	}

	section + section {
		padding-top: 4rem;
	}

	/* social links sit directly under contact */
	section.contact + section.social {
		padding-top: 1.5rem;
	}

	h2 {
		font-size: 1.75rem;
		padding-bottom: 1.25rem;
	}

	/* links inside lists: inline, quiet underline */
	li a {
		display: inline;
		text-decoration: underline;
		text-decoration-color: var(--neutral-300);
		text-decoration-thickness: 1px;
		text-underline-offset: .2em;
		transition: text-decoration-color 200ms;

		&:hover {
			text-decoration-color: currentColor;
		}
	}

	.video video {
		display: block;
		width: 100%;
		max-width: 40rem; /* same width as the bio text */
		height: auto;
	}

	.bio {
		.calm-voice {
			max-width: 40rem;
			font-size: 1.125rem;
			line-height: 1.6;
		}
		.calm-voice:first-of-type {
			font-size: 1.5rem;
			line-height: 1.4;
			padding-bottom: 1rem;
		}
	}

	.contact {
		ul {
			display: flex;
			flex-direction: column;
			gap: .75rem;
		}
	}

	.social {
		ul {
			display: flex;
			flex-wrap: wrap;
			gap: .5rem 2rem;
		}
	}

	/* awards & press: one compact line per entry — Title / Source */
	.awards, .press {
		ul {
			max-width: 52rem;
		}

		li {
			display: flex;
			flex-wrap: wrap;
			align-items: baseline;
			padding-block: .2rem;
			font-size: 1.0625rem;
		}

		li a {
			text-decoration-color: transparent;

			&:hover {
				text-decoration-color: currentColor;
			}
		}

		.title {
			order: -1;
			color: var(--neutral-900);

			&::after {
				content: "/";
				margin-inline: .5em;
				color: var(--neutral-300);
			}
		}

		.source {
			font-style: italic;
			color: var(--muted);
		}

		/* phones: title and source on separate lines, no slash */
		@media (max-width: 619px) {
			li {
				flex-direction: column;
				align-items: flex-start;
				padding-block: .4rem;
			}

			.title::after {
				content: none;
			}

			.source {
				font-size: .9375rem;
			}
		}
	}

	.press {
		h3 {
			font-family: "Fraunces", serif;
			font-weight: 300;
			font-size: 1.75rem;
			font-variation-settings:
				"SOFT" 100,
				"WONK" 1;
			color: var(--pink);
			padding-top: 1.75rem;
			padding-bottom: .4rem;
		}

		h2 + h3 {
			padding-top: 0;
		}

		details > summary {
			margin-top: 2rem;
		}
	}

	.faq {
		ul {
			border-bottom: 1px solid var(--neutral-200);
		}

		li {
			padding-block: 1.5rem;
			border-top: 1px solid var(--neutral-200);
		}

		.question {
			font-family: "Fraunces", serif;
			font-weight: 300;
			font-size: 1.375rem;
			line-height: 1.3;
			font-variation-settings:
				"SOFT" 100,
				"WONK" 1;
			color: var(--neutral-900);
			padding-bottom: .5rem;
		}

		.answer p {
			max-width: 40rem;
		}
	}

	/* wide screens: headings in a left column, content on the right */
	@media (min-width: 900px) {
		inner-column {
			display: grid;
			grid-template-columns: 10rem minmax(0, 1fr);
			column-gap: 2.5rem;

			> * {
				grid-column: 2;
			}

			> h2 {
				grid-column: 1;
				grid-row: 1 / span 99;
				align-self: start;
				position: sticky;
				top: 2rem;
			}
		}
	}

}

/* PROJECT */

main.project {
	padding-block: 3rem 4rem;

	inner-column {
		max-width: 50rem;
		padding-inline: var(--padding-inline);
		display: flex;
		flex-direction: column;
		gap: 1.5rem;
	}

	.embed {
		aspect-ratio: 16 / 9;

		&.audio {
			aspect-ratio: auto;
			height: 166px;
		}

		iframe {
			width: 100%;
			height: 100%;
			border: 0;
		}
	}

	.description {
		max-width: 40rem;
		font-size: 1.125rem;
		line-height: 1.6;

		p {
			font-size: inherit;
			line-height: inherit;
		}

		p + p {
			margin-top: 1em;
		}

		/* descriptions aren't always wrapped in <p>, so keep links inline here too */
		a {
			display: inline;
			color: blue;
			text-decoration: underline;
		}
	}

	.dateline {
		font-size: .875rem;
		text-transform: uppercase;
		letter-spacing: .06em;
	}

	.source-link a {
		display: inline;
		text-decoration: underline;
		text-decoration-color: var(--neutral-300);
		text-underline-offset: .2em;

		&:hover {
			text-decoration-color: currentColor;
		}
	}

	.images {
		display: flex;
		flex-direction: column;
		gap: 1.5rem;
		padding-top: 1rem;
	}
}

/* HOME / SPLASH */

main.home {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr 1fr;
	height: 100vh;
	height: 100dvh;

	.cell {
		position: relative;
		display: grid;
		place-items: center;
		overflow: hidden;
		text-align: center;
	}

	h1 {
		position: relative;
		z-index: 1;
		font-family: "Fraunces", serif;
		font-weight: 300;
		font-size: clamp(4rem, 9vw, 7rem);
		line-height: 1.2;
		/* sharp, high-contrast cut to match the live splash page */
		font-variation-settings:
			"opsz" 144,
			"SOFT" 0,
			"WONK" 0;
	}

	.name {
		color: var(--pink);
	}

	/* "Giaever" lives in cell 4 on wide screens */
	.cell-1 .giaever {
		display: none;
	}

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

	.video-cell a {
		color: white;
		padding: 20px 30px;
		transition: color 200ms;

		&:hover {
			color: var(--pink);
		}
	}

	/* narrow: stacked text links, no videos */
	@media (max-width: 800px) {
		display: block;
		height: auto;
		padding: 20px;

		.cell {
			display: block;
		}

		/* same type treatment as the site header on Work / About */
		h1 {
			font-size: clamp(3.5rem, 18vw, 6rem);
			font-variation-settings:
				"SOFT" 100,
				"WONK" 1;
		}

		.cell-1 .giaever {
			display: block;
		}

		.cell-1 .name span {
			display: block;
		}

		/* the name in the header's animated rainbow */
		.cell-1 .name {
			width: fit-content;
			margin-inline: auto;
			color: transparent;
			background-image: var(--gradient);
			background-size: 200vw 100%;
			-webkit-background-clip: text;
			background-clip: text;
			animation: rainbow-move 10s linear infinite;
			animation-delay: var(--rainbow-delay, 0s);
		}

		.cell-4,
		video {
			display: none;
		}

		/* About / Work like the header nav links (same size as the name) */
		.video-cell a {
			display: inline-block;
			padding: 0;
			color: var(--ink);
			transition: color 150ms;

			&:hover {
				color: var(--neutral-900);
			}
		}
	}
}

/* TYPOGRAPHY */

.header-text {
	font-family: "Fraunces", serif;
	font-weight: 300;
	font-variation-settings:
		"SOFT" 100,
		"WONK" 1;
}

strong {
	font-weight: 600;
}

.sans {
	font-family: "Red Hat", sans-serif;
}

.loud-voice {
	font-family: "Fraunces", serif;
	font-size: 2.25rem;
	font-weight: 300;
	font-variation-settings:
		"SOFT" 100,
		"WONK" 1;
}

.calm-voice, p {
	line-height: 1.4;
	font-family: "Spectral";
	font-size: 1rem;
}


/* BREAK POINTS */

@media (min-width: 620px) {

	:root {
		--padding-inline: 24px;
	}

	header {
		.roles p {
			font-size: 24px;
		}
	}

	main.work {
		.work-grid {
			grid-template-columns: 1fr 1fr;
			gap: 24px;
		}
	}
}

@media (min-width: 900px) {

	main.work {
		.work-grid {
			grid-template-columns: 1fr 1fr 1fr;
			gap: 36px;
		}
	}
}


@keyframes rainbow-move {
	0% {
		background-position: 0% 50%;
	}
	100% {
		background-position: 200% 50%;
	}
}
