/* Pixelify Sans and Nunito Sans (SIL Open Font License, see assets/fonts), served from the site rather than Google Fonts so they do not hold up the first paint */
@font-face {
	font-family: "Pixelify Sans";
	src: url("../fonts/pixelify-sans.woff2") format("woff2");
	font-weight: 400 700;
	font-display: swap;
}
@font-face {
	font-family: "Nunito Sans";
	src: url("../fonts/nunito-sans.woff2") format("woff2");
	font-weight: 200 1000;
	font-display: swap;
}

/* Colors from the mod's own interface (tools/gui_theme.py): mauve wood, leather, cream paper, gold. */
:root {
	--night: #211414;
	--bg: #2f1c1b;
	--bg-alt: #392421;
	--wood: #6e4838;
	--wood-light: #865e46;
	--wood-dark: #4d2e28;
	--outline: #1a0b0c;
	--leather: #7c3b27;
	--paper: #f0e1bd;
	--paper-shadow: #cfb984;
	--ink: #40231f;
	--cream: #f6e9cb;
	--muted: #ceb49d;
	--gold: #dea62b;
	--gold-light: #ffd76a;
	--gold-dark: #935f00;
	--green: #7bc042;
	--red: #bd4b43;
	--pixel: "Pixelify Sans", ui-monospace, monospace;
	--text: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--gutter: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--cream);
	font: 17px/1.6 var(--text);
	-webkit-font-smoothing: antialiased;
}

a { color: var(--gold-light); }
a:hover { color: #ffffff; }

h1, h2, h3 { font-family: var(--pixel); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.35rem; }

code { font-family: ui-monospace, Menlo, monospace; font-size: .9em; background: rgba(0, 0, 0, .25); padding: .1em .35em; border-radius: 3px; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; }

/* Bevelled panels, like Minecraft's windows */
.panel {
	background: var(--wood);
	border: 3px solid var(--outline);
	box-shadow: inset 3px 3px 0 var(--wood-light), inset -3px -3px 0 var(--wood-dark);
	padding: 24px;
}
.panel p:last-child { margin-bottom: 0; }

.paper {
	background: var(--paper);
	color: var(--ink);
	border: 3px solid var(--outline);
	box-shadow: inset -3px -3px 0 var(--paper-shadow), 0 6px 0 rgba(0, 0, 0, .25);
	overflow-x: auto;
}

/* Buttons */
.button {
	display: inline-block;
	font-family: var(--pixel);
	font-weight: 700;
	font-size: 1.1rem;
	text-decoration: none;
	color: var(--outline);
	background: var(--gold);
	border: 3px solid var(--outline);
	box-shadow: inset 3px 3px 0 var(--gold-light), inset -3px -3px 0 var(--gold-dark);
	padding: 10px 22px;
	transition: transform .08s;
}
.button:hover { color: var(--outline); background: var(--gold-light); transform: translateY(-2px); }
.button:active { transform: translateY(1px); }
.button-ghost { background: var(--wood); color: var(--cream); box-shadow: inset 3px 3px 0 var(--wood-light), inset -3px -3px 0 var(--wood-dark); }
.button-ghost:hover { background: var(--wood-light); color: #ffffff; }
.button-small { font-size: .95rem; padding: 6px 14px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 12px; }

/* Top bar */
.topbar {
	position: sticky;
	top: 0;
	z-index: 10;
	background: rgba(33, 20, 20, .92);
	backdrop-filter: blur(6px);
	border-bottom: 3px solid var(--outline);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--pixel); font-weight: 700; font-size: 1.25rem; color: var(--cream); text-decoration: none; }
.brand img { image-rendering: pixelated; }
.nav { display: flex; gap: 20px; margin-right: auto; }
.nav a, .lang { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav a:hover, .lang:hover { color: var(--cream); }
.topbar-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }

/* Hero */
.hero {
	background:
		radial-gradient(ellipse at 75% 30%, rgba(222, 166, 43, .16), transparent 60%),
		linear-gradient(180deg, var(--night), var(--bg));
	padding: 72px 0 80px;
}
.hero-inner { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; }
.eyebrow { font-family: var(--pixel); color: var(--gold); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }
/* The mod's name and kind open the page's heading, in the eyebrow's small type */
h1 .eyebrow { display: block; font-size: 1rem; font-weight: 500; line-height: 1.6; }
.lead { font-size: 1.2rem; color: var(--cream); max-width: 34em; }
.note { color: var(--muted); font-size: .92rem; margin: 0; }
.note a { color: var(--muted); }
.note a:hover { color: var(--cream); }

/* Screenshots */
.shot {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border: 3px solid var(--outline);
	box-shadow: 0 0 0 3px var(--wood-dark), 0 18px 40px rgba(0, 0, 0, .45);
	image-rendering: auto;
}
.shot-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	color: var(--muted);
	font-family: var(--pixel);
	text-align: center;
	padding: 16px;
	background:
		repeating-linear-gradient(45deg, rgba(255, 255, 255, .03) 0 12px, transparent 12px 24px),
		var(--wood-dark);
}
.shot-placeholder code { color: var(--gold); background: rgba(0, 0, 0, .3); }
.shot-link { display: block; cursor: zoom-in; }
.shot-link:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 6px; }

