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

body {
	font-family: 'Roboto',sans-serif;
	color: #585656;
	background: #000;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
	max-width: 100vw;
}

main {
	display: flex;
	overflow: hidden;
	overflow-x: hidden;
	height: 100vh;
	max-width: 100vw;
	width: 100%;
}

a {
	text-decoration: none;
	color: #6dcc9e;
	outline: none;
	cursor: pointer;
}

a:hover {
	color: #fff;
}

a:focus {
	outline: none;
}

.hidden {
	position: absolute;
	overflow: hidden;
	width: 0;
	height: 0;
	pointer-events: none;
}

.js .loading {
	position: fixed;
	z-index: 100;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #232323;
	transition: opacity 0.3s;
}

.js .loading--hide {
	pointer-events: none;
	opacity: 0;
}

.js .loading::after {
	content: '- - -';
	font-family: 'Roboto Mono', monospace;
	font-size: 1.5em;
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	height: 100%;
	animation: animLoader 1s infinite alternate forwards;
}

@keyframes animLoader {
	0% {
		content: '- - -';
	}
	25% {
		content: 'd - -';
	}
	50% {
		content: '- - c';
	}
	75% {
		content: '- / -';
	}
	100% {
		content: 'd - c';
	}
}

.github {
	font-size: 0.875em;
	margin: 0 2em 0 auto;
}

.btn {
	border: none;
	background: none;
}

.btn:focus {
	outline: none;
}

.btn--menu {
	font-size: 1em;
	margin: 0 0 0 2em;
	padding: 0;
	color: #585656;
}

.btn--menu .icon--menu-alt,
.btn--menu.mode--code .icon--menu {
	display: none;
}

.btn--menu.mode--code .icon--menu-alt {
	display: block;
}

/* Icons */
.icon {
	display: block;
	width: 1.5em;
	height: 1.5em;
	margin: 0 auto;
	fill: currentColor;
}

/* Content */
.content,
.content__inner {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 100%;
	height: 100%;
	overflow-x: hidden;
	box-sizing: border-box;
}

.content__inner {
	z-index: 100;
	flex-direction: column;
	align-content: flex-start;
	padding: 2.5em 2.5em 0;
}

.content__top {
	display: flex;
	align-items: center;
	flex: none;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.title {
	font-size: 1em;
	font-weight: normal;
	line-height: 1;
	display: flex;
	align-items: center;
	height: 1.75em;
	margin: 0;
}

.title__inner.mode--design {
	font-size: 1.5em;
}

.title__inner.mode--code {
	text-transform: lowercase;
}

.controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1em;
	width: auto;
	margin: 1em 0 0 auto;
}

.social-icon {
	color: #484545;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.3s ease;
	text-decoration: none;
}

.social-icon:hover {
	color: #fff;
}

.social-icon .icon {
	width: 1.5em;
	height: 1.5em;
	fill: currentColor;
}

/* Mudança de cor no modo code */
.content__inner.mode--code .social-icon {
	color: #e04643;
}

.content__inner.mode--code .social-icon:hover {
	color: #fff;
}

.mode--code,
.menu--code .menu__link {
	font-family: 'Roboto Mono', monospace;
	text-transform: lowercase;
	color: #e04643;
}

.menu {
	font-size: 1.85em;
	flex: none;
	width: 100%;
	margin: 2em 0 0 auto;
	text-align: right;
}

.menu__inner {
	margin: 0;
	padding: 0;
	list-style: none;
}

.menu--code {
	font-size: 1em;
	flex: none;
	width: 100%;
	margin: auto 0 2em 0;
	text-align: left;
}

.menu:not(.menu--code) .menu__item {
	position: relative;
}

.menu__item:not(:last-child) {
	margin: 0 0 0.25em 0;
}

.js .menu--code {
	display: none;
}

.menu__link {
	display: inline-block;
}

.menu--code .menu__link:hover {
	color: #fff;
}

