/* lionbackup Demo. One dark stage with the brand gold as its light.
   Colours, faces and button manners follow apps/bz/website/public/style.css,
   so the demo reads as a sibling of www.lionbackup.cloud. Dark only, on purpose:
   the gold cannot carry text on a light ground (docs/Brand.md, contrast rules). */

@font-face {
	font-family: 'Adwaita Sans';
	src: url(../fonts/adwaita-sans.woff2) format('woff2');
	font-weight: 100 700;
	font-display: swap;
}

@font-face {
	font-family: 'Adwaita Mono';
	src: url(../fonts/adwaita-mono.woff2) format('woff2');
	font-weight: 400;
	font-display: swap;
}

@font-face {
	font-family: 'Adwaita Mono';
	src: url(../fonts/adwaita-mono-bold.woff2) format('woff2');
	font-weight: 700;
	font-display: swap;
}

:root {
	color-scheme: dark;
	--bg: #0a0b0e;
	--bg-deep: #08090c;
	--surface: #101218;
	--surface-2: #15171c;
	--line: #1f2229;
	--line-strong: #34373f;
	--text: #f4f5f6;
	--heading: #ffffff;
	--text-2: #c4c7cd;
	--muted: #9a9ea6;
	--gold: #e7a93a;
	--on-gold: #0a0b0e;
	--sans: 'Adwaita Sans', 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
	--mono: 'Adwaita Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--radius: 8px;
	--gutter: clamp(20px, 4vw, 48px);
	--wrap: 1240px;
	--header: 68px;
	/* Height of the WordPress toolbar, which is there for signed-in visitors. */
	--bar: 0px;
	--step: clamp(72px, 11vw, 150px);
	interpolate-size: allow-keywords;
}

.admin-bar {
	--bar: 32px;
}

@media (max-width: 782px) {
	.admin-bar {
		--bar: 46px;
	}
}

/* ── Base ─────────────────────────────────────────────────────────────────── */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header) + var(--bar) + 16px);
	scrollbar-color: var(--line-strong) var(--bg-deep);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 1.0625rem/1.6 var(--sans);
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}

::selection {
	background: var(--gold);
	color: var(--on-gold);
}

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

::-webkit-scrollbar {
	width: 12px;
	height: 12px;
}

::-webkit-scrollbar-track {
	background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
	background: var(--line-strong);
	border: 3px solid var(--bg-deep);
	border-radius: 8px;
}

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

