:root {
	--paper: #f1f3f4;
	--ink: #1a1d1e;
	--ink-soft: #4b5356;
	--card: #fcfcfc;
	--line: #2a3133;
	--accent: #1f8b88;
	--accent-soft: #d9efee;
	--shadow: rgba(0, 0, 0, 0.14);
	--maxw: 1260px;
	--radius: 14px;
	--space: clamp(1rem, 1.7vw, 1.25rem);
	--space-lg: clamp(1.4rem, 2.4vw, 2rem);
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	background: var(--paper);
	color: var(--ink);
	scroll-behavior: smooth;
}

body {
	font-family: "Patrick Hand", "Trebuchet MS", sans-serif;
	font-size: 1.12rem;
	line-height: 1.56;
	min-height: 100dvh;
	background-image:
		radial-gradient(circle at 12% 18%, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px),
		radial-gradient(circle at 84% 26%, rgba(0, 0, 0, 0.045) 0 1px, transparent 1px),
		radial-gradient(circle at 22% 84%, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px),
		linear-gradient(to bottom, rgba(0, 0, 0, 0.015), rgba(0, 0, 0, 0.03));
	background-size: 120px 120px, 100px 100px, 140px 140px, 100% 100%;
}

.wrap {
	width: min(calc(100% - 2rem), var(--maxw));
	margin-inline: auto;
}

.scribble {
	border: 3.3px solid var(--line);
	border-width: 2.9px 3.7px 3.4px 2.6px;
	border-radius: 22px 16px 20px 18px / 17px 22px 16px 21px;
	position: relative;
	background: var(--card);
	box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.2);
	transform: none;
}

.scribble::before {
	content: "";
	position: absolute;
	inset: 6px;
	border: 0;
	pointer-events: none;
}

header {
	padding: var(--space-lg);
	margin-top: 1.2rem;
	animation: reveal 0.7s ease-out both;
}

.hero-head {
	display: grid;
	grid-template-columns: clamp(6.2rem, 12vw, 8.6rem) 1fr;
	align-items: center;
	column-gap: 0.95rem;
	margin-bottom: 0.35rem;
}

.hero-text {
	min-width: 0;
}

.header-face {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	object-position: center 35%;
	border-radius: 50%;
	border: 2.6px solid var(--line);
	box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.18);
	flex: 0 0 auto;
}

.title {
	margin: 0;
	font-family: "Gloria Hallelujah", cursive;
	font-size: clamp(2rem, 6vw, 3.3rem);
	letter-spacing: 0.4px;
	text-wrap: balance;
}

.subtitle {
	margin: 0.2rem 0 0;
	font-size: clamp(1rem, 1.9vw, 1.18rem);
	color: var(--ink-soft);
	max-width: 56ch;
}

nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 1rem;
}

nav a {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	text-decoration: none;
	color: var(--ink);
	border: 3px dashed var(--line);
	border-radius: 30px 22px 28px 24px / 24px 30px 22px 28px;
	padding: 0.48rem 0.9rem;
	background: var(--card);
	font-size: 1rem;
	font-family: "Patrick Hand", "Trebuchet MS", sans-serif;
	letter-spacing: 0.02em;
	box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.22);
	transform: translate(0, 0) rotate(var(--tilt, 0deg));
	transition: transform 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.nav-icon {
	width: 1.68rem;
	height: 1.68rem;
	display: block;
	fill: currentColor;
	flex: 0 0 auto;
}

nav a:nth-child(odd) {
	--tilt: -0.7deg;
}

nav a:nth-child(even) {
	--tilt: 0.45deg;
}

nav a:hover,
nav a:focus-visible {
	background: var(--accent-soft);
	color: var(--accent);
	border-color: var(--accent);
	transform: translate(1px, 1px) rotate(var(--tilt, 0deg));
	box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.25);
	outline: none;
}

nav a.is-pressing {
	transform: translate(3px, 3px) rotate(var(--tilt, 0deg)) scale(0.99);
	box-shadow: 0 0 0 rgba(0, 0, 0, 0.18);
}

nav a.nav-contact {
	background: var(--accent);
	color: #f7fbfb;
	border-style: solid;
	border-color: var(--line);
	font-weight: 700;
	box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.28);
}

