@import url("https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;600;700;800;900&display=swap");

:root {
	--ink: #101010;
	--accent: #111111;

	--binder-ratio: 2;
	--binder-w: max(100vw, calc(100vh * var(--binder-ratio)));
	--binder-h: max(100vh, calc(100vw / var(--binder-ratio)));
	--page-top: 12%;
	--page-bottom: 12%;
	--page-outer: 23%;
	--page-gutter: 3%;

	--type-scale: 1;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	min-height: 100%;
	font-family: "Public Sans", "Helvetica Neue", Helvetica, sans-serif;
	color: var(--ink);
}

body {
	--binder-image: url("../src/binder_1.png");
	min-height: 100vh;
	display: block;
	overflow-x: hidden;
	overflow-y: hidden;
	position: relative;
	padding: 0;
	background: #0b0b0b;
}

body.page-empty {
	--binder-image: url("../src/empty.png");
}

body.page-warcal {
	--binder-image: url("../src/empty.png");
	overflow-y: auto;
}

body::before {
	content: "";
	position: fixed;
	z-index: -2;
	left: 50%;
	top: 50%;
	width: calc(var(--binder-w) + 2px);
	height: calc(var(--binder-h) + 2px);
	transform: translate(-50%, -50%);
	background-image: var(--binder-image);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

/* ─── Navigation ──────────────────────────────────────────── */

.site-nav,
.site-footer {
	position: fixed;
	left: 0;
	width: 100%;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	background: rgb(18, 18, 18);
}

.site-nav {
	top: 0;
	padding: 11px 24px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer {
	bottom: 0;
	left: 0;
	transform: none;
	width: 100%;
	border-radius: 0;
	border: none;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	background: rgb(18, 18, 18);
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	padding: 7px 24px;
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: rgba(240, 240, 240, 0.86);
}

.site-nav a {
	text-decoration: none;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(245, 245, 245, 0.92);
	padding: 6px 8px;
	border-radius: 6px;
	transition: background-color 120ms ease, color 120ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
	background: rgba(255, 255, 255, 0.16);
	color: #ffffff;
	outline: none;
}

.site-nav a.active {
	background: rgba(248, 226, 145, 0.24);
	color: #fff8dd;
}

.nav-bmc {
	position: absolute;
	right: 24px;
	display: flex;
	align-items: center;
}

.nav-bmc img {
	display: block;
	height: 26px;
	width: auto;
}

/* Hamburger button — hidden on desktop */
.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
	border-radius: 6px;
	position: absolute;
	left: 16px;
}

.nav-toggle span {
	display: block;
	width: 22px;
	height: 2px;
	background: rgba(245, 245, 245, 0.9);
	border-radius: 2px;
	transition: opacity 120ms ease;
}

.nav-toggle:hover span {
	background: #ffffff;
}

/* ─── Mobile warning banner ───────────────────────────────── */

.mobile-warning {
	display: none;
}

/* ─── Layout ─────────────────────────────────────────────── */

.spread {
	position: fixed;
	left: 50%;
	top: 50%;
	width: var(--binder-w);
	height: var(--binder-h);
	transform: translate(-50%, -50%);
}

.page {
	position: absolute;
	top: var(--page-top);
	bottom: var(--page-bottom);
	border-radius: 4px;
	padding: clamp(62px, 2.8vw, 72px) clamp(24px, 2.65vw, 62px) clamp(28px, 2.8vw, 62px);
	overflow: hidden;
}

.page.left {
	left: var(--page-outer);
	right: calc(50% + (var(--page-gutter) / 2));
	overflow-y: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.page.left::-webkit-scrollbar {
	display: none;
}

.page.right {
	left: calc(50% + (var(--page-gutter) / 2));
	right: var(--page-outer);
	overflow-y: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.page.right::-webkit-scrollbar {
	display: none;
}

/* ─── Typography ─────────────────────────────────────────── */

h1,
h2,
p {
	margin: 0;
	position: relative;
	z-index: 1;
}

h1 {
	font-size: calc(5.5vh * var(--type-scale));
	line-height: 0.95;
	font-weight: 900;
	letter-spacing: 0.04em;
	text-align: center;
	margin-bottom: 24px;
	text-transform: uppercase;
	color: var(--accent);
}

h2 {
	font-size: calc(2.95vh * var(--type-scale));
	line-height: 1.06;
	font-weight: 800;
	text-align: center;
	margin-bottom: 54px;
	color: var(--accent);
}

.lead,
.section-copy {
	font-size: calc(1.62vh * var(--type-scale));
	line-height: 1.44;
	font-weight: 500;
	text-align: left;
	margin-bottom: 24px;
	max-width: 100%;
	overflow-wrap: break-word;
	text-wrap: pretty;
}

.lead:last-child,
.section-copy:last-child {
	margin-bottom: 0;
}

.section-title {
	font-size: calc(2.3vh * var(--type-scale));
	line-height: 1.2;
	font-weight: 800;
	margin-bottom: 16px;
	color: var(--accent);
	overflow-wrap: break-word;
}

.section-title--gap {
	margin-top: 28px;
}

/* Content links — printed annotation feel */
.page a {
	color: #2a1b12;
	font-weight: 700;
	text-decoration: none;
	background: rgba(211, 167, 98, 0.34);
	padding: 0 0.08em;
	border-radius: 2px;
	transition: color 120ms ease, background-image 120ms ease;
}

.page a:visited {
	color: #3a2618;
}

.page a:hover,
.page a:focus-visible {
	color: #1a110b;
	background-image: linear-gradient(
		to top,
		rgba(211, 167, 98, 0.46) 0,
		rgba(211, 167, 98, 0.38) 0.48em,
		rgba(211, 167, 98, 0.16) 0.76em,
		rgba(211, 167, 98, 0) 1.04em
	);
	outline: 1px dashed rgba(95, 56, 24, 0.52);
	outline-offset: 2px;
}

.page a:active {
	color: #120c08;
}

.emphasis {
	font-weight: 800;
	letter-spacing: 0.01em;
}

/* ─── CTA buttons ────────────────────────────────────────── */

.cta-row {
	display: flex;
	gap: 12px;
	margin-top: 28px;
	flex-wrap: wrap;
}

.btn {
	display: inline-block;
	font-family: inherit;
	font-size: calc(1.5vh * var(--type-scale));
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 0.5em 1.1em;
	border-radius: 5px;
	transition: opacity 120ms ease, transform 80ms ease;
	cursor: pointer;
}

.btn:hover {
	opacity: 0.85;
	transform: translateY(-1px);
}

.btn:active {
	transform: translateY(0);
}

.btn-primary {
	background: rgba(211, 167, 98, 0.9);
	color: #1a0f06;
}

.btn-secondary {
	background: rgba(211, 167, 98, 0.22);
	color: #2a1b12;
	outline: 1.5px solid rgba(211, 167, 98, 0.5);
	outline-offset: -1.5px;
}

/* Override the .page a hover styles for buttons */
.page .btn,
.page .btn:visited,
.page .btn:hover,
.page .btn:focus-visible {
	background-image: none;
	outline-offset: 3px;
	padding: 0.5em 1.1em;
}

.page .btn-primary:hover,
.page .btn-primary:focus-visible {
	outline: 2px solid rgba(211, 167, 98, 0.7);
}

.page .btn-secondary:hover,
.page .btn-secondary:focus-visible {
	outline: 1.5px solid rgba(211, 167, 98, 0.5);
	outline-offset: -1.5px;
}

/* ─── Responsive: tablet nav ─────────────────────────────── */

@media (max-width: 900px) {
	.site-nav {
		gap: 10px;
		padding: 8px 16px;
	}

	.site-nav a {
		font-size: 0.72rem;
		letter-spacing: 0.06em;
	}
}

/* ─── Responsive: mobile ─────────────────────────────────── */

@media (max-width: 680px) {
	/* Allow page to scroll */
	body.page-index {
		overflow-y: auto;
	}

	/* ── Mobile warning banner ── */
	.mobile-warning {
		display: block;
		position: relative;
		z-index: 10;
		margin: 52px 16px 0;
		padding: 12px 16px;
		background: rgb(26, 20, 6);
		border: 1px solid rgba(248, 200, 80, 0.5);
		border-radius: 6px;
		font-size: 0.82rem;
		line-height: 1.5;
		color: rgb(240, 218, 140);
	}

	/* ── Nav: hamburger layout ── */
	.site-nav {
		justify-content: center;
		padding: 10px 16px;
		flex-wrap: nowrap;
		position: fixed;
	}

	.nav-toggle {
		display: flex;
	}

	.nav-links {
		display: none;
		position: fixed;
		top: 48px;
		left: 0;
		right: 0;
		z-index: 19;
		background: rgb(22, 22, 22);
		border-bottom: 1px solid rgba(255, 255, 255, 0.12);
		flex-direction: column;
		align-items: stretch;
		padding: 8px 12px 12px;
		gap: 4px;
	}

	.nav-links.is-open {
		display: flex;
	}

	.nav-links a {
		font-size: 0.85rem;
		padding: 10px 12px;
		border-radius: 6px;
	}

	.nav-bmc {
		position: static;
		margin-left: auto;
	}

	/* ── Main layout: single column ── */
	.spread {
		position: static;
		width: 100%;
		height: auto;
		transform: none;
		left: auto;
		top: auto;
		display: flex;
		flex-direction: column;
		gap: 2px;
		padding-bottom: 48px; /* footer height */
	}

	.page {
		position: static;
		width: 100%;
		height: auto;
		overflow: visible;
		top: auto;
		bottom: auto;
		left: auto;
		right: auto;
		padding: 28px 20px 32px;
		background: rgba(233, 224, 206, 0.97);
		border-radius: 0;
	}

	/* ── Mobile typography — px floors ── */
	h1 {
		font-size: max(32px, 9vw);
		margin-bottom: 12px;
	}

	h2 {
		font-size: max(17px, 4.5vw);
		margin-bottom: 20px;
	}

	.lead,
	.section-copy {
		font-size: max(14px, 3.8vw);
		line-height: 1.52;
		margin-bottom: 16px;
	}

	.section-title {
		font-size: max(15px, 4vw);
	}

	.section-title--gap {
		margin-top: 24px;
	}

	/* ── Mobile CTA buttons ── */
	.btn {
		font-size: max(12px, 3.2vw);
		padding: 0.65em 1.2em;
	}

	.cta-row {
		margin-top: 20px;
	}
}
