@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap");

:root {
	/* Colors */
	--color-h: 20;
	--color-s: 20%;
	--color-l: 41%;
	--color-blue: hsl(216, 100%, 50%);
	--color-black: hsl(24 16% 13%);
	--color-gray: hsl(25 10% 45%);

	--brand-primary: hsl(var(--color-h) var(--color-s) var(--color-l));
	--brand-a30: hsl(var(--color-h) var(--color-s) var(--color-l) / 0.28);

	/* Fonts */
	--font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji",
		"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-family: var(--font-sans);
	font-optical-sizing: auto;
	letter-spacing: -0.5px;
	font-synthesis-weight: none;
	text-rendering: optimizeLegibility;
	background: #fdf8f4;
	color: var(--color-black);
}

/* Desktop/laptop: fit content to viewport without scrollbar */
@media (min-width: 1101px) {
	html,
	body {
		height: 100%;
		overflow: hidden;
	}
}

body {
	padding: clamp(20px, 5vw, 48px);
	font-size: 16px;
	display: flex;
	justify-content: center;
	min-height: 100vh;
}

main {
	width: min(1240px, 100%);
	display: grid;
	grid-template-columns: 1.15fr 1fr;
	grid-template-rows: 1fr auto auto;
	grid-template-areas:
		"pitch squad"
		"pitch install"
		"pitch template";
	gap: clamp(12px, 2vw, 20px);
	align-items: stretch;
}

/* Desktop: ensure main fills available space */
@media (min-width: 1101px) {
	main {
		height: calc(100vh - clamp(40px, 10vw, 96px));
		max-height: calc(100vh - clamp(40px, 10vw, 96px));
	}
}

section {
	width: 100%;
	background: #fff;
	border: 1px solid var(--brand-a30);
	border-radius: 32px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: clamp(14px, 2vw, 22px);
	padding: clamp(20px, 3vw, 28px);
	box-shadow: 0 12px 40px rgba(34, 21, 10, 0.06);
}

.container-1 {
	grid-area: pitch;
}

.container-1 .main-image {
	flex-shrink: 1;
	min-height: 0;
	max-height: 100%;
	object-fit: contain;
	align-self: center;
}

.container-1 article {
	flex: 1;
	width: 100%;
}

.container-2 {
	grid-area: squad;
}

.container-3 {
	grid-area: install;
}

.container-4 {
	grid-area: template;
}

header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	width: 100%;
	gap: 12px;
}

h1 {
	font-weight: 700;
	font-size: clamp(18px, 2vw, 22px);
	letter-spacing: -0.2px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	line-height: 1.35;
}

h2 {
	display: flex;
	align-items: center;
	font-size: 16px;
	font-weight: 600;
	gap: 8px;
	width: 100%;
}

strong {
	font-weight: 600;
}

p {
	color: var(--color-gray);
	font-weight: 300;
	line-height: 1.7;
	font-size: 15px;
}

pre {
	margin: 0;
	font-size: 12px;
	letter-spacing: 0;
	white-space: nowrap;
}

button {
	display: flex;
	margin-left: 16px;
	cursor: pointer;
	border: 1px solid hsl(var(--color-h) var(--color-s) var(--color-l) / 0.2);
	background-color: hsl(var(--color-h) var(--color-s) var(--color-l) / 0.12);
	color: var(--brand-primary);
	padding: 6px 8px;
	border-radius: 10px;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

button:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px
		hsl(var(--color-h) var(--color-s) var(--color-l) / 0.12);
}

button:active {
	transform: translateY(1px);
	box-shadow: none;
}

sub {
	color: var(--color-gray);
	font-weight: 300;
}

a {
	text-decoration: none;
	color: inherit;
}

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

.highlighted {
	color: var(--highlighted-color, var(--brand-primary));
}

[data-highlighted="brown"] {
	--highlighted-color: var(--brand-primary);
}
[data-highlighted="blue"] {
	--highlighted-color: var(--color-blue);
}

.link {
	cursor: pointer;
	text-decoration-style: dotted;
	text-decoration-line: underline;
	text-underline-offset: 3px;
}

