/* ══════════════════════════════════════════════════════════════
   Zhanchao Yang — North Is a Choice
   Loads after home.css and reassigns its tokens for a dark page.

   The register here is an atlas at night: deep navy ground, a
   faint graticule, numbered plates, and captions set like the
   marginalia on an old map sheet. The homepage is ivory and
   quiet; this one is meant to feel like a light table.
══════════════════════════════════════════════════════════════ */

body.map-page {
	/* reassign home.css tokens so the shared nav + footer go dark */
	--bg: #0d1b2e;
	--ink: #f2f6fa;
	--ink-soft: rgba(242, 246, 250, 0.68);
	--ink-faint: rgba(242, 246, 250, 0.42);
	--line: rgba(242, 246, 250, 0.16);
	--line-soft: rgba(242, 246, 250, 0.09);
	--red: #e8a33d;

	/* page-local */
	--deep: #0d1b2e;
	--deeper: #091423;
	--panel: #14263d;
	--ice: #d9e8f2;
	--amber: #e8a33d;
	--teal: #4bb3c9;
	--rust: #d1573f;

	background: var(--deep);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

body.map-page .site-nav {
	background: rgba(13, 27, 46, 0.82);
	border-bottom: 1px solid transparent;
}
body.map-page .nav-links a.active { color: var(--amber); }
body.map-page .nav-toggle span { background: var(--ink); }

/* graticule: a faint polar grid behind everything */
body.map-page::before {
	content: '';
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-image: repeating-linear-gradient(
			90deg,
			rgba(217, 232, 242, 0.055) 0 1px,
			transparent 1px 132px
		),
		repeating-linear-gradient(
			0deg,
			rgba(217, 232, 242, 0.04) 0 1px,
			transparent 1px 132px
		);
	-webkit-mask-image: radial-gradient(ellipse 120% 70% at 50% 8%, #000 0%, transparent 78%);
	mask-image: radial-gradient(ellipse 120% 70% at 50% 8%, #000 0%, transparent 78%);
}

body.map-page > main,
body.map-page > section,
body.map-page > footer {
	position: relative;
	z-index: 1;
}

/* ── Hero ─────────────────────────────────────────────────── */
.mp-hero {
	padding: 178px 0 58px;
	position: relative;
	overflow: hidden;
}

/* concentric rings, like the latitude circles on a polar sheet */
.mp-rings {
	position: absolute;
	top: -34%;
	right: -14%;
	width: 760px;
	height: 760px;
	pointer-events: none;
	opacity: 0.5;
}
.mp-rings circle {
	fill: none;
	stroke: rgba(217, 232, 242, 0.13);
	stroke-width: 1;
}
.mp-rings line { stroke: rgba(217, 232, 242, 0.08); stroke-width: 1; }

.mp-eyebrow {
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--amber);
	margin-bottom: 26px;
}
.mp-hero h1 {
	font-family: var(--serif);
	font-weight: 600;
	font-size: clamp(2.9rem, 8vw, 6rem);
	line-height: 1;
	letter-spacing: -0.03em;
	max-width: 14ch;
}
.mp-hero h1 em {
	font-style: italic;
	color: var(--amber);
}
.mp-lead {
	font-family: var(--serif);
	font-size: clamp(1.1rem, 2vw, 1.35rem);
	line-height: 1.6;
	color: var(--ink-soft);
	max-width: 60ch;
	margin-top: 34px;
}
.mp-note {
	font-size: 0.95rem;
	line-height: 1.75;
	color: var(--ink-faint);
	max-width: 58ch;
	margin-top: 20px;
	padding-left: 20px;
	border-left: 1px solid var(--line);
}

/* ── Plate rail: internal nav, fixed to the right edge ───── */
.mp-rail {
	position: fixed;
	right: 26px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 40;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.55s ease, visibility 0.55s ease;
}
.mp-rail.is-visible {
	opacity: 1;
	visibility: visible;
}
.mp-rail ol {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.mp-rail a {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	padding: 9px 0;
	text-decoration: none;
	color: var(--ink-faint);
	transition: color 0.3s ease;
}
.mp-rail-t {
	font-size: 0.74rem;
	letter-spacing: 0.04em;
	white-space: nowrap;
	opacity: 0;
	transform: translateX(6px);
	transition: opacity 0.35s ease, transform 0.35s ease;
}
.mp-rail-n {
	font-family: var(--serif);
	font-size: 0.76rem;
	letter-spacing: 0.1em;
	width: 26px;
	text-align: right;
	position: relative;
}
/* the tick: short by default, long and amber on the current plate */
.mp-rail-n::after {
	content: '';
	position: absolute;
	right: -14px;
	top: 50%;
	width: 8px;
	height: 1px;
	background: currentcolor;
	transition: width 0.35s ease;
}
.mp-rail li.is-current a { color: var(--amber); }
.mp-rail li.is-current .mp-rail-n {
	font-size: 0.86rem;
	font-weight: 600;
}
.mp-rail li.is-current .mp-rail-n::after { width: 18px; }
.mp-rail a:hover { color: var(--ink); }

/* names stay folded away until the reader reaches for the rail */
.mp-rail:hover .mp-rail-t,
.mp-rail:focus-within .mp-rail-t {
	opacity: 1;
	transform: none;
}

/* ── Plates ───────────────────────────────────────────────── */
.mp-plates {
	padding: 0 0 20px;
	border-top: 1px solid var(--line-soft);
}

.mp-plate {
	padding: 88px 0 92px;
	border-bottom: 1px solid var(--line-soft);
	scroll-margin-top: 80px;
}
.mp-plate:last-of-type { border-bottom: 0; }

.mp-plate-head {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 56px;
	align-items: end;
	margin-bottom: 40px;
}
.mp-plate-n {
	font-size: 0.66rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--amber);
	margin-bottom: 14px;
}
.mp-plate-head h2 {
	font-family: var(--serif);
	font-weight: 600;
	font-size: clamp(1.7rem, 3.6vw, 2.6rem);
	line-height: 1.14;
	letter-spacing: -0.02em;
	max-width: 20ch;
}
.mp-plate-head > div > p {
	margin-top: 16px;
	font-size: 1rem;
	line-height: 1.72;
	color: var(--ink-soft);
	max-width: 56ch;
}

/* the specs block sitting beside each title */
.mp-specs {
	border-top: 1px solid var(--line);
	padding-top: 12px;
}
.mp-specs div {
	display: flex;
	justify-content: space-between;
	gap: 18px;
	padding: 9px 0;
	border-top: 1px solid var(--line-soft);
	font-size: 0.8rem;
}
.mp-specs div:first-child { border-top: 0; }
.mp-specs dt {
	color: var(--ink-faint);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 0.66rem;
	font-weight: 600;
	padding-top: 2px;
}
.mp-specs dd {
	color: var(--ink-soft);
	text-align: right;
	max-width: 62%;
}

/* the map itself, mounted like a print */
.mp-mount {
	display: block;
	background: rgba(217, 232, 242, 0.04);
	border: 1px solid var(--line-soft);
	padding: 14px;
	transition: border-color 0.4s ease, transform 0.5s ease;
}
.mp-mount img {
	display: block;
	width: 100%;
	height: auto;
}
.mp-mount:hover {
	border-color: rgba(232, 163, 61, 0.4);
	transform: translateY(-3px);
}
.mp-mount figcaption {
	margin-top: 14px;
	font-size: 0.78rem;
	line-height: 1.6;
	color: var(--ink-faint);
	letter-spacing: 0.02em;
}

.mp-read {
	margin-top: 30px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 44px;
}
.mp-read p {
	font-family: var(--serif);
	font-size: 1.02rem;
	line-height: 1.7;
	color: var(--ink-soft);
}
.mp-read p strong {
	color: var(--ink);
	font-weight: 600;
}

/* ── Plate 01: the study-after comparison ─────────────────── */
/* mine is a portrait sheet, the reference is landscape — the uneven
   columns keep the two plates closer to the same visual height */
.mp-compare {
	display: grid;
	grid-template-columns: 0.82fr 1fr;
	gap: 26px;
	align-items: start;
}
.mp-compare-item {
	background: rgba(217, 232, 242, 0.04);
	border: 1px solid var(--line-soft);
	padding: 14px;
}
.mp-compare-item img {
	display: block;
	width: 100%;
	height: auto;
	background: #fff;
}
.mp-compare-tag {
	display: inline-block;
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	padding: 4px 10px;
	margin-bottom: 12px;
	border: 1px solid var(--line);
	color: var(--ink-faint);
}
.mp-compare-item.is-mine .mp-compare-tag {
	border-color: rgba(232, 163, 61, 0.55);
	color: var(--amber);
}
.mp-compare-item figcaption {
	margin-top: 13px;
	font-size: 0.78rem;
	line-height: 1.62;
	color: var(--ink-faint);
}
.mp-compare-item figcaption a {
	color: var(--ink-soft);
	text-decoration: none;
	border-bottom: 1px solid var(--line);
}
.mp-compare-item figcaption a:hover {
	color: var(--amber);
	border-bottom-color: var(--amber);
}

/* what was copied and what was not */
.mp-diff {
	margin-top: 34px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	border: 1px solid var(--line-soft);
}
.mp-diff > div { padding: 26px 28px 30px; }
.mp-diff > div:first-child { border-right: 1px solid var(--line-soft); }
.mp-diff h3 {
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	margin-bottom: 16px;
}
.mp-diff .is-kept { color: var(--teal); }
.mp-diff .is-changed { color: var(--rust); }
.mp-diff ul { list-style: none; }
.mp-diff li {
	font-size: 0.88rem;
	line-height: 1.6;
	color: var(--ink-soft);
	padding: 9px 0 9px 18px;
	position: relative;
	border-top: 1px solid var(--line-soft);
}
.mp-diff li:first-child { border-top: 0; }
.mp-diff li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 17px;
	width: 8px;
	height: 1px;
	background: currentcolor;
	opacity: 0.5;
}

/* ── Interactive plate ────────────────────────────────────── */
.mp-live {
	background: rgba(20, 38, 61, 0.62);
	border: 1px solid var(--line-soft);
	padding: 46px 46px 50px;
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 48px;
	align-items: center;
}
.mp-live h2 {
	font-family: var(--serif);
	font-size: clamp(1.6rem, 3.2vw, 2.2rem);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.16;
	margin-bottom: 14px;
}
.mp-live p {
	font-size: 0.98rem;
	line-height: 1.72;
	color: var(--ink-soft);
	max-width: 54ch;
}
.mp-live-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 24px;
	font-size: 0.86rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	color: var(--amber);
	text-decoration: none;
	padding-bottom: 3px;
	border-bottom: 1px solid rgba(232, 163, 61, 0.4);
	transition: border-color 0.3s ease;
}
.mp-live-link:hover { border-bottom-color: var(--amber); }
.mp-live-link .arrow { transition: transform 0.3s ease; }
.mp-live-link:hover .arrow { transform: translateX(4px); }