nav a.nav-contact:hover,
nav a.nav-contact:focus-visible {
	background: #167270;
	color: #ffffff;
	border-color: var(--line);
	box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

main {
	padding-block: 0 0.35rem;
}

section {
	margin-block: 1rem;
	padding: var(--space-lg);
	animation: reveal 0.7s ease-out both;
	animation-delay: 80ms;
}

.section-title {
	margin: 0 0 0.75rem;
	font-family: "Gloria Hallelujah", cursive;
	font-size: clamp(1.35rem, 3.4vw, 2rem);
	letter-spacing: 0.2px;
}

.about {
	margin: 0;
	max-width: none;
	width: 100%;
	color: var(--ink-soft);
}

.about-top {
	display: block;
	margin-block: 1rem;
	animation: reveal 0.7s ease-out both;
	animation-delay: 80ms;
}

.about-text-card {
	padding: var(--space-lg);
	display: flex;
	align-items: center;
	width: 100%;
}


.project-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(0.8rem, 1.2vw, 1rem);
	margin-top: 1rem;
}

.project-category {
	padding: 0 0 0.2rem;
}

.project-category + .project-category {
	margin-top: 1.4rem;
	padding-top: 1rem;
	border-top: 2px solid rgba(42, 49, 51, 0.22);
}

.project-category-title {
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-family: "Gloria Hallelujah", cursive;
	font-size: clamp(1.1rem, 2.2vw, 1.45rem);
	color: var(--ink-soft);
	letter-spacing: 0.02em;
}

.project-category .project-grid {
	margin-top: 0.7rem;
}

.project-category-icon {
	width: 1.77rem;
	height: 1.77rem;
	display: block;
	fill: currentColor;
	flex: 0 0 auto;
}

.project-status {
	margin: 0.4rem 0;
	color: var(--ink-soft);
}

.project-status-error {
	color: #8a3a3a;
}

.project-card {
	text-decoration: none;
	color: inherit;
	border: 3.3px solid var(--line);
	border-width: 2.6px 3.8px 3.5px 2.4px;
	border-radius: 20px 14px 18px 16px / 15px 20px 14px 18px;
	overflow: clip;
	background: #fff;
	box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.2);
	transition: transform 0.22s ease, box-shadow 0.22s ease;
	position: relative;
	display: flex;
	flex-direction: column;
}

.project-card:hover,
.project-card:focus-visible {
	transform: translate(1px, 1px) rotate(0.2deg);
	box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.24);
	outline: none;
}

.project-image {
	aspect-ratio: 16 / 10;
	width: 100%;
	object-fit: cover;
	display: block;
	filter: none;
	transition: filter 0.35s ease, transform 0.35s ease;
	transform-origin: center;
}

