/*
Metodología BEM: https://en.bem.info/methodology/quick-start/
Generador de animaciones: https://animista.net/
Efectos de hover para botones y enlaces: https://ianlunn.github.io/Hover/
Loaders con CSS: https://css-loaders.com/
Sombras con CSS: https://getcssscan.com/css-box-shadow-examples
Frontend Code con ideas geniales: https://codepen.io/
==============================
  * CSS TABLE CONTENT *  
==============================
1. GOOGLE FONT
2. VARIABLES CSS
3. BASE
4. REUSABLE CSS CLASSES
5. HEADER & NAV
6. SECTIONS
7. MEDIA QUERYS
==============================
  * END TABLE CONTENT *  
==============================
*/

/* =============== VARIABLES ============== */

:root {
	/* Colors */
	--primary-color: #b733f9;
	--secondary-color: #ff7e5f;
	--third-color: #427982;
	--color-light: #f0f0f0;
	--color-lightest: #fff;
	--color-dark: #111;
	--color-shadow: #00000035;

	/* Text */
	--font-size-xl: 5rem;

	/* animations */
	--animation-timing-short: 0.3s ease-in-out;
	--animation-timing-large: 0.6s ease-in-out;
	--scroll-animation-range: entry 10% cover 20%;
}

/* =============== RESET ============== */
html {
	scroll-behavior: smooth;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	background-color: var(--color-light);
	font-family: 'Onest', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
		Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
	font-optical-sizing: auto;
	color: var(--color-dark);
	overflow-x: hidden;

	a {
		text-decoration: none;
		color: var(--color-light);
	}

	ul {
		list-style: none;
		padding: 0;
		margin: 0;
	}

	figure {
		margin: 0;
		position: relative;
		figcaption {
			position: absolute;
			left: 1rem;
			bottom: 1rem;
			color: var(--primary-color);
		}
	}

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

/* ============= REUSABLE CLASES ============ */
.flex--container {
	display: flex;
	justify-content: center;
	align-items: center;
}

.section {
	max-width: 992px;
	margin: 0 auto;
	position: relative;
	padding: 3rem 1rem 2rem;
	.section__title {
		font-size: 2rem;
	}
	p {
		color: var(--color-dark);
		line-height: 24px;
	}
}

.card--base {
	background-color: var(--color-lightest);
	border-radius: 10px;
	box-shadow: 0 5px 15px var(--color-shadow);
	transition: all var(--animation-timing-short);
	overflow: hidden;
}

.btn {
	display: inline-block;
	padding: 0.8rem 1.5rem;
	background-color: var(--secondary-color);
	color: var(--color-light);
	text-decoration: none;
	border-radius: 50px;
	font-weight: bold;
	transition: var(--animation-timing-short);
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 8px var(--color-shadow);
	&:hover {
		background-color: #ff6a45;
		transform: translateY(-3px);
		box-shadow: 0 6px 12px var(--color-shadow);
	}
}

/* ============= NAVBAR ============ */

.header {
	width: 100%;
	position: fixed;
	top: 0;
	left: 0;
	z-index: 5;
	backdrop-filter: blur(10px);
	background-color: #ffffff9a;
	h1 {
		position: absolute;
		animation: moveText linear both;
		animation-timeline: scroll();
		animation-range: 0 400px;
	}

	.btn {
		position: absolute;
		top: 0.5rem;
		right: 1rem;
		width: 50px;
		height: 50px;
		padding: 0.5rem;
		&.btn--login {
			right: 4.5rem;
		}
	}
}

.nav__container {
	position: relative;
	z-index: 3;
	height: 100dvh;
	width: 100%;
	background: url(../img/logo-paw-white.svg) center center / 30% no-repeat,
		var(--third-color);
	animation: resize linear both;
	animation-timeline: scroll();
	animation-range: 0 400px;
}

.nav__links {
	position: fixed;
	top: -700%;
	left: 0;
	width: 100%;
	height: 50dvh;
	z-index: 4;
	flex-direction: column;
	gap: 1rem;
	background-color: #f00;
	border-radius: 0 0 100% 100%;
	opacity: 0;
	transition: var(--animation-timing-large);
	&::before {
		content: '';
		position: absolute;
		top: -10px;
		background-color: var(--color-dark);
		width: 10px;
		height: 100%;
		border-radius: 5px;
	}

	li {
		transition: var(--animation-timing-short);
		z-index: 1;

		a {
			font-weight: bold;
			width: 8rem;
			height: 2rem;
			text-align: center;
		}

		&:nth-child(1) {
			background-color: #23b1d8;
			&:hover {
				box-shadow: 0 0 2rem #23b1d8;
				scale: 1.1;
			}
		}

		&:nth-child(2) {
			background-color: #dc5fe2;
			&:hover {
				box-shadow: 0 0 2rem #dc5fe2;
				scale: 1.1;
			}
		}

		&:nth-child(3) {
			background-color: #a0de59;
			&:hover {
				box-shadow: 0 0 2rem #a0de59;
				scale: 1.1;
			}
		}

		&:nth-child(4) {
			background-color: #83d1ad;
			&:hover {
				box-shadow: 0 0 2rem #83d1ad;
				scale: 1.1;
			}
		}

		&:nth-child(5) {
			background-color: #f7b500;
			&:hover {
				box-shadow: 0 0 2rem #f7b500;
				scale: 1.1;
			}
		}
	}
	.btn--close {
		background-color: var(--primary-color);
		text-align: center;
		line-height: 0;
		width: 30px;
		height: 30px;
		a {
			font-size: 1.5rem;
		}
	}
	&:target {
		top: 0;
		opacity: 1;
	}
}

.nav__scroll {
	position: absolute;
	bottom: 3rem;
	gap: 5px;
	padding-top: 24px;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--color-light);
}

