/* Main Site - Descending Divinity */

:root {
	--bg: #0a0a0f;
	--bg-surface: #0e0e15;
	--bg-card: rgba(255, 255, 255, 0.04);
	--bg-card-hover: rgba(255, 255, 255, 0.07);
	--text: #e8e6e3;
	--text-muted: #a6a39e;
	--accent: #f6cd27;
	--accent-hover: #f8d84e;
	--accent-glow: rgba(246, 205, 39, 0.15);
	--border: rgba(246, 205, 39, 0.2);
	--border-subtle: rgba(255, 255, 255, 0.06);
	--font-heading: 'Cinzel', Georgia, serif;
	--font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--header-height: 64px;
}

*, *::before, *::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

/* ===== BUTTONS ===== */
.btn {
	display: inline-block;
	padding: 0.75rem 1.75rem;
	border-radius: 4px;
	font-family: var(--font-heading);
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	transition: all 0.25s;
	cursor: pointer;
	text-align: center;
}

.btn--primary {
	background: var(--accent);
	color: #0a0a0f;
	border: 2px solid var(--accent);
}
.btn--primary:hover {
	background: var(--accent-hover);
	color: #0a0a0f;
	box-shadow: 0 0 20px var(--accent-glow);
}

.btn--outline {
	background: transparent;
	color: var(--accent);
	border: 2px solid var(--border);
}
.btn--outline:hover {
	border-color: var(--accent);
	color: var(--accent-hover);
	box-shadow: 0 0 20px var(--accent-glow);
}

/* ===== HEADER ===== */
.site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	height: var(--header-height);
	background: rgba(10, 10, 15, 0.8);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border-subtle);
	transition: background 0.3s, box-shadow 0.3s;
}
.site-header.is-sticky {
	background: rgba(10, 10, 15, 0.95);
	box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.site-header__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1.5rem;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.site-header__brand {
	font-family: var(--font-heading);
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--accent);
	letter-spacing: 0.06em;
}
.site-header__brand:hover { color: var(--accent-hover); }

.site-header__nav {
	display: flex;
	align-items: center;
	gap: 2rem;
}
.site-header__nav a {
	color: var(--text-muted);
	font-size: 0.9rem;
	font-weight: 400;
	letter-spacing: 0.02em;
	transition: color 0.2s;
}
.site-header__nav a:hover,
.site-header__nav a.is-active {
	color: var(--accent);
}

.site-header__cta {
	background: var(--accent);
	color: #0a0a0f !important;
	padding: 0.4rem 1.1rem;
	border-radius: 4px;
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.site-header__cta:hover {
	background: var(--accent-hover);
	color: #0a0a0f !important;
}

/* Mobile toggle */
.site-header__toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
}
.site-header__toggle span {
	display: block;
	width: 24px;
	height: 2px;
	background: var(--text);
	border-radius: 2px;
	transition: transform 0.3s, opacity 0.3s;
}
.site-header__toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header__toggle.is-active span:nth-child(2) { opacity: 0; }
.site-header__toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== HERO ===== */
.hero {
	position: relative;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding-top: var(--header-height);
}

.hero__backdrop {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-image: url('/assets/images/hero_parallax.png');
	background-image: image-set(
		url('/assets/images/hero_parallax.webp') type('image/webp'),
		url('/assets/images/hero_parallax.png') type('image/png')
	);
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	background-attachment: fixed;
}
.hero__backdrop::after {
	content: '';
	position: absolute;
	inset: 0;
	background:
		linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 70%),
		radial-gradient(ellipse at center, transparent 30%, var(--bg) 80%),
		linear-gradient(to bottom, transparent 50%, var(--bg) 100%);
}

.hero__content {
	position: relative;
	z-index: 1;
	max-width: 1200px;
	width: 100%;
	margin: 0 auto;
	padding: 4rem 1.5rem;
	display: flex;
	align-items: center;
	gap: 4rem;
}

.hero__text {
	flex: 1;
}

.hero__title {
	font-family: var(--font-heading);
	font-size: clamp(2.5rem, 5vw, 4rem);
	font-weight: 900;
	color: var(--accent);
	line-height: 1.1;
	letter-spacing: 0.04em;
	margin-bottom: 0.75rem;
	text-shadow: 0 0 40px var(--accent-glow);
}

.hero__subtitle {
	font-family: var(--font-heading);
	font-size: clamp(1rem, 2vw, 1.3rem);
	color: var(--text-muted);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin-bottom: 1.25rem;
}

.hero__tagline {
	font-size: 1.15rem;
	color: var(--text);
	font-style: italic;
	margin-bottom: 2rem;
	opacity: 0.85;
}

.hero__actions {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
}

