/*
 * Additions on top of the Luique theme: typed hero roles, tech marquee,
 * scroll progress, back-to-top, availability badge and small polish.
 */

:root {
	--accent: #29a587;
	--line: #000;
	--shadow: rgba(0, 0, 0, 0.2);
	--surface: #fff;
	--text: #000;
	/* Colour where the template's section gradients meet (see .lui-gradient-*). */
	--section-edge: #fff;
}

.dark-skin {
	--line: #a3a5a7;
	--shadow: rgba(255, 255, 255, 0.1);
	--surface: #1d222a;
	--text: #fff;
	--section-edge: #31363c;
}

::selection {
	background: var(--accent);
	color: #fff;
}

html {
	scroll-behavior: smooth;
}

/* - Hero typed roles */

.role-typer {
	display: inline-block;
	white-space: nowrap;
}

.role-typer__caret {
	display: inline-block;
	width: 3px;
	height: 1.05em;
	margin-left: 4px;
	vertical-align: text-bottom;
	background: var(--accent);
	animation: caret-blink 1s steps(1) infinite;
}

@keyframes caret-blink {
	50% {
		opacity: 0;
	}
}

.lui-started .bts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 20px;
	margin-top: 40px;
}

/* - Tech marquee */
.tech-marquee-wrap {
	position: relative;
	z-index: 2;
	padding: 50px 0 90px;
	overflow: hidden;
	background: var(--section-edge);
}

.tech-marquee {
	padding: 34px 0;
	overflow: hidden;
	background: var(--accent);
	border-top: 2px solid var(--line);
	border-bottom: 2px solid var(--line);
	transform: rotate(-2deg) scale(1.04);
	backface-visibility: hidden;
}

.tech-marquee__row {
	display: flex;
	width: max-content;
	animation: marquee 45s linear infinite;
	will-change: transform;
	backface-visibility: hidden;
}

.tech-marquee__row + .tech-marquee__row {
	margin-top: 16px;
}

.tech-marquee__row.reverse {
	animation-direction: reverse;
	animation-duration: 55s;
}

.tech-marquee:hover .tech-marquee__row {
	animation-play-state: paused;
}

.tech-marquee__track {
	display: flex;
	gap: 16px;
	margin: 0;
	padding: 0 16px 0 0;
	list-style: none;
}

.tech-marquee__item {
	padding: 8px 22px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--text);
	background: var(--surface);
	border: 2px solid var(--line);
	border-radius: 30px;
	box-shadow: 4px 4px var(--shadow);
	transition: transform 0.3s cubic-bezier(0.3, 0, 0.3, 1);
}

.tech-marquee__item:hover {
	transform: translateY(-3px) rotate(-3deg);
}

@keyframes marquee {
	from {
		transform: translate3d(0, 0, 0);
	}

	to {
		transform: translate3d(-50%, 0, 0);
	}
}

/* - Scroll progress and back to top */

.scroll-progress {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 1001;
	width: 100%;
	height: 3px;
	background: var(--accent);
	transform-origin: 0 50%;
	pointer-events: none;
}

.back-to-top {
	position: fixed;
	right: 30px;
	bottom: 30px;
	z-index: 998;
	display: grid;
	place-items: center;
	width: 54px;
	height: 54px;
	padding: 0;
	color: var(--text);
	background: var(--surface);
	border: 2px solid var(--line);
	border-radius: 50%;
	box-shadow: 4px 4px var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(20px);
	transition: all 0.4s cubic-bezier(0.3, 0, 0.3, 1);
	cursor: pointer;
}

.back-to-top.visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.back-to-top:hover {
	color: #fff;
	background: var(--accent);
	transform: translateY(-4px);
}

.back-to-top svg {
	position: absolute;
	inset: -2px;
	width: calc(100% + 4px);
	height: calc(100% + 4px);
	transform: rotate(-90deg);
}

.back-to-top circle {
	fill: none;
	stroke-width: 3;
}

.back-to-top .track {
	stroke: transparent;
}

.back-to-top .fill {
	stroke: var(--accent);
	stroke-linecap: round;
	transition: stroke-dashoffset 0.1s linear;
}

