/* Cinderdelve web page. Frames are the trailer's brass plates
   (tools/make_site_assets.py), stretched with border-image. */

@font-face {
	font-family: "Pixelify Sans";
	src: url("fonts/PixelifySans.ttf") format("truetype");
	font-display: swap;
}

:root {
	--bg: #120d0a;
	--bg-deep: #0b0807;
	--stone: #29252e;
	--text: #f1e6cf;
	--muted: #b8ab98;
	--gold: #e9b04b;
	--gold-light: #ffd889;
	--ember: #d87a34;
	--ink: #2a1a08;
	--pixel: "Pixelify Sans", ui-monospace, monospace;
	--body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--wide: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background:
		radial-gradient(ellipse 90% 50% at 50% 0%, #3a1a0c 0%, transparent 70%),
		var(--bg);
	color: var(--text);
	font: 17px/1.6 var(--body);
	overflow-x: hidden;
}

img { max-width: 100%; }
a { color: var(--gold); }
a:hover { color: var(--gold-light); }

h1, h2, h3, summary, .btn, .topbar, .kicker, .fact, .release { font-family: var(--pixel); }

/* --- Plates ------------------------------------------------------------ */

.plate, .btn {
	border: 15px solid transparent;
	border-image: url("img/plate.png") 15 fill / 15px stretch;
	image-rendering: pixelated;
}

.plate { padding: 6px 10px; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.45)); }

.btn {
	display: inline-block;
	padding: 3px 16px;
	font-size: 1.2rem;
	line-height: 1.4;
	color: var(--text);
	text-decoration: none;
	filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.5));
	transition: transform 0.12s ease;
}

.btn-gold { border-image-source: url("img/plate_gold.png"); color: var(--ink); }
a.btn:hover { transform: translateY(-2px); color: #000; }
.btn-iron { border-image-source: url("img/plate_iron.png"); color: var(--muted); }
span.btn-iron::after { content: " · 30 Oct"; color: #8b8090; }

/* --- Top bar ----------------------------------------------------------- */

.topbar {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	max-width: var(--wide);
	margin: 0 auto;
	padding: 16px;
	font-size: 18px;
}

.topbar a { color: var(--muted); text-decoration: none; }
.topbar a:hover { color: var(--gold-light); }
.topbar nav { display: flex; gap: 22px; }

/* --- Hero -------------------------------------------------------------- */

.hero { position: relative; text-align: center; padding: 20px 0 0; }
.hero-copy { position: relative; z-index: 1; padding: 0 16px; }

.logo {
	display: block;
	width: min(860px, 100%);
	height: auto;
	margin: 12px auto 0;
	image-rendering: pixelated;
	filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.55));
}

h1 { margin: 0; }

.tagline {
	margin: 22px auto 0;
	max-width: 30em;
	font-size: clamp(1.1rem, 2.4vw, 1.4rem);
}

.buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px 14px;
	margin: 26px 0 0;
}

.release {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 22px;
	margin: 20px 0 0;
	color: var(--muted);
	font-size: 1.05rem;
}

.release span:first-child { color: var(--gold-light); }

.lineup {
	position: relative;
	display: block;
	width: 100%;
	height: auto;
	margin: 30px auto 0;
	image-rendering: pixelated;
	-webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18%, #000 80%, transparent 100%);
	mask-image: linear-gradient(to bottom, transparent 0, #000 18%, #000 80%, transparent 100%);
}

/* Slow embers rising behind the logo. No flashes: they only drift and fade. */
.embers {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image:
		radial-gradient(2px 2px at 12% 80%, var(--ember), transparent),
		radial-gradient(2px 2px at 27% 60%, var(--gold), transparent),
		radial-gradient(3px 3px at 44% 90%, var(--ember), transparent),
		radial-gradient(2px 2px at 63% 70%, var(--gold), transparent),
		radial-gradient(2px 2px at 78% 85%, var(--ember), transparent),
		radial-gradient(3px 3px at 91% 65%, var(--gold), transparent);
	background-size: 100% 100%;
	animation: rise 14s linear infinite;
	opacity: 0.7;
}

@keyframes rise {
	from { transform: translateY(0); opacity: 0; }
	15% { opacity: 0.7; }
	to { transform: translateY(-40%); opacity: 0; }
}

/* --- Sections ---------------------------------------------------------- */

section { max-width: var(--wide); margin: 0 auto; padding: 72px 16px 0; }

.kicker {
	margin: 0 0 4px;
	color: var(--ember);
	font-size: 1.05rem;
	letter-spacing: 0.04em;
}

h2 {
	margin: 0 0 18px;
	font-size: clamp(1.9rem, 4.5vw, 2.8rem);
	line-height: 1.1;
	color: var(--gold);
	text-shadow: 0 4px 0 #000;
}

h3 { margin: 0 0 6px; font-size: 1.3rem; line-height: 1.2; color: var(--gold-light); }

.lede { font-size: 1.15rem; max-width: 44em; color: var(--text); }

/* --- Facts strip ------------------------------------------------------- */

.facts {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	padding-top: 24px;
}

.fact { display: flex; flex-direction: column; align-items: center; padding: 4px 6px; text-align: center; }
.fact strong { font-size: 2.4rem; line-height: 1; color: var(--gold-light); }
.fact span { color: var(--muted); font-size: 1rem; }

/* --- Cards ------------------------------------------------------------- */

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
	margin-top: 30px;
}