/* a small bivariate legend, drawn in CSS */
.mp-bivariate {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 3px;
	width: 168px;
	margin: 0 auto;
	transform: rotate(-45deg);
}
.mp-bivariate span {
	aspect-ratio: 1;
	display: block;
}
.mp-bivariate-wrap { text-align: center; }
.mp-bivariate-cap {
	margin-top: 42px;
	font-size: 0.68rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink-faint);
}

/* ── Closing note ─────────────────────────────────────────── */
.mp-close {
	border-top: 1px solid var(--line-soft);
	background: var(--deeper);
	padding: 84px 0 90px;
}
.mp-close-inner {
	display: grid;
	grid-template-columns: 1.2fr 1fr;
	gap: 60px;
	align-items: start;
}
.mp-close h2 {
	font-family: var(--serif);
	font-size: clamp(1.8rem, 3.8vw, 2.5rem);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.16;
	margin-bottom: 20px;
}
.mp-close h2 em { font-style: italic; color: var(--amber); }
.mp-close p {
	font-size: 1rem;
	line-height: 1.78;
	color: var(--ink-soft);
}
.mp-close p + p { margin-top: 15px; }
.mp-close a {
	color: var(--amber);
	text-decoration: none;
	border-bottom: 1px solid rgba(232, 163, 61, 0.35);
}
.mp-close a:hover { border-bottom-color: var(--amber); }