.back-to-top:hover .fill {
	stroke: #fff;
}

.back-to-top i {
	position: relative;
	font-size: 16px;
}

/* - Skill bars fill in when they scroll into view */

.skills-item:not(.animate__active) .dots .dot {
	width: 0 !important;
}

.skills-item .dots .dot {
	transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* - Availability badge */

.status-dot {
	position: relative;
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 10px;
	border-radius: 50%;
	background: var(--accent);
	vertical-align: middle;
}

.status-dot:after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--accent);
	animation: status-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes status-ping {
	75%,
	100% {
		transform: scale(2.6);
		opacity: 0;
	}
}

/* - Project cards: lift on hover */

.works-item {
	transition: transform 0.5s cubic-bezier(0.3, 0, 0.3, 1);
}

.works-item:hover {
	transform: translateY(-6px);
}

.works-item .image img {
	transition: transform 0.8s cubic-bezier(0.3, 0, 0.3, 1);
}

.works-item:hover .image img {
	transform: scale(1.04);
}

/* - Pointer effects (src/effects.js sets the custom properties) */

.services-item:after,
.works-item:after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	background: radial-gradient(
		420px circle at var(--spot-x, 50%) var(--spot-y, 50%),
		rgba(41, 165, 135, 0.16),
		transparent 60%
	);
	opacity: 0;
	transition: opacity 0.4s ease;
}

.services-item:hover:after,
.works-item:hover:after {
	opacity: 1;
}

.works-item .image .img > a {
	display: block;
	transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
	transition: transform 0.4s cubic-bezier(0.3, 0, 0.3, 1);
	will-change: transform;
}

a.btn,
.btn {
	translate: var(--magnet-x, 0) var(--magnet-y, 0);
	transition: all 0.7s cubic-bezier(0.3, 0, 0.3, 1), translate 0.25s ease-out;
}

/* - Hero portrait: parallax depth, hover pop, speech bubble */

.hero-portrait > * {
	transition: translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), scale 0.5s cubic-bezier(0.3, 0, 0.3, 1),
		rotate 0.8s cubic-bezier(0.3, 0, 0.3, 1);
}

.section.hero-started .hero-portrait__face {
	position: absolute;
	inset: 0;
	z-index: 10;
	width: 100%;
	height: 100%;
	padding: 0;
	line-height: 1;
	border: 0;
	border-radius: 380px;
	background: none;
	box-shadow: none;
	overflow: visible;
	transform-origin: 50% 100%;
	translate: calc(var(--px, 0) * 14px) calc(var(--py, 0) * 10px);
}

.section.hero-started .hero-portrait__face:before,
.section.hero-started .hero-portrait__face:after {
	display: none;
}

.section.hero-started .hero-portrait__face:hover {
	scale: 1.035;
}

.section.hero-started .hero-portrait__face:active {
	scale: 0.98;
	transition-duration: 0.9s, 0.1s, 0.8s;
}

.section.hero-started .hero-portrait__face:focus-visible {
	outline: 3px dashed var(--accent) !important;
	outline-offset: 6px;
}

.hero-portrait .circle.circle-1 {
	translate: calc(var(--px, 0) * 6px) calc(var(--py, 0) * 6px);
}

.hero-portrait__face:hover ~ .circle.circle-1 {
	scale: 0.965;
}

.hero-portrait .circle.img-1 {
	translate: calc(var(--px, 0) * -28px) calc(var(--py, 0) * -20px);
}

.hero-portrait .circle.img-2 {
	translate: calc(var(--px, 0) * 32px) calc(var(--py, 0) * 24px);
}

.hero-portrait .circle.img-3 {
	translate: calc(var(--px, 0) * -22px) calc(var(--py, 0) * 28px);
}

.hero-portrait__face:hover ~ .circle.img-1,
.hero-portrait__face:hover ~ .circle.img-3 {
	rotate: 20deg;
}

.hero-portrait__face:hover ~ .circle.img-2 {
	rotate: -20deg;
}

.hero-portrait .info-list {
	translate: calc(var(--px, 0) * 22px) calc(var(--py, 0) * 16px);
}