.row-flex {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
}

.column-flex {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
}

.column-flex strong {
	color: var(--color-black);
	font-weight: 800;
	font-size: 15px;
}

.column-flex span {
	color: var(--color-gray);
	font-size: 13px;
	letter-spacing: -0.2px;
}

.badge {
	border: 1px solid var(--brand-a30);
	padding: 4px 8px;
	gap: 6px;
	border-radius: 38px;
}

.badge #circle {
	background-color: var(--brand-primary);
	border-radius: 38px;
	height: 8px;
	width: 18px;
}

.badge span {
	color: var(--brand-primary);
	font-family: monospace;
	font-size: 13px;
}

.main-image {
	width: auto;
	height: fit-content;
}

.squad-wrapper {
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: smaller;
	font-weight: 300;
	color: var(--brand-primary);
	align-items: center;
	width: 100%;
	text-align: center;
}

.squad-stack {
	display: flex;
	justify-content: center;
	padding: 24px 40px 8px;
}

.squad-member {
	position: relative;
	width: 80px;
	height: 80px;
	border-radius: 50%;
	overflow: visible;
	margin-left: -24px;
	transition: margin 0.3s ease, transform 0.3s ease;
	cursor: pointer;
}

.squad-member:first-child {
	margin-left: 0;
}

/* Separate avatars on container hover */
.container-2:hover .squad-member {
	margin-left: 8px;
}

.container-2:hover .squad-member:first-child {
	margin-left: 0;
}

.squad-member img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 4px 12px rgba(34, 21, 10, 0.15);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.squad-member:hover {
	z-index: 10;
	transform: scale(1.1);
}

.squad-member:hover img {
	box-shadow: 0 8px 24px rgba(34, 21, 10, 0.25);
}

/* Thinking bubble - main bubble */
.squad-member::after {
	content: attr(data-name);
	position: absolute;
	top: -40px;
	left: 50%;
	transform: translateX(-50%);
	background: #fff;
	color: var(--brand-primary);
	padding: 6px 14px;
	border-radius: 16px;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	box-shadow: 0 2px 8px rgba(34, 21, 10, 0.15);
	border: 1px solid var(--brand-a30);
}

/* Thinking bubble - small circles */
.squad-member::before {
	content: "";
	position: absolute;
	top: -12px;
	left: 50%;
	transform: translateX(-50%);
	width: 8px;
	height: 8px;
	background: #fff;
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	box-shadow: 0 2px 4px rgba(34, 21, 10, 0.1), -8px -8px 0 -2px #fff,
		-8px -8px 0 -1px var(--brand-a30);
}

.squad-member:hover::after,
.squad-member:hover::before {
	opacity: 1;
}

.join-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: #f0ebe7;
	border-radius: 32px;
	border: 1px solid #d8cfc7;
	padding: 12px 28px;
	color: var(--color-black);
	text-decoration: none;
	font-size: 26px;
	gap: 8px;
	align-self: center;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.join-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(34, 21, 10, 0.14);
}

.join-button:active {
	transform: translateY(1px);
	box-shadow: none;
}

.code-box {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background-color: hsl(var(--color-h) var(--color-s) var(--color-l) / 0.08);
	color: var(--brand-primary);
	padding: 12px 14px;
	border-radius: 14px;
	gap: 10px;
	font-family: ui-monospace, monospace;
	width: 100%;
	max-width: 560px;
	overflow: hidden;
	border: 1px dashed #d8cfc7;
}

.code-box pre {
	overflow-x: auto;
}