.hero__book {
	flex-shrink: 0;
	width: 300px;
}
.hero__book img {
	width: 100%;
	height: auto;
	transition: transform 0.4s;
}
.hero__book img:hover {
	transform: translateY(-6px);
}

/* ===== SECTION SHARED ===== */
.section-inner {
	max-width: 1000px;
	margin: 0 auto;
	padding: 5rem 1.5rem;
}

.section-heading {
	font-family: var(--font-heading);
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: 700;
	color: var(--accent);
	text-align: center;
	letter-spacing: 0.04em;
	margin-bottom: 2.5rem;
	position: relative;
}
.section-heading::after {
	content: '';
	display: block;
	width: 60px;
	height: 2px;
	background: var(--accent);
	margin: 0.75rem auto 0;
	opacity: 0.6;
}

/* ===== CHRONOLOGY ===== */
.chronology {
	background: var(--bg-surface);
	border-top: 1px solid var(--border-subtle);
	border-bottom: 1px solid var(--border-subtle);
}

.chronology__grid {
	display: flex;
	gap: 2rem;
	justify-content: center;
	flex-wrap: wrap;
}

.chronology__book {
	text-align: center;
	width: 200px;
}

.chronology__cover {
	width: 180px;
	height: 270px;
	margin: 0 auto 1rem;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
	transition: transform 0.3s, box-shadow 0.3s;
}
.chronology__book--active .chronology__cover:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
}

.chronology__cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.chronology__cover--placeholder {
	background: rgba(255, 255, 255, 0.03);
	border: 1px dashed var(--border);
	display: flex;
	align-items: center;
	justify-content: center;
}
.chronology__lock {
	font-family: var(--font-heading);
	font-size: 2.5rem;
	color: var(--text-muted);
	opacity: 0.4;
}

.chronology__number {
	display: block;
	font-size: 0.8rem;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin-bottom: 0.25rem;
}

.chronology__title {
	font-family: var(--font-heading);
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--text);
}

.chronology__status {
	display: inline-block;
	margin-top: 0.5rem;
	padding: 0.2rem 0.7rem;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.chronology__status--writing {
	background: rgba(201, 168, 76, 0.15);
	color: var(--accent);
	border: 1px solid var(--border);
}

/* ===== PROGRESS ===== */
.progress-section {
	position: relative;
	overflow: hidden;
	border-bottom: 1px solid var(--border-subtle);
}

.progress-section__backdrop {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-image: url('/assets/images/progress_parallax.png');
	background-image: image-set(
		url('/assets/images/progress_parallax.webp') type('image/webp'),
		url('/assets/images/progress_parallax.png') type('image/png')
	);
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	background-attachment: fixed;
	filter: brightness(0.3) saturate(0.8);
}
.progress-section__backdrop::after {
	content: '';
	position: absolute;
	inset: 0;
	background:
		linear-gradient(to bottom, var(--bg) 0%, transparent 20%, transparent 80%, var(--bg) 100%);
}

.progress-section .section-inner {
	position: relative;
	z-index: 1;
}

.progress-card {
	background: var(--bg-card);
	border: 1px solid var(--border-subtle);
	border-radius: 10px;
	padding: 2.5rem 3rem;
	max-width: 750px;
	margin: 0 auto;
}

.progress-card__header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 0.75rem;
}

.progress-card__label {
	font-family: var(--font-heading);
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--text);
}

.progress-card__pct {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--accent);
}

.progress-card__bar {
	height: 14px;
	background: rgba(255, 255, 255, 0.06);
	border-radius: 7px;
	overflow: hidden;
	margin-bottom: 1.25rem;
}

.progress-card__fill {
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, var(--accent), var(--accent-hover));
	border-radius: 7px;
	transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	box-shadow: 0 0 12px var(--accent-glow);
}

.progress-card__note {
	font-size: 1.3rem;
	color: var(--text-muted);
	text-align: center;
}

/* ===== SYNOPSIS ===== */
.synopsis {
	background: var(--bg-surface);
	border-bottom: 1px solid var(--border-subtle);
}

.synopsis__content {
	max-width: 960px;
	margin: 0 auto;
	text-align: center;
}

.synopsis__content p {
	margin-bottom: 1.25rem;
	color: var(--text);
	line-height: 1.8;
}
.synopsis__content p:first-child {
	font-size: 1.15rem;
	font-style: italic;
	color: var(--accent);
}

.synopsis__content .btn {
	margin-top: 1rem;
}

/* ===== COMMUNITY ===== */
.community {
	position: relative;
	overflow: hidden;
	text-align: center;
}