.hero-portrait__bubble {
	position: absolute;
	top: 70px;
	left: 10px;
	z-index: 13;
	padding: 12px 22px;
	font-size: 16px;
	font-weight: 700;
	white-space: nowrap;
	color: var(--text);
	background: var(--surface);
	border: 2px solid var(--line);
	border-radius: 24px;
	box-shadow: 5px 5px var(--shadow);
	pointer-events: none;
	transform-origin: 85% 100%;
	animation: bubble-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.hero-portrait__bubble:after {
	content: "";
	position: absolute;
	right: 34px;
	bottom: -10px;
	width: 16px;
	height: 16px;
	background: var(--surface);
	border-right: 2px solid var(--line);
	border-bottom: 2px solid var(--line);
	transform: rotate(45deg);
}

@keyframes bubble-pop {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.6) rotate(-6deg);
	}
}

/* - Plain buttons (undo the template's global button styling) */

button.copy-btn,
button.cmdk__item,
button.cmdk-hint {
	height: auto;
	padding: 0;
	line-height: inherit;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	color: inherit;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	overflow: visible;
}

button.copy-btn:before,
button.cmdk__item:before,
button.cmdk-hint:before {
	display: none;
}

button.copy-btn:hover,
button.cmdk__item:hover,
button.cmdk-hint:hover {
	color: inherit;
}

/* - Contact extras */

button.copy-btn {
	margin-left: 10px;
	width: 30px;
	height: 30px;
	line-height: 26px;
	text-align: center;
	font-size: 13px;
	vertical-align: middle;
	border: 2px solid var(--line);
	border-radius: 50%;
	box-shadow: 3px 3px var(--shadow);
	transition: transform 0.3s cubic-bezier(0.3, 0, 0.3, 1), background 0.3s ease, color 0.3s ease;
}

button.copy-btn:hover {
	color: #fff;
	background: var(--accent);
	transform: translateY(-2px) rotate(-8deg);
}

.local-time {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	opacity: 0.7;
}

/* - Section dots */

.section-dots {
	position: fixed;
	top: 50%;
	right: 28px;
	z-index: 90;
	display: flex;
	flex-direction: column;
	gap: 14px;
	transform: translateY(-50%);
}

.section-dots a {
	position: relative;
	display: block;
	width: 12px;
	height: 12px;
	border: 2px solid var(--line);
	border-radius: 50%;
	transition: background 0.3s ease, transform 0.3s cubic-bezier(0.3, 0, 0.3, 1), border-color 0.3s ease;
}

.section-dots a:hover {
	transform: scale(1.3);
}

.section-dots a.active {
	background: var(--accent);
	border-color: var(--accent);
	transform: scale(1.35);
}

.section-dots__label {
	position: absolute;
	top: 50%;
	right: 22px;
	padding: 3px 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--text);
	background: var(--surface);
	border: 2px solid var(--line);
	border-radius: 20px;
	opacity: 0;
	pointer-events: none;
	transform: translate(6px, -50%);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.section-dots a:hover .section-dots__label {
	opacity: 1;
	transform: translate(0, -50%);
}

@media (max-width: 1199px) {
	.section-dots {
		display: none;
	}
}

/* - Command palette */

.cmdk {
	position: fixed;
	inset: 0;
	z-index: 1001;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 14vh 16px 16px;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(6px);
	animation: cmdk-fade 0.2s ease both;
}

.cmdk__panel {
	width: 100%;
	max-width: 620px;
	overflow: hidden;
	color: var(--text);
	background: var(--surface);
	border: 2px solid var(--line);
	border-radius: 18px;
	box-shadow: 8px 8px var(--shadow);
	animation: cmdk-pop 0.3s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}

.cmdk__search {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 0 20px;
	border-bottom: 2px solid var(--line);
}

.cmdk__search i {
	color: var(--accent);
}

.section .cmdk__search input,
.cmdk__search input {
	flex: 1;
	height: 62px;
	margin: 0;
	padding: 0;
	font-size: 17px;
	color: inherit;
	background: none;
	border: 0;
	box-shadow: none;
	outline: none;
}

