/* Echoes of the Isles: the one stylesheet every page shares.
   Layout: a slim header, then a reading column about 68 characters wide.
   Guides and changelogs add a contents rail beside it on wide screens.
   Night comes first (lamplight on a dark sea); Day follows the device,
   or the switch in the footer. */

/* ------------------------------------------------------------------ */
/* Tokens                                                              */
/* ------------------------------------------------------------------ */

:root {
	color-scheme: dark;

	/* Night */
	--bg: #0e141b;            /* the sea after dark */
	--bg-raised: #141c25;     /* header, footer, panels */
	--bg-band: #111922;       /* full-width bands */
	--ink: #ebe5d8;           /* lamplit paper */
	--ink-soft: #a9b3bd;      /* secondary text */
	--rule: #243040;          /* hairlines */
	--rule-strong: #3a4859;
	--lamp: #e9b35c;          /* the one accent: links, marks, numbers */
	--lamp-hover: #f6cd85;
	--lamp-fill: #e9b35c;     /* a button's face */
	--lamp-fill-hover: #f6cd85;
	--on-lamp: #1c1407;       /* text on a button */
	--tint: rgba(233, 179, 92, 0.07);
	--focus: #ffd897;
	--code-bg: #18222d;

	/* The elements, as the game colours them */
	--air: #6fd3e8;
	--earth: #6cc070;
	--fire: #e8674f;
	--water: #5b8fe6;

	/* The game window keeps the game's own colours in both themes */
	--game-bg: #0a0e12;
	--game-edge: #2b3644;
	--game-text: #e4e4e4;
	--game-room: #4fd16a;
	--game-weather: #e05ad6;
	--game-exits: #4fd16a;
	--game-cmd: #86aefc;
	--game-strong: #ffffff;
	--game-mob: #e4bc4f;
	--game-alert: #f06a6a;
	--game-info: #5fd0d8;
	--game-field: #e3d270;
	--game-forest: #4fd16a;
	--game-sky: #6fd3e8;

	--f-display: "Sorts Mill Goudy", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--f-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
	--f-mono: "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;

	--gutter: clamp(1rem, 4vw, 2.5rem);
	--radius: 6px;
	--label: 0.75rem;         /* small capitals: kickers, labels */
}

@media (prefers-color-scheme: light) {
	:root:not([data-theme="dark"]) {
		color-scheme: light;
		--bg: #edf0ef;
		--bg-raised: #f7f9f8;
		--bg-band: #e3e9e8;
		--ink: #17212b;
		--ink-soft: #3b4753;
		--rule: #cbd3d6;
		--rule-strong: #a3afb5;
		--lamp: #8a5200;
		--lamp-hover: #653c00;
		--lamp-fill: #e3a947;
		--lamp-fill-hover: #eebd62;
		--on-lamp: #1c1407;
		--tint: rgba(138, 82, 0, 0.07);
		--focus: #17212b;
		--code-bg: #e2e8e8;
		--air: #1d8fa8;
		--earth: #3c8a40;
		--fire: #c2412b;
		--water: #2f63c4;
	}
}

:root[data-theme="light"] {
	color-scheme: light;
	--bg: #edf0ef;
	--bg-raised: #f7f9f8;
	--bg-band: #e3e9e8;
	--ink: #17212b;
	--ink-soft: #3b4753;
	--rule: #cbd3d6;
	--rule-strong: #a3afb5;
	--lamp: #8a5200;
	--lamp-hover: #653c00;
	--lamp-fill: #e3a947;
	--lamp-fill-hover: #eebd62;
	--on-lamp: #1c1407;
	--tint: rgba(138, 82, 0, 0.07);
	--focus: #17212b;
	--code-bg: #e2e8e8;
	--air: #1d8fa8;
	--earth: #3c8a40;
	--fire: #c2412b;
	--water: #2f63c4;
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

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

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

/* Escard's sun across every page: from the east in the morning, the west in the evening,
   none at night (set from world.json by site.js). Faint enough to leave every contrast alone. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -2;
	pointer-events: none;
	background: radial-gradient(110rem 60rem at var(--sun-x, 50%) -14rem, rgba(var(--sun-rgb, 255, 255, 255), var(--sun-a, 0)), transparent 70%);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--f-body);
	font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
	line-height: 1.65;
}

h1, h2, .display {
	font-family: var(--f-display);
	font-weight: 400;
	font-synthesis: none;	/* the display face has no bold; never fake one */
	line-height: 1.1;
	letter-spacing: 0.005em;
	text-wrap: balance;
	margin: 0;
}