img {
	height: auto;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

h1,
h2,
h3,
h4 {
	margin: 0;
	color: var(--heading);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

h2 {
	font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3rem);
	letter-spacing: -0.03em;
}

h3 {
	font-size: 1.3125rem;
}

p {
	margin: 0;
	text-wrap: pretty;
}

code,
kbd,
pre,
samp {
	font-family: var(--mono);
	font-size: 0.9em;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

.icon {
	width: 1.25em;
	height: 1.25em;
	flex: none;
}

.wrap {
	width: min(100% - 2 * var(--gutter), var(--wrap));
	margin-inline: auto;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: fixed;
	top: calc(var(--bar) + 8px);
	left: 8px;
	z-index: 50;
	padding: 12px 16px;
	border-radius: var(--radius);
	background: var(--gold);
	color: var(--on-gold);
	font-weight: 700;
	text-decoration: none;
	translate: 0 -200%;
}

.skip-link:focus {
	translate: none;
}

.display {
	font-size: clamp(2.4rem, 1rem + 3.9vw, 3.75rem);
	line-height: 1.04;
	letter-spacing: -0.035em;
}

.display--page {
	font-size: clamp(2.2rem, 1.3rem + 3.2vw, 3.75rem);
}

.lead {
	max-width: 46ch;
	color: var(--text-2);
	font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
	line-height: 1.5;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	padding: 0 22px;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: transparent;
	font: 600 0.8125rem/1 var(--sans);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: translate 0.15s var(--ease-out), scale 0.1s ease-out, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.btn .icon {
	width: 18px;
	height: 18px;
	transition: translate 0.2s var(--ease-out);
}

.btn--gold {
	background: var(--gold);
	color: var(--on-gold);
}

.btn--line {
	border-color: var(--line-strong);
	color: var(--text);
}

.btn--small {
	min-height: 44px;
	padding: 0 16px;
}

@media (hover: hover) and (pointer: fine) {
	.btn--gold:hover {
		filter: brightness(1.08) saturate(1.1);
		box-shadow: 0 8px 26px rgba(231, 169, 58, 0.35);
	}

	.btn--line:hover {
		border-color: var(--gold);
		background-color: var(--surface-2);
	}

	.btn:hover .icon {
		translate: 3px 0;
	}
}

.btn:active {
	scale: 0.97;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.progress {
	position: fixed;
	inset: var(--bar) 0 auto 0;
	z-index: 40;
	height: 2px;
	pointer-events: none;
}

.progress__bar {
	display: block;
	height: 100%;
	background: var(--gold);
	transform: scaleX(0);
	transform-origin: left;
}

@supports (animation-timeline: scroll()) {
	.progress__bar {
		animation: progress linear both;
		animation-timeline: scroll(root);
	}

	@keyframes progress {
		to {
			transform: scaleX(1);
		}
	}
}

.site-header {
	position: sticky;
	top: var(--bar);
	z-index: 30;
	height: var(--header);
	border-bottom: 1px solid var(--line);
	background: rgba(10, 11, 14, 0.82);
	/* The page scrolls under the header; the blur keeps its labels readable. */
	backdrop-filter: blur(14px) saturate(140%);
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	height: 100%;
}

.site-logo {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
}

.site-logo__tag {
	padding: 4px 7px;
	border: 1px solid currentColor;
	border-radius: 4px;
	color: var(--gold);
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 28px;
	margin-left: auto;
}

.site-nav__list {
	display: flex;
	gap: 26px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav__list a {
	position: relative;
	display: inline-block;
	padding: 12px 0;
	color: var(--text-2);
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease;
}

.site-nav__list a::after {
	content: "";
	position: absolute;
	inset: auto 0 5px;
	height: 1px;
	background: var(--gold);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.2s var(--ease-out);
}

.site-nav__list a:hover,
.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a,
.site-nav__list .current_page_parent > a {
	color: var(--heading);
}

.site-nav__list a:hover::after,
.site-nav__list .current-menu-item > a::after,
.site-nav__list .current_page_item > a::after,
.site-nav__list .current_page_parent > a::after {
	transform: scaleX(1);
}

.nav-toggle {
	display: none;
}

/* Below this width the five labels and the button no longer fit on one line. */
@media (max-width: 1180px) {
	.js .nav-toggle {
		display: inline-grid;
		place-items: center;
		width: 44px;
		height: 44px;
		margin-left: auto;
		padding: 0;
		border: 1px solid var(--line-strong);
		border-radius: var(--radius);
		background: transparent;
		cursor: pointer;
	}

	.nav-toggle .icon {
		width: 22px;
		height: 22px;
	}

	.nav-toggle__close,
	.nav-toggle[aria-expanded="true"] .nav-toggle__open {
		display: none;
	}

	.nav-toggle[aria-expanded="true"] .nav-toggle__close {
		display: block;
	}

	.js .site-nav {
		position: fixed;
		inset: calc(var(--header) + var(--bar)) 0 auto;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		max-height: calc(100dvh - var(--header) - var(--bar));
		margin: 0;
		padding: 4px var(--gutter) 28px;
		overflow: auto;
		border-bottom: 1px solid var(--line);
		background: var(--bg);
		visibility: hidden;
		opacity: 0;
		translate: 0 -8px;
		transition: opacity 0.18s ease, translate 0.22s var(--ease-out), visibility 0s 0.22s;
	}

	.js .site-nav.is-open {
		visibility: visible;
		opacity: 1;
		translate: none;
		transition-delay: 0s;
	}

	.js .site-nav__list {
		flex-direction: column;
		gap: 0;
	}

	.js .site-nav__list a {
		display: block;
		padding: 18px 0;
		border-bottom: 1px solid var(--line);
		font-size: 0.9375rem;
	}

	.js .site-nav__list a::after {
		content: none;
	}

	.js .site-nav .btn {
		margin-top: 20px;
	}

	/* Without scripts there is no toggle: the menu wraps under the logo. */
	.no-js .site-header {
		position: static;
		height: auto;
		padding-block: 14px;
	}

	.no-js .site-header__inner,
	.no-js .site-nav,
	.no-js .site-nav__list {
		flex-wrap: wrap;
		gap: 6px 22px;
	}

	.no-js .site-nav {
		margin-left: 0;
	}
}

/* ── Story: a backup run, told by the stage behind the text ───────────────── */

.story {
	--stage: calc(100dvh - var(--header) - var(--bar));
	position: relative;
}

.story__stage {
	position: sticky;
	top: calc(var(--header) + var(--bar));
	height: var(--stage);
	overflow: hidden;
}

.story__canvas {
	width: 100%;
	height: 100%;
}

.story__readout {
	position: absolute;
	right: var(--gutter);
	bottom: 26px;
	display: grid;
	justify-items: end;
	gap: 4px;
	color: var(--gold);
	font: 400 0.8125rem/1.4 var(--mono);
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.story__readout small {
	color: var(--muted);
	font: 400 0.75rem/1.4 var(--sans);
}

.story__beats {
	position: relative;
	z-index: 1;
	margin-top: calc(-1 * var(--stage));
	/* The text must not swallow the pointer the stage reacts to. */
	pointer-events: none;
}

.beat {
	display: grid;
	align-content: center;
	justify-items: start;
	gap: 20px;
	max-width: min(480px, 42vw);
	min-height: var(--stage);
	padding-block: 48px;
}

.beat > * {
	pointer-events: auto;
}

.beat--hero {
	gap: 26px;
	max-width: min(620px, 46vw);
}

.beat__title {
	font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem);
	letter-spacing: -0.035em;
}

.beat__text {
	max-width: 40ch;
	color: var(--text-2);
	font-size: 1.1875rem;
	line-height: 1.55;
}

@media (max-width: 960px) {
	/* The stage draws in the upper part; the text sits below it on a ground
	   that fades in, so particles never run behind a line of text. */
	.story__stage::after {
		content: "";
		position: absolute;
		inset: 44% 0 0;
		background: linear-gradient(rgba(10, 11, 14, 0), var(--bg) 26%);
	}

	/* Above the signet: below it the text of the beats needs the room. */
	.story__readout {
		inset: 14px 0 auto;
		z-index: 1;
		justify-items: center;
		text-align: center;
	}

	.beat {
		align-content: end;
		max-width: none;
		padding-block: 0 9vh;
	}

	.beat__text {
		font-size: 1.0625rem;
	}
}

/* ── Tour: the plugin in six views ────────────────────────────────────────── */

.tour {
	padding-top: var(--step);
	overflow: hidden;
}

.tour__head {
	display: grid;
	gap: 16px;
	margin-bottom: clamp(28px, 4vw, 48px);
}

.tour__track {
	display: flex;
	gap: clamp(20px, 3vw, 44px);
	margin: 0;
	padding: 0 var(--gutter) 28px;
	overflow-x: auto;
	list-style: none;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
}

.tour__slide {
	flex: 0 0 min(84vw, 760px);
	scroll-snap-align: center;
}

.tour figure {
	display: grid;
	gap: 20px;
	margin: 0;
	perspective: 1400px;
}

.tour figcaption {
	display: grid;
	gap: 6px;
}

.tour figcaption p {
	max-width: 48ch;
	color: var(--text-2);
}

/* Each view sits on the grey of the WordPress dashboard it was taken from, so
   screenshots of different heights share one frame. */
.shot {
	display: grid;
	place-items: center;
	aspect-ratio: 16 / 10;
	padding: clamp(12px, 2.6vw, 30px);
	overflow: hidden;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	background: #f0f0f1;
	box-shadow: 0 34px 60px -34px rgba(0, 0, 0, 0.9);
}

.shot img {
	width: auto;
	max-height: 100%;
	object-fit: contain;
	border-radius: 2px;
}

/* Set by the script when it pins the section and moves the track itself. */
.tour.is-pinned .tour__pin {
	display: grid;
	/* One column as wide as the screen: the track is wider and must not stretch it. */
	grid-template-columns: minmax(0, 1fr);
	align-content: center;
	min-height: calc(100dvh - var(--header) - var(--bar));
	padding-block: 24px;
}

.tour.is-pinned .tour__track {
	overflow: visible;
	padding-bottom: 0;
	scroll-snap-type: none;
	will-change: transform;
}

.tour.is-pinned .tour__slide {
	flex-basis: min(58vw, 760px, (100dvh - var(--header) - var(--bar) - 300px) * 1.6);
}

/* ── Keys: who may do what ────────────────────────────────────────────────── */

.keys {
	padding-block: var(--step);
}

.keys__head {
	display: grid;
	gap: 16px;
	max-width: 720px;
	margin-bottom: clamp(32px, 5vw, 56px);
}

.keys__board {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: clamp(28px, 5vw, 80px);
	align-items: start;
}

.keys__choice {
	display: grid;
	gap: 12px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.keys__option {
	position: relative;
	display: grid;
	gap: 4px;
	padding: 20px 22px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	background: var(--surface);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.keys__option input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.keys__option:has(input:checked) {
	border-color: var(--gold);
	background: var(--surface-2);
}

.keys__option:has(input:focus-visible) {
	outline: 2px solid var(--gold);
	outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
	.keys__option:hover {
		background: var(--surface-2);
	}
}

.keys__name {
	color: var(--heading);
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: -0.015em;
}

.keys__where {
	color: var(--muted);
	font-size: 0.9375rem;
}

.keys__rights ul {
	margin: 0 0 26px;
	padding: 0;
	list-style: none;
}

.right {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-block: 18px;
	color: var(--muted);
	font-size: clamp(1.25rem, 1rem + 1.1vw, 1.875rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.025em;
	transition: color 0.25s ease;
}

.right + .right {
	border-top: 1px solid var(--line);
}

.right__state {
	display: none;
	flex: none;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
}

.right__state .icon {
	width: 20px;
	height: 20px;
}

.right__state--no {
	display: grid;
	border: 1px solid var(--line-strong);
}

.right__state--yes {
	background: var(--gold);
	color: var(--on-gold);
}

.keys:has(input[value="write"]:checked) .right[data-holder="write"],
.keys:has(input[value="read"]:checked) .right[data-holder="read"],
.keys:has(input[value="private"]:checked) .right[data-holder="private"] {
	color: var(--heading);
}

.keys:has(input[value="write"]:checked) .right[data-holder="write"] .right__state--yes,
.keys:has(input[value="read"]:checked) .right[data-holder="read"] .right__state--yes,
.keys:has(input[value="private"]:checked) .right[data-holder="private"] .right__state--yes {
	display: grid;
}

.keys:has(input[value="write"]:checked) .right[data-holder="write"] .right__state--no,
.keys:has(input[value="read"]:checked) .right[data-holder="read"] .right__state--no,
.keys:has(input[value="private"]:checked) .right[data-holder="private"] .right__state--no {
	display: none;
}

.keys__note {
	display: none;
	max-width: 52ch;
	color: var(--text-2);
}

.keys:has(input[value="write"]:checked) .keys__note[data-for="write"],
.keys:has(input[value="read"]:checked) .keys__note[data-for="read"],
.keys:has(input[value="private"]:checked) .keys__note[data-for="private"] {
	display: block;
}

/* A browser without :has() shows everything at once instead of nothing. */
@supports not selector(:has(*)) {
	.keys__note {
		display: block;
		margin-top: 10px;
	}

	.right {
		color: var(--heading);
	}
}

@media (max-width: 860px) {
	.keys__board {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ── Strip: what the plugin can do, as a running band ─────────────────────── */

.strip {
	padding-block: 24px;
	overflow: hidden;
	border-block: 1px solid var(--line);
}

.strip__list {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 28px;
	margin: 0;
	padding: 0 var(--gutter);
	color: var(--text-2);
	font-size: clamp(1.0625rem, 0.9rem + 0.9vw, 1.5rem);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.015em;
	list-style: none;
}

.strip__list li {
	display: inline-flex;
	align-items: center;
	gap: 28px;
	white-space: nowrap;
}

/* The square is a chunk: the same mark the stage draws. */
.strip__list li::after {
	content: "";
	width: 9px;
	height: 9px;
	background: var(--gold);
}

.strip.is-running {
	display: flex;
}

.strip.is-running .strip__list {
	flex: none;
	flex-wrap: nowrap;
	padding: 0 28px 0 0;
	will-change: transform;
}

/* ── Magazine teasers ─────────────────────────────────────────────────────── */

.magazine {
	padding-block: var(--step);
}

.magazine__head {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	justify-content: space-between;
	gap: 16px 24px;
	margin-bottom: clamp(28px, 4vw, 44px);
}

.more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	color: var(--gold);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
}

.more .icon {
	width: 18px;
	height: 18px;
	transition: translate 0.2s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
	.more:hover .icon {
		translate: 3px 0;
	}
}

.teasers {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: 20px;
}

.teasers > .teaser:first-child {
	grid-row: span 2;
}

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

.teasers--list > .teaser:first-child {
	grid-row: auto;
	grid-column: 1 / -1;
}

.teaser {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	transition: border-color 0.2s ease;
}

/* A light that follows the pointer; the script sets --mx and --my. */
.teaser::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(440px circle at var(--mx, 50%) var(--my, 0%), rgba(231, 169, 58, 0.12), transparent 62%);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
	.teaser:hover {
		border-color: var(--line-strong);
	}

	.teaser:hover::before {
		opacity: 1;
	}
}

.teaser__link {
	position: relative;
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	gap: 22px;
	align-items: start;
	height: 100%;
	padding: 24px;
	text-decoration: none;
}

.teasers:not(.teasers--list) > .teaser:first-child .teaser__link {
	grid-template-columns: minmax(0, 1fr);
	align-content: space-between;
	gap: 36px;
	padding: clamp(24px, 3vw, 36px);
}

.teasers:not(.teasers--list) > .teaser:first-child .teaser__glyph {
	width: min(52%, 230px);
}

.teasers:not(.teasers--list) > .teaser:first-child .teaser__title {
	font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
	letter-spacing: -0.03em;
}

.teasers--list > .teaser:first-child .teaser__link {
	grid-template-columns: 150px minmax(0, 1fr);
	gap: 32px;
	padding: clamp(24px, 3vw, 36px);
}

.teasers--list > .teaser:first-child .teaser__title {
	font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
	letter-spacing: -0.03em;
}

.glyph {
	width: 100%;
	height: auto;
}

.glyph__gold {
	fill: var(--gold);
}

.glyph__light {
	fill: var(--text);
}

.teaser__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	color: var(--muted);
	font-size: 0.8125rem;
}

.teaser__category {
	color: var(--gold);
}

.teaser__title {
	margin-block: 8px 10px;
	font-size: 1.3125rem;
}

.teaser__excerpt {
	color: var(--text-2);
	font-size: 1rem;
}

.teaser__sum {
	margin-top: 14px;
	color: var(--muted);
	font-size: 0.8125rem;
}

@media (max-width: 860px) {
	.teasers,
	.teasers--list {
		grid-template-columns: minmax(0, 1fr);
	}

	.teaser__link,
	.teasers--list > .teaser:first-child .teaser__link {
		grid-template-columns: 64px minmax(0, 1fr);
		gap: 18px;
		padding: 20px;
	}
}

/* ── Closing ──────────────────────────────────────────────────────────────── */

.closing {
	display: grid;
	gap: 24px;
	justify-items: start;
	padding-block: var(--step);
	border-top: 1px solid var(--line);
}

/* ── Pages and posts ──────────────────────────────────────────────────────── */

.entry,
.listing {
	padding-block: clamp(48px, 8vw, 104px) var(--step);
}

.entry__head {
	display: grid;
	gap: 20px;
	max-width: 900px;
	margin-bottom: clamp(36px, 6vw, 72px);
}

.entry__head--post {
	grid-template-columns: 112px minmax(0, 1fr);
	gap: clamp(20px, 3vw, 36px);
	align-items: start;
	max-width: 1000px;
}

.entry__head--post > div:last-child {
	display: grid;
	gap: 18px;
}

.entry__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	color: var(--muted);
	font-size: 0.875rem;
}

.entry__meta a {
	color: var(--gold);
	text-decoration: none;
}

.entry__meta a:hover {
	text-decoration: underline;
}

.listing .actions {
	margin-bottom: 40px;
}

.entry__body--outlined {
	display: grid;
	grid-template-columns: minmax(0, 60ch) minmax(200px, 280px);
	gap: 64px;
	align-items: start;
	justify-content: space-between;
}

/* "On this page": stays in view and marks the section being read. */
.outline {
	position: sticky;
	top: calc(var(--header) + var(--bar) + 40px);
	font-size: 0.9375rem;
}

.outline__title {
	margin-bottom: 12px;
	color: var(--muted);
	font-size: 0.8125rem;
}

.outline ol {
	display: grid;
	margin: 0;
	padding: 0;
	border-left: 1px solid var(--line);
	list-style: none;
}

.outline a {
	display: block;
	margin-left: -1px;
	padding: 7px 0 7px 16px;
	border-left: 1px solid transparent;
	color: var(--muted);
	line-height: 1.35;
	text-decoration: none;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.outline a:hover {
	color: var(--heading);
}

.outline a[aria-current="true"] {
	border-left-color: var(--gold);
	color: var(--heading);
}

@media (max-width: 1040px) {
	.entry__body--outlined {
		grid-template-columns: minmax(0, 1fr);
	}

	.outline {
		display: none;
	}
}

.prose {
	/* 60 zeros are about 78 letters of this face: a comfortable line. */
	max-width: 60ch;
	color: var(--text-2);
	font-size: 1.125rem;
	line-height: 1.7;
}

.prose > * + * {
	margin-top: 1.25em;
}

.prose h2 {
	margin-top: 2.2em;
	font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.125rem);
}

.prose h3 {
	margin-top: 1.9em;
	font-size: 1.3125rem;
}

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

.prose a {
	color: var(--gold);
}

.prose strong {
	color: var(--heading);
	font-weight: 600;
}

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

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

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

.prose figure {
	margin-inline: 0;
	margin-block: 2em;
}

.prose figure img {
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
}

.prose figcaption {
	margin-top: 10px;
	color: var(--muted);
	font-size: 0.875rem;
	line-height: 1.5;
	text-align: left;
}

.prose pre {
	position: relative;
	margin-inline: 0;
	padding: 18px 20px;
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg-deep);
	color: var(--text);
	font-size: 0.875rem;
	line-height: 1.65;
	tab-size: 2;
}

.prose :not(pre) > code {
	padding: 0.1em 0.35em;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--surface-2);
	color: var(--text);
	font-size: 0.86em;
	overflow-wrap: anywhere;
}

.prose blockquote {
	margin-inline: 0;
	padding-left: 1.2em;
	border-left: 1px solid var(--gold);
	color: var(--text);
	font-size: 1.15em;
	line-height: 1.5;
}

.prose blockquote cite {
	display: block;
	margin-top: 0.6em;
	color: var(--muted);
	font-size: 0.8em;
	font-style: normal;
}

.prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: 1rem;
	line-height: 1.5;
}

.prose .wp-block-table {
	overflow-x: auto;
}

.prose th {
	padding: 10px 16px 10px 0;
	border: 0;
	border-bottom: 1px solid var(--line-strong);
	color: var(--heading);
	font-weight: 600;
	text-align: left;
}

.prose td {
	padding: 12px 16px 12px 0;
	border: 0;
	border-bottom: 1px solid var(--line);
	vertical-align: top;
}

.prose hr {
	height: 1px;
	margin-block: 2.5em;
	border: 0;
	background: var(--line);
}

.prose .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: 0 22px;
	border-radius: var(--radius);
	background: var(--gold);
	color: var(--on-gold);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
}

/* Questions and answers: the core "details" block. */
.prose details {
	margin-top: 0;
	border-top: 1px solid var(--line);
}

.prose details:last-of-type {
	border-bottom: 1px solid var(--line);
}

.prose summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding-block: 20px;
	color: var(--heading);
	font-size: 1.1875rem;
	font-weight: 600;
	line-height: 1.35;
	list-style: none;
	cursor: pointer;
}

.prose summary::-webkit-details-marker {
	display: none;
}

.prose summary::after {
	content: "";
	flex: none;
	width: 22px;
	height: 22px;
	background: var(--gold);
	mask: url(../icons/plus.svg) center / contain no-repeat;
	transition: rotate 0.22s var(--ease-out);
}

.prose details[open] > summary::after {
	rotate: 45deg;
}

.prose details > :not(summary) {
	margin-top: 0;
	padding-bottom: 22px;
}

.prose details::details-content {
	block-size: 0;
	overflow: clip;
	transition: block-size 0.28s var(--ease-out), content-visibility 0.28s allow-discrete;
}

.prose details[open]::details-content {
	block-size: auto;
}

.copy {
	position: absolute;
	top: 8px;
	right: 8px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 32px;
	padding: 0 10px;
	border: 1px solid var(--line-strong);
	border-radius: 6px;
	background: var(--surface);
	color: var(--text-2);
	font: 600 0.75rem/1 var(--sans);
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, scale 0.1s ease-out;
}

.copy .icon {
	width: 15px;
	height: 15px;
}

.copy:hover {
	border-color: var(--gold);
	color: var(--heading);
}

.copy:active {
	scale: 0.97;
}

.entry__foot {
	display: grid;
	gap: 28px;
	max-width: 67.5rem;
	margin-top: clamp(48px, 7vw, 88px);
	padding-top: 28px;
	border-top: 1px solid var(--line);
}

.entry__sum {
	color: var(--muted);
	font-size: 0.875rem;
}

.entry__sum code {
	display: block;
	margin-top: 6px;
	color: var(--gold);
	overflow-wrap: anywhere;
}

.entry__nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.entry__nav span {
	display: block;
	margin-bottom: 4px;
	color: var(--muted);
	font-size: 0.8125rem;
}

.entry__nav a {
	color: var(--heading);
	font-weight: 600;
	text-decoration: none;
}

.entry__nav a:hover {
	text-decoration: underline;
}

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

@media (max-width: 640px) {
	.entry__head--post {
		grid-template-columns: minmax(0, 1fr);
	}

	.entry__glyph {
		width: 84px;
	}
}

/* ── Lists, search, pagination ────────────────────────────────────────────── */

.empty {
	display: grid;
	gap: 24px;
	max-width: 560px;
	color: var(--text-2);
}

.search {
	display: grid;
	gap: 8px;
}

.search label {
	color: var(--text-2);
	font-size: 0.875rem;
	font-weight: 600;
}

.search__row {
	display: flex;
	gap: 10px;
}

.search input {
	flex: 1;
	min-width: 0;
	min-height: 48px;
	padding: 0 14px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	background: var(--bg-deep);
	caret-color: var(--gold);
}

.search input:focus-visible {
	border-color: var(--gold);
	outline-offset: 0;
}

.pagination {
	margin-top: 40px;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	font-size: 0.875rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	text-decoration: none;
}

.pagination .page-numbers.current {
	border-color: var(--gold);
	background: var(--gold);
	color: var(--on-gold);
}

.pagination a.page-numbers:hover {
	border-color: var(--gold);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
	padding-block: 56px 36px;
	border-top: 1px solid var(--line);
	background: var(--bg-deep);
	color: var(--text-2);
	font-size: 0.9375rem;
}

.site-footer__inner {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr);
	gap: 40px clamp(24px, 4vw, 64px);
}

