/* Pixel Alchemia site. Colours come from the game's UiTheme; frames and props are the game's sprites. */
:root {
	--ink: #171525;
	--night: #110f1c;
	--panel: #1d1a2d;
	--line: #49425c;
	--cream: #fff0cf;
	--gold: #efbf71;
	--amber: #c98f45;
	--wood: #744a28;
	--muted: #a4b9cf;
	--dim: #7d7897;
	--plum: #3a2458;
	--good: #78ba79;
	--danger: #ea705e;
	--violet: #b4a0f0;
	--frame: 20px; /* panel border */
	color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--ink);
	color: var(--cream);
	font: 17px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, "Open Sans", sans-serif;
	overflow-x: hidden;
}
img { max-width: 100%; }
.px, .sprite, .icon, .beta-icon, .brand img { image-rendering: pixelated; }
a { color: var(--gold); }
a:hover { color: var(--cream); }
strong { color: var(--gold); }
.muted { color: var(--dim); }
.small { font-size: 14px; }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }

/* Brick wall behind everything, dimmed like the workshop's vignette. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(ellipse at 50% 20%, rgba(23, 21, 37, .55), rgba(23, 21, 37, .94) 70%),
		url(img/wall_tile.png) 0 0 / 96px 96px;
	image-rendering: pixelated;
}

/* Navigation */
.nav {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px max(16px, calc(50% - 560px));
	background: rgba(17, 15, 28, .9);
	border-bottom: 2px solid var(--line);
	backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-weight: 700; }
.nav nav { display: flex; gap: 18px; margin-left: auto; }
.nav nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav nav a:hover { color: var(--cream); }
.nav .nav-beta { color: var(--gold); }