.community__backdrop {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-image: url('/assets/images/community_parallax.png');
	background-image: image-set(
		url('/assets/images/community_parallax.webp') type('image/webp'),
		url('/assets/images/community_parallax.png') type('image/png')
	);
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	background-attachment: fixed;
	filter: brightness(0.3) saturate(0.8);
}
.community__backdrop::after {
	content: '';
	position: absolute;
	inset: 0;
	background:
		linear-gradient(to bottom, var(--bg) 0%, transparent 20%, transparent 80%, var(--bg) 100%);
}

.community .section-inner {
	position: relative;
	z-index: 1;
}

.community__text {
	color: var(--text-muted);
	margin-bottom: 2rem;
	text-align: center;
}

.discord-card {
	display: inline-flex;
	align-items: center;
	gap: 1.25rem;
	background: rgba(88, 101, 242, 0.12);
	border: 1px solid rgba(88, 101, 242, 0.4);
	border-radius: 16px;
	padding: 1.5rem 2rem;
	text-decoration: none;
	color: var(--text);
	transition: background 0.2s, border-color 0.2s, transform 0.2s;
	max-width: 420px;
	width: 100%;
}
.discord-card:hover {
	background: rgba(88, 101, 242, 0.22);
	border-color: rgba(88, 101, 242, 0.7);
	transform: translateY(-2px);
	color: var(--text);
}

.discord-card__icon {
	color: #5865f2;
	flex-shrink: 0;
}

.discord-card__body {
	display: flex;
	flex-direction: column;
	text-align: left;
	flex: 1;
}

.discord-card__name {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--text);
}

.discord-card__sub {
	font-size: 0.9rem;
	color: var(--text-muted);
	margin-top: 0.15rem;
}

.discord-card__cta {
	background: #5865f2;
	color: #fff;
	font-weight: 600;
	font-size: 0.9rem;
	padding: 0.5rem 1.25rem;
	border-radius: 8px;
	white-space: nowrap;
	transition: background 0.2s;
}
.discord-card:hover .discord-card__cta {
	background: #4752c4;
}

/* ===== FOOTER ===== */
.site-footer {
	border-top: 1px solid var(--border-subtle);
	background: var(--bg-surface);
}

.site-footer__inner {
	max-width: 1000px;
	margin: 0 auto;
	padding: 3rem 1.5rem 2rem;
}

.site-footer__top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 2rem;
}

.site-footer__logo {
	font-family: var(--font-heading);
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--accent);
	letter-spacing: 0.04em;
}

.site-footer__tagline {
	color: var(--text-muted);
	font-size: 0.85rem;
	margin-top: 0.25rem;
}

.site-footer__social a {
	color: var(--text-muted);
	transition: color 0.2s;
}
.site-footer__social a:hover { color: var(--accent); }

.site-footer__nav {
	display: flex;
	gap: 1.5rem;
	margin-bottom: 2rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid var(--border-subtle);
}
.site-footer__nav a {
	color: var(--text-muted);
	font-size: 0.9rem;
}
.site-footer__nav a:hover { color: var(--accent); }

.site-footer__copyright {
	text-align: center;
	color: var(--text-muted);
	font-size: 0.8rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
	.site-header__toggle { display: flex; }
	.site-header__nav {
		display: none;
		position: absolute;
		top: var(--header-height);
		left: 0;
		right: 0;
		background: rgba(10, 10, 15, 0.98);
		flex-direction: column;
		padding: 1.5rem;
		gap: 1rem;
		border-bottom: 1px solid var(--border-subtle);
	}
	.site-header__nav.is-open { display: flex; }
	.site-header__nav a { font-size: 1rem; }
	.site-header__cta {
		text-align: center;
		margin-top: 0.5rem;
	}

	.hero__content {
		flex-direction: column-reverse;
		text-align: center;
		padding-top: 2rem;
		gap: 2rem;
	}
	.hero__book { width: 220px; }
	.hero__actions { justify-content: center; }

	.chronology__grid { gap: 1.5rem; }
	.chronology__book { width: 160px; }
	.chronology__cover { width: 140px; height: 210px; }

	.progress-card { padding: 1.25rem; }

	.site-footer__top { flex-direction: column; gap: 1rem; }
	.site-footer__nav { flex-wrap: wrap; gap: 1rem; }
}

@media (max-width: 480px) {
	.hero__book { width: 180px; }
	.hero__actions { flex-direction: column; align-items: center; }
	.btn { width: 100%; }
	.chronology__grid { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
	.chronology__book { width: 160px; text-align: center; }
	.chronology__cover { width: 140px; height: 210px; }
	.chronology__book--locked { display: none; }

	/* Fixed backgrounds cause continual repaints on mobile - switch to scroll */
	.hero__backdrop,
	.progress-section__backdrop,
	.community__backdrop { background-attachment: scroll; }
}