.card p, .roster p { margin: 0; font-size: 0.97rem; }

/* --- Class roster ------------------------------------------------------ */

.roster {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin: 30px 0 0;
	padding: 0;
	list-style: none;
}

.roster li { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4px 8px 8px; }
.roster .god { grid-column: 1 / -1; }
.roster .god p { max-width: 30em; }

.sprite {
	display: block;
	width: 128px;
	height: 120px;
	margin: 0 0 4px;
	background: var(--sheet) 0 0 / 400% 100% no-repeat;
	image-rendering: pixelated;
	animation: walk 0.5s steps(4) infinite;
}

/* The God walks twice the size and slower, as in the menu. */
.roster .god .sprite { width: 256px; height: 240px; animation-duration: 0.8s; }

.roster li:nth-child(3n + 2) .sprite { animation-delay: -0.23s; }
.roster li:nth-child(3n) .sprite { animation-delay: -0.47s; }

/* Four frames side by side: 133.333% slides the strip by four frame widths. */
@keyframes walk {
	from { background-position: 0 0; }
	to { background-position: 133.333% 0; }
}

/* --- Trailer ---------------------------------------------------------- */

.trailer { margin-top: 30px; padding: 0; }
.trailer video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--bg-deep); }
#trailer .faq details { font-size: 0.92rem; color: var(--muted); }

/* --- Screenshots ------------------------------------------------------- */

.shots {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
	gap: 16px;
}

.shots figure { margin: 0; padding: 0; }
.shots a { display: block; overflow: hidden; }
.shots img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; transition: transform 0.3s ease; }
.shots a:hover img { transform: scale(1.04); }
.shots figcaption { padding: 8px 4px 2px; color: var(--muted); font-size: 0.92rem; }

.viewer {
	max-width: min(96vw, 1920px);
	padding: 0;
	border: 0;
	background: transparent;
}

.viewer::backdrop { background: rgba(5, 3, 2, 0.88); }
.viewer img { display: block; max-height: 86vh; width: auto; margin: 0 auto; image-rendering: pixelated; cursor: zoom-out; }
.viewer form { text-align: right; margin-bottom: 8px; }
.viewer .close { cursor: pointer; font-size: 1rem; background: none; }

/* --- Call to action ---------------------------------------------------- */

.cta-plate {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 24px;
	padding: 14px 18px;
}

.cta-plate img { border-radius: 20px; image-rendering: auto; }
.cta-plate div { flex: 1 1 280px; }
.cta-plate h2 { margin: 0; font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.cta-plate p { margin: 4px 0 0; color: var(--muted); }

/* --- Support ----------------------------------------------------------- */

.faq { display: grid; gap: 12px; margin-top: 24px; }
.faq details { padding: 4px 10px; }

.faq summary {
	cursor: pointer;
	font-size: 1.2rem;
	color: var(--gold-light);
	list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; display: inline-block; width: 1.2em; color: var(--ember); }
.faq details[open] summary::before { content: "−"; }
.faq p, .faq ul { margin: 8px 0 4px; }
.faq ul { padding-left: 1.2em; }

code {
	background: var(--bg-deep);
	padding: 1px 5px;
	font-size: 0.85em;
	overflow-wrap: anywhere;
}

/* --- Footer ------------------------------------------------------------ */

footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
	max-width: var(--wide);
	margin: 80px auto 0;
	padding: 24px 16px 40px;
	border-top: 2px solid #2b1f17;
	color: var(--muted);
	font-size: 0.9rem;
}

/* --- Privacy page ------------------------------------------------------ */

.doc { max-width: 760px; padding-top: 32px; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); color: var(--gold); text-shadow: 0 4px 0 #000; }
.doc h2 { font-size: 1.5rem; margin: 36px 0 8px; }
.doc .meta { color: var(--muted); margin-top: 4px; }
.doc .summary { margin-top: 24px; }
.doc .summary p { margin: 0; }

/* --- Small screens and reduced motion ---------------------------------- */

@media (max-width: 700px) {
	.topbar nav { gap: 10px; font-size: 15px; }
	.topbar .studio { font-size: 16px; }
	.facts { grid-template-columns: repeat(2, 1fr); }
	.lineup { height: 210px; object-fit: cover; object-position: 85% 50%; }
	.roster { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.roster h3 { font-size: 1.1rem; }
	.roster p { font-size: 0.88rem; }
	.sprite { width: 96px; height: 90px; }
	.roster .god .sprite { width: 192px; height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
	.sprite, .embers { animation: none; }
	.btn, .shots img { transition: none; }
}
