@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400&display=swap');

/* Reset */
*,
*::before,
*::after {
	box-sizing: border-box;
}

/* Custom Properties to allow for easy reference and consistency with house style */
:root {

	/* Fonts */
	--ff-main: 'Montserrat', sans-serif;
	--ff-secondary: 'Montserrat', sans-serif;

	/* Font weights */
	--fw-reg: 300;
	--fw-bold: 400;
	--fw-super-bold: 700;

	/* Colors */
	--clr-light: #fff;
	--clr-dark: #1e2124;
	--clr-super-dark: #121212;
	--clr-accent: #5865F2;
	--clr-hover: #5865f2a9;

	/* Heading sizes */
	--fs-h1: 3rem;
	--fs-h2: 2.25rem;
	--fs-h3: 1.25rem;
	--fs-body: 1rem;
	--fs-copyright: 0.8rem;

	/* Shadows */
	--boxShadow: 0.5em 0.5em 1em rgba(0, 0, 0, 0.25);

	/* Border radius */
	--borderRadius: 5px;
}

html {
	scroll-behavior: smooth;
}

/* General styles */

body {
	overflow-x: hidden;
	/* Solves issue with horizontal scroll */
	background-color: var(--clr-light);
	color: var(--clr-dark);
	font-family: var(--ff-main);
	margin: 0;
	font-size: var(--fs-body);
	line-height: 1.6;
}

body.darkmode {
	background-color: var(--clr-super-dark);
	color: var(--clr-light);
}

body.darkmode .dark-mode-toggle {
	color: var(--clr-light);
	transform: rotate(180deg);
}

body.darkmode .section__title--intro {
	color: var(--clr-light);
}

body.darkmode .section__title--about {
	color: var(--clr-light);
}

body.darkmode .technologies i {
	color: var(--clr-light);
}

body.darkmode .socials a {
	color: var(--clr-light);
}

body.darkmode .socials a:hover {
	color: var(--clr-accent);
	transform: scale(1.2);
}

body.darkmode .my-location h2 {
	color: var(--clr-light);
}

section {
	padding: 5em 0.5em;
}

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

/* Typography */
h1,
h2,
h3 {
	line-height: 1;
	margin: 0;
}

h1 {
	font-size: var(--fs-h1)
}

h2 {
	font-size: var(--fs-h2)
}

h3 {
	font-size: var(--fs-h3)
}

.section__title {
	margin: 0.1em;
	color: var(--clr-dark);
}

.section__title--intro {
	font-weight: var(--fw-reg);
}

.section__title--intro strong {
	/* Ensures my name is always on it's own line (if wrapped in strong tags) */
	display: block;
}

.section__subtitle {
	margin: 0;
	font-size: var(--fs-h3);
	color: var(--clr-light);
}

.blinking-caret {
	display: inline-block;
	width: 2px; /* Ensures it doesn't cause shifting */
	background-color: var(--clr-light); /* Or the same color as your text */
	animation: blink 1s step-end infinite;
	height: 1em; /* Match the height of the text */
	vertical-align: text-bottom; /* Align the caret to the bottom of the text */
  }
  
  
  @keyframes blink {
	from, to { opacity: 1; }
	50% { opacity: 0; }
  }

.section__subtitle--intro,
.section__subtitle--about {
	background: var(--clr-accent);
	padding: .25em 1em;
	font-family: var(--ff-secondary);
	margin-bottom: 1em;
	border-radius: var(--borderRadius);
}

span {
	color: var(--clr-accent);
	font-weight: var(--fw-super-bold);
}

/* Intro section */
.intro {
	position: relative;
	z-index: 0;
}

.intro__img {
	box-shadow: var(--boxShadow);
	max-width: 100%;
	width: 100%;
	border-radius: var(--borderRadius);
}

/* Remember to animate these to fade/slide in left to right later */
.socials {
	display: flex;
	justify-content: center;
}

.socials a {
	display: flex;
	justify-content: center;
	margin: 0.25em;
	color: var(--clr-dark);
	font-size: 1.25em;
	text-decoration: none;
	transition: ease-in-out 0.3s;
}