h1 {
	font-size: clamp(2.4rem, 1.7rem + 2.8vw, 3.75rem);
}

h2 {
	font-size: clamp(1.7rem, 1.4rem + 1.1vw, 2.3rem);
}

h3 {
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
	text-wrap: balance;
	margin: 0;
}

p {
	text-wrap: pretty;
}

a {
	color: var(--lamp);
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--lamp-hover);
	text-decoration-thickness: 2px;
}

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

code, kbd {
	font-family: var(--f-mono);
	font-size: 0.9em;
	font-variant-ligatures: none;
	padding: 0.06em 0.36em;
	border: 1px solid var(--rule);
	border-radius: 4px;
	background: var(--code-bg);
	color: var(--ink);
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
	overflow-wrap: anywhere;
}

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

[hidden] {
	display: none !important;
}

.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wrap {
	width: 100%;
	max-width: 76rem;
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* Icons come from icons.svg; each is a stroked line drawing */
.ico {
	width: 1.25rem;
	height: 1.25rem;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Small capitals used for every label on the site */
.label, .kicker, .toc-label, .facts dt, thead th, .site-foot h2 {
	font-family: var(--f-body);
	font-size: var(--label);
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-transform: uppercase;
}

/* ------------------------------------------------------------------ */
/* Skip link, header and navigation                                    */
/* ------------------------------------------------------------------ */

.skip {
	position: absolute;
	left: 1rem;
	top: -10rem;
	z-index: 10;
	padding: 0.65rem 1rem;
	border-radius: var(--radius);
	background: var(--lamp-fill);
	color: var(--on-lamp);
	font-weight: 700;
	text-decoration: none;
}

.skip:focus {
	top: calc(env(safe-area-inset-top, 0px) + 1rem);
}

.site-head {
	border-bottom: 1px solid var(--rule);
}

.site-head .wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 2rem;
	padding-block: 0.85rem;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--ink);
	font-family: var(--f-display);
	font-size: 1.45rem;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
}

.brand:hover {
	color: var(--ink);
}

.brand i {
	font-size: 0.8em;
}

.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 1.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav a {
	display: inline-block;
	padding-block: 0.3rem;
	border-bottom: 2px solid transparent;
	color: var(--ink);
	font-size: 0.97rem;
	text-decoration: none;
}

.site-nav a:hover {
	border-bottom-color: var(--rule-strong);
}

.site-nav a[aria-current],
.site-nav a.in-section {
	border-bottom-color: var(--lamp);
}

.site-nav a.nav-play {
	padding: 0.4rem 0.95rem;
	border: 1px solid var(--lamp);
	border-radius: 999px;
	color: var(--lamp);
	font-weight: 700;
}

.site-nav a.nav-play:hover {
	background: var(--tint);
}

.site-nav a.nav-play[aria-current] {
	background: var(--lamp-fill);
	color: var(--on-lamp);
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.8rem 1.3rem;
	border: 1px solid transparent;
	border-radius: var(--radius);
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}

.btn-primary {
	background: var(--lamp-fill);
	color: var(--on-lamp);
}

.btn-primary:hover {
	background: var(--lamp-fill-hover);
	color: var(--on-lamp);
}

.btn-quiet {
	border-color: var(--rule-strong);
	color: var(--ink);
}

.btn-quiet:hover {
	border-color: var(--lamp);
	background: var(--tint);
	color: var(--ink);
}

.btn .ico {
	width: 1.1rem;
	height: 1.1rem;
}

.cta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

/* ------------------------------------------------------------------ */
/* Home: the opening                                                   */
/* ------------------------------------------------------------------ */

.hero {
	position: relative;
}

/* Escard's sky, drawn by sky.js behind the header and the opening (front page only) */
.sky-canvas {
	position: absolute;
	top: 0;
	left: 0;
	z-index: -1;
	display: block;
	width: 100%;
	height: 0;
	pointer-events: none;
}

