@view-transition {
	navigation: auto;
}

:root {
	scrollbar-width: none;
	--page-transition-duration: 1000ms;
	--page-transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

body {
	color: rgb(100, 70, 40);

	background-color: white;
	font-family: 'Sans-serif';
	font-size: clamp(1rem, 2vw, 1.375rem);
	margin: 0;
	padding: 0;
	backface-visibility: hidden;
	position: relative;
	overflow-x: hidden;

	min-height: 100vh;
}

.html {
	padding: 0;
	margin: 0;
	scroll-behavior: smooth;
}

a {
	color: inherit;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}

.pageWrapper {
	background-color: antiquewhite;
	min-height: 100%;
}

.bannerWrapper {
	display: flex;

	position: relative;
	flex-direction: column;
	width: 100%;
	box-sizing: border-box;
	min-height: 90vh;
	min-height: 90svh;
	padding: clamp(1rem, 5vw, 2rem);
	gap: clamp(1.25rem, 4svh, 2rem);
	align-items: center;
	justify-content: space-evenly;
	text-align: center;


	/* Remove this for transparent effect */
	/* background-image: url(/IMG/adarafront2.jpg);
	background-size: cover;
	background-position: bottom; */

	--bg-image: url(/IMG/adarafront2.jpg);
	--bg-opacity: .5;

	isolation: isolate;

}

/* Background image with opacity pseudoelement */
.bannerWrapper::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;

	/* background: black; */
	background-image: var(--bg-image);
	opacity: var(--bg-opacity);

	background-size: cover;
	background-position: bottom;

}

.bannerColumn {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	min-width: 0;
	gap: .75rem;
	font-family: 'Alex Brush', cursive;
	text-decoration: none;
	font-weight: normal;
	text-align: center;
	text-shadow: 1px 1px 1px beige;
}

.bannerLogo {
	display: flex;
	flex-direction: column;
	height: clamp(7rem, 28svh, 14rem);
	max-width: 100%;
	object-fit: contain;
}

.bannerName {
	font-size: clamp(2rem, 8.5vw, 3rem);
	color: rgb(100, 70, 40);
	height: auto;
	max-width: 100%;
	line-height: 1.15;
	overflow-wrap: break-word;

}

.bannerText {
	padding-top: 1%;
	word-spacing: 4px;
	color: rgb(100, 70, 40);
	font-size: clamp(1.5rem, 3vw, 2rem);
}

.bannerButtonContainer {
	display: flex;
	width: min(100%, 20rem);
	min-width: 0;
	flex-direction: column;
	align-items: center;
	gap: .75rem;
	container-type: inline-size;
}

.bannerButton {
	display: flex;
	text-align: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	padding: .625rem 1rem;
	margin: 0;
	align-items: center;
	background-color: linen;
	box-shadow: 0px 0px 1px rgb(100, 70, 40);
	color: rgb(100, 70, 40);
	opacity: 0.8;
	border-radius: 10px;
	font-family: 'Alex Brush', cursive;
	font-size: clamp(1.75rem, 8vw, 2.25rem);
	font-size: clamp(1.75rem, 10cqi, 2.25rem);
	line-height: 1.25;
	white-space: nowrap;
	text-decoration: none;
	font-weight: normal;
}

.bannerButton:hover {
	cursor: pointer;
	opacity: 1;
}

.introductionWrapper {
	display: flex;
	width: 100%;
	background-color: rgb(255, 249, 240);
	color: rgb(100, 70, 40);

	/* background-image: url(/IMG/dust_scratches.png); */
	align-items: center;
}

.introductionContainer {
	display: block;
	flex-direction: column;
	text-align: left;
	/* Width: 60%; */
	width: clamp(60%, 90%, 54rem);
	padding-top: 5%;
	padding-bottom: 7.5%;
	margin: 0 auto;

}

#cvLink {
	width: fit-content;
}

.projectsWrapper {
	display: flex;
	position: relative;
	width: 100%;
	color: rgb(100, 70, 40);
	/* background-image: url(/IMG/adarafront.jpg); */
	background-position: top;
	align-items: center;

	--bg-image2: url(/IMG/adarafront.jpg);
	--bg-opacity2: .1;

	isolation: isolate;
}