/* Frames: the game's nine-slice plaques and panel. */
.panel {
	border: var(--frame) solid transparent;
	border-image: url(img/panel.png) 20 fill / var(--frame) round;
	image-rendering: pixelated;
}
.btn {
	display: inline-flex; align-items: center; gap: 8px;
	min-height: 48px; padding: 4px 14px;
	border: 12px solid transparent;
	border-image: url(img/button_normal.png) 12 fill / 12px stretch;
	image-rendering: pixelated;
	color: var(--cream); font: inherit; font-weight: 700; text-decoration: none;
	background: none; cursor: pointer;
	transition: transform .08s;
}
.btn > * { image-rendering: auto; }
.btn:hover { border-image-source: url(img/button_hover.png); color: #fff; }
.btn:active, .btn[aria-pressed="true"] { border-image-source: url(img/button_pressed.png); transform: translateY(2px); }
.btn.primary { border-image-source: url(img/button_primary_normal.png); color: var(--ink); }
.btn.primary:hover { border-image-source: url(img/button_primary_hover.png); color: var(--ink); }
.btn.primary:active, .btn.primary[aria-pressed="true"] { border-image-source: url(img/button_primary_pressed.png); }

.badge {
	display: inline-flex; align-items: center; gap: 8px;
	margin: 0 0 18px; padding: 4px 12px;
	background: rgba(9, 8, 15, .8); border: 2px solid var(--gold);
	color: var(--gold); font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.dot { width: 8px; height: 8px; background: var(--good); box-shadow: 0 0 0 2px rgba(120, 186, 121, .3); animation: blink 2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* Hero */
.hero {
	position: relative;
	display: grid;
	grid-template-columns: 1.2fr .8fr;
	align-items: center;
	gap: 40px;
	max-width: 1120px;
	margin: 0 auto;
	padding: 72px 16px 40px;
}
.hero h1 { margin: 0; line-height: 0; }
.tagline { margin: 22px 0 18px; line-height: 0; }
.lede { max-width: 34em; color: var(--muted); font-size: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.hero-phone { justify-self: center; }
.hero-phone img {
	display: block; width: 300px; height: auto;
	border: 6px solid var(--night); outline: 2px solid var(--line);
	box-shadow: 16px 16px 0 rgba(58, 36, 88, .6);
	animation: bob 5s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-10px); } }

/* The five-pixel sparkle from the store captions. */
.sparkles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sparkles i {
	position: absolute; width: 25px; height: 25px;
	background:
		linear-gradient(currentColor, currentColor) 10px 0 / 5px 10px no-repeat,
		linear-gradient(currentColor, currentColor) 10px 15px / 5px 10px no-repeat,
		linear-gradient(currentColor, currentColor) 0 10px / 10px 5px no-repeat,
		linear-gradient(currentColor, currentColor) 15px 10px / 10px 5px no-repeat;
	color: #ffe8b0;
	animation: twinkle 3.2s steps(4) infinite;
	pointer-events: none;
}
.sparkles i:nth-child(1) { left: 2%; top: 60px; }
.sparkles i:nth-child(2) { left: 50%; top: 110px; color: var(--violet); transform: scale(.6); animation-delay: -1s; }
.sparkles i:nth-child(3) { left: 8%; bottom: 20px; color: var(--violet); transform: scale(.8); animation-delay: -2s; }
.sparkles i:nth-child(4) { right: 4%; top: 90px; animation-delay: -.5s; }
.sparkles i:nth-child(5) { left: 44%; bottom: 60px; transform: scale(.6); animation-delay: -2.6s; }
.sparkles i:nth-child(6) { right: 30%; top: 40px; color: var(--violet); transform: scale(.5); animation-delay: -1.7s; }
@keyframes twinkle { 0%, 100% { opacity: 0; } 25%, 60% { opacity: 1; } }

/* Sections */
.section { max-width: 1120px; margin: 0 auto; padding: 56px 16px; scroll-margin-top: 40px; }
.section h2 { margin: 0 0 12px; line-height: 0; text-align: center; }
.intro { text-align: center; color: var(--muted); max-width: 40em; margin: 18px auto 28px; }

.sprite { background-repeat: no-repeat; background-size: 800% 100%; }
@keyframes idle { to { background-position: 100% 0; } }

/* Features */
.features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.features li {
	padding: 18px 18px 18px 84px; position: relative; min-height: 96px;
	background: rgba(29, 26, 45, .85); border: 2px solid var(--line); color: var(--muted);
}
.features b { display: block; color: var(--cream); font-size: 18px; }
.features .icon { position: absolute; left: 14px; top: 18px; width: 56px; height: 56px; }
.features li:hover .icon { animation: idle .8s steps(8, jump-none) infinite; }

/* Screenshots */
.shots {
	display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr);
	gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 16px;
	scrollbar-color: var(--wood) transparent;
}
.shots button {
	scroll-snap-align: center; padding: 0; border: 4px solid var(--night); outline: 2px solid var(--line);
	background: var(--night); cursor: zoom-in; transition: transform .2s, outline-color .2s;
}
.shots button:hover { transform: translateY(-6px); outline-color: var(--gold); }
.shots img { display: block; width: 100%; height: auto; }
.feature { margin: 32px auto 0; max-width: 900px; line-height: 0; }
.feature img { width: 100%; height: auto; }

.lightbox { padding: 0; border: 4px solid var(--gold); background: var(--night); max-width: 94vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(9, 8, 15, .85); }
.lightbox img { display: block; max-height: calc(94vh - 8px); width: auto; }
.lightbox .close {
	position: absolute; right: 8px; top: 8px; width: 40px; height: 40px;
	font-size: 26px; line-height: 1; color: var(--cream); background: var(--ink); border: 2px solid var(--line); cursor: pointer;
}

/* Beta */
.beta { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: start; max-width: 860px; margin: 28px auto 0; }
.beta-icon { width: 128px; height: 128px; border: 4px solid var(--night); outline: 2px solid var(--gold); }
.beta p { margin: 0 0 12px; }
.beta ol { margin: 0 0 8px; padding-left: 22px; color: var(--muted); }
.beta li::marker { color: var(--gold); font-weight: 800; }
.beta .actions { margin: 18px 0 12px; }

.footer { text-align: center; padding: 40px 16px 56px; color: var(--dim); border-top: 2px solid var(--line); background: rgba(9, 8, 15, .6); }
.footer p { margin: 8px 0; }

/* Privacy page */
.doc { max-width: 720px; margin: 0 auto; padding: 48px 16px 64px; }
.doc h1 { font-size: 30px; color: var(--gold); margin: 0 0 8px; }
.doc h2 { font-size: 20px; margin: 28px 0 8px; }
.doc p, .doc li { color: var(--muted); }

@media (max-width: 1000px) {
	.features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
	.hero { grid-template-columns: 1fr; padding-top: 40px; text-align: center; }
	.hero .actions { justify-content: center; }
	.lede { margin: 0 auto; }
	.hero-phone img { width: 220px; }
	.nav nav { display: none; }
	.features { grid-template-columns: 1fr; }
	.shots { grid-auto-columns: 62%; }
	.beta { grid-template-columns: 1fr; justify-items: center; text-align: left; }
	.beta-icon { width: 96px; height: 96px; }
}
@media (max-width: 370px) { :root { --frame: 12px; } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
}