.site-head.over-sky {
	border-bottom-color: transparent;
}

/* Over the sky, the header and the opening take their colours from the sky, not the page */
:root[data-sky="dark"] .over-sky,
:root[data-sky="dark"] .hero {
	--ink: #ebe5d8;
	--ink-soft: #c2cad2;
	--rule: rgba(235, 229, 216, 0.2);
	--rule-strong: rgba(235, 229, 216, 0.38);
	--lamp: #f0be6a;
	--lamp-hover: #f8d390;
	--tint: rgba(240, 190, 106, 0.12);
	--focus: #ffd897;
	--code-bg: rgba(8, 12, 18, 0.6);
	--shade: 0 1px 2px rgba(0, 0, 0, 0.55);
}

:root[data-sky="light"] .over-sky,
:root[data-sky="light"] .hero {
	--ink: #131c25;
	--ink-soft: #2c3844;
	--rule: rgba(19, 28, 37, 0.22);
	--rule-strong: rgba(19, 28, 37, 0.42);
	--lamp: #5e3600;
	--lamp-hover: #432600;
	--tint: rgba(94, 54, 0, 0.08);
	--focus: #131c25;
	--code-bg: rgba(255, 255, 255, 0.6);
	--shade: 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* Re-read the colour here: inherited text keeps the page's colour, not the sky's */
.hero,
.over-sky {
	color: var(--ink);
}

.hero h1,
.hero .kicker,
.hero .cta-note,
.over-sky .brand,
.over-sky .site-nav a:not(.nav-play) {
	text-shadow: var(--shade, none);
}

.hero .btn-quiet {
	background: var(--code-bg);
}

.hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: center;
	gap: 2.75rem;
	/* The town stands in the space below */
	padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(7.5rem, 6.5rem + 6.5vw, 13rem);
}

.hero .kicker {
	color: var(--lamp);
}

.hero h1 {
	margin-top: 0.9rem;
	font-size: clamp(3.2rem, 2.1rem + 5vw, 5.75rem);
	line-height: 0.92;
}

.hero h1 span {
	display: block;
}

.hero h1 i {
	font-size: 0.52em;
	letter-spacing: 0.01em;
}

.standfirst {
	max-width: 34em;
	margin: 1.4rem 0 0;
	color: var(--ink-soft);
	font-size: clamp(1.12rem, 1.04rem + 0.35vw, 1.3rem);
	line-height: 1.55;
}

.hero .cta-row {
	margin-top: 2rem;
}

.cta-note {
	margin: 1rem 0 0;
	color: var(--ink-soft);
	font-size: 0.92rem;
}

/* The game window: real output, in the game's colours */
.game {
	min-width: 0;
	margin: 0;
}

.game-screen {
	padding: 1.15rem 1.3rem 1.3rem;
	border: 1px solid var(--game-edge);
	border-radius: var(--radius);
	background: var(--game-bg);
	color: var(--game-text);
	font-family: var(--f-mono);
	font-size: 0.86rem;
	font-variant-ligatures: none;
	line-height: 1.58;
	box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.75);
	/* Every scene gets the same window, so the page never jumps when one replaces another */
	height: 26rem;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--game-edge) transparent;
}

.game-screen p {
	margin: 0;
}

.game-screen .cmd {
	color: var(--game-cmd);
}

.game-screen .cmd:not(:first-child) {
	margin-top: 0.85em;
}

.game-screen .prompt {
	margin-right: 0.6ch;
	color: var(--game-edge);
}

.game-screen .room { color: var(--game-room); }
.game-screen .weather { color: var(--game-weather); }
.game-screen .exits { color: var(--game-exits); }
.game-screen .mob { color: var(--game-mob); }
.game-screen .alert { color: var(--game-alert); }
.game-screen .info { color: var(--game-info); }
.game-screen .ok { color: var(--game-room); }

.game-screen .exits b,
.game-screen .strong {
	color: var(--game-strong);
	font-weight: 700;
}

.game-screen .exits .field { color: var(--game-field); }
.game-screen .exits .forest { color: var(--game-forest); }
.game-screen .exits .sky { color: var(--game-sky); }

.game-screen .desc {
	text-indent: 2ch;
}

.game-screen .pre {
	white-space: pre-wrap;
}

