/*
  The look of thelisti.com.

  The founder's brief: simple, squared, and no brand color. So every corner is square, every rule
  is one pixel, and the page is black, white and gray, following the device's light or dark mode.
  Gold appears in one place only: the sponsor slot. Category emoji carry the rest of the color.
  System fonts only: the serif for names, headlines and numbers, the mono for labels.
*/

:root {
	--ink: #111111;
	--paper: #ffffff;
	--soft: rgba(17, 17, 17, 0.64);
	--rule: rgba(17, 17, 17, 0.18);
	--wash: rgba(17, 17, 17, 0.05);
	--dot: rgba(17, 17, 17, 0.16);
	--gold: #b98a1c;
	--stamp: #b3261e;
	/* The wordmark: a black block with white letters, as the founder drew it. On a dark screen it turns over. */
	--block: var(--ink);
	--block-ink: var(--paper);
	--serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	--emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--ink: #f2f2f2;
		--paper: #0e0e0e;
		--soft: rgba(242, 242, 242, 0.68);
		--rule: rgba(242, 242, 242, 0.22);
		--wash: rgba(242, 242, 242, 0.07);
		--dot: rgba(242, 242, 242, 0.16);
		--gold: #d4a73c;
		--stamp: #e5534b;
	}
}

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

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

/* The page is the founder's dot-grid pad: one small dot every sixteen pixels. */
body {
	margin: 0;
	background-color: var(--paper);
	background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0);
	background-size: 16px 16px;
	color: var(--ink);
	font: 1rem/1.5 var(--sans);
}

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

:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}

[hidden] {
	display: none !important;
}

