/* 
	This CSS is just emerging along with design exploration.
	Needs properly modularising (on top of a decent CSS reset).
*/

:root {
	--green-1-hsl: 180deg 52.3% 17.3%; /* #154343 */
	--green-1: hsl(var(--green-1-hsl));
	
	--green-2-hsl: 73deg 72.6% 48.6%; /* #afd622 */
	--green-2: hsl(var(--green-2-hsl));
	
	--link: hsl(73.2deg 77.9% 64.5%);

	--green-5-hsl: 71.4deg 55.8% 79.6%; /* #dde8ae */
	--green-5: hsl(var(--green-5-hsl));

	--green-6-hsl: /* #eaf1cf */
}


/***** =base *****/
/* add a good reset! */

* {
	box-sizing: border-box;
}

html {
	font: 1rem / 1.5 system-ui, sans-serif;
	color: #314013;
}

body, h1, h2, h3, h4, p, figure, blockquote {
	margin: 0;
}

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

/* dev only */

.pending {
	color: #999;
	background: hsl(0deg 0% 95%);
	border-top: 2px solid #999;
}

.pending pre {color: black;}


/***** =links *****/

.nonederline {
	text-decoration: none;
}

a:not(.nonederline, .btn) {
	color: black;
	text-decoration: none;
	background: linear-gradient(to top, var(--link) 0.23em, transparent 0.23em);
	transition: 0.3s;
}

a:not(.nonederline, .btn):focus, 
a:not(.nonederline, .btn):hover {
	background: var(--green-5);
}

#gotop {
	line-height: 1;
	padding: 0.25rem;
	display: block;
	background: rgb(0 0 0 / 0.2);
	color: rgb(0 0 0 / 0.4);
	width: 1.5rem;
	border: 1px solid white;
	border-radius: 50%;
}


/***** Utilities *****/

.grid      {display: grid;}
.gap-1\/4r {gap: 0.25rem;}
.gap-1\/2r {gap: 0.5rem;}
.gap-3\/4r {gap: 0.75rem;}
.gap-1r    {gap: 1rem;}

.listless, 
.benefits__list ul,
ul.grid,
ol.grid {
	list-style: '';
	padding: 0;
	margin-inline: 0;
}

.line-br {display: block;}
.line-ib {display: inline-block;}

.pos-abs {position: absolute;}
.pos-rel {position: relative;}

.neg {color: white;}

.visually-hidden:not(:focus):not(:active) {
	clip: rect(0 0 0 0); 
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap; 
	width: 1px;
}


/***** major =page sections *****/

.max-x {
	padding-inline: 4vw;
}

.max-x > *:not(.max-content, h2) {
	max-width: 32rem;
}

.page-section {
	padding-block: 12vw;
}

.intro.page-section {
	padding-top: 0;
}


/***** basic =typography *****/


/* =headings =sizes */

h2, .h2, .size-xxl {font-size: 2rem; font-weight: 500;}
h3, .h3, .size-xl  {font-size: 1.25rem;}
h4, .h4, size-l    {font-size: 1.125rem;}
.size-r            {font-size: 1rem;}
.size-s            {font-size: 0.875rem;}


/* =headings */

h1, h2, h3, h4 {
	line-height: 1.15;
	text-wrap: balance;
}


/* vertical =spacing */

.page-section * + p, 
.page-section * + h4, 
.page-section * + figure, 
.page-section * + blockquote {
	margin-top: 1rem;
}

.page-section * + h2,
.page-section * + h3,
.page-section * + *:has(h2:first-child) {
	margin-top: 2rem;
}


/***** =nav =menu *****/

.menu {
	z-index: 2;
	align-items: center;
	line-height: 1;
	gap: 0.5rem 2rem;
	top: 1.5rem;
}

.menu .brand {
	max-width: 280px;
}

.menu__list {
	margin: 0;
}

.menu__list > li {
	border-bottom: 1px solid rgb(255 255 255 / 0.25);
}

.menu__list a {
	display: block;
	padding: 0.65em 4px;
	color: var(--link);
	text-decoration: none;
	font-size: 16px;
}