.socials a:hover {
	color: var(--clr-accent);
	transform: scale(1.2);
}

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

/* My Skills Section */
.my-skills {
	background-color: var(--clr-dark);
	background-image: url(./img/skills.webp);
	background-size: cover;
	background-blend-mode: multiply;
	color: var(--clr-light);
	text-align: center;
	position: relative;
	z-index: 0;
}

.my-skills i {
	margin-bottom: 0.25em;
}

.section__title--skills {
	color: var(--clr-accent);
	position: relative;
}

/* Insert the underline AFTER the title, this allows for a small underline*/
.section__title--skills::after {
	content: '';
	display: block;
	width: 2.5em;
	height: 1px;
	margin: 0.5em auto 1.2em;
	background: var(--clr-light);
	opacity: 0.5;
}

.skill {
	max-width: 500px;
	margin-left: auto;
	margin-right: auto;
}

.skill a {
	color: var(--clr-accent);
	cursor: pointer;
}

.skill a:hover {
	color: var(--clr-hover);
}

/* Navigation styles */
#menuToggler {
	position: fixed;
	top: 0.5rem;
	right: 0.5rem;
	background-color: rgba(0, 0, 0, 0.5);
	color: white;
	font-size: 3em;
	text-align: right;
	line-height: 1em;
	padding: 0 1rem;
	z-index: 2;
	/* Toggler given z-indez of 2 to keep it in front of the nav, which was change due to Google Maps */
	cursor: pointer;
}

nav {
	position: fixed;
	width: 100vw;
	height: 100vh;
	top: 0;
	display: flex;
	flex-direction: column;
	background-color: #5865F2;
	opacity: 0;
	transform: translateX(100vw);
	transition: transform 0.4s, opacity 0.6s;
	z-index: 1;
	/* Nav given z-index of 1 to stop Google Maps appearing over the top */
}

nav.open {
	transition: transform 0.4s, opacity 0.2s;
	transform: none;
	opacity: 1;
	z-index: 2;
}

nav a {
	display: flex;
	font-size: 2em;
	text-decoration: none;
	padding: 0.5em 1em;
	color: white;
	text-align: center;
	align-items: center;
	justify-content: center;
	flex-grow: 1;
	transition: background-color 0.5s;
}

nav a:hover {
	background-color: rgba(0, 0, 0, 0.7);
	color: #FFFFFF;
}

.dark-mode-toggle {
	position: absolute;
	top: 1.25rem;
	left: 0.5rem;
	color: var(--clr-dark);
	background: none;
	font-size: 2em;
	text-align: left;
	cursor: pointer;
	z-index: 1;
	border: none;
	transition: 0.5s ease;
	padding-left: 1.5rem;
}

.about-me {
	max-width: 1000px;
	margin: 0 auto;
}

.technologies i {
	font-size: 3em;
	margin: 0.5em 0.25em 0 0;
	color: var(--clr-dark);
}

/* My Work Section */
.my-work {
	background-color: var(--clr-dark);
	color: var(--clr-light);
	text-align: center;
}

.my-work .section__title {
	color: var(--clr-accent);
}

p.section__subtitle.jobs {
	margin-top: 1em;
}

.portfolio {
	display: flex;
	gap: 1em;
}

.portfolio__item {
	background: var(--clr-accent);
	overflow: hidden;
	border-radius: 5px;
}

.portfolio__img {
	transition:
		transform 750ms cubic-bezier(0.5, 0.5, .5, 1);
	border-radius: var(--borderRadius);
}

.portfolio__img:hover {
	transform: scale(1.1);
	opacity: 0.75;
}

.my-location {
	text-align: center;
}

.my-location .section__subtitle {
	color: var(--clr-accent);
}

#map {
	display: flex;
	height: 60vh;
	z-index: 0;
}

.back-to-top {
	position: fixed;
	bottom: 2rem;
	right: 1rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: var(--clr-accent);
	border-radius: 0.5rem;
	padding: 0.5rem;
	text-decoration: none;
	transition: 0.25s ease-out;
	color: var(--clr-light);
	font-size: 1.5rem;
	opacity: 0;
}

.back-to-top.active {
	pointer-events: auto;
	opacity: 1;
	transition: 0.25s ease-out;
}