.col {
	max-width: 720px;
	margin: 0 auto;
	padding: 0 16px;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.emoji,
.thumb {
	font-family: var(--emoji);
}

/* ------------------------------------------------------------------ The preview band */

.band {
	margin: 0;
	padding: 7px 16px;
	border-bottom: 1px dashed var(--ink);
	background: var(--paper);
	font: 700 0.6rem/1.4 var(--mono);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-align: center;
}

/* ------------------------------------------------------------------ The wordmark */

.wordmark {
	display: block;
	flex: none;
	line-height: 0;
}

.wm {
	display: block;
	width: auto;
	height: 40px;
}

.wm-block {
	fill: var(--block);
}

.wm-word {
	fill: var(--block-ink);
}

.wm-gem path {
	fill: none;
	stroke: var(--block-ink);
	stroke-width: 0.42;
	stroke-linejoin: miter;
}

/* ------------------------------------------------------------------ The top of a page */

.top {
	position: relative;
	overflow: hidden;
	border-bottom: 1px solid var(--ink);
	background: var(--paper);
}

.top-row {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 64px;
	padding-top: 10px;
	padding-bottom: 10px;
}

/* The city's own street map, faded, behind its name. Drawn large so a street is still a line. */
.top-map {
	position: absolute;
	top: 50%;
	left: 50%;
	width: max(100%, 1100px);
	height: auto;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	opacity: 0.28;
	pointer-events: none;
}

.place {
	display: grid;
	grid-template-columns: auto auto;
	justify-content: end;
	justify-items: end;
	align-items: center;
	gap: 5px 8px;
	margin: 0;
	font: 700 0.72rem/1.1 var(--mono);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.place-city {
	grid-column: 1 / -1;
	padding: 1px 4px;
	background: var(--paper);
	font: 600 1.12rem/1.1 var(--serif);
	letter-spacing: 0;
	text-transform: none;
	text-decoration: underline;
	text-align: right;
	overflow-wrap: anywhere;
}

.weather {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 4px;
	background: var(--paper);
	white-space: nowrap;
}

.sky {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: square;
}

/* The state, as a stamp. */
.place-state {
	grid-column: 2;
	padding: 3px 5px;
	border: 1px solid var(--ink);
	outline: 1px dashed var(--ink);
	outline-offset: 1px;
	background: var(--paper);
	text-decoration: none;
}

.weather + .place-state {
	grid-column: auto;
}

/* ------------------------------------------------------------------ Category rows */

.cats {
	border-bottom: 1px solid var(--ink);
	background: var(--paper);
}

.cats-row {
	display: flex;
	align-items: stretch;
	max-width: 720px;
	margin: 0 auto;
}

.cats-row + .cats-row {
	border-top: 1px solid var(--rule);
}

.cats-group {
	display: flex;
	flex: none;
	align-items: center;
	width: 78px;
	margin: 0;
	padding: 0 8px 0 16px;
	border-right: 1px solid var(--ink);
	font: 700 0.64rem/1 var(--mono);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.cats-scroll {
	display: flex;
	flex: 1;
	gap: 8px;
	min-width: 0;
	margin: 0;
	padding: 8px 16px 8px 8px;
	overflow-x: auto;
	list-style: none;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.cats-scroll::-webkit-scrollbar {
	display: none;
}

.chip {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 7px 10px;
	border: 1px solid var(--ink);
	background: var(--paper);
	font-size: 0.86rem;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
}

.chip .emoji {
	font-size: 1.1em;
	line-height: 1;
}

.chip[aria-current],
.chip:hover {
	background: var(--ink);
	color: var(--paper);
}

/* ------------------------------------------------------------------ The sponsor slot */

/* The one place gold appears: it marks what is paid for. The dashed edge is the sketch's. */
.slot {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	margin: 16px 0 0;
	padding: 10px 12px;
	border: 1px dashed var(--ink);
	background: var(--paper);
}

.slot-icon {
	line-height: 0;
}

.envelope {
	width: 36px;
	height: 36px;
}

.env-body {
	fill: var(--gold);
}

.env-flap {
	fill: none;
	stroke: var(--paper);
	stroke-width: 1.3;
}

.env-stamp {
	fill: var(--stamp);
	stroke: var(--paper);
	stroke-width: 0.7;
}

.slot-say {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.slot-say a {
	font-weight: 600;
	white-space: nowrap;
}

.ad-name {
	font: 600 1.02rem/1.25 var(--serif);
}

.slot-mark {
	display: grid;
	justify-items: center;
	gap: 3px;
}

.slot-label {
	font: 700 0.56rem/1 var(--mono);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.star {
	width: 26px;
	height: 26px;
	fill: var(--gold);
}

/* ------------------------------------------------------------------ Tabs and titles */

.tabs,
.tab-row {
	display: flex;
	align-items: flex-end;
	margin: 20px 0 0;
	border-bottom: 1px solid var(--ink);
}

.tab {
	display: block;
	margin-right: -1px;
	padding: 7px 10px 6px;
	border: 1px solid var(--ink);
	border-bottom: 0;
	background: var(--paper);
	font: 700 0.64rem/1.2 var(--mono);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
}

strong.tab,
a.tab:hover {
	background: var(--ink);
	color: var(--paper);
}

.list-title {
	margin: 18px 0 0;
	font: 600 1.7rem/1.15 var(--serif);
	letter-spacing: -0.01em;
}

.meta {
	margin: 2px 0 0;
	color: var(--soft);
	font-size: 0.78rem;
	line-height: 1.35;
}

/* While a row says what it is waiting for, it says only that. */
.meta-none:not([hidden]) + .meta-info {
	display: none;
}

.list-meta {
	margin: 4px 0 12px;
	font-family: var(--mono);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
}

.lede {
	margin: 10px 0 0;
	font: 400 1.12rem/1.45 var(--serif);
}

.fine {
	margin: 16px 0 0;
	color: var(--soft);
	font-size: 0.8rem;
}

.notice,
.empty {
	margin: 12px 0 0;
	padding: 10px 12px;
	border: 1px solid var(--ink);
	background: var(--paper);
	font-size: 0.9rem;
}

.section {
	margin: 28px 0 0;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--ink);
	font: 700 0.66rem/1 var(--mono);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.back {
	margin: 16px 0 0;
	font: 700 0.66rem/1.4 var(--mono);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ------------------------------------------------------------------ A list: rows of square cells */

.rows,
.standings {
	margin: 0;
	padding: 0;
	list-style: none;
}

.row {
	position: relative;
	display: grid;
	grid-template-columns: 28px 44px minmax(0, 1fr) auto 52px;
	align-items: stretch;
	min-height: 64px;
	border-bottom: 1px solid var(--rule);
	background: var(--paper);
}

.rank {
	display: flex;
	align-items: center;
	justify-content: center;
	font: 600 1.3rem/1 var(--serif);
	font-variant-numeric: tabular-nums;
}

.thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	border-right: 1px solid var(--rule);
	border-left: 1px solid var(--rule);
	background: var(--wash);
	font-size: 1.5rem;
	line-height: 1;
	text-decoration: none;
}

.who {
	align-self: center;
	min-width: 0;
	padding: 8px 10px;
}

.who h3 {
	margin: 0;
	font: 600 0.98rem/1.2 var(--serif);
	overflow-wrap: anywhere;
}

.who h3 a {
	text-decoration: none;
}

.who h3 a:hover {
	text-decoration: underline;
}

.vote {
	display: flex;
	margin: 0;
	border-left: 1px solid var(--rule);
}

.vote button,
.vote-off > span {
	display: grid;
	align-content: center;
	justify-items: center;
	gap: 5px;
	width: 44px;
	min-height: 56px;
	padding: 0;
	border: 0;
	border-right: 1px solid var(--rule);
	background: transparent;
	color: inherit;
	font: inherit;
}

.vote button {
	appearance: none;
	cursor: pointer;
	touch-action: manipulation;
}

.vote button:hover {
	background: var(--wash);
}

.vote button[aria-pressed="true"] {
	background: var(--ink);
	color: var(--paper);
}

.arrow {
	font: 0.78rem/1 var(--sans);
	font-variant-emoji: text;
}

.n {
	color: var(--soft);
	font: 600 0.7rem/1 var(--mono);
	font-variant-numeric: tabular-nums;
}

.vote button[aria-pressed="true"] .n {
	color: inherit;
}

.pct {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	font: 600 1.12rem/1 var(--serif);
	font-variant-numeric: tabular-nums;
}

.pct-n {
	font-weight: 600;
}

.pct-sign {
	margin-left: 1px;
	font-size: 0.66em;
}

/* The leader's score is the one black cell on the list. */
.rows > .row:first-child .pct {
	background: var(--ink);
	color: var(--paper);
}

/* A thin bar under each row, as long as its percent. */
.bar {
	position: absolute;
	right: 0;
	bottom: -1px;
	left: 0;
	width: 100%;
	height: 2px;
	pointer-events: none;
}

.bar-fill {
	fill: var(--ink);
}

.standing {
	grid-template-columns: 44px minmax(0, 1fr) auto 52px;
}

/* The sponsor page shows the slot above three empty rows, so its place is plain. */
.ghost .row {
	grid-template-columns: 30px minmax(0, 1fr);
	min-height: 44px;
}

.ghost .row::after {
	content: "";
	margin: 14px 12px 14px 0;
	background: var(--wash);
}

.ghost .rank {
	color: var(--soft);
}

/* ------------------------------------------------------------------ Top 3s */

.trios {
	display: grid;
	gap: 16px;
	margin-top: 16px;
}

.trio {
	border: 1px solid var(--ink);
	background: var(--paper);
}

.trio h2 {
	margin: 0;
	border-bottom: 1px solid var(--ink);
	font: 700 0.68rem/1 var(--mono);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.trio h2 a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	text-decoration: none;
}

.trio h2 .emoji {
	font-size: 1.5em;
	line-height: 1;
}

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

.mini li {
	display: grid;
	grid-template-columns: 34px minmax(0, 1fr) auto;
	align-items: center;
	min-height: 46px;
	border-bottom: 1px solid var(--rule);
}

.mini .rank {
	font-size: 1.05rem;
}

.mini a {
	padding: 8px 8px 8px 0;
	font: 600 0.95rem/1.2 var(--serif);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.pct-s {
	padding: 0 12px;
	font: 600 0.76rem/1 var(--mono);
	font-variant-numeric: tabular-nums;
}

.more {
	display: block;
	padding: 10px 12px;
	font: 700 0.64rem/1 var(--mono);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
}

.more:hover,
.trio h2 a:hover {
	background: var(--ink);
	color: var(--paper);
}

/* ------------------------------------------------------------------ One business */

.biz-head {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr);
	align-items: center;
	gap: 14px;
	margin-top: 16px;
}

.biz-head .thumb-big {
	width: 72px;
	height: 72px;
	border: 1px solid var(--ink);
	background: var(--paper);
	font-size: 2.3rem;
}

.biz-head h1 {
	margin: 0;
	font: 600 1.55rem/1.15 var(--serif);
	letter-spacing: -0.01em;
	overflow-wrap: anywhere;
}

.facts {
	display: grid;
	margin: 0;
}

.fact {
	display: grid;
	grid-template-columns: 92px minmax(0, 1fr);
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--rule);
	background: var(--paper);
}

.fact dt {
	padding-left: 8px;
	color: var(--soft);
	font: 700 0.64rem/1.7 var(--mono);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.fact dd {
	margin: 0;
	padding-right: 8px;
	overflow-wrap: anywhere;
}

.unfilled {
	color: var(--soft);
	font-style: italic;
}

p.unfilled {
	margin: 0;
	padding: 10px 8px;
	border-bottom: 1px solid var(--rule);
	background: var(--paper);
}

.menu {
	margin: 0;
	padding: 0;
	background: var(--paper);
	list-style: none;
}

.menu li {
	padding: 9px 8px;
	border-bottom: 1px solid var(--rule);
}

/* ------------------------------------------------------------------ The sponsor page and plain reading */

.adform {
	display: grid;
	gap: 6px;
	margin-top: 20px;
}

.adform label {
	margin-top: 10px;
	font: 700 0.64rem/1 var(--mono);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.adform input[type="text"] {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--ink);
	background: var(--paper);
	color: var(--ink);
	font: inherit;
}

.button {
	appearance: none;
	justify-self: start;
	margin-top: 12px;
	padding: 12px 16px;
	border: 1px solid var(--ink);
	background: var(--ink);
	color: var(--paper);
	font: 700 0.7rem/1 var(--mono);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
}

.adpreview .slot {
	margin-top: 12px;
}

.prose ul {
	margin: 10px 0 0;
	padding: 0;
	background: var(--paper);
	list-style: none;
}

.prose li {
	padding: 9px 8px;
	border-bottom: 1px solid var(--rule);
}

.prose .lede,
.sponsor .lede {
	padding: 2px 0;
}

/* ------------------------------------------------------------------ The front door */

.stage {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 88vh;
	min-height: 88svh;
	padding: 56px 16px;
	overflow: hidden;
	border-bottom: 1px solid var(--ink);
	background: var(--paper);
}

.maps {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

/* The still map: what shows without the script, and to anyone who has asked for less motion. */
.map {
	position: absolute;
	top: 50%;
	left: 50%;
	width: max(118vw, 118vh, 900px);
	height: auto;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	opacity: 0.6;
}

.maps.live .map {
	visibility: hidden;
}

.wave {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
}

@media (prefers-color-scheme: dark) {
	.map,
	.top-map {
		filter: invert(1);
	}
}

/* The door: a paper card with a hard square shadow. */
.door {
	position: relative;
	display: grid;
	justify-items: start;
	gap: 16px;
	width: min(100%, 430px);
	padding: 20px;
	border: 1px solid var(--ink);
	background: var(--paper);
	box-shadow: 8px 8px 0 var(--ink);
}

.door .wm {
	height: 56px;
}

.line {
	margin: 0;
	font: 600 1.28rem/1.3 var(--serif);
	letter-spacing: -0.005em;
}

.note {
	margin: 0;
	padding: 6px 8px;
	border: 1px dashed var(--ink);
	font: 700 0.64rem/1.4 var(--mono);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.picker {
	width: 100%;
}

.picker summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 15px 16px;
	background: var(--ink);
	color: var(--paper);
	font: 700 0.78rem/1 var(--mono);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

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

.picker summary::after {
	content: "▾";
	font-size: 1.2em;
	line-height: 0.6;
}

.picker[open] summary::after {
	content: "▴";
}

.picker summary:active {
	transform: translate(2px, 2px);
}

.picker ul {
	margin: 0;
	padding: 0;
	border: 1px solid var(--ink);
	border-top: 0;
	list-style: none;
}

.picker li + li {
	border-top: 1px solid var(--rule);
}

.picker li a {
	display: block;
	padding: 13px 16px;
	font: 600 1.06rem/1.2 var(--serif);
	text-decoration: none;
}

.picker li a:hover,
.picker li a:focus-visible {
	background: var(--ink);
	color: var(--paper);
}

.pause,
.cap {
	position: absolute;
	bottom: 12px;
	margin: 0;
	padding: 8px 10px;
	border: 1px solid var(--ink);
	background: var(--paper);
	color: var(--ink);
	font: 700 0.6rem/1 var(--mono);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.pause {
	right: 12px;
	appearance: none;
	cursor: pointer;
}

.cap {
	left: 12px;
}

/* ------------------------------------------------------------------ The foot of a page */

.foot {
	margin-top: 48px;
	border-top: 1px solid var(--ink);
	background: var(--paper);
}

.front .foot,
.lost .foot {
	margin-top: 0;
	border-top: 0;
}

.foot .col {
	display: grid;
	gap: 8px;
	padding-top: 16px;
	padding-bottom: 32px;
	color: var(--soft);
	font-size: 0.82rem;
}

.foot p {
	margin: 0;
}

.foot-line {
	color: var(--ink);
	font: 600 1rem/1.2 var(--serif);
}

.foot-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
}

.foot-credit {
	font-size: 0.72rem;
}

/* ------------------------------------------------------------------ Motion */

/* A number that just changed turns over, like a card on a scoreboard. */
@keyframes turn {
	from {
		transform: rotateX(90deg);
	}
	to {
		transform: none;
	}
}

.turn {
	display: inline-block;
	animation: turn 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

/* ------------------------------------------------------------------ Narrow and wide screens */

@media (max-width: 399px) {
	.col {
		padding: 0 12px;
	}

	.wm {
		height: 34px;
	}

	.row {
		grid-template-columns: 24px 38px minmax(0, 1fr) auto 48px;
	}

	.standing {
		grid-template-columns: 36px minmax(0, 1fr) auto 48px;
	}

	.vote button,
	.vote-off > span {
		width: 40px;
	}

	.thumb {
		font-size: 1.3rem;
	}

	.cats-group {
		width: 70px;
		padding-left: 12px;
	}
}

/* On the smallest phones the picture gives its room to the name. */
@media (max-width: 339px) {
	.rows .row {
		grid-template-columns: 24px minmax(0, 1fr) auto 48px;
	}

	.rows .row > .thumb {
		display: none;
	}

	.ghost .row {
		grid-template-columns: 24px minmax(0, 1fr);
	}
}

@media (min-width: 640px) {
	.trios {
		grid-template-columns: 1fr 1fr;
	}

	.menu {
		columns: 2;
		column-gap: 0;
	}

	.menu li {
		break-inside: avoid;
	}
}

@media (min-width: 900px) {
	html {
		font-size: 18px;
	}

	.wm {
		height: 44px;
	}

	.door .wm {
		height: 64px;
	}

	.door {
		width: min(100%, 470px);
		padding: 24px;
	}
}