.projectsWrapper::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;

	/* background: black; */
	background-image: var(--bg-image2);
	opacity: var(--bg-opacity2);

	background-size: cover;
	background-position: top;
}

.projectsContainer {
	display: flex;
	flex-direction: column;
	justify-content: center;
	text-align: left;
	/* Width: 60%; */
	width: clamp(60%, 90%, 54rem);
	padding-top: 5%;
	padding-bottom: 7.5%;
	margin: 0 auto;
}

.projectsContainer>h2,
h3,
h4,
p {}

h1,
h2,
h3 {
	font-family: 'Alex Brush', cursive;
}

.projectsRowContainer {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
}

.projectsColumnContainer {
	display: flex;
	max-width: 49.5%;
	flex-direction: column;
	justify-content: space-between;
	flex-grow: 1;
}

.projectTileContainer {
	display: flex;
	flex-grow: 1;
	position: relative;
	width: 95%;
	padding-left: 2.5%;
	/* margin-left: -5%; if width is 100% */
	padding-right: 2.5%;
	margin-top: 2.5%;
	padding-bottom: 2.5%;

	text-decoration: none;
	color: inherit;

	transition: background-color 0.5s, box-shadow 0.5s;
	border-radius: 5px;

	&::before {
		content: '';
		position: absolute;
		background-repeat: no-repeat;
		background-position: center;
		background-size: cover;
		border-radius: 5px;

		top: 0px;
		right: 0px;
		bottom: 0px;
		left: 0px;
		opacity: 0.5;
	}

	box-shadow: 0px 0px 1px rgb(100, 70, 40);

	@media (hover:none) {
		box-shadow: 0px 0px 3px rgb(100, 70, 40);
		background-color: linen;
	}

}

@keyframes linen-anim {
	0% {
		background-color: transparent;
	}

	100% {
		background-color: linen;
	}
}

.projectTileContainer:hover {
	cursor: pointer;
	opacity: 1;
	box-shadow: 0px 0px 3px rgb(100, 70, 40);
}

.projectTileContainer {
	@media (hover:none) {
		opacity: 1;
	}
}

@keyframes projectile {

	from,
	5% {
		opacity: 0;
		transform: translateX(-2.5%);
	}

	30%,
	70% {
		opacity: 1;
		transform: translateX(0);
	}

	95%,
	to {
		opacity: 0;
		transform: translateX(2.5%);
	}
}

@keyframes tile-parallax {
	from {
		background-position: bottom;
	}

	to {
		background-position: top;
	}
}

.projectTileContainer:hover {
	/* color: black; */
	background-color: linen;
	/* padding-left: 7.5%;
	margin-left: -2.5%;
	padding-right: 7.5%; */
	transition: background-color 0.1s, box-shadow 0.1s;
	cursor: pointer;
}

.projectsSmallRowContainer {
	display: flex;
	width: 100%;
	flex-direction: row;
	align-items: center;
	justify-content: space-around;
	text-align: center;
}

.projectSmallTileContainer {
	display: flex;
	position: relative;
	flex-grow: 1;
	max-width: 42.5%;
	padding-left: 2.5%;
	/* margin-left: -5%; if width is 100% */
	padding-right: 2.5%;
	margin-top: 2.5%;

	justify-content: center;
	text-align: center;
	text-decoration: none;
	text-wrap: nowrap;
	color: inherit;

	transition: background-color 0.5s, box-shadow 0.5s;
	border-radius: 5px;

	&::before {
		content: '';
		position: absolute;
		background-repeat: no-repeat;
		background-position: center;
		background-size: cover;
		border-radius: 5px;

		top: 0px;
		right: 0px;
		bottom: 0px;
		left: 0px;
		opacity: 0.4;
	}

	box-shadow: 0px 0px 1px rgb(100, 70, 40);

}

.projectSmallTileContainer:hover {
	/* color: black; */
	background-color: whitesmoke;
	/* padding-left: 7.5%;
	margin-left: -2.5%;
	padding-right: 7.5%; */
	transition: background-color 0.2s, box-shadow 0.2s;
	cursor: pointer;

	opacity: 1;
	box-shadow: 0px 0px 3px rgb(100, 70, 40);
}

#kauneuspalvelut::before {
	background-image: url(/IMG/hoitola.jpeg)
}

