/* The Long Descent website. Colours follow the game's UI (scripts/ui/gear_ui.gd) and the Steam art. */

@font-face {
	font-family: "Cinzel";
	src: url("fonts/Cinzel.ttf") format("truetype");
	font-weight: 400 900;
	font-display: swap;
}

:root {
	--bg: #0c0a11;
	--bg-deep: #050407;
	--panel: #1c1a21;
	--panel-hi: #24212a;
	--border: #524c5c;
	--brass: #6b5733;
	--gold: #f6d58e;
	--gold-hi: #ffd966;
	--ember: #c06a26;
	--text: #e8e2d6;
	--muted: #a8a2b2;
	--necro: #7fb2ff;
	--depth: 0;
	color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 17px/1.65 Georgia, "Iowan Old Style", "Palatino Linotype", serif;
	overflow-x: hidden;
}

/* The page gets darker as you go down, like the floors do. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	background: var(--bg-deep);
	opacity: calc(var(--depth) * 0.75);
	pointer-events: none;
	z-index: -1;
}

a { color: var(--gold); text-underline-offset: 3px; }
a:hover, a:focus-visible { color: var(--gold-hi); }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }

h1, h2, h3, .brand, .btn, .eyebrow {
	font-family: "Cinzel", Georgia, serif;
	letter-spacing: 0.04em;
	color: var(--gold);
	line-height: 1.2;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 0.4em; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); margin: 0 0 0.6em; }
h3 { font-size: 1.2rem; margin: 0 0 0.4em; }

.skip {
	position: absolute; left: -999px; top: 8px;
	background: var(--panel); padding: 8px 14px; z-index: 20;
}
.skip:focus { left: 16px; }

/* Header */
.site-header {
	position: sticky; top: 0; z-index: 10;
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding: 12px max(16px, calc((100vw - 1100px) / 2));
	background: rgba(12, 10, 17, 0.88);
	backdrop-filter: blur(6px);
	border-bottom: 1px solid #2a2631;
}
.brand { text-decoration: none; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: flex-end; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--gold); }

/* Layout */
main { display: block; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
section { padding: clamp(48px, 8vw, 96px) 0; }
.eyebrow { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--ember); margin: 0 0 0.6em; }
.lede { font-size: 1.2rem; color: var(--text); }
.muted { color: var(--muted); }