.game-cap {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.4rem 1rem;
	margin-top: 0.75rem;
	color: var(--ink-soft);
	font-size: 0.9rem;
	line-height: 1.5;
}

.game-cap .label {
	margin-right: 0.5rem;
	color: var(--lamp);
}

.another {
	padding: 0.2rem 0.75rem;
	border: 1px solid var(--rule-strong);
	border-radius: 999px;
	background: transparent;
	color: var(--ink);
	font-family: var(--f-body);
	font-size: 0.82rem;
	font-weight: 700;
	cursor: pointer;
}

.another:hover {
	border-color: var(--lamp);
	background: var(--tint);
}

/* ------------------------------------------------------------------ */
/* Home: bands and sections                                            */
/* ------------------------------------------------------------------ */

.band {
	border-block: 1px solid var(--rule);
	background: var(--bg-band);
}

.section {
	padding-block: clamp(3rem, 7vw, 5rem);
}

.split {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem 4rem;
}

/* The setting, in the display face */
.story p {
	max-width: 34em;
	margin: 0;
	font-family: var(--f-display);
	font-size: clamp(1.25rem, 1.12rem + 0.5vw, 1.5rem);
	line-height: 1.55;
}

.story p + p {
	margin-top: 1em;
}

.section-head {
	display: grid;
	gap: 0.7rem;
	max-width: 46rem;
	margin-bottom: 2.25rem;
}

.section-head p {
	margin: 0;
	color: var(--ink-soft);
}

/* The guides, in groups */
.guide-groups {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2.75rem 4rem;
}

.guide-group h3 {
	padding-bottom: 0.65rem;
	border-bottom: 1px solid var(--rule-strong);
	color: var(--ink-soft);
}

.guide-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.guide-list li {
	position: relative;
	display: grid;
	grid-template-columns: 2.75rem minmax(0, 1fr);
	column-gap: 1rem;
	padding: 1.05rem 0.75rem 1.1rem 0;
	border-bottom: 1px solid var(--rule);
}

.guide-list li:hover {
	background: var(--tint);
}

.guide-list .badge {
	grid-row: 1 / span 3;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid var(--rule-strong);
	border-radius: 50%;
	color: var(--lamp);
}

.guide-list a {
	color: var(--ink);
	font-family: var(--f-display);
	font-size: 1.45rem;
	line-height: 1.2;
	text-decoration: none;
}

/* The whole row answers the click; the link keeps the title as its name */
.guide-list a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.guide-list li:hover a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
}

.guide-list a:focus-visible {
	outline: none;
}

.guide-list a:focus-visible::after {
	outline: 3px solid var(--focus);
	outline-offset: -3px;
}

.guide-list .desc {
	margin: 0.2rem 0 0;
	color: var(--ink-soft);
	font-size: 0.98rem;
	line-height: 1.5;
}

.guide-list .who {
	margin: 0.45rem 0 0;
	color: var(--lamp);
}

/* The latest update */
.latest h3 {
	font-family: var(--f-display);
	font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
	font-weight: 400;
	line-height: 1.15;
	margin-top: 0.5rem;
}

.latest h3 a {
	color: var(--ink);
	text-decoration-color: var(--rule-strong);
}

.latest h3 a:hover {
	color: var(--ink);
	text-decoration-color: var(--lamp);
}

.latest p {
	margin: 0.75rem 0 0;
}

.latest .more {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin-top: 1.25rem;
}

/* ------------------------------------------------------------------ */
/* Inner pages: breadcrumbs, the page's head, the contents rail        */
/* ------------------------------------------------------------------ */

.crumbs {
	padding-top: 1.4rem;
	font-size: 0.92rem;
}

.crumbs ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 0.6rem;
	margin: 0;
	padding: 0;
	color: var(--ink-soft);
	list-style: none;
}

/* A drawn chevron, so screen readers have no character to read */
.crumbs li + li::before {
	content: "";
	display: inline-block;
	width: 0.4em;
	height: 0.4em;
	margin-right: 0.6rem;
	border-top: 1px solid var(--rule-strong);
	border-right: 1px solid var(--rule-strong);
	transform: translateY(-0.1em) rotate(45deg);
}

.crumbs a {
	color: var(--ink-soft);
}