#kasvohoidot::before {
	background-image: url(/IMG/kasvohoidot_pallura.png);
}

#sokeroinnit::before {
	background-image: url(/IMG/karvanpoisto_pallura.png);
}

#kampaamopalvelut::before {
	background-image: url(/IMG/kampaamopalvelut.jpg);
}

#testi::before {
	background-image: url(/IMG/hoitola_1x1.jpg);
}

#testi2::before {
	background-image: linear-gradient(to left, transparent, linen), url("/IMG/Rakennus.jpeg");
}

.socialButton {
	background-color: linen;
}

.projectTileContainerText {
	position: relative;
	flex-wrap: nowrap;

}

.servicesButtonContainer {
	display: flex;
	justify-content: center;
}

.servicesButton {
	display: flex;
	justify-content: center;
	width: 90%;
	padding-block: 10px;
	margin: 10px 0;
	background-color: linen;
	box-shadow: 0px 0px 1px rgb(100, 70, 40);
	color: rgb(100, 70, 40);
	opacity: 0.8;
	border-radius: 10px;
	font-family: 'Alex Brush', cursive;
	font-size: clamp(2rem, 3vw, 2.25rem);
	text-decoration: none;
	font-weight: normal;

	transition-duration: 0.2s;
}

.servicesButton:hover {
	cursor: pointer;
	opacity: 1;
	box-shadow: 0px 0px 3px rgb(100, 70, 40);
}

.projectHeader {
	text-align: center;
}

.projectPageHeader {
	text-shadow: 0px 0px 5px black;
}

.websiteHeader {
	margin-bottom: -10px;
}

.divider {
	width: 100%;
	height: 5px;
	margin-top: 7.5%;
	margin-bottom: 2.5%;

	border-radius: 5px;
	background-color: aliceblue;

	/* padding-left: 5%;
	margin-left: -5%;
	padding-right: 5%; */

}

.aboutMeWrapper {
	display: flex;
	width: 100%;

	align-items: center;
}

.aboutMeContainer {
	display: flex;
	flex-direction: column;
	text-align: left;
	Width: 27.5%;
	padding-top: 5%;
	padding-bottom: 7.5%;
	margin-left: 12.5%;
	margin-right: 5%;
}

.aboutMePicsContainer {
	display: flex;
	flex-direction: row;
	width: 42.5%;
	height: 100%;
	margin-right: 12.5%;

	/* background-color: burlywood; */
}

/* Keep the overlap in layout; animate only the painted photo positions. */
.aboutMePic, .aboutMePic2, .aboutMePic3 {
	display: block;
	flex: 0 0 50%;
	width: 50%;
	height: auto;
	aspect-ratio: 2 / 3;
	max-height: 300px;
	box-shadow: 0px 0px 20px black;
	border-radius: 5px;
	object-fit: cover;
	object-position: top;
}
.aboutMePic {
	margin-top: -2.5%;
	margin-bottom: 2.5%;
	margin-left: 0;
	--photo-start: -10%;
}
.aboutMePic2 {
	margin-left: -25%;
	--photo-start: -30%;
}
.aboutMePic3 {
	margin-left: -25%;
	margin-top: 2.5%;
	margin-bottom: -2.5%;
	--photo-start: -50%;
}
@keyframes about-me-photo-reveal {
	from { transform: translateX(var(--photo-start)); }
	to { transform: translateX(0); }
}

.footerWrapper {
	display: flex;
	position: relative;
	width: 100%;
	color: black;
	background-position: center;
	background-size: contain;
	align-items: center;

	--bg-footer-image: url(/IMG/adarafooter.jpg);
	--bg-footer-opacity: .1;

	isolation: isolate;
}

.footerWrapper::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;

	/* background: black; */
	background-image: var(--bg-footer-image);
	opacity: var(--bg-footer-opacity);

	background-size: cover;
	background-position: center;
}



.footerContactContainer {
	display: flex;
	flex-direction: column;
	text-align: left;
	Width: 40%;
	/* font-size: 22px; */
	padding-top: 2.5%;
	padding-bottom: 2.5%;
	padding-left: 10%;
	padding-right: 10%;

}

.emailLink {
	text-decoration: none;
	width: fit-content;

	b {
		font-size: x-large;
	}
}