.site-footer__about {
	display: grid;
	gap: 18px;
	align-content: start;
	max-width: 44ch;
}

.site-footer__nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
	align-content: start;
}

.site-footer__list {
	display: grid;
	gap: 4px;
	align-content: start;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__list a {
	display: inline-block;
	padding-block: 6px;
	text-decoration: none;
}

.site-footer__list a:hover {
	color: var(--heading);
	text-decoration: underline;
}

.site-footer__seal {
	display: grid;
	gap: 8px;
	align-content: start;
}

.site-footer__seal p {
	color: var(--muted);
	font-size: 0.8125rem;
}

.site-footer__hash {
	color: var(--gold);
	font-size: 0.8125rem;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.site-footer__legal {
	grid-column: 1 / -1;
	padding-top: 24px;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 0.8125rem;
}

@media (max-width: 860px) {
	.site-footer__inner {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ── Motion ───────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
	/* Teasers rise as they scroll into view. Tied to the scroll position in
	   CSS, so nothing is ever hidden where this is not supported. */
	@supports (animation-timeline: view()) {
		.teaser {
			animation: rise linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 60%;
		}

		@keyframes rise {
			from {
				opacity: 0;
				translate: 0 28px;
			}
		}
	}

	/* Pages hand over with a short cross-fade instead of a white flash. */
	@view-transition {
		navigation: auto;
	}

	::view-transition-old(root),
	::view-transition-new(root) {
		animation-duration: 0.22s;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}

	.progress__bar {
		animation: none;
	}
}