.crumbs a:hover {
	color: var(--ink);
}

.page-head {
	padding-block: 1.75rem 2.25rem;
	border-bottom: 1px solid var(--rule);
}

.page-head > * {
	max-width: 50rem;
}

.kicker {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0;
	color: var(--lamp);
}

.kicker .ico {
	width: 1.45rem;
	height: 1.45rem;
}

.kicker .sep {
	color: var(--rule-strong);
}

.page-head h1 {
	margin-top: 0.75rem;
}

.page-head .standfirst {
	margin-top: 1rem;
}

/* What you are reading: who it is for, where it lives in the game, how long it is */
.facts {
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem 2.5rem;
	margin: 1.6rem 0 0;
}

.facts div {
	display: grid;
	gap: 0.15rem;
}

.facts dt {
	color: var(--ink-soft);
}

.facts dd {
	margin: 0;
	font-size: 0.98rem;
}

.doc {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2.25rem;
	padding-block: 2.25rem 3.5rem;
}

.toc {
	font-size: 0.93rem;
}

.toc-label {
	margin: 0 0 0.6rem;
	color: var(--ink-soft);
}

.toc ol {
	margin: 0;
	padding: 0;
	border-left: 1px solid var(--rule-strong);
	list-style: none;
}

.toc a {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	margin-left: -1px;
	padding: 0.32rem 0 0.32rem 0.9rem;
	border-left: 2px solid transparent;
	color: var(--ink-soft);
	line-height: 1.35;
	text-decoration: none;
}

.toc a:hover {
	border-left-color: var(--lamp);
	color: var(--ink);
}

.toc .n {
	color: var(--ink-soft);
	font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ */
/* Running text                                                        */
/* ------------------------------------------------------------------ */

.prose {
	min-width: 0;
	max-width: 44rem;
}

.prose > *,
.prose section > * {
	margin-block: 0;
}

.prose > * + *,
.prose section > * + * {
	margin-top: 1.05em;
}

.prose > * + section {
	margin-top: 2.75rem;
}

.prose h2 {
	scroll-margin-top: 1.5rem;
}

.prose * + h3 {
	margin-top: 2rem;
}

.prose h2 + *,
.prose h3 + * {
	margin-top: 0.75em;
}

.prose .lede {
	font-size: 1.17em;
	line-height: 1.6;
}

.prose ul, .prose ol {
	padding-left: 1.3em;
}

.prose li + li {
	margin-top: 0.5em;
}

.prose li > ul {
	margin-top: 0.5em;
}

.prose li::marker {
	color: var(--ink-soft);
}

.prose li > p {
	margin: 0;
}

/* Lists drawn without markers keep no indent or spacing of their own */
.prose .entries,
.prose .steps {
	padding: 0;
}

.prose .entries > li + li {
	margin-top: 0;
}

/* "In the game": the commands that go with a passage */
.ingame {
	padding: 1rem 1.2rem 1.15rem;
	border: 1px solid var(--rule-strong);
	border-radius: var(--radius);
	background: var(--bg-raised);
}

.ingame .label {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0 0 0.7rem;
	color: var(--lamp);
}

.commands {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.1rem;
	margin: 0;
}

.commands dt + dd {
	margin: 0 0 0.6rem;
	color: var(--ink-soft);
}

.commands dd:last-child {
	margin-bottom: 0;
}

/* Tables */
.table-wrap {
	overflow-x: auto;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.97rem;
	font-variant-numeric: tabular-nums;
}

caption {
	padding-bottom: 0.6rem;
	color: var(--ink);
	font-weight: 700;
	text-align: left;
}

th, td {
	padding: 0.6rem 1rem 0.6rem 0;
	border-bottom: 1px solid var(--rule);
	text-align: left;
	vertical-align: top;
}

thead th {
	border-bottom-color: var(--rule-strong);
	color: var(--ink-soft);
	white-space: nowrap;
}

tbody th {
	font-weight: 700;
}

.el {
	white-space: nowrap;
}

.el::before {
	content: "";
	display: inline-block;
	width: 0.65em;
	height: 0.65em;
	margin-right: 0.45em;
	border-radius: 50%;
	background: var(--el, currentColor);
	vertical-align: 0.02em;
}

.el-air { --el: var(--air); }
.el-earth { --el: var(--earth); }
.el-fire { --el: var(--fire); }
.el-water { --el: var(--water); }

/* Pictures */
figure {
	margin: 0;
}

figure img {
	display: block;
	width: 100%;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
}

figure figcaption {
	margin-top: 0.6rem;
	color: var(--ink-soft);
	font-size: 0.92rem;
	line-height: 1.5;
}

/* Screenshots in a changelog entry: a client window at its own size, or two side by side */
figure.shot {
	margin: 1rem 0 1.75rem;
}

figure.shot.window img {
	width: auto;
	max-width: 100%;
	margin-inline: auto;
}

figure.shot .pair {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
}

figure.shot .pair img {
	flex: 1 1 16rem;
	width: 0;
	min-width: 0;
}

/* The next and previous page */
.pager {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
	padding-block: 2rem 3.5rem;
	border-top: 1px solid var(--rule);
}

.pager a {
	display: grid;
	gap: 0.2rem;
	padding: 1rem 1.15rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	color: var(--ink);
	text-decoration: none;
}

.pager a:hover {
	border-color: var(--lamp);
	background: var(--tint);
	color: var(--ink);
}

.pager .label {
	color: var(--ink-soft);
}

.pager .t {
	font-family: var(--f-display);
	font-size: 1.4rem;
	line-height: 1.2;
}

/* ------------------------------------------------------------------ */
/* Changelog                                                           */
/* ------------------------------------------------------------------ */

.cl-sec h2 {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.15rem 0.85rem;
}

.cl-sec h2 .count {
	color: var(--ink-soft);
	font-family: var(--f-body);
	font-size: 0.95rem;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.01em;
}

.cl-sec li + li {
	margin-top: 0.6em;
}

/* Admin changes sit apart, in a panel of their own */
.prose > .cl-staff {
	padding: 1.4rem 1.4rem 1.5rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--bg-raised);
}

