/* /kin: the kin constellation (kin.html, kin/page.ts). The shell, the colors
   and the cards are site.css; this is the sky itself, the house row, the lit
   muse's card and the plain list under it. The sky's strokes and labels are
   sized in CSS pixels through --u, which page.ts sets to how many of the
   sky's own units one pixel is worth, so a thread stays a hairline at every
   width and at every zoom. */

main {
	max-width: 1240px;
	margin: 0 auto;
	padding: 28px var(--pad) calc(56px + env(safe-area-inset-bottom));
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 22px;
}
main > header {
	display: grid;
	gap: 4px;
}

/* The sky, its tools and the lit muse. One column on a phone; from 1040px
   the muse sits beside the sky, where there is room for it. */
.sky-box {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 14px;
	align-items: start;
}
.sky-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}
/* The find box itself is muses/finder.css; here it is one of the tools. */
.find {
	flex: 1 1 200px;
	max-width: 280px;
}

.house-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.hb {
	min-height: 36px;
	padding: 0 13px;
	border: 1px solid var(--line);
	border-radius: var(--r-pill);
	background: var(--card);
	color: var(--soft);
	font: 400 var(--t-sm) var(--sans);
	cursor: pointer;
	transition:
		background-color 0.15s,
		color 0.15s;
}
.hb.on {
	background: rgba(var(--gold-rgb), 0.14);
	border-color: rgba(var(--gold-rgb), 0.4);
	color: var(--gold-hi);
}
@media (hover: hover) {
	.hb:hover {
		background: var(--card-hi);
		color: var(--bone);
	}
}

.sky {
	position: relative;
	width: 100%;
	max-width: 760px;
	margin: 0 auto;
	aspect-ratio: 1;
	border-radius: var(--r-lg);
	background:
		radial-gradient(circle at 50% 46%, rgba(var(--gold-rgb), 0.05), transparent 62%), var(--card);
	overflow: hidden;
	touch-action: manipulation;
}
.sky svg {
	display: block;
	width: 100%;
	height: 100%;
}
.sky-skel {
	position: absolute;
	inset: auto 0 50% 0;
	margin: 0 auto;
	width: 60%;
	height: 14px;
	border-radius: var(--r-pill);
	color: transparent;
}

/* Every thread and every star. The kind threads (a muse and its kin of the
   same species) run right across the sky, so they sit far back; the house
   threads stay inside one house and carry the shape of it. */
.th-kind {
	stroke: rgba(var(--gold-rgb), 0.5);
	stroke-opacity: 0.13;
	stroke-width: var(--w-th, 1);
	fill: none;
}
.th-house {
	stroke: rgba(var(--gold-rgb), 0.5);
	stroke-opacity: 0.6;
	stroke-width: var(--w-th, 1);
	fill: none;
}
.stars {
	fill: var(--bone);
}
.house-names {
	fill: var(--gold);
	font: italic 600 var(--label, 13px) / 1 var(--serif);
	paint-order: stroke;
	stroke: var(--void);
	stroke-width: var(--w-fl, 2);
	stroke-opacity: 0.75;
}
.near .house-names {
	display: none;
}

/* With one muse lit, the rest of the sky falls back and only its own
   threads, its kin and its name stay bright. */
.sky.one .th-kind,
.sky.one .th-house {
	stroke-opacity: 0.07;
}
.sky.one .stars {
	fill-opacity: 0.4;
}
.fl-th {
	stroke: var(--gold-hi);
	stroke-width: var(--w-fl, 2);
	stroke-linecap: round;
	fill: none;
}
.fl-kin {
	fill: var(--gold-hi);
}
.fl-star {
	fill: var(--bone);
}
.fl-ring {
	fill: none;
	stroke: var(--gold-hi);
	stroke-width: var(--w-th, 1);
	stroke-opacity: 0.8;
}
/* A muse's art in the sky, cut to a circle by a clipPath the page writes. */
.fl-face-ring {
	fill: none;
	stroke: var(--gold-hi);
	stroke-width: var(--w-fl, 2);
}
.fl-name {
	fill: var(--bone);
	font: 600 var(--label, 13px) / 1 var(--sans);
	paint-order: stroke;
	stroke: var(--void);
	stroke-width: var(--w-fl, 2);
	stroke-opacity: 0.85;
}

.sky-keys {
	margin: 0;
	font-size: var(--t-ui);
	color: var(--dim);
}

/* The strip across the foot of the sky naming the lit muse, for the phone,
   where the muse's own card is out of sight under the sky. It takes no
   pointer, so a tap goes through it to the stars underneath. */
