:root {
	--page: #f5f5f5;
	--color: #666;
	
	--dark: #000;
	--green: #5A8472;
	--tan: #EBE9DF;

	--gap: 4rem;
	--pad: clamp(5rem, 1.9rem + 10.44vw, 15rem);
	
	--narrow: 800px;
	--wide: 1280px;
	--wider: calc( var(--wide) + var(--pad, 3em) );

}

* {
	scroll-margin-top: 1250px;
}

body.home > header {
	position: absolute;
	width: 100%;
}


/* basic structure */

section {
	padding: var(--pad, 3em) 0;
	position: relative;
}

header > *,
section > *,
footer > *,
body > .wide,
main > .wide {
	position: relative;
	width: 88%;
	max-width: var(--wide);
	margin-inline: auto;
}

section.wider > *,
section > .wider {
	max-width: var(--wider);
}

section.widest > *,
section > .widest,
section > .full {
	max-width: none;
}

section > .full {
	width: initial;
}

.narrow > *:not(.wide) {
	max-width: var(--narrow);
	margin-inline: auto;
}



/* header */

#header {
	padding: 1.5em 0;
	background-color: black;
	color: white;
	z-index: 999;
	position: sticky;
	top: 0;
	transition: all 222ms ease-out;
	transform: translateZ(0);
}

.home #header {
	/* background-color: #0003;
	background-color: transparent; */
}

#header .cols {
	align-items: center;
	padding: 1.5em 0;
	gap: 0.75em;
}

#header .cols * {
	margin: 0;
}

#header nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	text-transform: uppercase;
}

#header.stuck {
	position: sticky;
	padding: 0;
	font-size: 0.75em;
	background-color: var(--dark);
}

#header .logo a {
	display: block;
	text-indent: -999em;
	background: url(images/logo.svg) no-repeat left center;
	max-width: 18rem;
	height: 2.2rem;
}



/* hero section */

#hero {
	background-repeat: no-repeat;
	background-size: cover;
	background-color: var(--green);
	color: white;
	/* padding-top: calc( 1 * var(--pad) ); */
	/* margin-top: calc( -1 * var(--pad) ); */
}

#hero .cols {
	align-items: center;
}


/* main content */

h3 {
	padding-bottom: 1.25em;
}

img.icon {
	display: inline-block;
	width: 32px;
	vertical-align: top;
	margin-right: 0.25em;
}

#better {
	padding-block: 0;
	color: var(--green);

	& p {
		font-size: var(--body-m);
	}
}

article > p:first-of-type {
	font-size: var(--body-l);
}

#clients {
	color: var(--green);
}

.clients {
	display: grid;
	grid-gap: 0;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	border-color: var(--green);
	border-style: solid;
	border-width: 1px 0 0 1px;
}

.clients > * {
	border-color: inherit;
	border-style: inherit;
	border-width: 0 1px 1px 0;
}

#work {
	background-color: var(--dark);
	color: white;
}

.projects > * {
	& * {
		margin-bottom: 1rem;
	}
	& h5 {
		font-size: var(--body-m);
	}
	& h5 + p {
		font-size: var(--body-m);
	}
	& p:last-child {
		color: var(--green);
	}
	& a {
		display: block;
	}
	&:hover {
		outline: 1em solid var(--tan);
		background: var(--tan);
		color: var(--dark);
	}
}

.intro {
	font-size: var(--body-l);
	max-width: var(--narrow);
}

.green:not(section) {
	color: var(--green);
}

#services {
	color: white;
	background-color: var(--green);
	background-image: url(images/noise.png);
	background-repeat: repeat;

	& p {
		font-size: var(--body-m);
	}
}


/* feature gallery */

#feature {
	padding: 2rem;
}

.feature.gallery {
	max-width: 100%;
	width: initial;
	display: grid;
	gap: 2rem;
	grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 600px) {
	.feature.gallery {
		grid-template-columns: repeat(2, 1fr);
	}
}

.feature.gallery > :nth-child(1),
.feature.gallery > :nth-child(8),
.feature.gallery > :nth-child(11) {
	grid-row-end: span 2;
	grid-column-end: span 2;
}

.feature.gallery > * {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

#feature + section {
	padding-top: calc( 0.3 * var(--pad) );
}

#feature.video {
	padding: 0;
}

#feature.video > * {
	padding:56.25% 0 0 0;
	position:relative;
	width: 100%;
}

#feature.video iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}




/* footer */

#footer {
	background-color: var(--tan);
	background-image: url(images/noise.png);
	background-repeat: repeat;
	padding-top: var(--pad, 3em);
}

#footer .bottom {
	padding-top: var(--pad);
	position: relative;
}

body:not(.home) #footer h2 span {
	display: none;
}





/* utility */

.flex {
	display: flex;
	gap: var(--gap);
}

.flex > * {
	flex: 1;
}



.grid {
  display: grid;
  grid-gap: var(--gap);
}

@supports (width: min(300px, 100%)) {
	.grid {
		grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
	}
	.grid.gallery {
		--gap: 2rem;
		grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
	}
}

.grid.gallery img {
	aspect-ratio: 1;
	object-fit: cover;
}



.cols {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gap);
	--threshold: 42rem;
}

.cols > * {
	flex-grow: 1;
	flex-basis: calc(( var(--threshold) - 100%) * 999);
}

.cols > .wide {
	flex-grow: 1.5;
}

.cols > .wider,
.cols > article {
	flex-grow: 2;
}

.cols > :nth-last-child(n+ 5),
.cols > :nth-last-child(n+ 5) ~ * {
	flex-basis: 100%;
}

.cols.alt {
	flex-direction: row-reverse;
}

.cols > * {
	& > :first-child {
		margin-top: 0;
	}
	& > :last-child {
		margin-bottom: 0;
	}
}



/* (C) FULLSCREEN IMAGE */
.gallery img.full {
	position: fixed;
	top: 0; left: 0; z-index: 9999;
	width: 100vw; height: 100vh;
	object-fit: contain; /* fill | contain | cover | scale-down */
	background-color: #000d;
	border: 1em solid transparent;
	border-radius: 0;
}

.no-scroll {
	overflow: hidden;
}



.outline * {
	outline: 1px solid #f002;
}

img[src*="circle-text"] {
	max-width: 240px;
	margin-inline: auto;
}

.rotate {
	animation: rotation 22s infinite linear;
	animation-play-state: paused;
}

section:hover .rotate {
	animation-play-state: running;
}

@keyframes rotation {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}