.month + .month {
	margin-top: 3.25rem;
}

.month > h2 {
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--rule-strong);
}

.entries {
	margin: 0;
	padding: 0;
	list-style: none;
}

.entry {
	position: relative;
	display: grid;
	grid-template-columns: 3.75rem minmax(0, 1fr);
	column-gap: 1.25rem;
	padding-block: 1.35rem;
	border-bottom: 1px solid var(--rule);
}

.entry:hover {
	background: var(--tint);
}

.entry > * {
	grid-column: 2;
	margin: 0;
}

.entry h3 {
	font-family: var(--f-display);
	font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.8rem);
	font-weight: 400;
	line-height: 1.15;
}

.entry h3 a {
	color: var(--ink);
	text-decoration: none;
}

.entry h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.entry:hover h3 a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
}

.entry h3 a:focus-visible {
	outline: none;
}

.entry h3 a:focus-visible::after {
	outline: 3px solid var(--focus);
	outline-offset: -3px;
}

.entry .when {
	grid-column: 1;
	grid-row: 1 / span 3;
	padding-top: 0.15rem;
}

/* The day over its weekday, in the left-hand column */
.when time {
	display: grid;
	justify-items: center;
}

.when .day {
	color: var(--lamp);
	font-family: var(--f-display);
	font-size: 2.5rem;
	line-height: 1;
}

.when .wd {
	margin-top: 0.3rem;
	color: var(--ink-soft);
}

.entry .teaser {
	margin-top: 0.4rem;
	color: var(--ink-soft);
}

.when .day.word {
	padding-top: 0.3rem;
	font-size: 1.15rem;
}

.entry .tally {
	margin-top: 0.55rem;
	color: var(--ink-soft);
	font-size: 0.88rem;
	font-variant-numeric: tabular-nums;
}

.tag {
	display: inline-block;
	margin-left: 0.6rem;
	padding: 0.1rem 0.6rem;
	border: 1px solid var(--lamp);
	border-radius: 999px;
	color: var(--lamp);
	font-family: var(--f-body);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.5;
	text-transform: uppercase;
	vertical-align: 0.35em;
}

/* ------------------------------------------------------------------ */
/* How to Play                                                         */
/* ------------------------------------------------------------------ */