.name {
	position: relative;
	display: flex;

	&.section__title {
		--font-size-xl: 2.5rem;
		font-size: var(--font-size-xl);
	}

	.name__hover {
		position: relative;
		cursor: pointer;

		span {
			font-size: var(--font-size-xl);
			font-weight: 700;
			-webkit-text-stroke: 2px var(--color);
			color: transparent;

			transition: var(--animation-timing-large);
		}

		&:hover span {
			opacity: 0;
		}
		&:hover::before {
			height: 120%;
			filter: drop-shadow(0 0 2rem var(--color));
		}

		&::before {
			content: attr(data-text);
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			font-size: var(--font-size-xl);
			height: 0;
			font-weight: 700;
			overflow: hidden;
			transition: var(--animation-timing-large);
			text-align: center;
			color: var(--color);
		}
	}
}

@keyframes resize {
	to {
		height: 2rem;
		width: 2rem;
		margin: 1rem;
		border-radius: 24px;
		background: url(../img/logo-paw-white.svg) center center/ 80% no-repeat,
			var(--primary-color);

		--font-size-xl: 2.2rem;
		font-size: var(--font-size-xl);
	}
}

@keyframes moveText {
	to {
		left: 2.3rem;
	}
}

/* =============== HERO ============== */
.hero {
	height: 100dvh;
	width: 100dvw;
	flex-direction: column;
	background: linear-gradient(#b733f98c, #ff7e5f8c, transparent),
		url(../img/hero-dog.avif) no-repeat center center/cover;
	color: var(--color-light);
	text-align: center;
	position: relative;
	margin-top: 500px;

	animation: heroDisappear auto linear forwards;
	animation-timeline: scroll(root);
	animation-range: 500px 1100px;

	view-timeline-name: --hero;
	view-timeline-axis: block;
	.hero__content {
		max-width: 800px;
		padding: 0 2rem;
		animation: fadeInUp 1s ease forwards;
		animation-timeline: view();
		animation-range: entry;
	}
	h2 {
		margin-bottom: 1rem;
		text-shadow: 2px 2px 4px var(--color-shadow);
	}
	p {
		font-size: 1.5rem;
		margin-bottom: 2rem;
		text-shadow: 2px 2px 4px var(--color-shadow);
	}
}

@keyframes heroDisappear {
	to {
		opacity: 0;
		overflow: hidden;
	}
}

/* ================= SERVICES ================= */
.services__container {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 2rem;
}

.service__card {
	animation: slideIn both ease-in;
	animation-timeline: view();
	animation-range: var(--scroll-animation-range);

	.service__content {
		padding: 1.5rem;
		h3 {
			margin-bottom: 1rem;
			color: var(--primary-color);
		}
	}

	.service__img {
		height: 200px;
		overflow: hidden;
		img {
			width: 100%;
			height: 100%;
			object-fit: cover;
			transition: transform var(--animation-timing-large);
		}
	}

	&:nth-child(odd) {
		--slide-distance: -30px;
	}

	&:nth-child(even) {
		--slide-distance: 30px;
	}

	&:hover {
		transform: translateY(-10px);
		box-shadow: 0 15px 30px var(--color-shadow);

		.service__img img {
			transform: scale(1.1);
		}
	}
}

/* ================= CLIENTS ================= */

.clients__cards {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	view-timeline-name: --stack-cards;
}

.clients__card {
	width: 100%;
	height: 80dvh;
	aspect-ratio: 1/1;
	border-radius: 1.5rem;
	flex-direction: column;
	color: var(--color-dark);
	font-size: 24px;
	font-weight: 700;
	position: sticky;
	top: 48px;

	view-timeline-name: --card-fade;
	view-timeline-axis: block;
	animation-timeline: --card-fade;
	animation-name: fade-in;
	animation-range: entry 0% cover 42%;
	&:nth-child(1) {
		--max-scale: 0.7;
		--final-bg: #555;
		padding-top: 32px;

		.card__container {
			animation-range: exit-crossing 0% exit-crossing 25%;
		}
	}
	&:nth-child(2) {
		--max-scale: 0.8;
		--initial-range: 25%;
		--final-range: 50%;
		--final-bg: #888;
		padding-top: 64px;

		.card__container {
			animation-range: exit-crossing 25% exit-crossing 50%;
		}
	}
	&:nth-child(3) {
		--max-scale: 0.9;
		--initial-range: 50%;
		--final-range: 75%;
		--final-bg: #bbb;
		padding-top: 96px;

		.card__container {
			animation-range: exit-crossing 50% exit-crossing 75%;
		}
	}

	&:nth-child(4) {
		--max-scale: 1;
		--initial-range: 75%;
		--final-range: 100%;
		--final-bg: #eee;
		padding-top: 128px;

		.card__container {
			animation-range: exit-crossing 75% exit-crossing 100%;
		}
	}
}

.card__container {
	background-color: var(--color-lightest);
	width: 100%;
	height: inherit;
	border-radius: 24px;
	flex-direction: column;
	justify-content: space-between;

	color: var(--color-dark);
	transform-origin: center top;
	animation: linear scale forwards;
	animation-timeline: --stack-cards;
	box-shadow: 0 5px 15px var(--color-shadow);
	overflow: hidden;

	span {
		font-size: 20px;
		font-weight: normal;
		color: #333;
		padding-bottom: 0.5rem;
	}

	h3 {
		margin: 0.5rem 0;
		font-size: 2rem;
		font-weight: 900;
		color: var(--primary-color);
	}

	img {
		object-fit: cover;
		width: 100%;
		height: 80%;
	}
}

@keyframes fade-in {
	from {
		opacity: 0;
		transform: translateY(48px) scale(0.9);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes scale {
	to {
		background-color: var(--final-bg, var(--color-lightest));
		transform: scale(var(--max-scale, 1));
	}
}

/* ================= TEAM ================= */
.team {
	position: relative;
}

.team__scroll {
	--viewport-width: 100dvw;
	--max-scroll-distance: calc((var(--viewport-width) * -3) + 144px - 72px);

	display: flex;
	height: calc(var(--viewport-width) * 4);
	view-timeline-name: --section-pin-tl;
	view-timeline-axis: block;
}

.team__scroll--horizontal {
	position: sticky;
	top: 0;
	padding: 80px 0 24px;
	gap: 24px;
	height: 100dvh;
	width: calc(var(--viewport-width) * 4);

	animation: linear move forwards;
	animation-timeline: --section-pin-tl;
	animation-range: contain 0% contain 100%;
}

.team__card {
	position: relative;
	height: 100%;
	width: calc(var(--viewport-width) - 48px);
	max-width: 992px;
	flex-direction: column;
	justify-content: space-between;
	overflow: hidden;
	gap: 1rem;

	.team__card--img {
		height: 70%;
		width: 100%;

		img {
			border-radius: 10px 10px 0 0;
			border: 4px solid var(--primary-color);
			width: 100%;
			height: 100%;
			object-fit: cover;
		}
	}

	.team__card--info {
		width: 100%;
		padding: 1.5rem;

		span {
			font-size: 1.2rem;
			font-weight: 700;
			background-color: #fff1;
			border-radius: 100%;
			color: #aaa;
		}
		h3 {
			font-size: 1.5rem;
			color: var(--primary-color);
			margin: 0;
		}
		p {
			font-size: 1rem;
		}
	}
}

@keyframes move {
	to {
		transform: translateX(var(--max-scroll-distance));
	}
}

/* ================= CONTACT ================= */
.contact__container {
	flex-wrap: wrap;
	gap: 3rem;
	flex: 1 1 940px;
}

.contact__info {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	flex: 1 1 300px;
	.contact__item {
		display: flex;
		align-items: flex-start;
		gap: 1rem;

		animation: horizontalLeftEntry both ease-in;
		animation-timeline: view();
		animation-range: var(--scroll-animation-range);

		.contact__icon {
			font-size: 1.5rem;
			color: var(--primary-color);
		}
		.contact__text h3 {
			margin-bottom: 0.5rem;
		}

		&:nth-child(1) {
			animation-delay: 0s;
		}
		&:nth-child(2) {
			animation-delay: 0.1s;
		}
		&:nth-child(3) {
			animation-delay: 0.2s;
		}
		&:nth-child(4) {
			animation-delay: 0.3s;
		}
	}
}

.contact__form {
	flex: 1 1 300px;
	background-color: var(--color-lightest);
	padding: 2rem;
	border-radius: 10px;
	box-shadow: 0 5px 15px var(--color-shadow);

	animation: formEntry both ease-in;
	animation-timeline: view();
	animation-range: entry 10% cover 30%;
}

@keyframes formEntry {
	from {
		opacity: 0;
		transform: translateY(50px) rotateX(30deg);
	}
	to {
		opacity: 1;
		transform: translateY(0) rotateX(0);
	}
}

.form__group {
	margin-bottom: 1.5rem;
	label {
		display: block;
		margin-bottom: 0.5rem;
		font-weight: 500;
	}
	input,
	textarea {
		width: 100%;
		padding: 0.8rem;
		border: 1px solid #ddd;
		border-radius: 5px;
		font-size: 1rem;
		transition: var(--animation-timing-short);
		&:focus {
			outline: none;
			border-color: var(--primary-color);
			box-shadow: 0 0 0 3px #4e8cff33;
		}
	}

	textarea {
		height: 150px;
		resize: none;
	}
}

/* ============= FOOTER ============ */

.footer {
	background-color: var(--third-color);
	color: var(--color-lightest);
	padding: 3rem 2rem;
	text-align: center;
}

.footer__content {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 2rem;
	margin-bottom: 2rem;
}

.footer__logo {
	display: flex;
	flex-direction: column;
	align-items: center;

	animation: footerLogoEntry both ease-in;
	animation-timeline: view();
	animation-range: var(--scroll-animation-range);
	img {
		height: 60px;
		margin-bottom: 1rem;
	}
}

.footer__links,
.footer__social {
	h3 {
		margin-bottom: 1.5rem;
		color: var(--secondary-color);
	}
}

.footer__links {
	li {
		margin-bottom: 0.5rem;

		--slide-distance: 30px;
		animation: slideIn both ease-in;
		animation-timeline: view();
		animation-range: var(--scroll-animation-range);
		&:nth-child(1) {
			animation-delay: 0s;
		}
		&:nth-child(2) {
			animation-delay: 0.1s;
		}
		&:nth-child(3) {
			animation-delay: 0.2s;
		}
		&:nth-child(4) {
			animation-delay: 0.3s;
		}
		&:nth-child(5) {
			animation-delay: 0.4s;
		}
	}
	a {
		color: var(--color-lightest);
		transition: color var(--animation-timing-short);
		&:hover {
			color: var(--secondary-color);
		}
	}
}

.footer__social--icons {
	display: flex;
	justify-content: center;
	gap: 1rem;
	a {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		background-color: #fff1;
		border-radius: 50%;
		color: var(--color-lightest);
		font-size: 1.2rem;
		transition: var(--animation-timing-short);

		animation: socialIconEntry both ease-in;
		animation-timeline: view();
		animation-range: var(--scroll-animation-range);
		&:nth-child(1) {
			animation-delay: 0s;
		}
		&:nth-child(2) {
			animation-delay: 0.1s;
		}
		&:nth-child(3) {
			animation-delay: 0.2s;
		}
		&:nth-child(4) {
			animation-delay: 0.3s;
		}
		&:hover {
			background-color: var(--secondary-color);
			transform: translateY(-3px);
		}
	}
}

.footer__copyright {
	padding-top: 20rem;
	border-top: 1px solid #fff1;

	animation: copyrightEntry both ease-in;
	animation-timeline: view();
	animation-range: var(--scroll-animation-range);
}

@keyframes footerLogoEntry {
	from {
		opacity: 0;
		transform: translateY(30px) rotate(-10deg);
	}
	to {
		opacity: 1;
		transform: translateY(0) rotate(0);
	}
}

@keyframes socialIconEntry {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.5);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes copyrightEntry {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ============= ANIMATIONS ============ */

@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateX(var(--slide-distance, 30px));
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* ================= MEDIA QUERYS ================= */

@media (width > 868px) {
	:root {
		--font-size-xl: 15rem;
	}

	.team__scroll {
		--viewport-width: 992px;
	}
}