.content__bottom {
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 100%;
	margin: auto 0 0 0;
	position: relative;
	overflow-x: hidden;
	/* Isolar o layout para evitar que transforms internos afetem o posicionamento */
	contain: layout style;
	min-height: 64px;
	/* Garantir que o layout não seja recalculado quando elementos filhos têm transform */
	will-change: auto;
	/* A largura será fixada via JavaScript após o carregamento */
	box-sizing: border-box;
}

.switch {
	position: relative;
	display: flex;
	align-items: center;
	flex-shrink: 1;
	min-width: 0;
	max-width: 100%;
	/* A largura será fixada via JavaScript após o carregamento */
	box-sizing: border-box;
	/* Isolar do layout para evitar que transforms internos afetem o posicionamento */
	contain: layout style;
}

.switch__content {
	display: flex;
}

.switch__item {
	line-height: 1;
	position: relative;
	display: inline-block;
	margin: 0 1.5em 0 0;
	padding: 0 0 0.15em;
	color: #585656;
}

.switch__item span {
	position: relative;
	display: inline-block;
	pointer-events: none;
}

/* Isolar elementos com glitch do layout para evitar deslocamento */
.switch__item[data-switch],
.switch__item span[data-switch],
.contact-link[data-switch] {
	position: relative;
	display: inline-block;
	will-change: transform;
	backface-visibility: hidden;
	/* Criar um novo contexto de empilhamento e isolar do layout */
	transform: translateZ(0);
	isolation: isolate;
	/* Garantir que o transform não afete o espaço ocupado */
	transform-origin: center center;
	/* Garantir que o elemento mantenha seu espaço no layout mesmo com transform */
	contain: layout style paint;
}

/* Garantir que o transform não mova o elemento no fluxo */
.switch__item[data-glitch],
.switch__item span[data-glitch],
.contact-link[data-glitch] {
	position: relative;
	z-index: 1;
	/* Forçar que o transform seja aplicado em um contexto isolado */
	transform-style: preserve-3d;
	/* Garantir que o elemento mantenha seu espaço no layout */
	display: inline-block;
	vertical-align: baseline;
	/* Garantir que o transform não afete o tamanho do container pai */
	contain: layout style paint;
	text-align: end;
}

.switch__item--current {
	pointer-events: none;
	color: #232323;
	background-color: #6dcc9e;
}

.mode--code .switch__item--current {
	color: #232323;
	background-color: #e04643;
}

.switch__item:first-child::after {
	content: '';
	position: absolute;
	top: -5%;
	left: calc(100% + 0.75em);
	width: 1px;
	height: 110%;
	background: #464646;
	transform: rotate(22.5deg);
}

.link-wrap {
	display: flex;
	justify-content: flex-start;
	align-items: flex-end;
	height: 4em;
	margin: 0 0 0 auto;
	flex-shrink: 1;
	min-width: 0;
	max-width: 100%;
	/* A largura será fixada via JavaScript após o carregamento */
	box-sizing: border-box;
	/* Isolar do layout para evitar que transforms internos afetem o posicionamento */
	contain: layout style;
}

.contact-link {
	display: inline-block;
	padding: 1em 0;
	min-width: 149px;
	max-width: 149px;
	box-sizing: border-box;
}

.mode--code .contact-link {
	text-align: right;
}

/* Logo Carousel */
.logo-carousel-wrapper {
	position: relative;
	flex: 1;
	overflow: hidden;
	margin: 0 2em;
	height: 64px;
	cursor: none;
	min-width: 0;
	max-width: 100%;
	flex-shrink: 1;
	box-sizing: border-box;
}

.logo-carousel-wrapper * {
	pointer-events: none !important;
}

.logo-carousel {
	display: flex;
	width: 100%;
	height: 100%;
	position: relative;
}