.cmdk kbd {
	padding: 2px 8px;
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: inherit;
	background: none;
	border: 2px solid var(--line);
	border-radius: 6px;
	box-shadow: none;
}

.cmdk__list {
	max-height: min(420px, 55vh);
	margin: 0;
	padding: 8px;
	overflow-y: auto;
	list-style: none;
}

.cmdk__group {
	padding: 12px 12px 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent);
}

button.cmdk__item {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 10px 12px;
	font-size: 15px;
	border-radius: 10px;
	cursor: pointer;
}

button.cmdk__item i {
	width: 18px;
	text-align: center;
	opacity: 0.7;
}

button.cmdk__item span {
	flex: 1;
}

button.cmdk__item.active {
	color: #fff;
	background: var(--accent);
}

button.cmdk__item.active i {
	opacity: 1;
}

button.cmdk__item.active kbd {
	border-color: #fff;
}

.cmdk__empty {
	padding: 30px 12px;
	text-align: center;
	opacity: 0.7;
}

@keyframes cmdk-fade {
	from {
		opacity: 0;
	}
}

@keyframes cmdk-pop {
	from {
		opacity: 0;
		transform: translateY(-12px) scale(0.97);
	}
}

button.cmdk-hint {
	position: fixed;
	left: 24px;
	bottom: 24px;
	z-index: 90;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--text);
	background: var(--surface);
	border: 2px solid var(--line);
	border-radius: 30px;
	box-shadow: 4px 4px var(--shadow);
	cursor: pointer;
	transition: transform 0.3s cubic-bezier(0.3, 0, 0.3, 1);
}

button.cmdk-hint:hover {
	transform: translateY(-3px);
}

button.cmdk-hint kbd {
	padding: 1px 6px;
	font-family: inherit;
	font-size: 11px;
	color: inherit;
	background: none;
	border: 1px solid var(--line);
	border-radius: 5px;
	box-shadow: none;
}

button.cmdk-hint span {
	margin-left: 4px;
}

@media (max-width: 1023px), (pointer: coarse) {
	button.cmdk-hint {
		display: none;
	}
}

/* - Hero counters */

.count-up {
	font-variant-numeric: tabular-nums;
}

/* - Theme switch reveal */

::view-transition-old(root),
::view-transition-new(root) {
	animation: none;
	mix-blend-mode: normal;
}

/* - Konami confetti */

.confetti {
	position: fixed;
	inset: 0;
	z-index: 1000;
	overflow: hidden;
	pointer-events: none;
}

.confetti i {
	position: absolute;
	top: -20px;
	left: var(--x);
	width: 10px;
	height: 14px;
	border-radius: 2px;
	animation: confetti-fall var(--duration) cubic-bezier(0.25, 0.5, 0.5, 1) var(--delay) forwards;
}

.confetti i:nth-child(3n) {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

@keyframes confetti-fall {
	to {
		transform: translate3d(var(--drift), 110vh, 0) rotate(var(--spin));
	}
}

/* - Empty state and 404 */

.not-found {
	min-height: calc(100vh - 140px);
	display: flex;
	align-items: center;
	justify-content: center;
}

.section.section-inner.started-heading.not-found .m-titles .m-title {
	font-size: clamp(64px, 14vw, 160px);
	line-height: 1;
}

@media (max-width: 767px) {
	.tech-marquee-wrap {
		padding: 30px 0 60px;
	}

	.tech-marquee {
		padding: 22px 0;
	}

	.lui-started .bts {
		flex-direction: column;
		gap: 0;
	}

	.lui-started .bts .btn-lnk {
		height: auto;
		line-height: 1;
	}

	.tech-marquee__item {
		font-size: 13px;
		padding: 6px 16px;
	}

	.hero-started .title b {
		margin-right: 0.25em;
	}

	/* The template scales the whole portrait to 50% on phones. */
	.hero-portrait__bubble {
		font-size: 30px;
		padding: 20px 36px;
		border-radius: 40px;
	}

	.back-to-top {
		right: 16px;
		bottom: 16px;
		width: 46px;
		height: 46px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.tech-marquee__row,
	.status-dot:after,
	.role-typer__caret {
		animation: none;
	}
}