.mp-toolbox {
	border-top: 1px solid var(--line);
	padding-top: 14px;
}
.mp-toolbox div {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	padding: 11px 0;
	border-top: 1px solid var(--line-soft);
	font-size: 0.85rem;
}
.mp-toolbox div:first-child { border-top: 0; }
.mp-toolbox dt {
	color: var(--ink-faint);
	font-size: 0.66rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding-top: 3px;
}
.mp-toolbox dd { color: var(--ink-soft); text-align: right; max-width: 60%; }

.mp-back {
	margin-top: 30px;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--ink-soft);
	text-decoration: none;
	border-bottom: 0;
}
.mp-back:hover { color: var(--amber); }
.mp-back .arrow { transition: transform 0.3s ease; }
.mp-back:hover .arrow { transform: translateX(-4px); }

/* ── Footer tuning ────────────────────────────────────────── */
body.map-page .site-footer {
	background: var(--deeper);
	border-top: 1px solid var(--line-soft);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1250px) {
	.mp-rail { display: none; }
}

@media (max-width: 1000px) {
	.mp-plate-head,
	.mp-read,
	.mp-live,
	.mp-close-inner {
		grid-template-columns: 1fr;
		gap: 26px;
	}
	.mp-live { padding: 34px 28px 38px; }
	.mp-bivariate-cap { margin-top: 40px; }
}

@media (max-width: 720px) {
	.mp-hero { padding: 128px 0 66px; }
	.mp-rings { display: none; }
	.mp-compare,
	.mp-diff {
		grid-template-columns: 1fr;
	}
	.mp-diff > div:first-child {
		border-right: 0;
		border-bottom: 1px solid var(--line-soft);
	}
	.mp-plate { padding: 60px 0 64px; }
	.mp-mount { padding: 9px; }
	.mp-specs div { flex-direction: column; gap: 3px; }
	.mp-specs dd { text-align: left; max-width: none; }
	.mp-toolbox div { flex-direction: column; gap: 3px; }
	.mp-toolbox dd { text-align: left; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
	.mp-mount,
	.mp-rail,
	.mp-rail-t,
	.mp-rail-n::after,
	.mp-live-link .arrow,
	.mp-back .arrow {
		transition: none;
	}
	.mp-mount:hover { transform: none; }
}
