/* ==========================================================================
   Modules page. Built on the tokens and glass in site.css.
   ========================================================================== */

.mods {
	padding: 140px 0 110px;
	min-height: 100svh;
}

.mods-head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
	align-items: end;
	gap: 56px;
	margin-bottom: 44px;
}

.mods-head h1 {
	font-size: clamp(52px, 6.4vw, 92px);
}

.mods-head .say {
	max-width: 44ch;
}

/* ---------- the search panel ---------- */

.finder {
	--g-r: 18px;
	--g-fill: 0.06;
	padding: 14px;
}

.search {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 14px;
	height: 54px;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.34);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.06);
	transition: box-shadow 0.3s var(--ease);
	cursor: text;
}

.search:focus-within {
	box-shadow: inset 0 0 0 1px rgba(233, 185, 73, 0.6), 0 0 0 4px rgba(233, 185, 73, 0.12);
}

.search > svg {
	flex: none;
	color: var(--gold);
}

.search input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: 0;
	background: none;
	font-size: 16px;
}

.search input::placeholder {
	color: var(--text-3);
}

.search input::-webkit-search-cancel-button {
	filter: invert(1) opacity(0.5);
}

.search kbd {
	flex: none;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 6px;
	font: 600 11px Inter, sans-serif;
	color: var(--text-3);
	box-shadow: inset 0 0 0 1px var(--hair);
}

.search:focus-within kbd {
	opacity: 0;
}

.cats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}

.cat {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 12px;
	border: 0;
	border-radius: 9px;
	font-size: 13px;
	font-weight: 500;
	color: var(--text-2);
	background: rgba(255, 255, 255, 0.04);
	box-shadow: inset 0 0 0 1px var(--hair);
	cursor: pointer;
	transition: color 0.25s, background 0.25s, box-shadow 0.25s;
}

.cat span {
	font-size: 11px;
	color: var(--text-3);
	font-variant-numeric: tabular-nums;
}

.cat:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
}

.cat.on {
	color: #1c1402;
	background: linear-gradient(180deg, var(--gold-light), var(--gold) 60%, #c08f2b);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.cat.on span {
	color: rgba(28, 20, 2, 0.6);
}

.count {
	margin: 0 0 16px;
	font-size: 12.5px;
	color: var(--text-3);
	font-variant-numeric: tabular-nums;
}

/* ---------- the grid ---------- */

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 12px;
}

/* Cards are frosted rather than refracting: 157 displacement filters would be
   too much for one page. The search panel and the detail sheet carry the glass. */
.card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 18px 18px 17px;
	border: 0;
	border-radius: 14px;
	text-align: left;
	cursor: pointer;
	background: linear-gradient(180deg, rgba(20, 21, 24, 0.8), rgba(12, 13, 15, 0.84));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 14px 34px rgba(0, 0, 0, 0.26);
	/* No backdrop blur per card: 157 of them (and the sheet's veil on top) made the page crawl.
	   Off-screen cards are skipped entirely. */
	content-visibility: auto;
	contain-intrinsic-size: auto 150px;
	animation: card-in 0.5s var(--ease) both;
	animation-delay: calc(var(--i) * 14ms);
	transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.3s;
}

@keyframes card-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
}

.card:hover {
	transform: translateY(-2px);
	background: linear-gradient(180deg, rgba(26, 27, 31, 0.86), rgba(16, 17, 20, 0.88));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(233, 185, 73, 0.34), 0 18px 44px rgba(0, 0, 0, 0.34);
}

