Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

24.8 KB
Raw Blame
<!doctype html>
<html lang="en" class="tutorials-page">
	<head>
		<script>/* three.ws theme boot — no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<title data-i18n="tutorials.meta_title">three.ws — Tutorials</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta name="author" content="nirholas" />
		<meta
			name="description"
			content="Tutorials for building 3D agents with three.ws — from a 30-second embed to on-chain identity and paid x402 endpoints."
		 data-i18n-attr="content:tutorials.meta_description"/>
		<meta name="theme-color" content="#000000" />

		<meta property="og:type" content="website" />
		<meta property="og:site_name" content="three.ws" />
		<meta property="og:title" content="three.ws — Tutorials"  data-i18n-attr="content:tutorials.meta_og_title"/>
		<meta
			property="og:description"
			content="Tutorials for building 3D agents with three.ws — from a 30-second embed to on-chain identity and paid x402 endpoints."
		 data-i18n-attr="content:tutorials.meta_og_description"/>
		<meta property="og:url" content="https://three.ws/tutorials" />
		<meta property="og:image" content="https://three.ws/api/page-og?s=learn&amp;t=Tutorials&amp;d=Step-by-step+build+guides.&amp;p=%2Ftutorials" />
		<meta property="og:image:width" content="1200" />
		<meta property="og:image:height" content="630" />

		<meta name="twitter:card" content="summary_large_image" />
		<meta name="twitter:title" content="three.ws — Tutorials"  data-i18n-attr="content:tutorials.meta_twitter_title"/>
		<meta
			name="twitter:description"
			content="Tutorials for building 3D agents with three.ws — from a 30-second embed to on-chain identity and paid x402 endpoints."
		 data-i18n-attr="content:tutorials.meta_twitter_description"/>
		<meta name="twitter:image" content="https://three.ws/api/page-og?s=learn&amp;t=Tutorials&amp;d=Step-by-step+build+guides.&amp;p=%2Ftutorials" />

		<link rel="canonical" href="https://three.ws/tutorials" />
		<link rel="icon" href="/favicon.ico" sizes="any" />
		<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
		<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
		<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
		<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
		<link rel="manifest" href="/manifest.webmanifest" />
		<link rel="stylesheet" href="/style.css" />
		<link rel="stylesheet" href="/nav.css" />
		<link rel="stylesheet" href="/home.css" />
		<link rel="stylesheet" href="/footer.css" />
		<link rel="stylesheet" href="/fonts/fonts.css" />
		<link rel="stylesheet" href="/mobile.css" />
		<script defer src="/nav.js"></script>
		<script defer src="/footer-newsletter.js"></script>
		<script defer src="/tutorials-manifest.js"></script>
		<script
			type="module"
			src="https://cdn.jsdelivr.net/npm/@google/[email protected]/dist/model-viewer.min.js"
			integrity="sha384-wjsPzEO+lXOf7d9csIDfAQpPt2OKuUU3m0K9qsdKIuzX4N8czSF6hdh23eAbZa3p"
			crossorigin="anonymous"
		></script>

		<style>
			html.tutorials-page,
			html.tutorials-page body {
				overflow: auto !important;
				height: auto !important;
			}

			.tutorials-page body {
				display: block;
			}

			.tut-page {
				min-height: 100vh;
				display: flex;
				flex-direction: column;
			}

			/* The injected .nav owns its own height, padding, blur and border.
			   Neutralise the legacy app-shell `header {}` rule (style.css) so its
			   line-height: var(--header-h) doesn't cascade into the nav links and
			   blow out their height. This wrapper is a pure positioning context. */
			.tut-page header {
				position: sticky;
				top: 0;
				z-index: 200;
				flex-shrink: 0;
				display: block;
				height: auto;
				padding: 0;
				line-height: normal;
				white-space: normal;
				overflow: visible;
				background: none;
				backdrop-filter: none;
				-webkit-backdrop-filter: none;
				border-bottom: none;
			}

			/* ── Hero ────────────────────────────────────────────────────── */

			.tut-hero {
				background: linear-gradient(180deg, #0a0608 0%, #070707 60%, #070707 100%);
				border-bottom: 1px solid rgba(255, 255, 255, 0.06);
				padding: clamp(3rem, 8vh, 5.5rem) clamp(1.25rem, 4vw, 2rem) clamp(2rem, 5vh, 3.5rem);
				position: relative;
				overflow: hidden;
			}

			.tut-hero::before {
				content: '';
				position: absolute;
				inset: 0;
				background:
					radial-gradient(
						ellipse 60% 80% at 15% 50%,
						rgba(255, 255, 255, 0.12) 0%,
						transparent 60%
					),
					radial-gradient(
						ellipse 50% 60% at 85% 20%,
						rgba(255, 255, 255, 0.06) 0%,
						transparent 55%
					);
				pointer-events: none;
			}

			.tut-hero-inner {
				position: relative;
				max-width: 980px;
				margin: 0 auto;
			}

			.tut-hero-eyebrow {
				display: inline-flex;
				align-items: center;
				gap: 0.4rem;
				font-family: var(--font-display);
				font-size: 0.7rem;
				font-weight: 600;
				letter-spacing: 0.12em;
				text-transform: uppercase;
				color: rgba(255, 255, 255, 0.9);
				margin-bottom: 1rem;
			}

			.tut-hero-eyebrow::before {
				content: '';
				display: block;
				width: 18px;
				height: 1px;
				background: currentColor;
			}

			.tut-hero h1 {
				font-family: var(--font-display);
				font-size: clamp(2.1rem, 5vw, 3.4rem);
				font-weight: 700;
				letter-spacing: -0.025em;
				color: #fff;
				margin: 0 0 0.9rem;
				line-height: 1.1;
			}

			.tut-hero p {
				font-size: 1.08rem;
				color: rgba(255, 255, 255, 0.55);
				line-height: 1.65;
				margin: 0 0 1.6rem;
				max-width: 60ch;
			}

			.tut-hero-jumps {
				display: flex;
				gap: 0.6rem;
				flex-wrap: wrap;
			}

			.tut-jump {
				display: inline-flex;
				align-items: center;
				gap: 0.45rem;
				padding: 0.45rem 0.85rem;
				border-radius: 999px;
				background: rgba(255, 255, 255, 0.025);
				border: 1px solid rgba(255, 255, 255, 0.08);
				font-family: 'Inter', sans-serif;
				font-size: 0.82rem;
				font-weight: 500;
				color: rgba(255, 255, 255, 0.7);
				text-decoration: none;
				transition:
					background var(--duration-fast) var(--ease-standard),
					border-color var(--duration-fast) var(--ease-standard),
					color var(--duration-fast) var(--ease-standard);
			}

			.tut-jump:hover {
				background: rgba(255, 255, 255, 0.05);
				border-color: rgba(255, 255, 255, 0.18);
				color: #fff;
			}

			.tut-jump-dot {
				width: 7px;
				height: 7px;
				border-radius: 50%;
				background: var(--tut-jump-color, #ffffff);
			}

			/* ── Content ────────────────────────────────────────────────── */

			.tut-content {
				flex: 1;
				background: #070707;
				padding: clamp(2.5rem, 6vh, 4rem) clamp(1.25rem, 4vw, 2rem);
			}

			.tut-content-inner {
				max-width: 1080px;
				margin: 0 auto;
			}

			.tut-tier-section {
				margin-bottom: 4rem;
				scroll-margin-top: 80px;
			}

			.tut-tier-section:last-child {
				margin-bottom: 0;
			}

			.tut-tier-head {
				display: flex;
				align-items: baseline;
				gap: 1rem;
				margin-bottom: 1.6rem;
				flex-wrap: wrap;
			}

			.tut-tier-badge {
				display: inline-flex;
				align-items: center;
				gap: 0.5rem;
				padding: 0.35rem 0.85rem;
				border-radius: 999px;
				background: var(--tut-tier-soft, rgba(255, 255, 255, 0.16));
				border: 1px solid var(--tut-tier-border, rgba(255, 255, 255, 0.32));
				font-family: var(--font-display);
				font-size: 0.72rem;
				font-weight: 700;
				color: var(--tut-tier-accent, #ffffff);
				letter-spacing: 0.08em;
				text-transform: uppercase;
			}

			.tut-tier-badge::before {
				content: '';
				width: 7px;
				height: 7px;
				border-radius: 50%;
				background: currentColor;
			}

			.tut-tier-eyebrow {
				font-family: 'Inter', sans-serif;
				font-size: 0.84rem;
				color: rgba(255, 255, 255, 0.45);
			}

			.tut-tier-blurb {
				color: rgba(255, 255, 255, 0.6);
				font-size: 0.98rem;
				line-height: 1.6;
				margin: 0 0 1.6rem;
				max-width: 70ch;
			}

			.tut-grid {
				display: grid;
				grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
				gap: 1rem;
			}

			/* ── Card ───────────────────────────────────────────────────── */

			.tut-card-link {
				display: flex;
				flex-direction: column;
				background: rgba(255, 255, 255, 0.018);
				border: 1px solid rgba(255, 255, 255, 0.07);
				border-radius: 12px;
				padding: 1.4rem 1.5rem 1.25rem;
				text-decoration: none;
				transition:
					border-color var(--duration-base) var(--ease-standard),
					transform var(--duration-base) var(--ease-standard),
					background var(--duration-base) var(--ease-standard);
				position: relative;
				overflow: hidden;
				min-height: 200px;
			}

			.tut-card-link::after {
				content: '';
				position: absolute;
				top: 0;
				left: 0;
				right: 0;
				height: 2px;
				background: var(--tut-card-accent, #ffffff);
				opacity: 0;
				transition: opacity var(--duration-base) var(--ease-standard);
			}

			.tut-card-link:hover {
				border-color: var(--tut-card-accent, rgba(255, 255, 255, 0.18));
				transform: translateY(-2px);
				background: rgba(255, 255, 255, 0.028);
			}

			.tut-card-link:hover::after {
				opacity: 1;
			}

			.tut-card-meta {
				display: flex;
				align-items: center;
				gap: 0.55rem;
				margin-bottom: 0.85rem;
				font-family: var(--font-display);
				font-size: 0.66rem;
				font-weight: 600;
				letter-spacing: 0.08em;
				text-transform: uppercase;
				color: rgba(255, 255, 255, 0.42);
			}

			.tut-card-meta-dot {
				width: 4px;
				height: 4px;
				border-radius: 50%;
				background: rgba(255, 255, 255, 0.2);
			}

			.tut-card-title {
				font-family: var(--font-display);
				font-size: 1.08rem;
				font-weight: 700;
				color: #fff;
				letter-spacing: -0.01em;
				margin: 0 0 0.55rem;
				line-height: 1.3;
			}

			.tut-card-blurb {
				font-size: 0.92rem;
				color: rgba(255, 255, 255, 0.55);
				line-height: 1.6;
				margin: 0 0 1.1rem;
				flex: 1;
			}

			.tut-card-cta {
				display: inline-flex;
				align-items: center;
				gap: 0.4rem;
				font-family: 'Inter', sans-serif;
				font-size: 0.82rem;
				font-weight: 500;
				color: var(--tut-card-accent, #ffffff);
				margin-top: auto;
			}

			.tut-card-cta svg {
				width: 12px;
				height: 12px;
				transition: transform var(--duration-fast) var(--ease-standard);
			}

			.tut-card-link:hover .tut-card-cta svg {
				transform: translateX(3px);
			}

			/* ── Bottom CTA banner ──────────────────────────────────────── */

			.tut-bottom-cta {
				margin-top: 4rem;
				padding: 2rem;
				background: rgba(255, 255, 255, 0.025);
				border: 1px solid rgba(255, 255, 255, 0.07);
				border-radius: 14px;
				display: flex;
				align-items: center;
				gap: 1.5rem;
				flex-wrap: wrap;
				justify-content: space-between;
			}

			.tut-bottom-cta h2 {
				font-family: var(--font-display);
				font-size: 1.3rem;
				font-weight: 700;
				color: #fff;
				margin: 0 0 0.35rem;
				letter-spacing: -0.01em;
			}

			.tut-bottom-cta p {
				margin: 0;
				color: rgba(255, 255, 255, 0.55);
				font-size: 0.95rem;
				line-height: 1.55;
			}

			.tut-bottom-cta-actions {
				display: flex;
				gap: 0.6rem;
				flex-wrap: wrap;
			}

			.tut-bottom-btn {
				display: inline-flex;
				align-items: center;
				gap: 0.4rem;
				padding: 0.65rem 1.05rem;
				border-radius: 8px;
				font-family: 'Inter', sans-serif;
				font-size: 0.87rem;
				font-weight: 500;
				text-decoration: none;
				transition:
					background var(--duration-fast) var(--ease-standard),
					border-color var(--duration-fast) var(--ease-standard);
			}

			.tut-bottom-btn.primary {
				background: rgba(255, 255, 255, 0.16);
				border: 1px solid rgba(255, 255, 255, 0.4);
				color: var(--ink);
			}

			.tut-bottom-btn.primary:hover {
				background: rgba(255, 255, 255, 0.24);
				border-color: rgba(255, 255, 255, 0.6);
			}

			.tut-bottom-btn.secondary {
				background: rgba(255, 255, 255, 0.03);
				border: 1px solid rgba(255, 255, 255, 0.1);
				color: rgba(255, 255, 255, 0.85);
			}

			.tut-bottom-btn.secondary:hover {
				background: rgba(255, 255, 255, 0.06);
				border-color: rgba(255, 255, 255, 0.2);
			}

			@media (max-width: 640px) {
				.tut-grid {
					grid-template-columns: 1fr;
				}
				.tut-bottom-cta {
					flex-direction: column;
					align-items: flex-start;
				}
			}
		</style>

		<script type="application/ld+json">
			{
				"@context": "https://schema.org",
				"@type": "WebPage",
				"name": "Tutorials",
				"description": "Step-by-step build guides.",
				"url": "https://three.ws/tutorials",
				"isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }
			}
		</script>
	
	<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">
	<meta property="og:locale" content="en_US">
	<meta property="og:image:alt" content="Tutorials — three.ws">
	<meta name="twitter:site" content="@trythreews">
	<script src="/model-viewer-meshopt.js"></script>
</head>
	<body class="home-page tutorials-page tut-page">
		<div class="cursor" id="cursor" aria-hidden="true"></div>
		<a href="#main-content" class="h-skip-link" data-i18n="tutorials.skip_to_main_content">Skip to main content</a>

		<header><div id="nav-container"></div></header>

		<main id="main-content">
			<div class="tut-hero">
				<div class="tut-hero-inner">
					<p class="tut-hero-eyebrow" data-i18n="tutorials.tutorials">Tutorials</p>
					<h1 data-i18n="tutorials.build_with_3d_agents">Build with 3D agents</h1>
					<p data-i18n="tutorials.twenty_three_step_by_step_guides_from">
						Twenty-three step-by-step guides — from a one-line embed to a self-hosted
						backend with on-chain identity and paid x402 endpoints. Pick your tier.
					</p>
					<div class="tut-hero-jumps" id="tut-hero-jumps"></div>
				</div>
			</div>

			<div class="tut-content">
				<div class="tut-content-inner" id="tut-content-inner">
					<!-- Tiers populated from /tutorials-manifest.js -->
				</div>
			</div>
		</main>

		<footer class="h-footer h-footer-horizon">
			<div class="h-footer-glow-line" aria-hidden="true"></div>
			<div class="h-footer-floor" aria-hidden="true"></div>
			<div class="h-footer-haze" aria-hidden="true"></div>
			<div class="h-footer-watermark" aria-hidden="true">three.ws</div>
			<div class="h-footer-avatar" aria-hidden="true">
				<model-viewer
					src="/animations/robotexpressive.glb"
					auto-rotate
					auto-rotate-delay="0"
					rotation-per-second="20deg"
					interaction-prompt="none"
					camera-controls="false"
					disable-zoom
					shadow-intensity="0"
					exposure="0.7"
					environment-image="neutral"
					camera-orbit="0deg 80deg 9m"
					field-of-view="45deg"
					loading="lazy"
				></model-viewer>
			</div>
			<div class="h-footer-cta">
				<div class="h-footer-newsletter">
					<h3 data-i18n="tutorials.stay_in_the_loop">Stay in the loop</h3>
					<p data-i18n="tutorials.get_updates_on_new_features_agent_tooling">Get updates on new features, agent tooling, and protocol changes.</p>
					<form class="h-footer-newsletter-form" data-newsletter-form novalidate>
						<input
							type="email"
							class="h-footer-newsletter-input"
							name="email"
							placeholder="Enter your email"
							aria-label="Email address"
							autocomplete="email"
							required
						/>
						<button
							type="submit"
							class="h-footer-newsletter-btn"
							aria-label="Subscribe"
						 data-i18n-attr="aria-label:tutorials.subscribe_arialabel">
							<svg viewBox="0 0 16 16" aria-hidden="true">
								<path
									fill="none"
									stroke="currentColor"
									stroke-width="1.6"
									stroke-linecap="round"
									stroke-linejoin="round"
									d="M2 8h11m0 0L9 4m4 4l-4 4"
								/>
							</svg>
						</button>
					</form>
					<p class="h-footer-newsletter-msg" data-newsletter-msg aria-live="polite"></p>
				</div>
				<div class="h-footer-community">
					<h3 data-i18n="tutorials.join_the_community">Join the community</h3>
					<p data-i18n="tutorials.follow_along_for_builds_demos_and_conversati">Follow along for builds, demos, and conversations with the team.</p>
					<a
						class="h-footer-community-btn"
						href="https://x.com/trythreews"
						target="_blank"
						rel="noopener"
					>
						<svg viewBox="0 0 24 24" aria-hidden="true">
							<path
								fill="currentColor"
								d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"
							/>
						</svg>
						Follow on X
					</a>
				</div>
			</div>
			<div class="h-footer-inner">
				<div class="h-footer-brand-col">
					<div class="h-footer-brand">
						<img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" />
						<span class="wordmark-dot" aria-hidden="true"></span>
						<span data-i18n="tutorials.three_ws">three.ws</span>
					</div>
					<p class="h-footer-tagline" data-i18n="tutorials.give_your_ai_a_body">Give your AI a body.</p>
					<div class="h-footer-socials">
						<a
							class="h-footer-social"
							href="https://x.com/trythreews"
							target="_blank"
							rel="noopener"
							aria-label="three.ws on X"
						 data-i18n-attr="aria-label:tutorials.three_ws_on_x_arialabel">
							<svg viewBox="0 0 24 24" aria-hidden="true">
								<path
									fill="currentColor"
									d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"
								/>
							</svg>
						</a>
						<a
							class="h-footer-social"
							href="https://github.com/nirholas/three.ws"
							target="_blank"
							rel="noopener"
							aria-label="three.ws on GitHub"
						 data-i18n-attr="aria-label:tutorials.three_ws_on_github_arialabel">
							<svg viewBox="0 0 16 16" aria-hidden="true">
								<path
									fill="currentColor"
									d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"
								/>
							</svg>
						</a>
					</div>
				</div>
				<nav class="h-footer-links" aria-label="Footer">
					<div class="h-footer-link-col">
						<h4 class="h-footer-link-heading" data-i18n="tutorials.product">Product</h4>
						<a href="/create" data-i18n="tutorials.create">Create</a>
						<a href="/studio" data-i18n="tutorials.studio">Studio</a>
						<a href="/widgets" data-i18n="tutorials.widgets">Widgets</a>
						<a href="/discover" data-i18n="tutorials.discover">Discover</a>
					</div>
					<div class="h-footer-link-col">
						<h4 class="h-footer-link-heading" data-i18n="tutorials.developers">Developers</h4>
						<a href="/docs" data-i18n="tutorials.docs">Docs</a>
						<a
							href="https://github.com/nirholas/three.ws"
							target="_blank"
							rel="noopener"
							 data-i18n="tutorials.github">GitHub</a
						>
						<a
							href="https://eips.ethereum.org/EIPS/eip-8004"
							target="_blank"
							rel="noopener"
							 data-i18n="tutorials.erc_8004">ERC-8004</a
						>
					</div>
					<div class="h-footer-link-col">
						<h4 class="h-footer-link-heading" data-i18n="tutorials.resources">Resources</h4>
						<a href="/blog" data-i18n="tutorials.blog">Blog</a>
						<a href="/tutorials" aria-current="page" data-i18n="tutorials.tutorials_2">Tutorials</a>
						<a href="/dashboard" data-i18n="tutorials.dashboard">Dashboard</a>
					</div>
				</nav>
			</div>
			<div class="h-footer-bottom">
				<p class="h-footer-legal" data-i18n="tutorials.2026_three_ws_all_rights_reserved">© 2026 three.ws — All rights reserved.</p>
				<div class="h-footer-legal-links">
					<a href="/legal/privacy" data-i18n="tutorials.privacy_policy">Privacy Policy</a>
					<a href="/legal/tos" data-i18n="tutorials.terms_of_use">Terms of Use</a>
				</div>
			</div>
		</footer>

		<script>
			// Custom cursor
			(function () {
				const cursor = document.getElementById('cursor');
				if (!cursor || !window.matchMedia('(hover: hover)').matches) return;
				let x = 0,
					y = 0,
					tx = 0,
					ty = 0;
				document.addEventListener('mousemove', (e) => {
					tx = e.clientX;
					ty = e.clientY;
				});
				(function loop() {
					x += (tx - x) * 0.18;
					y += (ty - y) * 0.18;
					cursor.style.transform = `translate(${x - 5}px,${y - 5}px)`;
					requestAnimationFrame(loop);
				})();
				document.querySelectorAll('a,button').forEach((el) => {
					el.addEventListener('mouseenter', () => cursor.classList.add('cursor--hover'));
					el.addEventListener('mouseleave', () =>
						cursor.classList.remove('cursor--hover'),
					);
				});
			})();

			// ── Tutorial index renderer ─────────────────────────────────
			function escapeHtml(s) {
				return String(s).replace(
					/[&<>"']/g,
					(c) =>
						({
							'&': '&amp;',
							'<': '&lt;',
							'>': '&gt;',
							'"': '&quot;',
							"'": '&#39;',
						})[c],
				);
			}

			function tutorialCardHtml(entry, tierMeta) {
				return `
					<a class="tut-card-link" href="/tutorials/${entry.slug}" style="--tut-card-accent:${tierMeta.accent}">
						<div class="tut-card-meta">
							<span>${escapeHtml(tierMeta.label)}</span>
							<span class="tut-card-meta-dot"></span>
							<span>${escapeHtml(entry.time)}</span>
						</div>
						<h3 class="tut-card-title">${escapeHtml(entry.title)}</h3>
						<p class="tut-card-blurb">${escapeHtml(entry.blurb)}</p>
						<span class="tut-card-cta">
							Start tutorial
							<svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M2 6h8M6 2l4 4-4 4"/></svg>
						</span>
					</a>
				`;
			}

			function renderTutorials() {
				const tiers = ['easy', 'middle', 'advanced'];
				const root = document.getElementById('tut-content-inner');
				const jumps = document.getElementById('tut-hero-jumps');
				const blocks = [];
				const jumpLinks = [];

				tiers.forEach((tier) => {
					const meta = window.TUTORIAL_TIERS[tier];
					const list = window.tutorialsByTier(tier);
					if (!list.length) return;

					jumpLinks.push(`
						<a href="#tier-${tier}" class="tut-jump" style="--tut-jump-color:${meta.accent}">
							<span class="tut-jump-dot"></span>
							${escapeHtml(meta.label)}
							<span style="opacity:0.5;font-size:0.72rem;margin-left:0.15rem">(${list.length})</span>
						</a>
					`);

					blocks.push(`
						<section id="tier-${tier}" class="tut-tier-section" style="--tut-tier-accent:${meta.accent};--tut-tier-soft:${meta.accentSoft};--tut-tier-border:${meta.accentBorder}">
							<div class="tut-tier-head">
								<span class="tut-tier-badge">${escapeHtml(meta.label)}</span>
								<span class="tut-tier-eyebrow">${escapeHtml(meta.eyebrow)} · ${list.length} tutorials</span>
							</div>
							<p class="tut-tier-blurb">${escapeHtml(meta.blurb)}</p>
							<div class="tut-grid">
								${list.map((t) => tutorialCardHtml(t, meta)).join('')}
							</div>
						</section>
					`);
				});

				blocks.push(`
					<div class="tut-bottom-cta">
						<div>
							<h2>Don't see what you need?</h2>
							<p>The full SDK reference, REST API, and architecture deep-dives live in the docs.</p>
						</div>
						<div class="tut-bottom-cta-actions">
							<a class="tut-bottom-btn primary" href="/docs">Open docs →</a>
							<a class="tut-bottom-btn secondary" href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener">Read source on GitHub</a>
						</div>
					</div>
				`);

				root.innerHTML = blocks.join('');
				jumps.innerHTML = jumpLinks.join('');
			}

			if (window.TUTORIALS) {
				renderTutorials();
			} else {
				window.addEventListener('DOMContentLoaded', renderTutorials);
			}
		</script>
		<script src="/brand.js" defer></script>
		<div id="footer-container"></div>
		<script src="/footer.js"></script>
		<!-- Runtime i18n: detects locale, swaps annotated copy, mounts <lang-switcher>. -->
	<script type="module" src="/i18n.js"></script>
</body>
</html>