.back-to-top:hover {
	transform: translateY(-2px);
	background-color: var(--clr-hover);
}

footer {
	text-align: center;
	background-color: var(--clr-dark);
	color: var(--clr-light);
}

.footerText {
	margin-inline: auto;
	border-bottom: 1px solid var(--clr-accent);
	max-width: 200px;
	color: var(--clr-light);
}

#copyright {
	font-size: var(--fs-copyright);
	margin: auto;
	padding-bottom: 0.5em;
}

footer a {
	text-decoration: none;
	color: var(--clr-light);
	padding: 0.5em;
	transition: ease-in-out 0.25s;
}

footer a:hover {
	color: var(--clr-accent);
}

.weather {
	width: 15em;
	display: flex;
	flex-direction: column;
	justify-content: center;
	text-align: center;
	margin-inline: auto;
	border-radius: 5px;
	box-shadow: 0 0 3px var(--clr-dark);
	margin-top: 0.75em;
	background-color: var(--clr-accent);
	color: var(--clr-light);
	transition: 0.2s ease-in-out
}

.weather h3 {
	margin-top: 0.2em;
}

.weather p {
	margin: 0;
	padding: 0;
}

.weather img {
	margin-inline: auto;
	width: 25%;
}

.weather:hover {
	transform: scale(1.1);
}


/* MEDIA QUERIES */
@media (min-width: 600px) {

	#menuToggler {
		display: none;
	}

	nav {
		display: flex;
		flex-direction: row;
		transform: none;
		opacity: 1;
		height: auto;
		position: fixed;
		justify-content: center;
	}

	nav a {
		font-size: 1.3em;
		/* flex-grow: 0; */
	}

	.intro {
		display: grid;
		width: min-content;
		margin: 0 auto;
		column-gap: 1em;
		grid-template-areas:
			"img title"
			"img subtitle";
		grid-template-columns: min-content max-content;
		animation: fadeIn 1s ease-in-out;
	}

	@keyframes fadeIn {
		0% {
			opacity: 0;
			transform: translateY(-300px);
		}

		100% {
			opacity: 1;
		}
	}

	.intro__img {
		grid-area: img;
		min-width: 250px;
		position: relative;
		z-index: 2;
	}

	.section__subtitle--intro {
		align-self: start;
		grid-column: -1 / 1;
		grid-row: 2;
		text-align: right;
		position: relative;
		left: -1.5em;
		width: calc(100% + 1.5em);
	}

	.blinking-caret {
		display: inline-block;
		width: 2px; /* Ensures it doesn't cause shifting */
		background-color: var(--clr-light); /* Or the same color as your text */
		animation: blink 1s step-end infinite;
		height: 1em; /* Match the height of the text */
		vertical-align: text-bottom; /* Align the caret to the bottom of the text */
	  }
	  
	  
	  @keyframes blink {
		from, to { opacity: 1; }
		50% { opacity: 0; }
	  }
	  

	.about-me {
		display: grid;
		grid-template-columns: 1fr 200px;
		grid-template-areas:
			"title img"
			"subtitle img"
			"text img";
		column-gap: 2em;
		position: relative;
		z-index: 0;
	}

	.section__title--about {
		grid-area: title;
	}

	.section__subtitle--about {
		grid-column: 1 / -1;
		grid-row: 2;
		position: relative;
		left: -1em;
		width: 100%;
		padding-left: 1em;
		padding-right: calc(200px + 4em);
	}

	.about-me__img {
		grid-area: img;
		position: relative;
		z-index: 2;
	}

	.back-to-top {
		border-radius: 0.75rem;
		padding: 0.75rem;
	}

	.dark-mode-toggle {
		position: fixed;
		top: 5rem;
	}
}

@media (min-width: 800px) {

	:root {
		--fs-h1: 4.5rem;
		--fs-h2: 3.75rem;
		--fs-h3: 1.5rem;
		--fs-body: 1.125rem;
	}

	.skills {
		display: flex;
		justify-content: center;
		align-items: center;
		margin-left: auto;
		margin-right: auto;
	}

	.skill+.skill {
		margin-left: 2em;
	}
}