/* moloth.com v2 — shared styles for all pages */
:root {
	--bg-deep: #0b1220;
	--bg-glow: #17325a;
	--card: rgba(255, 255, 255, 0.05);
	--card-hover: rgba(92, 179, 255, 0.12);
	--border: rgba(255, 255, 255, 0.10);
	--text: #e8eef7;
	--muted: #9aabc2;
	--accent: #5cb3ff;   /* the original moloth.com blue */

	/* frosted glass surfaces (cards, docs rows, about panel, fact tags) */
	--frost: linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
	--frost-hover: linear-gradient(135deg, rgba(92, 179, 255, 0.20), rgba(92, 179, 255, 0.06));
	--frost-border: rgba(255, 255, 255, 0.14);
	/* layered depth: tight contact shadow + medium + wide soft lift, plus a glass top highlight */
	--shadow:
		0 1px 2px rgba(0, 0, 0, 0.35),
		0 4px 10px rgba(0, 0, 0, 0.30),
		0 14px 32px rgba(0, 0, 0, 0.42),
		inset 0 1px 0 rgba(255, 255, 255, 0.10);
	--shadow-raised:
		0 2px 4px rgba(0, 0, 0, 0.38),
		0 8px 18px rgba(0, 0, 0, 0.36),
		0 22px 44px rgba(0, 0, 0, 0.50),
		inset 0 1px 0 rgba(255, 255, 255, 0.14),
		0 0 0 1px rgba(92, 179, 255, 0.25);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
	min-height: 100vh;
	font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
	color: var(--text);
	background:
		/* faint blue glows behind the cards so the frosted glass has something to blur */
		radial-gradient(circle at 18% 520px, rgba(92, 179, 255, 0.16) 0, rgba(92, 179, 255, 0) 340px),
		radial-gradient(circle at 84% 900px, rgba(92, 179, 255, 0.12) 0, rgba(92, 179, 255, 0) 380px),
		radial-gradient(circle at 30% 1350px, rgba(120, 160, 255, 0.10) 0, rgba(120, 160, 255, 0) 360px),
		radial-gradient(ellipse at 50% 0%, var(--bg-glow) 0%, var(--bg-deep) 1100px),
		var(--bg-deep);
	line-height: 1.5;
}
a { color: inherit; }
.wrap { max-width: 680px; margin: 0 auto; padding: 48px 16px 40px; }

/* ---------- Header ---------- */
header { text-align: center; margin-bottom: 40px; }
.mage { image-rendering: pixelated; width: 39px; height: 56px; display: block; margin: 0 auto 6px;
	/* crisp pixel-style drop shadow, a nod to the original site's mage shadow */
	filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45)); }
/* The mage is a button that flips light/dark (js/theme.js) */
.mage-btn { display: block; margin: 0 auto 6px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 6px; }
.mage-btn .mage { margin: 0; transition: transform .15s; }
.mage-btn:hover .mage { transform: translateY(-3px); }
.mage-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.logo img { width: min(360px, 80vw); height: auto; display: block; margin: 0 auto;
	filter: drop-shadow(0 4px 18px rgba(92, 179, 255, 0.35)); }
.logo.small img { width: min(220px, 60vw); }
h1 { margin: 14px 0 4px; font-size: 1.25rem; font-weight: 600; letter-spacing: .02em; }
.tagline { margin: 0 auto; max-width: 520px; color: var(--muted); }
.tagline a, .prose a, .back { color: var(--accent); text-decoration: none; }
.tagline a:hover, .prose a:hover, .back:hover { text-decoration: underline; }

/* ---------- Section labels ---------- */
section { margin-bottom: 30px; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent);
	margin: 0 0 10px 4px; font-weight: 600; }

/* ---------- Link cards (home page) ---------- */
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.links a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-decoration: none;
	border-radius: 12px; }
.links a:hover, .links a:focus-visible { outline: none; }
.links img { width: 40px; height: 40px; flex: none; border-radius: 9px; background: #fff; padding: 3px; object-fit: contain;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.40), 0 3px 8px rgba(0, 0, 0, 0.35); }
.links strong { display: block; font-weight: 600; }
.links span { display: block; font-size: .85rem; color: var(--muted); }

/* ---------- Text pages (About, Docs) ---------- */
.panel { border-radius: 14px; padding: 8px 24px; }
.prose p { margin: 16px 0; }
.prose p:first-child { font-size: 1.1rem; }
.facts { list-style: none; padding: 0; margin: 0 0 30px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.facts li { font-size: .85rem; color: var(--muted); border-radius: 999px; padding: 4px 12px; }
.back { display: inline-block; margin-top: 24px; }

/* ---------- Story pages (docs/*.cfm) ---------- */
.story { padding: 18px 28px 22px; font-size: 1.02rem; line-height: 1.75; }
.story p { margin: 0 0 1em; text-indent: 1.5em; }
.story p:first-child, .story .story-section + p, .story .story-break + p { font-size: inherit; text-indent: 0; }
.story-section { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent);
	text-align: center; font-weight: 600; margin: 30px 0 14px; }
.story-section:first-child { margin-top: 6px; }
.story .story-break { text-align: center; text-indent: 0; color: var(--accent); font-size: 1.2rem; margin: 22px 0; }
.story .story-end { text-align: center; text-indent: 0; font-style: italic; color: var(--muted); margin: 28px 0 4px; }
@media (max-width: 480px) { .story { padding: 12px 18px 16px; font-size: 1rem; } }

/* ---------- Docs / writing list ---------- */
.section-about { margin: -4px 4px 12px; color: var(--muted); font-size: .92rem; }
.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.docs a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
	padding: 12px 16px; text-decoration: none; border-radius: 12px; }
.docs a:hover, .docs a:focus-visible { outline: none; }

/* ---------- Shared frosted glass + depth for every card surface ---------- */
.links a, .docs a, .panel, .facts li {
	background: var(--frost);
	border: 1px solid var(--frost-border);
	box-shadow: var(--shadow);
	-webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%);
}
.links a, .docs a { transition: background .15s, border-color .15s, transform .15s, box-shadow .15s; }
.links a:hover, .links a:focus-visible,
.docs a:hover, .docs a:focus-visible {
	background: var(--frost-hover); border-color: var(--accent);
	box-shadow: var(--shadow-raised); transform: translateY(-2px);
}
.doc-title { font-weight: 600; }
.doc-meta { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.doc-note { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); }
.badge { font-size: .7rem; font-weight: 700; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; }
.badge-pdf { background: rgba(255, 99, 99, .16); color: #ff9a9a; }
.badge-web { background: rgba(92, 179, 255, .16); color: var(--accent); }

/* ---------- Footer ---------- */
footer { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--border);
	text-align: center; font-size: .85rem; color: var(--muted); }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 480px) { .panel { padding: 4px 16px; } }
@media (prefers-reduced-motion: reduce) {
	.links a, .docs a, .mage-btn .mage { transition: none; }
	.mage-btn:hover .mage { transform: none; }
	.links a:hover, .links a:focus-visible, .docs a:hover, .docs a:focus-visible { transform: none; }
}