/* Lightbox: a screenshot full size over the page */
.lightbox {
	width: 100vw;
	height: 100vh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 16px;
	border: 0;
	background: transparent;
	cursor: zoom-out;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(33, 20, 20, .92); }
.lightbox img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	border: 3px solid var(--outline);
	box-shadow: 0 0 0 3px var(--wood-dark), 0 18px 40px rgba(0, 0, 0, .45);
}
.lightbox-close {
	position: fixed;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	font: 700 1.6rem/1 var(--pixel);
	color: var(--cream);
	background: var(--wood);
	border: 3px solid var(--outline);
	box-shadow: inset 3px 3px 0 var(--wood-light), inset -3px -3px 0 var(--wood-dark);
	cursor: pointer;
}
.lightbox-close:hover, .lightbox-close:focus-visible { background: var(--wood-light); }
.lightbox-arrow, .carousel-arrow {
	width: 44px;
	height: 44px;
	font: 700 1.8rem/1 var(--pixel);
	color: var(--cream);
	background: var(--wood);
	border: 3px solid var(--outline);
	box-shadow: inset 3px 3px 0 var(--wood-light), inset -3px -3px 0 var(--wood-dark);
	cursor: pointer;
}
.lightbox-arrow { position: fixed; top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
@media (min-width: 641px) {
	/* Room for the arrows on each side, so they never cover the screenshot */
	.lightbox { padding: 16px 76px; }
}
.lightbox-arrow:hover, .lightbox-arrow:focus-visible, .carousel-arrow:hover, .carousel-arrow:focus-visible { background: var(--wood-light); }

/* Several screenshots of one feature, one at a time: the frame goes around the track, not each image */
.carousel { position: relative; }
.carousel-track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	border: 3px solid var(--outline);
	box-shadow: 0 0 0 3px var(--wood-dark), 0 18px 40px rgba(0, 0, 0, .45);
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: start; }
.carousel .shot { border: 0; box-shadow: none; }
.carousel .shot-link:focus-visible { outline-offset: -6px; }
.carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-dots { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.carousel-dots button {
	width: 14px;
	height: 14px;
	padding: 0;
	background: var(--wood-dark);
	border: 2px solid var(--outline);
	cursor: pointer;
}
.carousel-dots button[aria-current] { background: var(--gold); }

/* Sections */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); border-top: 3px solid var(--outline); border-bottom: 3px solid var(--outline); }
.section-intro { color: var(--muted); font-size: 1.1rem; max-width: 46em; margin: 0 0 36px; }
.small { color: var(--muted); font-size: .92rem; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pillars h3 { color: var(--gold-light); }

/* Vanilla vs Vanilla Sugar */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 18px; vertical-align: top; }
thead th { font-family: var(--pixel); font-size: 1.05rem; border-bottom: 3px solid var(--paper-shadow); }
tbody tr + tr > * { border-top: 1px solid var(--paper-shadow); }
tbody th { font-weight: 700; }
.compare .before { color: #7e5b44; }
.compare .before::before { content: "✗ "; color: var(--red); font-weight: 700; }
.after { font-weight: 700; color: #266007; }
.compare .after::before { content: "✓ "; color: #388b10; }

/* Controls: keys drawn as keycaps */
.controls kbd {
	display: inline-block;
	min-width: 1.6em;
	font-family: var(--pixel);
	font-size: .95rem;
	text-align: center;
	color: var(--cream);
	background: var(--wood);
	border: 2px solid var(--outline);
	box-shadow: inset 2px 2px 0 var(--wood-light), inset -2px -2px 0 var(--wood-dark);
	padding: 1px 7px;
}
.controls th { white-space: nowrap; }
.controls .needs { color: #7e5b44; }

/* Features */
.feature {
	display: grid;
	grid-template-columns: 1fr 1.2fr;
	gap: 48px;
	align-items: center;
	padding: 40px 0;
}
.feature + .feature { border-top: 2px dashed var(--wood-dark); }
.feature:nth-of-type(even) .feature-text { order: 2; }
.feature-lead { font-size: 1.15rem; font-weight: 600; color: var(--gold-light); margin-top: 0; }
.feature ul { padding-left: 1.2em; margin: 0 0 16px; }
.feature li { margin-bottom: 8px; }
.feature li::marker { color: var(--gold); content: "◆  "; font-size: .8em; }
.keys { display: inline-block; font-size: .95rem; background: var(--wood-dark); border: 2px solid var(--outline); padding: 4px 12px; margin: 0; }
.keys span { font-family: var(--pixel); color: var(--gold); margin-right: 6px; }
/* A craftable item, its pixel icon scaled up without smoothing, its recipe beside its name */
.item-card {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 14px;
	align-items: start;
	margin: 0 0 16px;
	padding: 12px 14px;
	background: var(--wood);
	border: 2px solid var(--outline);
	box-shadow: inset 2px 2px 0 var(--wood-light), inset -2px -2px 0 var(--wood-dark);
}
.item-card img { image-rendering: pixelated; background: var(--wood-dark); border: 2px solid var(--outline); padding: 4px; box-sizing: content-box; }
.item-card p { margin: 0; }
.item-name { font-family: var(--pixel); font-weight: 700; color: var(--gold-light); margin-bottom: 4px !important; }
.item-name > span { display: block; font-weight: 400; font-size: .9rem; color: var(--muted); }
.tag { display: inline-block; vertical-align: middle; font-size: .8rem; background: var(--leather); border: 2px solid var(--outline); padding: 2px 8px; color: var(--cream); }

/* Ko-fi support banner, a leather panel under the features */
.support {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 16px 24px;
	align-items: center;
	margin-top: 40px;
	padding: 20px 24px;
	background: var(--leather);
	border: 3px solid var(--outline);
	box-shadow: inset 3px 3px 0 #9a5236, inset -3px -3px 0 #5a2a1c;
	color: var(--cream);
}
.support-cup { color: var(--cream); }
.support p { margin: 0; max-width: 60ch; }
.support strong { color: var(--gold-light); }
.support-button { white-space: nowrap; }

/* Recipes, install */
.split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start; }
.never { margin-top: 80px; }
.never h2 { font-size: 1.5rem; color: var(--gold-light); }
.never ul { list-style: none; padding: 0; margin: 0; }
.never li { padding: 8px 0 8px 30px; position: relative; }
.never li::before { content: "✗"; position: absolute; left: 4px; color: #ff9482; font-weight: 700; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 24px; }
.steps li { counter-increment: step; position: relative; padding: 10px 0 10px 52px; }
.steps li::before {
	content: counter(step);
	position: absolute; left: 0; top: 6px;
	width: 36px; height: 36px;
	display: grid; place-items: center;
	font-family: var(--pixel); font-weight: 700; color: var(--outline);
	background: var(--gold); border: 3px solid var(--outline);
}
.requires h3 { color: var(--gold-light); }
.requires dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; margin: 0; }
/* The muted beige is too faint on wood: a lighter one keeps 4.5:1 */
.requires dt { color: #dcc5b0; }
.requires dd { margin: 0; font-weight: 700; }

/* FAQ */
.faq { background: var(--wood); border: 3px solid var(--outline); margin-bottom: 12px; }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 700; font-size: 1.05rem; list-style: none; position: relative; padding-right: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 12px; font-family: var(--pixel); font-size: 1.4rem; color: var(--gold); }
.faq[open] summary::after { content: "−"; }
.faq p { margin: 0; padding: 0 20px 18px; color: var(--cream); }

/* Footer */
.footer { background: var(--night); padding: 40px 0; color: var(--muted); font-size: .9rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 12px; }
.footer p { margin: 0; }

:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }

@media (max-width: 960px) {
	.nav { display: none; }
	.hero-inner, .feature, .split { grid-template-columns: 1fr; gap: 28px; }
	.feature:nth-of-type(even) .feature-text { order: 0; }
	.pillars { grid-template-columns: 1fr; }
	.never { margin-top: 0; }
	.support { grid-template-columns: auto minmax(0, 1fr); }
	.support-button { grid-column: 1 / -1; justify-self: start; }
	.hero { padding: 48px 0 56px; }
	.section { padding: 64px 0; }
}

@media (max-width: 640px) {
	.brand span { display: none; }
	.topbar-actions { gap: 10px; }
	.compare thead { display: none; }
	.compare tr { display: block; padding: 14px 16px; }
	.compare th, .compare td { display: block; padding: 2px 0; }
	.compare tbody tr + tr > * { border-top: 0; }
	.compare tbody tr + tr { border-top: 1px solid var(--paper-shadow); }
	.recipes th, .recipes td { padding: 10px 10px; font-size: .92rem; }
	/* Each key beside its action, what it needs underneath */
	.controls thead { display: none; }
	.controls tr { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); column-gap: 12px; padding: 12px 14px; }
	.controls th { white-space: normal; }
	.controls th, .controls td { padding: 0; font-size: .92rem; }
	.controls tbody tr + tr > * { border-top: 0; }
	.controls tbody tr + tr { border-top: 1px solid var(--paper-shadow); }
	.controls .needs { grid-column: 2; font-size: .85rem; }
	.controls .needs:empty { display: none; }
	.controls .needs::before { content: attr(data-label) " "; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.button { transition: none; }
	.carousel-track { scroll-behavior: auto; }
}