.menu__list a:focus,
.menu__list a:hover {
	color: white;
	background: rgb(0 0 0 / 0.4);
}


/* =sticky */

.menu.sticky {
	background: var(--green-1);
}

.menu.sticky .menu__list {
	display: flex;
}

.menu.sticky .menu__list > li:not(:last-child) {
	padding-right: 0.75rem;
}



/***** =header *****/

h1 {
	font-size: clamp(2rem, calc(1rem + 11vw), 5.5rem);
	color: white;
	text-shadow: 0 0 0.25em rgb(0 0 0 / 0.4);
}

h1 span {
	font-size: 39%;
	font-weight: 500;
}

h1 em {
	display: block;
	font-style: normal;
	font-weight: 200;
	line-height: 0.8;
	letter-spacing: -0.02em;
	text-indent: -0.04em;
}


/***** specific page =sections *****/
/* probably needs abstracting a bit better */

.benefits {
	background: var(--green-2) url('grass-blur.jpg') no-repeat;
	background-size: cover;
}

.benefits h2 {
	color: white;
	text-shadow: 0 0 0.25em rgb(0 0 0 / 0.4);
}

.experience {
	background: hsl(var(--green-1-hsl) / 0.15);
}

.intro__list {
	grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
	font-size: 1.5rem;
	line-height: 1.15;
}

.intro__list > li,
.benefits__list > li {
	padding: 0.5rem 0.33rem 0.67rem;
	text-wrap: balance;
	border-radius: 3px;
}

.intro__list > li {
	background: var(--green-1);
	color: var(--green-5);
}

.intro__list .size-r {
	color: white;
	margin-top: 0.5rem;
}

.benefits__list > li {
	background: white;
	padding: 1rem;
}

.benefits__list > li > * {
	margin-block-start: 0;
	margin-block-end: 0.5rem;
	max-width: 32rem;
}

.benefits__list ul > li {
	padding-block: 0.5em;
	border-top: 1px solid rgb(0 0 0 / 0.1);
}

.grid.has-3 {
	grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
}

.projects figure {
	position: relative;
}

.projects figcaption {
	bottom: 0;
	background: linear-gradient(to top, rgb(0 0 0 / 0.7) 1rem, transparent);
	padding: 3rem 0.75rem 0.75rem;
	color: white;
	position: absolute;
	width: 100%;
}

.experience article {
	background: white;
}

.experience article > *:not(figure) {
	margin-inline: 1rem;
}


/***** =shapes *****/

.header-curve {
	bottom: -2px;
}


@media (max-width: 632px) {
	h1 {
		top: 52vw;
	}
}

@media (min-width: 633px) {
	h1 {
		font-size: clamp(2rem, calc(1rem + 9vw), 5rem);
		bottom: 12vw;
	}
}


@media (max-width: 767px) {
	/* =nav */
	.brand {
		width: 210px;
	}
	
	/* =menu */
	.menu {
		width: 90vw;
	}
	
	.menu__list {
		display: flex;
		justify-content: space-between;
		max-width: 385px;
	}
	
	.menu__list > li:not(:last-child) {
		flex-grow: 1;
	}
}

@media (min-width: 768px) {
	html {font-size: 112.5%;}
		
	/* =menu */
	.menu {
		display: grid;
		grid-template-columns: 280px 1fr;
	}

	.menu:not(.sticky) .menu__list {
		display: grid;
		grid-template-columns: max-content max-content;
	}

	.menu__list a {
		padding: 0.65em 4px;
	}

	.menu__list li:nth-child(-n + 2) {
		border-top: 1px solid rgb(255 255 255 / 0.25);
	}

	.menu__list li:nth-child(odd) {
		padding-right: 0.75em;
	}
	
	
	.benefits__list {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 768px) and (max-width: 1190px) {
	.intro__list {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1024px) {
	/* =headings */
	.page-section:not(.pending) > h2 {
		font-weight: 200;
		font-size: 3.33rem;
	}
}

@media (min-width: 1320px) {
	.max-x {
		padding-inline: calc( (100vw - 66rem) / 2 );
	}
}

@media (min-width: 1920px) {
	html {font-size: 125%;}
}