.footerLink {
	position: relative;
	width: min-content;
	max-height: 30px;
}

.linkedInPic {
	height: 30px;
}

.linkedInPicWhite {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	bottom: 0;
	height: 30px;
	object-fit: contain;
	opacity: 0;
	transition: opacity .5s;
}

.linkedInPicWhite:hover {
	transition: opacity 0.2s;
	opacity: 1;
}

.backArrow {
	display: block;
	position: fixed;

	text-align: center;
	justify-content: center;

	left: 7.5%;
	top: 45%;
	width: 5%;
	height: auto;

	color: darkgray;
	text-decoration: none;
	transition: 0.2s;
}

.backArrow:hover {
	cursor: pointer;
	color: white;
	transform: scale(1.3);
	transition: 0.2s;
}

.copyrightFooter {
	width: 100%;
	background-color: black;
	color: gray;
	text-align: center;
}

/* Responsivity for mobile  */
@media only screen and (max-width: 600px) {
	.bannerText {
		font-size: clamp(2rem, 5vw, 3rem);
	}

	.introductionContainer {
		padding-top: 10%;
		padding-bottom: 15%;

		h1 {
			text-align: center;
		}
	}

	.projectsRowContainer {
		flex-direction: column;
	}

	.projectsColumnContainer {
		max-width: 100%;
	}

	.projectsSmallRowContainer {
		flex-direction: row;
	}

	.projectSmallTileContainer {
		min-width: 42.5%;
		max-width: 42.5%;

		animation: none;
	}

	.aboutMeWrapper {
		flex-direction: column;
	}

	.aboutMeContainer {
		width: 90%;
		margin: 0 auto;
		text-align: center;
		align-items: center;
	}

	.aboutMePicsContainer {
		width: 90%;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 10%;


	}

	.aboutMePic { --photo-start: 20%; }
	.aboutMePic2 { --photo-start: 0%; }
	.aboutMePic3 { --photo-start: -20%; }

	.footerContactContainer {
		width: 90%;
		margin: auto;
		text-align: center;
		padding: 0;
	}

	.emailLink {

		width: 100%;

		b {
			text-align: center;
			font-size: x-large;
		}
	}

	.footerLink {
		width: 100%;
	}

	.linkedInPicWhite {
		margin: 0 auto;
	}
}

@keyframes fade-in {
	from {
		opacity: 0;
		scale: 0.975;
	}

	20%,
	80% {
		opacity: 1;
		scale: 1;
	}

	to {
		opacity: 0;
		scale: 0.975;
	}
}

@keyframes no-fade {

	from,
	to {
		opacity: 1;
	}
}

@keyframes exit-left {
	from {
		right: 0;
	}

	to {
		right: 1vw;
	}
}

@keyframes enter-left {
	from {
		right: 1vw;
	}

	to {
		right: 0;
	}
}


/* ------------------------- */

@keyframes slide-from-down {
	from {
		transform: translateY(99vh);
	}
}

@keyframes slide-to-up {
	to {
		transform: translateY(-99vh);
	}
}

@keyframes slide-to-down {
	to {
		transform: translateY(99vh);
	}
}

@keyframes slide-from-up {
	from {
		transform: translateY(-99vh);
	}
}

@keyframes z-index-behind-to-front {
	0% {
		z-index: -1;
	}

	99% {
		z-index: -1;
	}

	100% {
		z-index: 1;
	}
}

/* Touchscreen devices hover */
@media (hover:none) {
	.projectTileContainer {
		opacity: 1;
		box-shadow: 0px 0px 3px rgb(100, 70, 40);
	}

	.projectSmallTileContainer {
		opacity: 1;
		box-shadow: 0px 0px 3px rgb(100, 70, 40);
	}

}

/* Browser-generated snapshot movement must use the same curve as the slides,
   rather than the browser's default 250ms ease animation. */
::view-transition-group(*) {
	animation-duration: var(--page-transition-duration);
	animation-timing-function: var(--page-transition-easing);
}

::view-transition-old(root) {
	animation: var(--page-transition-duration) var(--page-transition-easing) both none;
}

::view-transition-new(root) {
	animation: var(--page-transition-duration) var(--page-transition-easing) both slide-from-down;
}

.back-transition::view-transition-old(root) {
	animation-name: slide-to-down;
}