.sky-now {
	position: absolute;
	inset: auto 8px 8px;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 12px;
	align-items: center;
	padding: 8px 14px 8px 8px;
	border-radius: var(--r-md);
	background: var(--void);
	box-shadow: inset 0 0 0 1px rgba(var(--gold-rgb), 0.26);
	pointer-events: none;
}
/* Out of the way when the lit star is low in the sky. */
.sky-now.high {
	inset: 8px 8px auto;
}
.sky-now[hidden] {
	display: none;
}
.now-art {
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 11px;
	object-fit: cover;
	background: var(--card-hi);
}
.now-of {
	display: grid;
	gap: 2px;
	min-width: 0;
}
.now-of > b {
	font: italic 600 var(--d-1) / 1.05 var(--serif);
	color: var(--bone);
}
.now-line,
.now-kin {
	font: 400 var(--t-xs) var(--mono);
	color: var(--dim);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* The muse the sky has lit: its art, its line, its house and its kin with
   the words its soul speaks about each. */
.lit {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 12px 14px;
	align-content: start;
	padding: 14px;
	border-radius: var(--r-lg);
	background: var(--card);
}
.lit-art img {
	display: block;
	width: 76px;
	height: 76px;
	border-radius: var(--r-md);
	object-fit: cover;
	background: var(--card-hi);
}
.lit-of {
	display: grid;
	gap: 4px;
	align-content: start;
	min-width: 0;
}
.lit-of h3 {
	margin: 0;
	font: italic 600 var(--d-2) / 1.1 var(--serif);
}
.lit-of h3 a {
	color: var(--bone);
	text-decoration: none;
}
.lit-line,
.lit-house {
	margin: 0;
	font-size: var(--t-sm);
	color: var(--dim);
}
.lit-kin {
	grid-column: 1 / -1;
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 12px;
}
.lit-kin > li {
	display: grid;
	gap: 6px;
	padding-top: 12px;
	border-top: 1px solid var(--line);
}
.lit-kin p {
	margin: 0;
	font-size: var(--t-ui);
	color: var(--soft);
}
.lk {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	text-decoration: none;
	color: var(--bone);
}
.lk img {
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: var(--r-sm);
	object-fit: cover;
	background: var(--card-hi);
}
.lk > span {
	display: grid;
	gap: 4px;
	min-width: 0;
}
.lk > span > b {
	font: 600 var(--t-note) var(--sans);
}
.lk > span > small {
	font: 400 var(--t-xs) var(--mono);
	color: var(--dim);
}

/* The same kin as words, a house at a time. */
.list-box {
	display: grid;
	gap: 16px;
}
.house-list {
	display: grid;
	gap: 4px;
}
.house-d > summary {
	display: flex;
	list-style: none;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 48px;
	padding: 0 4px;
	border-top: 1px solid var(--line);
	cursor: pointer;
	color: var(--bone);
}
.house-d > summary::-webkit-details-marker {
	display: none;
}
.house-d > summary b {
	font: italic 600 var(--d-1) var(--serif);
	color: var(--gold-hi);
}
.house-d > summary small {
	font: 400 var(--t-xs) var(--mono);
	color: var(--dim);
}
.kin-rows {
	margin: 0 0 14px;
	padding: 0;
	/* As many columns as the screen holds, so a house of 142 reads down a
	   few columns rather than one long fall. Each is its own column of
	   muses (page.ts), so opening one pushes only what is under it. */
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	align-items: start;
	gap: 0 18px;
}
.kin-col {
	display: grid;
	align-content: start;
	gap: 2px;
	min-width: 0;
}

/* One muse, shut: a single line. The whole line opens it. */
.muse-d > summary {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 4px 8px;
	border-radius: var(--r-sm);
	list-style: none;
	cursor: pointer;
	color: var(--bone);
	transition: background-color 0.15s;
}
.muse-d > summary::-webkit-details-marker {
	display: none;
}
@media (hover: hover) {
	.muse-d > summary:hover {
		background: var(--card-hi);
	}
}
.muse-d[open] > summary {
	background: var(--card-hi);
}
.f-art {
	flex: none;
	border-radius: 9px;
	object-fit: cover;
	background: var(--card-hi);
}
.f-of {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 2px 8px;
	min-width: 0;
}
.f-of > small {
	white-space: nowrap;
}
.f-of > b {
	font: 600 var(--t-note) var(--sans);
}
.f-of > small {
	font: 400 var(--t-xs) var(--mono);
	color: var(--dim);
}
/* The two kin as faces at the end of the line, which is what the row opens
   to tell you about, and the mark that says it opens. */
.f-kin {
	flex: none;
	display: flex;
	margin-left: auto;
	padding-left: 8px;
}
.f-more {
	flex: none;
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	color: var(--dim);
}
.muse-d[open] .f-more {
	transform: rotate(180deg);
	color: var(--gold);
}
.f-kin img {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--card-hi);
	box-shadow: 0 0 0 2px var(--void);
}
.f-kin img + img {
	margin-left: -8px;
}

/* Open: the two kin with the words the soul speaks about each. */
.muse-body {
	display: grid;
	gap: 4px;
	padding: 8px 10px 12px 12px;
}
.kin-of {
	display: flex;
	align-items: center;
	gap: 9px;
	min-width: 0;
	text-decoration: none;
	color: var(--bone);
}
.kin-of .f-art {
	width: 26px;
	height: 26px;
	border-radius: var(--r-sm);
}
.muse-body p {
	margin: 0 0 8px 35px;
	font-size: var(--t-sm);
	line-height: 1.45;
	color: var(--soft);
}
.muse-go {
	justify-self: start;
	font: 400 var(--t-xs) var(--mono);
	color: var(--dim);
}
@media (pointer: coarse) {
	.muse-go {
		padding-block: 8px;
		margin-block: -8px;
	}
}

@media (min-width: 1040px) {
	.sky-box {
		grid-template-columns: minmax(0, 1fr) 330px;
		grid-template-areas: "tools muse" "sky muse" "keys muse";
		column-gap: 22px;
	}
	.sky-tools {
		grid-area: tools;
	}
	.sky {
		grid-area: sky;
		max-width: none;
	}
	.sky-keys {
		grid-area: keys;
	}
	.lit {
		grid-area: muse;
		position: sticky;
		top: 86px;
	}
}
