/*
Theme Name: Zheng Han
Author: Zheng Han
Description: A textured geometric design for essays, investment notes, and reading.
Version: 1.26.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: zhenghan
*/

:root {
	--ink: #242518;
	--paper: #dcd2b2;
	--rambles: #44a363;
	--investments: #d8bc89;
	--books: #b398c6;
	--serif: 'Bitter', Georgia, serif;
	--script: 'Berkshire Swash', 'Apple Chancery', 'Brush Script MT', cursive;
	--display: 'Bricolage Grotesque', 'Avenir Next', 'Trebuchet MS', sans-serif;
	--sans: 'DM Sans', 'Avenir Next', sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--section-paper, var(--paper)); color: var(--ink); font-family: var(--sans); line-height: 1.5; }
a { color: inherit; }
a:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }

.section-rambles { --section-paper: #9bb6a0; }
.section-investments { --section-paper: #d9c7a5; }
.section-books { --section-paper: #bfaec0; }
.content-layer { --section-paper: #ede7db; }
.content-layer.section-rambles { --section-paper: #dce5d9; }
.content-layer.section-investments { --section-paper: #eae2d3; }
.content-layer.section-books { --section-paper: #e6dfe6; }

.site-shell {
	--toolbar-height: 0px;
	--paper-opacity: .43;
	--symbol-nav-bottom: max(10px, env(safe-area-inset-bottom, 0px));
	--symbol-button-height: clamp(47px, 6vw, 70px);
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	min-height: calc(100svh - var(--toolbar-height));
	background: var(--section-paper, var(--paper));
}
.admin-bar .site-shell { --toolbar-height: 32px; }
@media (max-width: 782px) {
	.admin-bar .site-shell { --toolbar-height: 46px; }
}

/* Paper grain is strongest on Home and lightest on individual posts. */
.site-shell::after, .rewind-home-art::after, .rewind-paper::after {
	position: absolute;
	z-index: 6;
	inset: 0;
	pointer-events: none;
	background: url('assets/paper-grain.jpg') left top / 390px auto repeat;
	mix-blend-mode: multiply;
	opacity: var(--paper-opacity);
	content: '';
}

.home-layer .site-shell, .rewind-home-art { --paper-opacity: .80; }
.content-layer .site-shell { --paper-opacity: .25; }

/* Feather the page through a translucent blur behind the symbols. */
body:not(.home-layer) .site-shell::before {
	position: fixed;
	z-index: 4;
	inset: auto 0 0;
	height: calc(clamp(120px, 17svh, 164px) + env(safe-area-inset-bottom, 0px));
	pointer-events: none;
	background: linear-gradient(to bottom, transparent 44%, var(--section-paper, var(--paper)) 100%);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	-webkit-mask-image: linear-gradient(to bottom, transparent, #000 83%);
	mask-image: linear-gradient(to bottom, transparent, #000 83%);
	content: '';
}

.front-stage { position: relative; display: grid; flex: 1; }
.front-masthead {
	position: absolute;
	z-index: 2;
	inset: clamp(16px, 4.1svh, 36px) auto auto clamp(16px, 3.6vw, 54px);
	color: #f5edcf;
	pointer-events: none;
}
.front-masthead h1 {
	margin: 0;
	font-family: var(--display);
	font-size: clamp(1.35rem, min(5.6vw, 7svh), 2.65rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.055em;
}

.cover-mosaic {
	position: relative;
	min-width: 0;
	min-height: calc(100svh - var(--toolbar-height));
	overflow: hidden;
	background: #d49d80;
}
.cover-mesh { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover-mesh polygon {
	fill: currentColor;
	stroke: currentColor;
	stroke-width: .75px;
	vector-effect: non-scaling-stroke;
	stroke-linejoin: round;
}
.facet-ink { --facet-colour: #595a50; }
.facet-gold { --facet-colour: #e7c679; }
.facet-orange { --facet-colour: #d49d80; }
.facet-rambles { --facet-colour: #a4bf9e; }
.facet-red { --facet-colour: #d58f89; }
.facet-blue { --facet-colour: #86aabc; }
.facet-investments { --facet-colour: #e3ceaa; }
.facet-books { --facet-colour: #baabc8; }
.mosaic-facet, .mesh-link, .mesh-lift { color: var(--facet-colour); }
.facet-tone-1 { color: color-mix(in srgb, var(--facet-colour) 88%, #f8e9d6); }
.facet-tone-2 { color: color-mix(in srgb, var(--facet-colour) 89%, #494454); }
.facet-tone-3 { color: color-mix(in srgb, var(--facet-colour) 77%, #eaddcc); }
.facet-ink.facet-tone-3 { color: color-mix(in srgb, var(--facet-colour) 90%, #eaddcc); }

.mesh-link, .mosaic-facet-link { cursor: pointer; }
.mosaic-facet-link:focus-visible polygon { stroke: #fff4d4; stroke-width: 3px; }
.mesh-link:focus-visible { outline: none; }
.mesh-link:focus-visible .mesh-hit { stroke: #fff4d4; stroke-width: 3px; }
.mesh-lift.facet-rambles { --lit-face: #c0daad; }
.mesh-lift.facet-investments { --lit-face: #f9e5bd; }
.mesh-lift.facet-books { --lit-face: #dbcae7; }
.mesh-lift.facet-gold { --lit-face: #fde0a2; }
.mesh-lift {
	pointer-events: none;
	opacity: 0;
	filter: drop-shadow(.38px .78px .64px #30282082);
	transition: opacity var(--tile-fade-time, .18s) ease var(--tile-fade-delay, 0s);
}
.mesh-bevel, .mesh-top {
	transform: var(--brick-offset, translate(0px, 0px));
	transition: transform var(--tile-press-time, .24s) cubic-bezier(.2,.72,.28,1);
}
.mesh-side, .mesh-bevel {
	stroke: currentColor;
	stroke-linejoin: round;
	fill: currentColor;
}
.mesh-side {
	color: color-mix(in srgb, var(--facet-colour) 52%, #302725);
	stroke-width: .7;
}
.mesh-bevel {
	color: color-mix(in srgb, var(--facet-colour) 79%, #342925);
	stroke-width: .5;
	transform: var(--bevel-offset, translate(0px, 0px));
}
.mesh-face { fill: var(--lit-face); }
.mesh-light {
	stroke: #fff4da90;
	stroke-width: 1px;
	vector-effect: non-scaling-stroke;
}
.cover-mesh:has(.mesh-link.facet-rambles:is(:hover, :focus-visible, .is-touch-lifted):not(.is-pressing)) .mesh-lift.facet-rambles,
.cover-mesh:has(.mesh-link.facet-investments:is(:hover, :focus-visible, .is-touch-lifted):not(.is-pressing)) .mesh-lift.facet-investments,
.cover-mesh:has(.mesh-link.facet-books:is(:hover, :focus-visible, .is-touch-lifted):not(.is-pressing)) .mesh-lift.facet-books,
.cover-mesh:has(.mesh-link.facet-gold:is(:hover, :focus-visible, .is-touch-lifted):not(.is-pressing)) .mesh-lift.facet-gold {
	opacity: 1;
	--brick-offset: translate(-1.1px, -2.25px);
	--bevel-offset: translate(-.3px, -.68px);
}
.cover-mosaic:has(.mesh-link.is-pressing), .phone-panel.is-pressing, .tile-link.is-pressing {
	--tile-press-time: 150ms;
}
.cover-mosaic:has(.mesh-link.is-pressing) {
	--tile-fade-time: 85ms;
	--tile-fade-delay: 65ms;
}

.cover-label {
	--angle: -7deg;
	position: absolute;
	top: var(--label-y);
	left: var(--label-x);
	font-size: var(--label-size);
	line-height: 1;
	white-space: nowrap;
	transform: translate(calc(-50% + var(--label-slide, 0px)), calc(-50% + var(--label-lift, 0px))) rotate(var(--angle));
	transition: transform var(--tile-press-time, .24s) cubic-bezier(.2,.72,.28,1);
	pointer-events: none;
}
.label-rambles {
	--label-x: 22%; --label-y: 38%; --label-size: clamp(1.8rem, min(9vw, 15svh), 8rem);
	/* Move the label without animating the tilted glyphs' transform or stacking order. */
	z-index: 1;
	top: calc(var(--label-y) + var(--label-lift, 0px));
	left: calc(var(--label-x) + var(--label-slide, 0px));
	padding: .12em .18em; /* Leave room for the script's painted overhang. */
	transform: translate(-50%, -50%) rotate(var(--angle));
	transition-property: top, left;
	font-family: 'Caveat', 'Apple Chancery', cursive;
	font-weight: 700;
	letter-spacing: -.035em;
}
.label-investments {
	--label-x: 48%; --label-y: 56.5%; --label-size: clamp(.95rem, min(4.45vw, 9svh), 4.35rem);
	--angle: -6deg;
	font-family: 'Space Mono', 'Courier New', monospace;
	font-weight: 700;
	letter-spacing: -.055em;
}
.label-books {
	--label-x: 69%; --label-y: 31%; --label-size: clamp(1.7rem, min(8.25vw, 14svh), 7.5rem);
	font-family: 'Fraunces', Georgia, serif;
	font-style: italic;
	font-weight: 800;
	letter-spacing: -.035em;
}
.label-rewind {
	--label-x: 76.5%; --label-y: 94.5%; --label-size: clamp(1.1rem, min(4.8vw, 5.2svh), 3rem);
	--angle: 0deg;
	font-family: var(--script);
}
.cover-record {
	position: absolute;
	inset: auto auto 9% 76.5%;
	width: min(15vw, 19svh);
	translate: calc(-50% + var(--label-slide, 0px)) var(--label-lift, 0px);
	transition: translate var(--tile-press-time, .24s) cubic-bezier(.2,.72,.28,1);
	pointer-events: none;
}
.cover-mosaic:has(.mesh-link.facet-rambles:is(:hover, :focus-visible, .is-touch-lifted):not(.is-pressing)) .label-rambles,
.cover-mosaic:has(.mesh-link.facet-investments:is(:hover, :focus-visible, .is-touch-lifted):not(.is-pressing)) .label-investments,
.cover-mosaic:has(.mesh-link.facet-books:is(:hover, :focus-visible, .is-touch-lifted):not(.is-pressing)) .label-books,
.cover-mosaic:has(.mesh-link.facet-gold:is(:hover, :focus-visible, .is-touch-lifted):not(.is-pressing)) :is(.label-rewind, .cover-record) {
	--label-slide: -1.1vw;
	--label-lift: -2.25svh;
	z-index: 1;
}
.rewind-record { display: block; width: 100%; height: auto; }
.cover-record .rewind-record { filter: drop-shadow(1px 4px 4px #40291370); }
@media (orientation: portrait) {
	.cover-label { --angle: -12deg; }
	.label-investments { --angle: -9deg; }
	.label-rewind { --angle: 0deg; }
}

.collection { flex: 1; min-width: 0; }
.collection-intro {
	max-width: 65ch;
	margin: 0;
	padding: clamp(16px, 2.7vw, 35px) clamp(18px, 4vw, 56px);
}
.collection-intro p { margin: 0; }
.collection-rambles {
	--deep: #2e5142;
	--middle: #587763;
	--soft: #8eab8b;
	--light: #d6dabb;
	--dark-number: #263b2e;
	--caption-paper: #f2edda;
}
.collection-investments {
	--deep: #624936;
	--middle: #806348;
	--soft: #cbb68e;
	--light: #ebdfc0;
	--dark-number: #402e23;
	--caption-paper: #f6ead3;
}
.collection-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}
.collection-tile {
	--field: var(--deep);
	--circle-left: var(--light);
	--circle-right: var(--soft);
	--number-ink: var(--dark-number);
	--number-shadow: #ffffff45;
	position: relative;
	isolation: isolate;
	display: grid;
	min-width: 0;
	min-height: 185px;
	aspect-ratio: 1.35;
	background: var(--field);
}
@media (max-width: 760px) {
	.collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* The pattern changes when the grid switches from three columns to two. */
@media (min-width: 761px) {
	.collection-tile:nth-child(even) {
		--field: var(--light);
		--circle-left: var(--middle);
		--circle-right: var(--deep);
		--number-ink: #fcf3df;
		--number-shadow: #241a1288;
	}
}
@media (max-width: 760px) {
	.collection-tile:is(:nth-child(4n + 2), :nth-child(4n + 3)) {
		--field: var(--light);
		--circle-left: var(--middle);
		--circle-right: var(--deep);
		--number-ink: #fcf3df;
		--number-shadow: #241a1288;
	}
}
.collection-tile::before, .tile-surface::before {
	position: absolute;
	z-index: -1;
	top: 50%;
	left: 50%;
	width: min(64%, 30svh);
	aspect-ratio: 1;
	translate: -50% -50%;
	border-radius: 50%;
	background: linear-gradient(90deg, var(--circle-left) 50%, var(--circle-right) 50%);
	content: '';
}

.collection-tile--empty {
	--deep: #607065;
	--middle: #778379;
	--soft: #a0a79a;
	--light: #c3c6b8;
}
.collection-investments .collection-tile--empty {
	--deep: #756e64;
	--middle: #8e8376;
	--soft: #b6ac9d;
	--light: #d5cbbd;
}

.tile-link {
	--tile-travel: var(--tile-press-time, .24s);
	--tile-ease: cubic-bezier(.2,.72,.28,1);
	position: relative;
	min-width: 0;
	display: grid;
	place-items: center;
	padding: 10px;
	color: var(--ink);
	text-decoration: none;
	scroll-margin-block: 1rem 7rem;
}
.tile-surface {
	position: absolute;
	z-index: 0;
	isolation: isolate;
	inset: 0;
	background: var(--field);
	border-radius: var(--tile-rounding, var(--tile-rest-radius, 0px));
	box-shadow: var(--tile-shadow, none);
	filter: var(--tile-light, none);
	pointer-events: none;
	transition: transform var(--tile-travel) var(--tile-ease), border-radius var(--tile-travel) ease,
		box-shadow var(--tile-travel) ease, filter var(--tile-travel) ease;
}
.collection-tile:has(.tile-link)::before { content: none; }
.collection-tile:has(.tile-link) { z-index: 0; transition: z-index 0s .24s; }
.collection-tile:has(.tile-link:is(:hover, :focus-visible, .is-touch-lifted, .is-pressing)) {
	z-index: 2;
	transition-delay: 0s;
}
.tile-link:is(:hover, :focus-visible, .is-touch-lifted):not(.is-pressing) {
	--tile-offset: translate(-5px, -9px);
	--tile-rounding: 16px;
	--tile-light: brightness(1.08);
	--tile-bevel: color-mix(in srgb, var(--field) 77%, #392e26);
	--tile-side: color-mix(in srgb, var(--field) 55%, #392e26);
	--tile-shadow:
		inset 0 1px #fff6d879,
		1px 1.5px var(--tile-bevel), 2px 3px var(--tile-bevel),
		3px 4.5px var(--tile-side), 4px 6px var(--tile-side),
		5px 7.5px var(--tile-side), 6px 9px var(--tile-side),
		8px 12px 13px #29221c60;
}
.tile-link :is(.tile-surface, .tile-number, .tile-caption, .investment-disc) {
	transform: var(--tile-offset, none);
}
.tile-link:focus-visible { outline: 3px solid #f4ebcc; outline-offset: -5px; }
.tile-number, .tile-caption {
	z-index: 1;
	grid-area: 1 / 1;
	transition: transform var(--tile-travel) var(--tile-ease), opacity .2s ease;
}
.tile-number { font: 400 clamp(1.6rem, 5vw, 4rem)/1 var(--script); color: var(--number-ink); text-shadow: 0 1px 3px var(--number-shadow); }
.tile-caption {
	display: grid;
	gap: .35em;
	max-width: min(82%, 24ch);
	padding: .55em .75em;
	border-radius: 2px;
	background: var(--caption-paper);
	box-shadow: 0 2px 8px #28221724;
	text-align: center;
	overflow-wrap: anywhere;
	font: 700 clamp(.9rem, 2vw, 1.5rem)/1.2 var(--serif);
	opacity: 0;
}
.tile-caption.collection-message { opacity: 1; margin: auto; }
.tile-caption strong { font-size: calc(1em * var(--zh-preview-scale, 1)); text-wrap: pretty; }
.tile-caption time { font: 400 clamp(.73rem, 1.3vw, .95rem)/1.15 var(--sans); }
.tile-link:is(:hover, :focus-visible, .is-touch-lifted, .is-pressing) .tile-number { opacity: 0; }
.tile-link:is(:hover, :focus-visible, .is-touch-lifted, .is-pressing) .tile-caption { opacity: 1; }

@media (hover: none) {
	.tile-number { display: none; }
	.tile-caption { max-width: 94%; opacity: 1; }
}

.collection-investments {
	--disc-gutter: clamp(8px, 1.65vw, 25px);
	--disc-limit: 31rem;
}
.collection-investments .collection-grid > .collection-tile {
	--field: var(--deep);
	--circle-left: var(--light);
	--circle-right: var(--soft);
	--disc-ink: #30241a;
	min-height: 0;
	aspect-ratio: 1;
}
.collection-investments :is(.collection-tile, .tile-surface)::before {
	width: min(calc(100% - var(--disc-gutter) - var(--disc-gutter)), var(--disc-limit));
}
.investment-link { padding: var(--disc-gutter); }
.investment-disc {
	position: relative;
	z-index: 1;
	container-type: inline-size;
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	width: min(100%, var(--disc-limit));
	aspect-ratio: 1;
	color: var(--disc-ink);
	transition: transform var(--tile-travel) var(--tile-ease);
}
.investment-half {
	display: grid;
	gap: clamp(.25rem, 1.65cqi, .55rem);
	min-width: 0;
	overflow-wrap: anywhere;
	line-height: 1.3;
}
.investment-identity { padding-inline: 25% 8%; }
.investment-summary { padding-inline: 8% 25%; }
.investment-kicker, .investment-tags, .investment-half time, .investment-open {
	font-size: clamp(.71rem, 3.1cqi, .9rem);
}
.investment-kicker {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .1rem .45rem;
	font-weight: 700;
	letter-spacing: .045em;
	text-transform: uppercase;
}
.investment-kicker > span:first-child:has(+ .investment-symbol) { opacity: .8; }
.investment-company, .investment-thesis {
	font-size: clamp(.84rem, 3.65cqi, 1.1rem);
}
.investment-title {
	font: 700 calc(clamp(.93rem, 5.1cqi, 1.55rem) * var(--zh-preview-scale, 1))/1.14 var(--serif);
}
.investment-company, .investment-title, .investment-thesis {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.investment-company { -webkit-line-clamp: 2; }
.investment-title { -webkit-line-clamp: 4; }
.investment-thesis { -webkit-line-clamp: 5; }
.investment-tile-return { display: grid; gap: .12em; font-size: clamp(.72rem, 3cqi, .92rem); }
.investment-tile-return strong {
	font: 700 clamp(1.06rem, 6.4cqi, 1.85rem)/1 var(--serif);
	font-variant-numeric: tabular-nums;
}
.investment-open { font-weight: 700; }
.investment-open-arrow { width: 1em; height: 1em; vertical-align: -.12em; }

@media (min-width: 1181px), (max-width: 600px) and (orientation: portrait) {
	.collection-investments .collection-grid > .collection-tile:nth-child(even) {
		--field: var(--light);
		--circle-left: var(--middle);
		--circle-right: var(--deep);
		--disc-ink: #fff6e3;
	}
}
@media (max-width: 1180px) {
	.collection-investments .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 601px) and (max-width: 1180px), (max-width: 600px) and (orientation: landscape) {
	.collection-investments .collection-grid > .collection-tile:is(:nth-child(4n + 2), :nth-child(4n + 3)) {
		--field: var(--light);
		--circle-left: var(--middle);
		--circle-right: var(--deep);
		--disc-ink: #fff6e3;
	}
}
@media (max-width: 600px) and (orientation: portrait) {
	:is(.collection-rambles, .collection-investments) .collection-grid { grid-template-columns: minmax(0, 1fr); }
	.collection-rambles .collection-grid > .collection-tile {
		--field: var(--deep);
		--circle-left: var(--light);
		--circle-right: var(--soft);
		--number-ink: var(--dark-number);
		--number-shadow: #ffffff45;
		min-height: clamp(12rem, 66vw, 19.5rem);
	}
	.collection-rambles .collection-grid > .collection-tile:nth-child(even) {
		--field: var(--light);
		--circle-left: var(--middle);
		--circle-right: var(--deep);
		--number-ink: #fcf3df;
		--number-shadow: #241a1288;
	}
	:is(.collection-rambles, .collection-investments) .collection-tile--empty + .collection-tile--empty:nth-child(n + 4) { display: none; }
}

.investment-snapshot {
	margin: 0 0 clamp(1.8rem, 5vw, 3rem);
	padding: clamp(1rem, 3vw, 1.6rem);
	border: 1px solid #8c735c50;
	border-radius: 4px;
	background: #f8f0df;
	color: #30241a;
	overflow-wrap: anywhere;
}
.investment-snapshot-heading, .investment-snapshot-note {
	display: flex;
	gap: .3rem 1rem;
	flex-wrap: wrap;
	align-items: baseline;
}
.investment-snapshot-heading strong { font-family: var(--serif); }
.investment-snapshot-heading span, .investment-snapshot-note { font-size: .875rem; }
.investment-snapshot-thesis { margin: .65rem 0 0; font-family: var(--serif); line-height: 1.6; }
.investment-metrics {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
	gap: .6rem .9rem;
	margin: .9rem 0 0;
}
.investment-metrics dt { font-size: .84rem; }
.investment-metrics dd { margin: 0; font: 700 1.12rem/1.4 var(--serif); font-variant-numeric: tabular-nums; }
.investment-gain { color: #25543b; }
.investment-loss { color: #833c35; }
.investment-snapshot-note { margin-top: .85rem; color: #514238; }
.investment-snapshot-note a { text-underline-offset: .15em; }

.bookcase {
	--shelf-columns: 4;
	--shelf-plank: clamp(12px, 2vw, 22px);
	--shelf-label: 6.4rem;
	--wood-grain: url('assets/purpleheart-grain.jpg');
	display: grid;
	grid-template-columns: repeat(var(--shelf-columns), minmax(0, 1fr));
	margin: 0;
	padding: 0 clamp(5px, 1.4vw, 20px);
	list-style: none;
	background:
		linear-gradient(90deg, #55324c38, transparent 8%, transparent 92%, #55324c38),
		linear-gradient(#c1a5bdcc, #b599b4d4),
		var(--wood-grain) center top / min(100%, 1100px) auto,
		#9e7996;
	box-shadow: inset 0 0 0 1px #59334e44;
}
.shelf-slot {
	position: relative;
	display: grid;
	align-items: end;
	min-width: 0;
	min-height: max(240px, calc((100svh - var(--toolbar-height)) / 2));
	padding: clamp(20px, 5svh, 50px) clamp(9px, 3vw, 40px) 0;
}
/* The first slot in each row draws a single plank across all of its columns. */
.shelf-slot::after {
	position: absolute;
	z-index: 1;
	inset-inline-start: 0;
	inset-block-end: var(--shelf-label);
	display: none;
	width: calc(100% * var(--shelf-columns));
	height: var(--shelf-plank);
	pointer-events: none;
	background:
		linear-gradient(#c09ab284 0%, #c09ab250 22%, #4e2b49a8 24%, #4e2b49e0 100%),
		var(--wood-grain) center center / 100% auto,
		#68425f;
	box-shadow: 0 2px #4c2c474d, 0 5px 8px #472d4236;
	content: '';
}
@media (min-width: 1024px) {
	.shelf-slot:nth-child(4n + 1)::after { display: block; }
	.shelf-slot--empty:nth-child(n + 9):nth-child(4n + 1),
	.shelf-slot--empty:nth-child(n + 9):nth-child(4n + 1) ~ .shelf-slot--empty { display: none; }
}
@media (min-width: 601px) and (max-width: 1023px) {
	.bookcase { --shelf-columns: 3; }
	.shelf-slot:nth-child(3n + 1)::after { display: block; }
	.shelf-slot--empty:nth-child(n + 7):nth-child(3n + 1),
	.shelf-slot--empty:nth-child(n + 7):nth-child(3n + 1) ~ .shelf-slot--empty { display: none; }
}
@media (max-width: 600px) {
	.bookcase { --shelf-columns: 2; }
	.shelf-slot:nth-child(2n + 1)::after { display: block; }
	.shelf-slot--empty:nth-child(n + 5):nth-child(2n + 1),
	.shelf-slot--empty:nth-child(n + 5):nth-child(2n + 1) ~ .shelf-slot--empty { display: none; }
}
.shelf-slot--empty, .shelf-slot--message { background: #bdbbc345; }
.shelf-book {
	display: grid;
	grid-template-rows: auto var(--shelf-label);
	justify-items: center;
	min-width: 0;
	text-decoration: none;
	scroll-margin-block: 1rem 8rem;
}
.shelf-book:focus-visible { outline-color: #fff2df; }
.shelf-cover {
	--book-cloth: #593949;
	position: relative;
	display: grid;
	place-items: center;
	align-self: end;
	width: min(100%, clamp(110px, 23svh, 184px));
	aspect-ratio: 2 / 3;
	margin-block-end: var(--shelf-plank);
	border-radius: 2px 4px 4px 2px;
	background: var(--book-cloth);
	color: #f9ead8;
	box-shadow: 3px 3px #422a41a1, 6px 6px 14px #432c424f;
	transition: filter .22s ease, transform .28s cubic-bezier(.2,.75,.3,1), box-shadow .28s ease;
}
.shelf-cover::after {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(90deg, #291b3345, transparent 8%);
	content: '';
}
.shelf-slot:nth-child(3n + 2) .shelf-cover { --book-cloth: #4d455d; }
.shelf-slot:nth-child(3n) .shelf-cover { --book-cloth: #6b415c; }
.shelf-book:is(:hover, :focus-visible) .shelf-cover {
	filter: brightness(1.12);
	transform: translateY(-5px) scale(1.04);
	box-shadow: 4px 6px #422a4175, 10px 12px 20px #432c4259;
}
.shelf-cover img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	object-fit: contain;
}
.shelf-cover-title {
	max-width: 100%;
	max-height: 100%;
	overflow: hidden;
	padding: .55rem;
	font: italic 800 calc(clamp(.78rem, 2.5vw, 1.3rem) * var(--zh-preview-scale, 1))/1.16 'Fraunces', Georgia, serif;
	text-align: center;
	overflow-wrap: anywhere;
}
.shelf-note {
	display: grid;
	align-content: center;
	width: 100%;
	color: #291b28;
	font-size: clamp(.72rem, 1.6vw, .9rem);
	line-height: 1.25;
	text-align: center;
	overflow-wrap: anywhere;
}
.shelf-progress { font-weight: 700; }
.shelf-description {
	display: -webkit-box;
	max-width: 34ch;
	margin: 0 auto .25em;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}
.shelf-empty-note {
	align-self: center;
	margin: 0 0 var(--shelf-label);
	color: #291b28;
	text-align: center;
}
.symbol-nav {
	position: sticky;
	z-index: 5;
	bottom: var(--symbol-nav-bottom);
	align-self: flex-end;
	display: flex;
	gap: clamp(5px, 1vw, 11px);
	margin: 18px clamp(14px, 3.2vw, 42px) max(12px, env(safe-area-inset-bottom));
}
.symbol-link {
	display: grid;
	place-items: center;
	width: clamp(47px, 6vw, 70px);
	height: var(--symbol-button-height);
	text-decoration: none;
}
.symbol-art {
	display: grid;
	place-items: center;
	pointer-events: none;
	transform-origin: 50% 80%;
	transition: transform .26s ease, filter .22s ease;
}
.symbol-link:is(:hover, :focus-visible) { z-index: 1; }
.symbol-link:is(:hover, :focus-visible) .symbol-art {
	filter: brightness(1.2) drop-shadow(0 0 6px #fff0c684);
	transform: translateY(-4px) scale(1.11);
	animation: symbol-genie .38s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes symbol-genie {
	0% { transform: none; }
	32% { transform: translateY(-2px) scale(.93, 1.17) skewX(-4deg); }
	68% { transform: translateY(-5px) scale(1.16, 1.08) skewX(1.5deg); }
	100% { transform: translateY(-4px) scale(1.11); }
}
.symbol-nav .rewind-record { width: clamp(36px, 4.8vw, 55px); }
.symbol-triangle { width: clamp(37px, 5.2vw, 59px); height: auto; overflow: visible; }
.symbol-nav .rewind-record, .symbol-triangle {
	filter: drop-shadow(1px 4px 2px #2c231c8f) drop-shadow(1px 6px 5px #2c231c42);
}
.symbol-triangle polygon { fill: var(--symbol-colour); stroke: var(--symbol-edge); stroke-width: 1.45; stroke-linejoin: round; }
.symbol-rambles { --symbol-colour: var(--rambles); --symbol-edge: #285638; }
.symbol-rambles .symbol-triangle { transform: rotate(147deg); }
.symbol-investments { --symbol-colour: var(--investments); --symbol-edge: #785e36; }
.symbol-investments .symbol-triangle { transform: rotate(-7deg); }
.symbol-books { --symbol-colour: var(--books); --symbol-edge: #594369; }
.symbol-books .symbol-triangle { transform: rotate(191deg); }

.site-shell > main { animation: page-settle .24s ease-out both; }
@keyframes page-settle {
	from { opacity: .72; }
	to { opacity: 1; }
}
.rewind-home-art {
	position: fixed;
	z-index: 0;
	isolation: isolate;
	inset: var(--toolbar-height) 0 auto;
	height: calc(100svh - var(--toolbar-height));
	pointer-events: none;
	background: #d49d80;
}
.rewind-active > .rewind-home-art { display: block; }
body:not(.home-layer) .rewind-active::before,
.rewind-active::after { opacity: 0; }
.rewind-active > main {
	position: relative;
	z-index: 1;
	pointer-events: none;
	animation: none;
}
.rewind-paper, .rewind-creases {
	position: fixed;
	inset: 0;
	pointer-events: none;
}
.rewind-paper { z-index: 0; isolation: isolate; background: var(--section-paper, var(--paper)); }
.rewind-creases {
	z-index: 3;
	opacity: 0;
	background:
		conic-gradient(from 12deg at 35% 38%, #fff8e784 0 51deg, #58422b57 52deg 110deg, transparent 111deg 184deg, #f8efdb6e 185deg 241deg, #75583f46 242deg 293deg, transparent 294deg),
		conic-gradient(from 64deg at 72% 60%, transparent 0 70deg, #5d47304d 71deg 128deg, #fff5db8f 129deg 174deg, transparent 175deg 280deg, #67492d3d 281deg 324deg, transparent 325deg);
}
.rewind-creases::before, .rewind-creases::after {
	position: absolute;
	inset: 0;
	content: '';
}
.rewind-creases::before {
	background: linear-gradient(134deg, #e4d3ad4d 25%, #fff7ddc4 44%, #70583362 75%);
	clip-path: polygon(0 0, 53% 8%, 33% 41%, 3% 65%);
}
.rewind-creases::after {
	background: linear-gradient(54deg, #654f3378 18%, #fff6d7a0 51%, #dac49a54 73%);
	clip-path: polygon(39% 93%, 67% 52%, 100% 30%, 91% 89%, 67% 73%);
}
.rewind-active .symbol-link { animation: rewind-nav-hide .55s ease-out both; }
.rewind-active .symbol-home { animation: rewind-record-hide .72s ease-out both; }
.rewind-active .symbol-home .symbol-art { filter: brightness(1.22) drop-shadow(0 0 8px #fff1c9a0); }
@keyframes rewind-nav-hide {
	0%, 42% { opacity: 1; }
	100% { opacity: 0; }
}
@keyframes rewind-record-hide {
	0%, 84% { opacity: 1; }
	100% { opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
	.rewind-arrived .site-shell > .front-stage { animation: none; }
	.rewind-arrived :is(.front-masthead, .cover-label) {
		animation: home-label-rise .56s .10s cubic-bezier(.22,.7,.3,1) both;
	}
	.rewind-arrived .label-rambles { animation-delay: .17s; }
	.rewind-arrived .label-investments { animation-delay: .24s; }
	.rewind-arrived .label-books { animation-delay: .31s; }
	.rewind-arrived .label-rewind { animation-delay: .38s; }
	.rewind-arrived .cover-record { animation: home-record-appear .56s .38s ease-out both; }
}
@keyframes home-label-rise {
	from { opacity: 0; translate: 0 9px; }
	to { opacity: 1; translate: 0 0; }
}
@keyframes home-record-appear {
	from { opacity: 0; }
	to { opacity: 1; }
}
.route-splash {
	position: fixed;
	z-index: 100000;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}
.route-splash--arrival {
	background: var(--section-paper);
	animation: splash-arrival .38s ease-out both;
}
.route-splash-pool, .route-splash--departure::before, .route-splash--departure::after {
	position: absolute;
	inset: var(--splash-y) auto auto var(--splash-x);
	translate: -50% -50%;
	aspect-ratio: 1;
	background: var(--section-paper, var(--paper));
}
.route-splash-pool {
	width: 328vmax;
	animation: splash-pool .7s cubic-bezier(.62,.02,.32,1) both;
}
.route-splash--departure::before, .route-splash--departure::after {
	--drop-x: -14vmin;
	--drop-y: -10vmin;
	width: clamp(14px, 5vmin, 50px);
	border-radius: 48% 52% 65% 35%;
	animation: splash-drop .5s ease-out both;
	content: '';
}
.route-splash--departure::after {
	--drop-x: 12vmin;
	--drop-y: -14vmin;
	width: clamp(10px, 3vmin, 30px);
	animation-delay: .04s;
}
@keyframes splash-pool {
	0% { transform: scale(.003) rotate(-17deg); border-radius: 46% 54% 66% 34% / 53% 32% 68% 47%; }
	36% { transform: scale(.15) rotate(-10deg); border-radius: 56% 44% 36% 64% / 40% 65% 35% 60%; }
	72% { transform: scale(.66) rotate(2deg); border-radius: 44% 56% 54% 46% / 58% 46% 54% 42%; }
	100% { transform: scale(1) rotate(0); border-radius: 50%; }
}
@keyframes splash-drop {
	from { transform: scale(.12); opacity: .25; }
	42% { opacity: .8; }
	to { transform: translate(var(--drop-x), var(--drop-y)) scale(.7) rotate(32deg); opacity: 0; }
}
@keyframes splash-arrival {
	from { opacity: 1; }
	to { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.site-shell > main, .symbol-link:is(:hover, :focus-visible) .symbol-art { animation: none; }
	.symbol-link:is(:hover, :focus-visible) .symbol-art { transform: none; }
	.mesh-lift, .mesh-bevel, .mesh-top, .cover-label, .cover-record,
	.collection-tile:has(.tile-link), .shelf-cover, .symbol-art { transition: none; }
	.mesh-lift :is(.mesh-bevel, .mesh-top) { transform: none; }
	.tile-link :is(.tile-surface, .tile-number, .tile-caption, .investment-disc) {
		transform: none;
		transition: none;
	}
	.tile-link .tile-surface { box-shadow: none; border-radius: var(--tile-rest-radius, 0px); }
	.shelf-book:is(:hover, :focus-visible) .shelf-cover { transform: none; }
	.cover-mosaic .cover-label { transform: translate(-50%, -50%) rotate(var(--angle)); }
	.cover-mosaic .label-rambles { top: var(--label-y); left: var(--label-x); }
	.cover-mosaic .cover-record { translate: -50% 0; }
}

.page-wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 4.75rem); }
.simple-page { flex: 1; max-width: 780px; min-height: 62vh; padding-top: 6.5rem; padding-bottom: 8rem; }
.simple-page h1 {
	--list-title-size: clamp(4rem, 8vw, 6.5rem);
	margin: 0 0 1rem;
	font-family: var(--script);
	font-size: calc(var(--list-title-size) * var(--zh-preview-scale, 1));
	font-weight: 400;
	line-height: 1.05;
}
.simple-page p { color: var(--ink); font-size: 1.15rem; line-height: 1.8; }
.single-wrap { flex: 1; max-width: 820px; padding-top: 5rem; padding-bottom: 8rem; overflow-x: clip; }
.site-shell > .single-wrap { animation: none; }
.entry-reader:focus { outline: none; }
.entry-password {
	width: min(100%, 31rem);
	margin-inline: auto;
	padding: clamp(1rem, 4vw, 1.75rem);
	border: 1px solid #3e30273b;
	border-radius: .65rem;
	background: color-mix(in srgb, var(--section-paper, var(--paper)) 52%, #fff7e7);
	box-shadow: 0 4px 12px #35271e17;
	font-size: calc(1rem * var(--zh-prompt-scale, 1));
}
.entry-password .post-password-form > p { margin-block: 0 1rem; }
.entry-password .post-password-form > p:last-child {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: .65rem;
	margin-block-end: 0;
}
.entry-password label {
	display: grid;
	flex: 1 1 12rem;
	min-width: 0;
	gap: .28rem;
	font-size: .9em;
	font-weight: 700;
}
.entry-password input {
	min-height: 44px;
	padding: .55rem .8rem;
	border: 1px solid #58433282;
	border-radius: .3rem;
	font: inherit;
}
.entry-password input[type="password"] {
	width: 100%;
	background: #fffaf0;
	color: var(--ink);
	font-size: 1rem;
}
.entry-password input[type="submit"] {
	background: #3c3228;
	color: #fff5df;
	font-weight: 700;
	cursor: pointer;
}
.entry-password .post-password-form-invalid-password { color: #742c25; }
.entry-pager {
	--step-accent: #c49a69;
	position: relative;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .6rem clamp(.65rem, 3vw, 1.8rem);
	margin-block-end: clamp(1.5rem, 4vw, 2.75rem);
}
.entry-step {
	--step-align: start;
	--arrow-tilt: -9deg;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	grid-template-areas: "arrow label" "arrow title";
	align-items: center;
	column-gap: .75rem;
	min-width: 0;
	width: 100%;
	max-width: 16rem;
	min-height: 50px;
	padding: .55rem .85rem;
	border: 1px solid #3e30273b;
	border-radius: .7rem 1.7rem 1.7rem .7rem;
	background: #f3e8cd;
	box-shadow: 1px 3px #4e3c3040, 1px 5px 8px #35271e18, inset 0 1px #fff9e4;
	text-align: var(--step-align);
	text-decoration: none;
}
.section-rambles .entry-pager { --step-accent: #a1b393; }
.section-books .entry-pager { --step-accent: #b8a6bf; }
.entry-step[data-entry-step="previous"] { grid-column: 1; grid-row: 1; }
.entry-step[data-entry-step="next"] {
	--step-align: end;
	--arrow-tilt: 9deg;
	grid-column: 2;
	grid-row: 1;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas: "label arrow" "title arrow";
	justify-self: end;
	border-radius: 1.7rem .7rem .7rem 1.7rem;
}
.entry-step:is(:hover, :focus-visible) { background: #fbf0d8; }
.entry-step-arrow {
	grid-area: arrow;
	display: grid;
	place-items: center;
	inline-size: clamp(1.6rem, 4.3vw, 2rem);
	block-size: clamp(1.45rem, 4vw, 1.8rem);
	border-radius: 50% 44% 50% 42%;
	background: var(--step-accent);
	box-shadow: 1px 2px #58433265;
	rotate: var(--arrow-tilt);
	font: 800 1.1rem/1 var(--display);
}
.entry-step-label { grid-area: label; font: 400 clamp(.85rem, 2vw, 1.08rem)/1.02 var(--script); }
.entry-step-title {
	grid-area: title;
	overflow: hidden;
	font-size: clamp(.78rem, 2.4vw, .94rem);
	text-overflow: ellipsis;
	white-space: nowrap;
}
.entry-pager-hint { display: none; }

@media (max-width: 1000px) and (pointer: coarse) {
	.has-entry-swipe .entry-pager { margin-block-end: 1.15rem; }
	.has-entry-swipe .entry-step:not(:focus-visible) {
		position: absolute;
		width: 1px;
		min-height: 0;
		height: 1px;
		padding: 0;
		border: 0;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
	.has-entry-swipe .entry-pager-hint {
		display: block;
		grid-column: 1 / -1;
		text-align: center;
		font-size: .8rem;
	}
}

.content-layer.section-rambles {
	--reading-face: 'Nunito', 'Avenir Next', system-ui, sans-serif;
	--reading-heading: var(--reading-face);
}
.content-layer.section-investments {
	--reading-face: var(--serif);
}
.content-layer.section-books {
	--reading-face: 'Caveat', 'Apple Chancery', 'Segoe Print', cursive;
	--reading-heading: var(--reading-face);
	--reading-size: clamp(1.6rem, 3vw, 1.95rem);
	--reading-leading: 1.45;
}
.single-heading { margin-bottom: 3rem; text-align: center; }
.single-heading h1 {
	--post-title-size: clamp(2rem, 5vw, 3.65rem);
	margin: 0;
	font-family: var(--reading-heading, var(--serif));
	font-size: calc(var(--post-title-size) * var(--zh-title-scale, 1));
	line-height: 1.13;
	letter-spacing: -.04em;
	overflow-wrap: anywhere;
}
.single-heading .meta { display: inline-block; margin-top: .75rem; color: var(--ink); font-size: .86rem; }
.entry-content { font-size: clamp(1.05rem, 1.5vw, 1.15rem); line-height: 1.8; overflow-wrap: anywhere; }
.single-wrap .entry-content {
	font-family: var(--reading-face, var(--sans));
	font-size: var(--reading-size, clamp(1.05rem, 1.5vw, 1.15rem));
	line-height: var(--reading-leading, 1.8);
}
.section-books .single-heading h1,
.section-books .entry-content :is(h2, h3, h4, h5, h6) { letter-spacing: 0; }
.entry-content > * { max-width: 66ch; margin-right: auto; margin-left: auto; }
.entry-content :is(h2, h3, h4, h5, h6) { font-family: var(--reading-heading, var(--serif)); letter-spacing: -.04em; line-height: 1.2; }
.entry-content img { max-width: 100%; height: auto; }
.entry-content a { text-underline-offset: .17em; }
.review-cover { width: min(50%, 230px); margin: 0 auto 2rem; }
.review-cover img { display: block; max-width: 100%; height: auto; box-shadow: 4px 5px 12px #2e1d3a50; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 540px) {
	.simple-page, .single-wrap { padding-top: 3.25rem; padding-bottom: 6rem; }
	.simple-page h1 { --list-title-size: clamp(2.75rem, 11vw, 4rem); overflow-wrap: anywhere; }
}

/* Keep the two cover views aligned as the mobile browser chrome moves. */
@supports (height: 100dvh) {
	.site-shell { --viewport-height: 100dvh; }
}
.cover-mosaic, .site-shell { min-height: calc(var(--viewport-height, 100svh) - var(--toolbar-height)); }
.rewind-home-art { height: calc(var(--viewport-height, 100svh) - var(--toolbar-height)); }
.site-shell { --content-safe-top: max(0px, calc(env(safe-area-inset-top, 0px) - var(--toolbar-height))); }
.front-masthead {
	top: max(clamp(16px, 4.1svh, 36px), calc(var(--content-safe-top) + 12px));
	left: max(clamp(16px, 3.6vw, 54px), calc(env(safe-area-inset-left, 0px) + 12px));
}
.page-wrap {
	--page-gutter: clamp(1.05rem, 4.5vw, 4.75rem);
	padding-inline-start: max(var(--page-gutter), calc(env(safe-area-inset-left, 0px) + .8rem));
	padding-inline-end: max(var(--page-gutter), calc(env(safe-area-inset-right, 0px) + .8rem));
}
.collection > h1 + .collection-intro {
	padding-block-start: calc(clamp(16px, 2.7vw, 35px) + var(--content-safe-top));
}
.collection-intro {
	padding-inline-start: max(clamp(18px, 4vw, 56px), calc(env(safe-area-inset-left, 0px) + .8rem));
	padding-inline-end: max(clamp(18px, 4vw, 56px), calc(env(safe-area-inset-right, 0px) + .8rem));
}
.bookcase {
	padding-block-start: var(--content-safe-top);
	padding-inline-start: max(clamp(5px, 1.4vw, 20px), env(safe-area-inset-left, 0px));
	padding-inline-end: max(clamp(5px, 1.4vw, 20px), env(safe-area-inset-right, 0px));
}
.collection-tile { aspect-ratio: auto; min-height: clamp(11.5rem, 24.7vw, 29rem); }
.single-heading h1 { text-wrap: balance; }
.entry-content :is(img, video, iframe) { max-width: 100%; }
.entry-content :is(pre, .wp-block-table) { max-width: 100%; overflow-x: auto; }
.entry-content > table { display: block; overflow-x: auto; }
.shelf-note { font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
	.collection-tile { min-height: clamp(8.75rem, 40vw, 13rem); }
	.entry-content { line-height: 1.7; }
	.simple-page, .single-wrap { padding-block-start: max(3.25rem, calc(var(--content-safe-top) + 1rem)); }
	.single-heading { margin-bottom: 1.9rem; }
	.single-heading h1 { --post-title-size: clamp(1.85rem, 7vw, 2.9rem); }
	.review-cover { width: min(58%, 205px); margin-bottom: 1.6rem; }
}
@media (max-width: 760px), (max-width: 1000px) and (max-height: 550px) and (orientation: landscape) and (pointer: coarse) {
	.site-shell {
		--symbol-nav-bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 8px));
		--symbol-button-height: 48px;
	}
	body:not(.home-layer) .site-shell::before { content: none; }
	.symbol-nav {
		align-self: center;
		gap: clamp(2px, 1.4vw, 9px);
		margin-block: 12px var(--symbol-nav-bottom);
		padding: 3px 10px;
		border: 1px solid #fdf8ebad;
		border-radius: 999px;
		background: var(--section-paper, var(--paper));
		box-shadow: 0 5px 16px #30251a30, inset 0 1px #fff8ed96, inset 0 -1px #55472f20;
	}
	.symbol-link { width: clamp(48px, 13vw, 62px); }

	@supports ((-webkit-backdrop-filter: blur(18px)) or (backdrop-filter: blur(18px))) {
		.symbol-nav {
			background:
				linear-gradient(160deg, #fff9ec59, transparent 60%),
				color-mix(in srgb, var(--section-paper, var(--paper)) 62%, transparent);
			-webkit-backdrop-filter: blur(18px) saturate(1.25);
			backdrop-filter: blur(18px) saturate(1.25);
		}
	}
}
@media (max-width: 600px) {
	.bookcase { --shelf-label: 7rem; --shelf-cover-width: clamp(100px, 34vw, 170px); }
	.shelf-slot {
		--shelf-top: clamp(1.2rem, 3.2svh, 2rem);
		min-height: calc(var(--shelf-cover-width) * 1.5 + var(--shelf-label) + var(--shelf-plank) + var(--shelf-top));
		padding: var(--shelf-top) clamp(8px, 3vw, 21px) 0;
	}
	.shelf-cover { width: min(100%, var(--shelf-cover-width)); }
	.shelf-note { font-size: clamp(.79rem, 2.5vw, .92rem); line-height: 1.3; }
}
@media (max-width: 540px) and (orientation: portrait) {
	.label-rambles { --label-x: 21%; --label-y: 39%; --label-size: clamp(1.5rem, 8vw, 2.7rem); }
	.label-investments { --label-x: 47%; --label-y: 56%; --label-size: clamp(.8rem, 4.05vw, 1.3rem); }
	.label-books { --label-x: 69%; --label-size: clamp(1.4rem, 7.3vw, 2.65rem); }
	.cover-record { inset-block-end: 10%; width: min(17vw, 13svh, 72px); }
	.label-rewind { --label-y: 93.5%; }
}
@media (max-height: 500px) and (orientation: landscape) {
	.simple-page, .single-wrap { padding-block-start: max(2rem, calc(var(--content-safe-top) + .8rem)); }
	.cover-label { --angle: -4deg; }
	.label-rewind { --angle: 0deg; --label-size: clamp(.83rem, 4.9svh, 1.2rem); }
	.cover-record { width: min(12vw, 18svh); }
}
@media (pointer: coarse) {
	.shelf-book:is(:hover, :focus-visible) .shelf-cover,
	.symbol-link:is(:hover, :focus-visible) .symbol-art { transform: none; }
	.symbol-link:is(:hover, :focus-visible) .symbol-art { animation: none; }
	.tile-number { display: none; }
	.tile-caption { max-width: 94%; opacity: 1; }
}

a:is([data-splash], [data-rewind]) { touch-action: manipulation; }

/* A separate cover for phones leaves each section a comfortably sized tap area. */
.phone-home { display: none; }
.phone-panel {
	position: relative;
	isolation: isolate;
	display: grid;
	align-items: center;
	min-width: 0;
	padding: .9rem clamp(1.35rem, 8vw, 3rem);
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}
.phone-panel-art {
	position: absolute;
	z-index: -1;
	inset: 0;
	overflow: hidden;
	background: var(--phone-field);
	border-radius: var(--phone-rounding, var(--phone-panel-radius, 0));
	box-shadow: var(--phone-shadow, 0 2px 4px #44392435);
	filter: var(--phone-light, none);
	transform: var(--phone-lift, none);
	transition: transform var(--tile-press-time, .18s) cubic-bezier(.2,.7,.25,1),
		box-shadow var(--tile-press-time, .18s) ease, border-radius var(--tile-press-time, .18s) ease,
		filter var(--tile-press-time, .18s) ease;
}
.phone-panel-art::before, .phone-panel-art::after {
	position: absolute;
	inset: 0;
	content: '';
}
.phone-panel-art::before {
	background: var(--phone-fold);
	clip-path: polygon(75% 0, 100% 0, 100% 100%, 58% 100%);
}
.phone-panel-art::after {
	background: var(--phone-edge);
	clip-path: polygon(0 72%, 0 100%, 24% 100%);
}
.phone-panel:active:not(.is-pressing) .phone-panel-art { filter: brightness(1.08); }
.phone-panel-title {
	justify-self: start;
	line-height: 1;
	transform: var(--phone-title-lift, none);
	transition: transform var(--tile-press-time, .18s) ease;
}
.phone-panel-rambles {
	--phone-field: #afc7a4;
	--phone-fold: #91ab90;
	--phone-edge: #cbd1a7;
	font: 700 clamp(2.55rem, 13vw, 4.5rem)/1 'Caveat', 'Apple Chancery', cursive;
}
.phone-panel-rambles .phone-panel-title {
	/* Move the text without rasterising the script into a transformed layer. */
	position: relative;
	top: var(--phone-lift-y, 0px);
	left: var(--phone-lift-x, 0px);
	margin: -.1em -.18em;
	padding: .1em .18em;
	transform: none;
	transition-property: top, left;
}
.phone-panel-investments {
	--phone-field: #e7cda1;
	--phone-fold: #cb9a74;
	--phone-edge: #efdcb3;
	font: 700 clamp(1.35rem, 6.4vw, 2.65rem)/1 'Space Mono', 'Courier New', monospace;
	letter-spacing: -.065em;
}
.phone-panel-books {
	--phone-field: #c2adcd;
	--phone-fold: #ad97bc;
	--phone-edge: #d5c2d8;
	font: italic 800 clamp(2.45rem, 11vw, 4.3rem)/1 'Fraunces', Georgia, serif;
	letter-spacing: -.035em;
}
.phone-panel:is(:focus-visible, .is-touch-lifted, :hover):not(.is-pressing) {
	--phone-side: color-mix(in srgb, var(--phone-field) 64%, #302725);
	--phone-lift-x: -3px;
	--phone-lift-y: -7px;
	--phone-lift: translate(var(--phone-lift-x), var(--phone-lift-y));
	--phone-title-lift: var(--phone-lift);
	--phone-rounding: 17px;
	--phone-light: brightness(1.065);
	--phone-shadow: .5px 1px var(--phone-side), 1px 2px var(--phone-side),
		1.5px 3px var(--phone-side), 2px 4px var(--phone-side),
		2.5px 5px var(--phone-side), 3px 6px var(--phone-side),
		3.5px 7px var(--phone-side), 5px 10px 9px #30282058;
	z-index: 2;
}
.phone-panel.is-pressing { z-index: 2; }
.phone-rewind {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: .6rem;
	min-height: 48px;
	padding: 0 .35rem;
	font: 400 1.3rem/1 var(--script);
	text-decoration: none;
}
.phone-rewind .rewind-record { width: 2.1rem; }

@media (max-width: 600px), (max-width: 1000px) and (max-height: 550px) and (orientation: landscape) and (pointer: coarse) {
	.home-layer .cover-mosaic, .rewind-home-art > .cover-mesh { display: none; }
	.home-layer .front-masthead {
		top: calc(var(--content-safe-top) + 1.15rem);
		left: max(1.3rem, calc(env(safe-area-inset-left, 0px) + .85rem));
		color: var(--ink);
	}
	.home-layer .front-masthead h1 { font-size: clamp(1.85rem, 7vw, 2.55rem); }
	.phone-home {
		display: grid;
		grid-template-rows: repeat(3, minmax(9rem, 1fr)) 3.1rem;
		gap: .7rem;
		min-height: calc(var(--viewport-height, 100svh) - var(--toolbar-height));
		padding: calc(var(--content-safe-top) + 4.45rem)
			max(1rem, calc(env(safe-area-inset-right, 0px) + .7rem))
			max(.65rem, env(safe-area-inset-bottom, 0px))
			max(1rem, calc(env(safe-area-inset-left, 0px) + .7rem));
		background: #e8dcc2;
	}
	.rewind-home-art { overflow: hidden; }
}
@media (max-width: 1000px) and (max-height: 550px) and (orientation: landscape) and (pointer: coarse) {
	.phone-home {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-template-rows: minmax(9.75rem, 1fr) 3.1rem;
	}
	.phone-panel { padding-inline: clamp(.75rem, 2.5vw, 1.9rem); }
	.phone-panel-rambles { font-size: clamp(2.25rem, 5.7vw, 3.65rem); }
	.phone-panel-investments { font-size: clamp(1rem, 2.85vw, 1.8rem); }
	.phone-panel-books { font-size: clamp(2rem, 5.4vw, 3.3rem); }
	.phone-rewind { grid-column: 1 / -1; }
}

.shelf-book.is-touch-lifted .shelf-cover { transform: translateY(-6px) scale(1.04); filter: brightness(1.10); }
.symbol-link.is-touch-lifted .symbol-art { transform: translateY(-5px) scale(1.13); filter: brightness(1.2); animation: none; }

@media (prefers-reduced-motion: no-preference) {
	.rewind-arrived .phone-panel-title { animation: home-label-rise .56s .17s cubic-bezier(.22,.7,.3,1) both; }
	.rewind-arrived .phone-panel-rambles .phone-panel-title { animation-name: home-record-appear; }
	.rewind-arrived .phone-panel-investments .phone-panel-title { animation-delay: .24s; }
	.rewind-arrived .phone-panel-books .phone-panel-title { animation-delay: .31s; }
	.rewind-arrived .phone-rewind { animation: home-label-rise .56s .38s cubic-bezier(.22,.7,.3,1) both; }
}
@media (prefers-reduced-motion: reduce) {
	.phone-panel :is(.phone-panel-art, .phone-panel-title) { transition: none; transform: none; }
	.phone-panel-rambles .phone-panel-title { top: 0; left: 0; }
	.shelf-book.is-touch-lifted .shelf-cover,
	.symbol-link.is-touch-lifted .symbol-art { transform: none; }
}

/* Match the outside edges across the phone cover, collections and reader. */
@media (max-width: 600px) and (orientation: portrait), (max-width: 1000px) and (max-height: 550px) and (orientation: landscape) and (pointer: coarse) {
	.site-shell {
		--mobile-gutter: clamp(1rem, 4.8vw, 1.65rem);
		--mobile-inline-start: max(var(--mobile-gutter), calc(env(safe-area-inset-left, 0px) + .45rem));
		--mobile-inline-end: max(var(--mobile-gutter), calc(env(safe-area-inset-right, 0px) + .45rem));
		--mobile-top: clamp(.9rem, 2.6svh, 1.55rem);
		--mobile-end: clamp(1.4rem, 4svh, 2.1rem);
		--mobile-card-radius: .9rem;
		--symbol-button-height: 46px;
	}
	.home-layer .front-masthead {
		top: calc(var(--content-safe-top) + clamp(1rem, 3svh, 1.6rem));
		left: var(--mobile-inline-start);
	}
	.phone-home {
		--phone-panel-radius: var(--mobile-card-radius);
		gap: clamp(.62rem, 1.6svh, .9rem);
		padding-inline: var(--mobile-inline-start) var(--mobile-inline-end);
	}
	.phone-panel { padding-inline: clamp(1rem, 6.5vw, 1.8rem); }
	.collection {
		padding-block: calc(var(--content-safe-top) + var(--mobile-top)) var(--mobile-end);
		padding-inline: var(--mobile-inline-start) var(--mobile-inline-end);
	}
	.collection-grid {
		--tile-rest-radius: var(--mobile-card-radius);
		gap: clamp(6px, 2vw, 10px);
	}
	.collection-grid :is(.collection-tile, .tile-link) { border-radius: var(--tile-rest-radius); }
	.collection-investments {
		padding-block-start: calc(var(--content-safe-top) + clamp(1.5rem, 4.4svh, 2.65rem));
		padding-block-end: clamp(1.85rem, 5.3svh, 3rem);
	}
	.collection > h1 + .collection-intro { padding: 0 .25rem 1rem; }
	.bookcase {
		padding-block-start: 0;
		padding-inline: clamp(4px, 1.4vw, 14px);
		border-radius: .6rem;
		overflow: clip;
	}
	.page-wrap { padding-inline: var(--mobile-inline-start) var(--mobile-inline-end); }
	.simple-page, .single-wrap {
		padding-block: max(clamp(2.4rem, 5.6svh, 3.3rem), calc(var(--content-safe-top) + 1.25rem))
			clamp(2.6rem, 7.2svh, 4.2rem);
	}
	.single-heading { margin-block-end: clamp(1.55rem, 4.9vw, 2rem); }
	.single-heading h1 { --post-title-size: clamp(1.8rem, 7.6vw, 2.65rem); }
	.single-heading .meta { margin-block-start: .6rem; }
	.single-wrap .entry-content { line-height: var(--reading-leading, 1.68); }
	.content-layer.section-books { --reading-size: clamp(1.45rem, 6.35vw, 1.7rem); }
	.review-cover { width: min(48%, 175px); margin-block-end: 1.5rem; }
	.symbol-nav { gap: clamp(.1rem, 1.6vw, .55rem); margin-block-start: .4rem; padding-inline: .65rem; }
	.symbol-link { width: clamp(46px, 12vw, 56px); }
}

@media (max-width: 600px) and (orientation: portrait) {
	.phone-home {
		grid-template-rows: repeat(3, minmax(clamp(6.4rem, 17svh, 9rem), 1fr)) 3rem;
		padding-block-start: calc(var(--content-safe-top) + clamp(4.15rem, 10svh, 5rem));
	}
	.collection-rambles .collection-grid > .collection-tile { min-height: clamp(11.5rem, 63vw, 19rem); }
	.collection-investments {
		--investment-tile-ratio: 1.1;
		--disc-gutter: clamp(10px, 3.2vw, 16px);
		--disc-limit: calc(100cqi / var(--investment-tile-ratio) - 2 * var(--disc-gutter));
	}
	.collection-investments .collection-grid { container-type: inline-size; }
	.collection-investments .collection-grid > .collection-tile { aspect-ratio: var(--investment-tile-ratio); }
	.investment-identity { padding-inline: 22% 7%; }
	.investment-title { display: block; overflow: visible; -webkit-line-clamp: unset; }
	.bookcase { --shelf-cover-width: clamp(92px, 31vw, 158px); }
	.shelf-slot { --shelf-top: clamp(1rem, 2.9svh, 1.5rem); }
}

@media (max-width: 1000px) and (max-height: 550px) and (orientation: landscape) and (pointer: coarse) {
	.phone-home { grid-template-rows: minmax(7.5rem, 1fr) 3rem; }
	.phone-panel { padding-inline: clamp(.7rem, 2.5vw, 1.75rem); }
	.simple-page, .single-wrap { padding-block-start: max(1.8rem, calc(var(--content-safe-top) + .9rem)); }
}