article {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.container-3 sub {
	margin-top: -6px;
}

.full-width-link {
	display: block;
	width: 100%;
	align-items: center;

	& img {
		justify-self: center;
	}
}

header .column-flex {
	align-items: flex-start;
}

@media (max-width: 1100px) {
	body {
		padding: clamp(18px, 6vw, 32px);
		overflow-x: hidden;
	}

	main {
		grid-template-columns: 1fr;
		grid-template-areas:
			"pitch"
			"squad"
			"install"
			"template";
		width: 100%;
		max-width: 100%;
	}

	header {
		align-items: center;
		flex-wrap: wrap;
	}

	.join-button {
		width: 100%;
	}

	section {
		align-items: flex-start;
		max-width: 100%;
		padding: clamp(20px, 4vw, 28px);
	}

	.full-width-link img {
		max-width: 100%;
		height: auto;
	}

	.squad-member {
		width: 70px;
		height: 70px;
		margin-left: -20px;
	}
}

@media (max-width: 720px) {
	html {
		overflow-x: hidden;
	}

	body {
		padding: clamp(12px, 4vw, 20px);
	}

	h1 {
		font-size: 16px;
		word-break: break-word;
	}

	h1 svg {
		flex-shrink: 0;
		width: 28px;
		height: auto;
	}

	h2 {
		font-size: 15px;
	}

	p {
		font-size: 14px;
		word-break: break-word;
	}

	.squad-member {
		width: 60px;
		height: 60px;
		margin-left: -16px;
	}

	.squad-member:first-child {
		margin-left: 0;
	}

	.squad-stack {
		padding: 16px 40px;
	}

	.code-box {
		flex-wrap: wrap;
		padding: 10px 12px;
	}

	.code-box pre {
		width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.code-box code {
		font-size: 11px;
	}

	button {
		margin-left: 0;
		width: 100%;
		justify-content: center;
	}

	section {
		border-radius: 24px;
		padding: clamp(16px, 4vw, 24px);
	}

	.join-button {
		font-size: 20px;
		padding: 10px 20px;
	}

	.badge {
		padding: 3px 6px;
	}

	.badge span {
		font-size: 11px;
	}

	header .row-flex svg {
		width: 48px;
		height: 48px;
	}

	.column-flex strong {
		font-size: 14px;
	}

	.column-flex span {
		font-size: 12px;
	}
}

@media (max-width: 400px) {
	body {
		padding: 10px;
	}

	h1 {
		font-size: 15px;
	}

	.code-box code {
		font-size: 10px;
	}

	.join-button {
		font-size: 18px;
	}
}

/* ========== Animations ========== */

/* Keyframes */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.6;
	}
}

@keyframes shimmer {
	0% {
		background-position: -200% 0;
	}
	100% {
		background-position: 200% 0;
	}
}

/* Section entrance animations */
section {
	animation: fadeInUp 0.6s ease-out both;
}

.container-1 {
	animation-delay: 0s;
}

.container-2 {
	animation-delay: 0.1s;
}

.container-3 {
	animation-delay: 0.2s;
}

.container-4 {
	animation-delay: 0.3s;
}

/* Header logo hover effect */
header .row-flex svg {
	transition: transform 0.3s ease;
}

header .row-flex:hover svg {
	transform: rotate(-5deg) scale(1.05);
}

/* Badge pulse animation */
.badge #circle {
	animation: pulse 2s ease-in-out infinite;
}

/* Main image hover effect */
.main-image {
	transition: transform 0.4s ease;
}

.main-image:hover {
	transform: scale(1.02);
}

/* Link hover animations */
.link {
	transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.link:hover {
	text-decoration-style: solid;
}

/* Full width link hover */
.full-width-link img {
	transition: transform 0.4s ease;
}

.full-width-link:hover img {
	transform: scale(1.02);
}

/* Code box shimmer effect on hover */
.code-box {
	position: relative;
	overflow: hidden;
}

.code-box::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(255, 255, 255, 0.4) 50%,
		transparent 100%
	);
	background-size: 200% 100%;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.code-box:hover::before {
	opacity: 1;
	animation: shimmer 1.5s ease-in-out;
}

/* H1 SVG subtle float */
h1 svg {
	transition: transform 0.3s ease;
}

h1:hover svg {
	transform: translateY(-2px);
}

/* H2 icon animations */
h2 svg {
	transition: transform 0.3s ease;
}

h2:hover svg {
	transform: scale(1.15);
}

/* Smooth focus states */
button:focus-visible,
a:focus-visible {
	outline: 2px solid var(--brand-primary);
	outline-offset: 2px;
}