.logo-carousel__track {
	display: flex;
	align-items: center;
	gap: 3em;
	/* Animação será aplicada via JavaScript para velocidade fixa */
	white-space: nowrap;
	flex-shrink: 0;
	will-change: transform;
}

.logo-carousel__item {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-width: 90px;
}

.logo-carousel__item img {
	max-height: 30px;
	max-width: 120px;
	width: auto;
	height: auto;
	object-fit: contain;
	filter: grayscale(100%) brightness(0) invert(1);
	opacity: 0.1;
	pointer-events: none;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	-webkit-user-drag: none;
	-khtml-user-drag: none;
	-moz-user-drag: none;
	-o-user-drag: none;
}

.logo-carousel__gradient {
	position: absolute;
	top: 0;
	width: 120px;
	height: 100%;
	z-index: 10;
	pointer-events: none;
}

.logo-carousel__gradient--left {
	left: 0;
	background: linear-gradient(to right, #000 0%, rgba(0, 0, 0, 0) 100%);
}

.logo-carousel__gradient--right {
	right: 0;
	background: linear-gradient(to left, #000 0%, rgba(0, 0, 0, 0) 100%);
}

/* Modo Code: degradê com cor de fundo do overlay */
.content__bottom .switch.mode--code ~ .logo-carousel-wrapper .logo-carousel__gradient--left {
	background: linear-gradient(to right, rgb(6, 4, 18) 0%, rgba(6, 4, 18, 0) 100%);
}

.content__bottom .switch.mode--code ~ .logo-carousel-wrapper .logo-carousel__gradient--right {
	background: linear-gradient(to left, rgb(6, 4, 18) 0%, rgba(6, 4, 18, 0) 100%);
}

@keyframes scroll {
	0% {
		transform: translateX(0);
	}
	100% {
		transform: translateX(-50%);
	}
}


/* Mobile: 4 itens visíveis */
@media screen and (max-width: 767px) {
	.logo-carousel-wrapper {
		margin: 0 1em;
		height: 48px;
	}
	
	.logo-carousel__track {
		gap: 2em;
	}
	
	.logo-carousel__item img {
		max-height: 36px;
		max-width: 80px;
	}
	
	.logo-carousel__gradient {
		width: 60px;
	}
}

.overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	background: 	rgb(26, 23, 88, .20);
	opacity: 0;
}

@media screen and (max-height: 38.5em) {
	.menu {
		text-align: left;
	}
}

@media screen and (max-width: 40em) {
	.content__top {
		font-size: 0.5em;
	}
	.content__bottom {
		font-size: 0.85em;
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-rows: auto auto;
		gap: 1em;
		align-items: center;
	}
	.content__bottom .logo-carousel-wrapper {
		grid-row: 1;
		grid-column: 1 / -1;
		margin: 0;
		width: 100%;
	}
	.content__bottom .switch {
		grid-row: 2;
		grid-column: 1;
		justify-self: start;
		margin: 0;
		width: auto;
	}
	.content__bottom .link-wrap {
		grid-row: 2;
		grid-column: 2;
		justify-self: end;
		margin: 0;
		width: auto;
		height: auto;
	}
	.menu {
		font-size: 1em;
	}
	.content__inner {
		padding: 1em 1em 0;
	}
}

/* Layout responsivo para telas médias - reorganiza quando não há espaço suficiente */
@media screen and (max-width: 60em) and (min-width: 40.01em) {
	.content__bottom {
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-rows: auto auto;
		gap: 1em;
		align-items: start;
	}
	.content__bottom .logo-carousel-wrapper {
		grid-row: 1;
		grid-column: 1 / -1;
		width: 100%;
		margin: 0;
	}
	.content__bottom .switch {
		grid-row: 2;
		grid-column: 1;
		justify-self: start;
		margin: 0;
		width: auto;
	}
	.content__bottom .link-wrap {
		grid-row: 2;
		grid-column: 2;
		justify-self: end;
		margin: 0;
		width: auto;
		height: auto;
	}
}