.steps {
	display: grid;
	gap: 1.15rem;
	padding: 0;
	counter-reset: step;
	list-style: none;
}

.prose .steps li + li {
	margin-top: 0;
}

.steps li {
	display: grid;
	grid-template-columns: 2.5rem minmax(0, 1fr);
	gap: 0.9rem;
	counter-increment: step;
}

.steps li::before {
	content: counter(step);
	color: var(--lamp);
	font-family: var(--f-display);
	font-size: 2.2rem;
	line-height: 1;
	text-align: right;
}

.shots {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.75rem 1.5rem;
}

.connect {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	align-items: center;
	gap: 0.6rem 1.5rem;
	margin: 0;
	padding: 1.15rem 1.3rem;
	border: 1px solid var(--rule-strong);
	border-radius: var(--radius);
	background: var(--bg-raised);
}

.connect dt {
	color: var(--ink-soft);
}

.connect dd {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.9rem;
	margin: 0;
	font-family: var(--f-mono);
	font-size: 1.2rem;
}

.copy {
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--rule-strong);
	border-radius: 999px;
	background: transparent;
	color: var(--ink);
	font-family: var(--f-body);
	font-size: 0.8rem;
	font-weight: 700;
	cursor: pointer;
}

.copy:hover {
	border-color: var(--lamp);
	background: var(--tint);
}

.clients {
	margin: 0;
}

.clients dt {
	font-weight: 700;
}

.clients dd {
	margin: 0.15rem 0 0.9rem;
	color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.site-foot {
	border-top: 1px solid var(--rule);
	background: var(--bg-raised);
	font-size: 0.95rem;
}

.site-foot .wrap {
	padding-block: 2.75rem 2.25rem;
}

.foot-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2rem 3rem;
}

.site-foot h2 {
	color: var(--ink-soft);
}

.site-foot ul {
	display: grid;
	gap: 0.3rem;
	margin: 0.7rem 0 0;
	padding: 0;
	list-style: none;
}

.site-foot a {
	color: var(--ink);
}

.site-foot a:hover {
	color: var(--lamp-hover);
}

.foot-note {
	margin: 1rem 0 0;
	color: var(--ink-soft);
}

.foot-base {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
	margin-top: 2.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--rule);
	color: var(--ink-soft);
}

.foot-base p {
	margin: 0;
}

/* Night or Day; hidden until the script that runs it is there */
.theme-pick {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 1.1rem;
	margin: 0;
	padding: 0;
	border: 0;
}

.theme-pick legend {
	float: left;
	margin-right: 0.4rem;
	padding: 0;
	color: var(--ink-soft);
}

.theme-pick label {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--ink);
	cursor: pointer;
}

.theme-pick input {
	width: 1rem;
	height: 1rem;
	margin: 0;
	accent-color: var(--lamp-fill);
}

/* ------------------------------------------------------------------ */
/* Wider screens                                                       */
/* ------------------------------------------------------------------ */

@media (min-width: 36rem) {
	.commands {
		grid-template-columns: max-content minmax(0, 1fr);
		gap: 0.6rem 1.4rem;
	}

	.commands dt + dd {
		margin: 0;
	}

	.shots {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.shots .wide {
		grid-column: 1 / -1;
		max-width: 38rem;
	}
}

@media (min-width: 48rem) {
	.pager {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.pager .next {
		grid-column: 2;
		text-align: right;
	}

	.foot-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.guide-groups {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 62rem) {
	.hero-grid {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
		gap: 4rem;
	}

	.game-screen {
		height: 31rem;
	}

	.split {
		grid-template-columns: 15rem minmax(0, 1fr);
	}

	.doc {
		grid-template-columns: 14rem minmax(0, 1fr);
		gap: 4.5rem;
	}

	.toc {
		position: sticky;
		top: calc(env(safe-area-inset-top, 0px) + 1.5rem);
		align-self: start;
		max-height: calc(100vh - 3rem);
		overflow-y: auto;
	}
}

/* ------------------------------------------------------------------ */
/* Motion and forced colours                                           */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}

	a, .btn, .guide-list li, .entry, .pager a, .copy {
		transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	}
}

@media (forced-colors: active) {
	.sky-canvas {
		display: none;
	}

	.btn, .copy {
		border-color: ButtonText;
	}
}
