/* ==========================================================================
   base.css — design tokens, reset, typography
   ========================================================================== */

:root {
	/* Palette — "twilight rose": plum ink, blush parchment, rose + gilt accents */
	--ink: #241028;
	--ink-deep: #1a0b1e;
	--page: #33193b;
	--page-soft: #3d2046;
	--parchment: #f7e9f0;
	--muted: #c7a3bc;
	--rose: #e9799e;
	--gilt: #e3b96b;
	--rule: rgba(231, 179, 205, 0.22);

	/* Blue edge on the live panels. Change --edge to retint all of it. */
	--edge: #5b9dff;
	--edge-line: rgba(91, 157, 255, 0.55);
	--edge-glow: rgba(91, 157, 255, 0.16);

	/* Spotify */
	--spotify: #1db954;

	/* Discord presence colours */
	--status-online: #43b581;
	--status-idle: #faa61a;
	--status-dnd: #f04747;
	--status-offline: #72767d;

	/* Type */
	--display: "Bodoni Moda", "Didot", Georgia, serif;
	--body: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;

	/* Scale (1.333 — perfect fourth) */
	--t-xs: 0.78rem;
	--t-sm: 0.9rem;
	--t-base: 1.05rem;
	--t-md: 1.35rem;
	--t-lg: 1.85rem;
	--t-xl: 2.6rem;

	/* Rhythm */
	--column: 34rem;
	--shell: 66rem;
	--gap: 1.5rem;
	--chapter-gap: 5rem;
}

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

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	min-height: 100vh;
	background:
		radial-gradient(120% 70% at 12% 0%, #3a1a42 0%, transparent 60%),
		radial-gradient(90% 60% at 100% 100%, #40203f 0%, transparent 55%),
		var(--ink);
	color: var(--parchment);
	font-family: var(--body);
	font-size: var(--t-base);
	line-height: 1.72;
	display: flex;
	flex-direction: column;
}

/* Paper grain — keeps the flat gradient from reading as a template wash */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	opacity: 0.05;
	background-image: radial-gradient(var(--parchment) 0.5px, transparent 0.5px);
	background-size: 4px 4px;
	z-index: 0;
}

h1,
h2,
h3 {
	font-family: var(--display);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.01em;
}

h1 {
	font-size: clamp(2.6rem, 7vw, 4.6rem);
}

h2 {
	font-size: clamp(1.9rem, 4vw, var(--t-xl));
}

h3 {
	font-size: var(--t-md);
}

p {
	max-width: var(--column);
}

a {
	color: var(--parchment);
	text-decoration-color: var(--rose);
	text-underline-offset: 0.25em;
}

a:hover {
	color: var(--rose);
}

:focus-visible {
	outline: 2px solid var(--gilt);
	outline-offset: 3px;
	border-radius: 3px;
}

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

/* Chapter marker — the storybook voice, set in display italic rather than
   an all-caps eyebrow label. */
.chapter-mark {
	font-family: var(--display);
	font-style: italic;
	font-size: var(--t-sm);
	color: var(--gilt);
	letter-spacing: 0.02em;
	display: block;
	margin-bottom: 0.6rem;
}

.lede {
	font-family: var(--display);
	font-size: clamp(1.15rem, 2.4vw, var(--t-md));
	line-height: 1.5;
	color: var(--parchment);
	max-width: 30rem;
}

.prose p + p {
	margin-top: 1.1rem;
}

.prose {
	color: var(--muted);
}

/* Drop cap opens each chapter's first paragraph */
.prose > p:first-of-type::first-letter {
	font-family: var(--display);
	float: left;
	font-size: 3.6rem;
	line-height: 0.82;
	padding: 0.12em 0.12em 0 0;
	color: var(--rose);
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--rose);
	color: var(--ink-deep);
	padding: 0.6rem 1rem;
	z-index: 10;
}

.skip-link:focus {
	left: 1rem;
	top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}