/* Hero */
.hero { padding: 0; position: relative; background: #08070c; }
.hero-art {
	position: relative;
	width: 100%;
	aspect-ratio: 2400 / 775;
	max-height: 78vh;
	margin: 0 auto;
	overflow: hidden;
}
.hero-media {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: cover;
	transform-origin: 50% 40%;
	animation: descend 14s cubic-bezier(.2, .6, .2, 1) both;
}
/* The still sits over the video until the video is playing (site.js adds .playing), so nothing flashes black. */
.hero-art img.hero-media { transition: opacity .6s ease; }
.hero-art.playing img.hero-media { opacity: 0; }
@keyframes descend {
	from { transform: scale(1.14) translateY(-4%); filter: brightness(0.15); }
	35% { filter: brightness(0.85); }
	to { transform: scale(1) translateY(0); filter: brightness(1); }
}
.hero-art::after {
	content: "";
	position: absolute; inset: 0;
	background:
		radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(8, 7, 12, 0.85) 100%),
		linear-gradient(to bottom, transparent 75%, #08070c 100%);
	pointer-events: none;
}
/* Phones: crop in on the title and party so they are not tiny. */
@media (max-width: 700px) {
	.hero-art { aspect-ratio: 4 / 3; }
}
.hero-toggle {
	position: absolute; right: 12px; bottom: 12px; z-index: 3;
	font: 600 0.75rem "Cinzel", Georgia, serif; letter-spacing: 0.08em;
	color: var(--muted);
	background: rgba(12, 10, 17, 0.65);
	border: 1px solid #3a3440;
	border-radius: 4px;
	padding: 5px 10px;
	cursor: pointer;
}
.hero-toggle:hover, .hero-toggle:focus-visible { color: var(--gold); border-color: var(--brass); }
#embers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

.hero-copy {
	text-align: center;
	padding: 8px 16px clamp(48px, 7vw, 80px);
	position: relative; z-index: 2;
}
.tagline {
	font-family: "Cinzel", Georgia, serif;
	font-size: clamp(1.25rem, 3vw, 1.9rem);
	color: var(--text);
	margin: 0 0 0.3em;
	opacity: 0;
	animation: rise 1.6s ease-out 2.2s forwards;
}
.hero-copy .sub { color: var(--muted); margin: 0 0 1.6em; opacity: 0; animation: rise 1.6s ease-out 2.8s forwards; }
.hero-copy .actions { opacity: 0; animation: rise 1.6s ease-out 3.2s forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
	.hero-media, .tagline, .hero-copy .sub, .hero-copy .actions { animation: none; opacity: 1; filter: none; transform: none; }
}

/* Buttons, styled like the game's brass-edged plates */
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn {
	display: inline-block;
	padding: 12px 24px;
	font-size: 1rem; font-weight: 700;
	text-decoration: none;
	color: var(--gold);
	background: #241f26;
	border: 2px solid var(--brass);
	border-radius: 4px;
	box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
	transition: border-color .15s, background .15s, color .15s;
}
.btn:hover, .btn:focus-visible { border-color: #d9ad4d; background: #332d33; color: #fff0c4; }
.btn.primary { background: linear-gradient(#5a3c1c, #3a2612); border-color: #d9ad4d; }
.btn.primary:hover { background: linear-gradient(#6d4922, #472e15); }
.btn[aria-disabled="true"] { cursor: default; }

/* Pitch */
.pitch { text-align: center; }
.pitch blockquote {
	margin: 0 auto;
	max-width: 760px;
	font-family: "Cinzel", Georgia, serif;
	font-size: clamp(1.3rem, 3vw, 1.8rem);
	color: var(--gold);
	line-height: 1.4;
}
.pitch p { max-width: 680px; margin: 1.2em auto 0; color: var(--muted); }

/* Feature cards */
.features {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 18px;
	margin-top: 32px;
}
.card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 22px 22px 18px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.card p { margin: 0; color: var(--muted); }
.card .rune { display: block; font-size: 1.6rem; margin-bottom: 6px; color: var(--ember); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .9s ease, transform .9s ease; }
.reveal.shown { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Death and rescue strip */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li {
	counter-increment: step;
	position: relative;
	padding: 0 0 18px 52px;
	border-left: 2px solid #3a3440;
	margin-left: 18px;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
	content: counter(step);
	position: absolute; left: -19px; top: -4px;
	width: 36px; height: 36px; border-radius: 50%;
	display: grid; place-items: center;
	background: var(--panel); border: 2px solid var(--brass);
	font-family: "Cinzel", Georgia, serif; color: var(--gold);
}
.steps strong { color: var(--text); }
.steps span { color: var(--muted); }

.framed {
	width: 100%; height: auto; display: block;
	border: 2px solid var(--brass);
	border-radius: 4px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* Depth gauge: a quiet floor counter on wide screens */
.gauge {
	position: fixed; right: 18px; top: 50%;
	transform: translateY(-50%);
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	font-family: "Cinzel", Georgia, serif; font-size: 0.75rem; color: var(--muted);
	z-index: 5; pointer-events: none;
}
.gauge .track { width: 2px; height: 160px; background: #2a2631; position: relative; }
.gauge .lamp {
	position: absolute; left: 50%; top: calc(var(--depth) * 100%);
	width: 10px; height: 10px; border-radius: 50%;
	transform: translate(-50%, -50%);
	background: var(--gold-hi);
	box-shadow: 0 0 12px 4px rgba(255, 190, 80, 0.6);
}
@media (max-width: 900px) { .gauge { display: none; } }

/* Heroes page: a card per class, its clip beside its text */
.classes-section { padding-top: 0; }
.classes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 18px; }
.class-card {
	display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: start;
	background: var(--panel);
	border: 1px solid var(--border);
	border-top: 3px solid var(--accent, var(--brass));
	border-radius: 6px;
	padding: 16px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.class-clip {
	width: 160px; aspect-ratio: 4 / 5; height: auto;
	border-radius: 4px; background: #1c1a21; object-fit: cover; display: block;
}
.class-text h2 { font-size: 1.45rem; margin: 0 0 0.15em; }
.class-text .role { margin: 0 0 0.6em; color: var(--text); font-style: italic; }
.traits { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: 0.95rem; }
.traits li { margin-bottom: 0.25em; }
.traits strong { color: var(--text); font-weight: normal; }
.spells { margin: 0.7em 0 0; font-size: 0.85rem; color: #9fb4e8; }
.unlock { margin: 0.6em 0 0; font-size: 0.85rem; color: var(--ember); }
@media (max-width: 420px) {
	.class-card { grid-template-columns: 1fr; }
	.class-clip { width: 100%; max-width: 260px; margin: 0 auto; }
}

/* What waits below: the first monsters shown, the deeper ones only as silhouettes */
.bestiary { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 32px; }
@media (max-width: 760px) { .bestiary { grid-template-columns: repeat(3, 1fr); } }
.beast { margin: 0; text-align: center; }
/* The ground sits on the frame, not the picture, so a silhouette darkens only the creature. */
.beast-frame {
	background: radial-gradient(ellipse at 50% 70%, #2a2230 0%, #121016 70%);
	border: 1px solid #2a2631; border-radius: 4px;
}
.beast img { width: 100%; height: auto; display: block; }
.beast figcaption { font-family: "Cinzel", Georgia, serif; color: var(--gold); margin-top: 6px; }
.beast.hidden img { filter: brightness(0) drop-shadow(0 0 10px rgba(127, 178, 255, 0.35)); }
.beast.hidden figcaption { color: var(--muted); letter-spacing: 0.2em; }

/* Screenshot gallery */
.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 28px; }
@media (max-width: 600px) { .shots { grid-template-columns: 1fr; } }
.shots a { display: block; }
.shots img { width: 100%; height: auto; display: block; border: 1px solid var(--brass); border-radius: 4px; }

/* Text pages */
.page h1 { margin-top: 0; }
.page h2 { font-size: 1.4rem; margin-top: 1.8em; }
.page table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.page th, .page td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #2a2631; vertical-align: top; }
.page th { color: var(--gold); font-weight: normal; font-family: "Cinzel", Georgia, serif; width: 34%; }
.art-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.art-grid figure { margin: 0; }
.art-grid figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 6px; }
.note {
	background: var(--panel); border-left: 3px solid var(--ember);
	padding: 12px 16px; border-radius: 0 4px 4px 0; color: var(--muted);
}

/* Footer */
.site-footer {
	border-top: 1px solid #2a2631;
	padding: 32px 16px 40px;
	text-align: center;
	color: var(--muted);
	font-size: 0.9rem;
	background: var(--bg-deep);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center; margin-bottom: 12px; }
.site-footer p { margin: 0.3em 0; }