.back-transition::view-transition-new(root) {
	animation-name: z-index-behind-to-front;
}

/* Capture an opaque resting state, including a button being clicked. The
   colors match 90% linen/brown over the cream header, without letting moving
   photos or snapshot edges show through as dark patches during navigation. */
.header-transition .headerButtonsContainer .headerButton {
	view-transition-name: var(--button-transition);
	background-color: rgb(251, 241, 231);
	color: rgb(116, 88, 60);
	box-shadow: 0px 0px 2px rgba(100, 70, 40, 0.9);
	opacity: 1;
	transition: none;
}

/* Hold the outgoing header snapshot throughout navigation. Cross-fading
   translucent copies can leave seams, and WebKit can omit the live incoming
   capture. These shared controls have the same appearance on both pages. */
::view-transition-group(header-btn-back),
::view-transition-group(header-btn-menu),
::view-transition-group(header-btn-fwd),
::view-transition-old(header-btn-back),
::view-transition-old(header-btn-menu),
::view-transition-old(header-btn-fwd),
::view-transition-new(header-btn-back),
::view-transition-new(header-btn-menu),
::view-transition-new(header-btn-fwd) {
	animation: none;
	mix-blend-mode: normal;
}

::view-transition-new(header-btn-back),
::view-transition-new(header-btn-menu),
::view-transition-new(header-btn-fwd) {
	visibility: hidden;
}

/* An incoming-only header still needs to be visible. */
::view-transition-new(header-btn-back):only-child,
::view-transition-new(header-btn-menu):only-child,
::view-transition-new(header-btn-fwd):only-child {
	visibility: visible;
}
.homeServicesGrid, .palvelutGridContainer {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-auto-rows: 1fr;
	column-gap: 1%;
}
.homeServicesGrid > .projectTileContainer::before,
.palvelutGridContainer > .projectTileContainer::before {
	background-image: var(--service-image);
	background-position: center var(--service-focus);
}
@keyframes service-photo-parallax {
	from { background-position: center calc(var(--service-focus) + 4%); }
	to { background-position: center calc(var(--service-focus) - 4%); }
}
@media (max-width: 600px) {
	.homeServicesGrid, .palvelutGridContainer { grid-template-columns: minmax(0, 1fr); }
}
/* Static styles above are also the fallback for older browsers and reduced
   motion. Fill both ends so entry never switches from a different resting pose.
   Parent timelines keep crops and photo motion independent of animated geometry. */
@supports (animation-timeline: view()) and (animation-range: entry) {
	@media (prefers-reduced-motion: no-preference) {
		.projectTileContainer, .projectSmallTileContainer {
			view-timeline-name: --tile-scroll;
			view-timeline-axis: block;
			view-timeline-inset: 0;
			animation: projectile auto ease-in-out both;
			animation-timeline: --tile-scroll;
			animation-range: cover;
		}
		.projectTileContainer::before, .projectSmallTileContainer::before {
			background-position: center bottom;
			animation: tile-parallax auto linear both;
			animation-timeline: --tile-scroll;
			animation-range: cover;
		}
		.homeServicesGrid > .projectTileContainer::before,
		.palvelutGridContainer .projectTileContainer::before {
			background-position: center calc(var(--service-focus) + 4%);
			animation-name: service-photo-parallax;
		}
		.aboutMePicsContainer {
			view-timeline-name: --team-reveal;
			view-timeline-axis: block;
			view-timeline-inset: 0;
		}
		.aboutMePic, .aboutMePic2, .aboutMePic3 {
			transform: translateX(var(--photo-start));
			animation: about-me-photo-reveal auto ease-out both;
			animation-timeline: --team-reveal;
			animation-range: entry 0% entry 100%;
		}
		@media (hover: none) {
			.projectTileContainer { animation: 5s linen-anim both; }
			.projectSmallTileContainer { animation: none; }
		}
		@media (max-width: 600px) {
			.projectSmallTileContainer { animation: none; }
		}
	}
}
@media (prefers-reduced-motion: reduce) {
	::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
	.headerButtonsContainer .headerButton { transition: none; }
}

.scriptTitle {
	font-family: 'Alex Brush', cursive;
	text-shadow: 1px 1px 1px white;
}