.card-top {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.card-cat {
	color: var(--gold);
}

.card-n {
	color: var(--text-3);
	letter-spacing: 0.04em;
	text-transform: none;
	font-weight: 500;
	font-size: 11.5px;
}

.card-name {
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.02em;
}

.card-desc {
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--text-2);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

mark {
	color: #1c1402;
	background: linear-gradient(180deg, var(--gold-light), var(--gold));
	border-radius: 3px;
	padding: 0 2px;
}

/* A module that only matched through a setting: dashed gold edge, dimmed
   description, and the matching settings shown underneath. */
.card.by-setting {
	background: linear-gradient(180deg, rgba(30, 25, 16, 0.82), rgba(14, 12, 9, 0.86));
	box-shadow: inset 0 0 0 1px rgba(233, 185, 73, 0.3), 0 14px 34px rgba(0, 0, 0, 0.26);
	outline: 1px dashed rgba(233, 185, 73, 0.38);
	outline-offset: -5px;
}

.card.by-setting .card-desc {
	opacity: 0.6;
	-webkit-line-clamp: 2;
}

.via {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	padding-top: 11px;
	border-top: 1px solid var(--hair);
}

.via-t {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold);
}

.st-chip {
	padding: 4px 9px;
	border-radius: 7px;
	font-size: 12px;
	font-weight: 500;
	color: #fff;
	background: rgba(233, 185, 73, 0.1);
	box-shadow: inset 0 0 0 1px rgba(233, 185, 73, 0.35);
}

.st-chip mark {
	padding: 0 1px;
}

.st-more {
	font-size: 12px;
	color: var(--text-3);
}

.none {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 80px 0;
	color: var(--text-2);
	opacity: 0.8;
}

.none b {
	color: #fff;
}

/* ---------- the detail sheet ---------- */

.mod-sheet {
	place-items: center end;
	padding: 18px;
}

.mod-body {
	width: min(560px, 100%);
	height: calc(100svh - 36px);
	--g-r: 22px;
	--g-fill: 0.07;
	--g-blur: 18px;
	transform: translateX(28px);
	transition: transform 0.5s var(--ease);
}

.mod-sheet.open .mod-body {
	transform: none;
}

.mod-scroll {
	height: 100%;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 36px 34px 40px;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.mod-scroll .micro {
	margin-bottom: 14px;
}

.mod-scroll h2 {
	font-size: 40px;
	padding-right: 36px;
}

.d-desc {
	margin: 18px 0 0;
	font-size: 16px;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.84);
}

.d-meta {
	margin: 14px 0 28px;
	font-size: 12.5px;
	color: var(--text-3);
}

.grp {
	margin-top: 26px;
}

.grp h3 {
	margin: 0 0 10px;
	padding-left: 12px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--gold);
	line-height: 1.2;
	border-left: 1px solid var(--gold);
}

.set {
	padding: 13px 14px;
	border-radius: 11px;
	background: rgba(0, 0, 0, 0.22);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
	transition: box-shadow 0.4s var(--ease), background 0.4s;
}

.set + .set {
	margin-top: 6px;
}

.set.hit {
	background: rgba(233, 185, 73, 0.09);
	box-shadow: inset 0 0 0 1px rgba(233, 185, 73, 0.5);
}

.set-top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
}

.set-top b {
	font-size: 14.5px;
	font-weight: 600;
}

.set-v {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11.5px;
	color: var(--text-3);
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.sw {
	width: 11px;
	height: 11px;
	border-radius: 3px;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.set p {
	margin: 6px 0 0;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--text-2);
}

.opts {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 9px;
}

.opts span {
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 11.5px;
	color: var(--text-2);
	box-shadow: inset 0 0 0 1px var(--hair);
}

.opts span.def {
	color: var(--gold-light);
	box-shadow: inset 0 0 0 1px rgba(233, 185, 73, 0.5);
}

.mast nav a[aria-current] {
	color: var(--gold);
}

@media (max-width: 960px) {
	.mods {
		padding-top: 110px;
	}

	.mods-head {
		grid-template-columns: 1fr;
		gap: 30px;
	}
}

@media (max-width: 720px) {
	.mod-sheet {
		padding: 0;
		place-items: end stretch;
	}

	.mod-body {
		width: 100%;
		height: 88svh;
		--g-r: 22px 22px 0 0;
		transform: translateY(30px);
	}

	.mod-scroll {
		padding: 28px 18px 34px;
	}

	.mod-scroll h2 {
		font-size: 32px;
	}

	.set-top {
		flex-direction: column;
		gap: 3px;
	}

	.set-v {
		text-align: left;
	}
}