.project-embed-wrap {
	aspect-ratio: 16 / 10;
	position: relative;
	overflow: hidden;
	background: linear-gradient(145deg, #dfe5e7, #eef2f3);
	border-bottom: 3.3px solid var(--line);
	cursor: pointer;
}

.project-embed-preview {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	filter: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
	z-index: 2;
	pointer-events: none;
}

.project-embed {
	width: 100%;
	height: 100%;
	display: block;
	border: 0;
	pointer-events: none;
	filter: none;
	transition: filter 0.25s ease;
	position: relative;
	z-index: 1;
}

.project-video-embed {
	width: 100%;
	height: 100%;
	display: block;
	border: 0;
	filter: none;
}

.project-video-preview {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	z-index: 2;
	cursor: pointer;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.project-embed-overlay {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 1rem;
	background: linear-gradient(rgba(241, 243, 244, 0.35), rgba(31, 139, 136, 0.18));
	color: var(--ink);
	font-family: "Gloria Hallelujah", cursive;
	font-size: 1rem;
	letter-spacing: 0.02em;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.project-embed-overlay span {
	padding: 0.35rem 0.8rem;
	border: 2.3px dashed var(--accent);
	border-radius: 999px;
	background: rgba(252, 252, 252, 0.92);
	box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
}

.project-card:hover .project-image,
.project-card:focus-visible .project-image {
	filter: none;
	transform: scale(1.03);
}

.project-card-embed:hover .project-embed,
.project-card-embed:focus-within .project-embed,
.project-card-embed.is-active .project-embed {
	pointer-events: auto;
	filter: none;
}

.project-card-embed.is-active .project-embed-wrap {
	cursor: auto;
}

.project-card-embed:hover .project-embed-preview,
.project-card-embed:focus-within .project-embed-preview,
.project-card-embed.is-active .project-embed-preview {
	opacity: 0;
	transform: scale(1.02);
}

.project-card-embed:hover .project-embed-overlay,
.project-card-embed:focus-within .project-embed-overlay,
.project-card-embed.is-active .project-embed-overlay {
	opacity: 0;
}

.project-card-video:hover .project-video-preview,
.project-card-video:focus-within .project-video-preview,
.project-card-video.is-active .project-video-preview {
	opacity: 0;
	transform: scale(1.02);
}

.project-card-video.is-active .project-video-preview {
	pointer-events: none;
}

.project-text {
	padding: 0.95rem 1rem 1.05rem;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	min-height: 150px;
}

.project-title {
	margin: 0;
	font-family: "Gloria Hallelujah", cursive;
	font-size: 1.2rem;
}

.project-description {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.94rem;
	line-height: 1.45;
}

.project-meta {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-top: auto;
}

.project-link {
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.project-link:hover,
.project-link:focus-visible {
	background: var(--accent-soft);
	outline: none;
}

.worksheets-intro {
	margin: 0;
	max-width: 74ch;
	color: var(--ink-soft);
}

.worksheet-list {
	margin-top: 0.9rem;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.7rem;
}

.worksheet-item {
	margin: 0;
	padding: 0.7rem 0.85rem;
	border: 2.5px dashed var(--line);
	border-radius: 16px 14px 15px 12px / 14px 16px 12px 15px;
	background: #fff;
	box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
	color: var(--ink);
	line-height: 1.4;
}

.worksheet-item-link {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	text-decoration: none;
	color: var(--accent);
	font-weight: 700;
	transition: transform 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}

.worksheet-icon {
	width: 1.1rem;
	height: 1.1rem;
	fill: currentColor;
	flex: 0 0 auto;
}

.worksheet-item-link:hover,
.worksheet-item-link:focus-visible {
	background: var(--accent-soft);
	transform: translate(1px, 1px);
	box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
	outline: none;
}

.contact-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
}

.contact-list a {
	color: var(--accent);
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	text-decoration: none;
	border-bottom: 2.8px solid var(--accent);
	padding-bottom: 2px;
}

.contact-icon {
	width: 1.58rem;
	height: 1.58rem;
	fill: currentColor;
	flex: 0 0 auto;
}

.contact-list a:hover,
.contact-list a:focus-visible {
	background: var(--accent-soft);
	outline: none;
}

.site-footer {
	margin-block: 0.35rem 1rem;
	padding: var(--space-lg);
	animation: reveal 0.7s ease-out both;
	animation-delay: 80ms;
	text-align: left;
	color: var(--ink);
	font-size: inherit;
}

.contact-footer {
	margin-top: 0.85rem;
	padding-top: 0.75rem;
	border-top: 2.8px dashed var(--line);
	display: flex;
	justify-content: center;
	flex-direction: column;
	align-items: center;
	gap: 0.45rem;
}

.footer-note {
	margin: 0;
	color: var(--ink-soft);
	font-size: 0.9rem;
}

.footer-note a {
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.footer-note a:hover,
.footer-note a:focus-visible {
	background: var(--accent-soft);
	outline: none;
}

.contact-back-top {
	color: var(--accent);
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	border-bottom: 2.8px solid var(--accent);
	padding-bottom: 2px;
}

.contact-back-top:hover,
.contact-back-top:focus-visible {
	background: var(--accent-soft);
	outline: none;
}

footer {
	margin: 0;
	padding: 0;
}

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

@media (max-width: 1080px) {
	.project-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.worksheet-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 800px) {
	.hero-head {
		grid-template-columns: clamp(4.8rem, 18vw, 6rem) 1fr;
		column-gap: 0.7rem;
	}

	.project-grid {
		grid-template-columns: 1fr;
	}

	.worksheet-list {
		grid-template-columns: 1fr;
	}

	.wrap {
		width: min(calc(100% - 1rem), var(--maxw));
	}
}

@media (max-width: 520px) {
	.hero-head {
		grid-template-columns: 1fr;
		row-gap: 0.55rem;
	}

	.header-face {
		width: clamp(5.6rem, 32vw, 7rem);
	}

	.subtitle {
		margin-top: 0.35rem;
	}
}
