:root {
	color-scheme: light;
	font-family:
		Inter,
		ui-sans-serif,
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		'Segoe UI',
		sans-serif;
	color: #111111;
	background: #f5f5f2;
	font-synthesis: none;
	--line: #d4d4cf;
	--muted: #65655f;
	--surface: #ffffff;
	--focus: #0a5bd8;
	--gold: #af7800;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-width: 320px;
	min-height: 100vh;
}

button,
input {
	font: inherit;
}

button {
	min-height: 2.6rem;
	border: 1px solid #bdbdb8;
	border-radius: 0.55rem;
	color: #111111;
	background: #ffffff;
	cursor: pointer;
}

button:hover {
	border-color: #111111;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--focus) 38%, transparent);
	outline-offset: 2px;
}

h1,
h2,
p {
	margin-top: 0;
}

h1 {
	max-width: 14ch;
	margin-bottom: 0.85rem;
	font-size: clamp(2.5rem, 7vw, 5.4rem);
	font-weight: 620;
	letter-spacing: -0.055em;
	line-height: 0.96;
}

h2 {
	margin-bottom: 0.25rem;
	font-size: 1.15rem;
	font-weight: 650;
	letter-spacing: -0.015em;
}

.site-header,
main,
footer {
	width: min(1180px, calc(100% - 2rem));
	margin-inline: auto;
}

.site-header {
	padding: clamp(3.5rem, 9vw, 8rem) 0 clamp(2.5rem, 6vw, 5rem);
	border-bottom: 1px solid var(--line);
}

.eyebrow {
	margin-bottom: 0.8rem;
	color: var(--muted);
	font-size: 0.76rem;
	font-weight: 650;
	letter-spacing: 0.04em;
}

.lede {
	max-width: 52rem;
	margin-bottom: 0;
	color: #373732;
	font-size: clamp(1rem, 2vw, 1.25rem);
	line-height: 1.55;
}

main {
	padding: 2rem 0 4rem;
}

.view-switcher {
	display: flex;
	gap: 0.4rem;
	margin-bottom: 0.75rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--line);
}

.view-switcher button {
	min-height: 2.5rem;
	padding-inline: 0.9rem;
	border-color: transparent;
	background: transparent;
	font-size: 0.88rem;
	font-weight: 650;
}

.view-switcher button[aria-selected='true'] {
	border-color: #111111;
	color: #ffffff;
	background: #111111;
}

.page-view[hidden] {
	display: none;
}

.cube-picker,
.evidence,
.provenance {
	padding: 1.25rem 0 1.5rem;
	border-bottom: 1px solid var(--line);
}

.section-heading,
.panel-heading,
.selected-summary {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

.section-heading p,
.panel-heading p {
	margin-bottom: 0;
	color: var(--muted);
	font-size: 0.9rem;
	line-height: 1.45;
}

.step-controls {
	display: flex;
	gap: 0.45rem;
}

.step-controls button {
	width: 2.75rem;
	font-size: 1.1rem;
}

.cube-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(3.4rem, 1fr));
	gap: 0.55rem;
	margin-top: 1.2rem;
}

.cube-button {
	position: relative;
	min-height: 3.3rem;
	font-weight: 620;
}

.cube-button[data-mount='gold']::after {
	position: absolute;
	top: 0.42rem;
	right: 0.42rem;
	width: 0.42rem;
	height: 0.42rem;
	border-radius: 50%;
	background: #d9a300;
	content: '';
}

.cube-button[aria-pressed='true'] {
	border-color: #111111;
	color: #ffffff;
	background: #111111;
}

.cube-button[aria-pressed='true'][data-mount='gold'] {
	box-shadow: inset 0 0 0 2px #e2b022;
}

.selected-summary {
	align-items: center;
	padding: 2.4rem 0 1.2rem;
}

.selected-summary h2 {
	margin: 0;
	font-size: clamp(1.8rem, 4vw, 2.8rem);
	letter-spacing: -0.035em;
}

.selected-summary .eyebrow {
	margin-bottom: 0.35rem;
}

.selected-badges {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.5rem;
}

.mount-badge,
.completion-badge,
.physical-detail-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 2rem;
	padding: 0.4rem 0.72rem;
	border: 1px solid #9a9a94;
	border-radius: 999px;
	color: #31312d;
	background: #ffffff;
	font-size: 0.82rem;
	font-weight: 650;
	white-space: nowrap;
}

.mount-badge::before,
.completion-badge::before,
.physical-detail-badge::before {
	width: 0.46rem;
	height: 0.46rem;
	border-radius: 50%;
	background: #128248;
	content: '';
}

.mount-badge::before {
	background: #292929;
}

.mount-badge[data-mount='gold'] {
	border-color: #a47400;
	color: #614500;
	background: #fff8d6;
}

.mount-badge[data-mount='gold']::before {
	background: #d9a300;
}

.completion-badge.incomplete::before {
	background: #9b4a00;
}

.physical-detail-badge::before {
	width: 0.58rem;
	height: 0.36rem;
	border-radius: 0.08rem;
	background: #111111;
	transform: rotate(10deg);
}

.physical-detail-badge[hidden] {
	display: none;
}

.solve-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 2rem;
	padding: 0.4rem 0.72rem;
	border: 1px solid #111111;
	border-radius: 999px;
	color: #111111;
	background: #ffffff;
	font-size: 0.82rem;
	font-weight: 650;
	white-space: nowrap;
}

.solve-badge::before {
	width: 0.46rem;
	height: 0.46rem;
	border-radius: 50%;
	background: #111111;
	content: '';
}

.solve-badge:hover {
	color: #ffffff;
	background: #111111;
}

.solve-badge:hover::before {
	background: #ffffff;
}

.solve-badge[hidden] {
	display: none;
}

.solve-dialog {
	width: min(30rem, calc(100% - 2rem));
	padding: clamp(1.25rem, 3vw, 1.75rem);
	border: 1px solid #111111;
	border-radius: 0.55rem;
	color: #111111;
	background: #ffffff;
}

.solve-dialog::backdrop {
	background: rgb(17 17 17 / 42%);
}

.solve-dialog-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.9rem;
}

.solve-dialog-heading .eyebrow {
	margin-bottom: 0.35rem;
}

.solve-dialog-heading h2 {
	margin: 0;
	font-size: 1.45rem;
	letter-spacing: -0.025em;
}

.solve-dialog-heading button {
	min-height: 2.2rem;
	min-width: 2.2rem;
	padding: 0;
}

.solve-counts {
	margin-bottom: 1rem;
	color: var(--muted);
	font-size: 0.9rem;
	font-weight: 650;
}

.solve-moves {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0 0 1.1rem;
	padding: 0;
	list-style: none;
	counter-reset: solve-move;
}

.solve-moves li {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.12rem;
	min-width: 2.35rem;
	padding: 0.42rem 0.5rem 0.34rem;
	border: 1px solid var(--line);
	border-radius: 0.35rem;
	background: #f7f7f4;
	font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
	font-size: 0.98rem;
	font-weight: 650;
	line-height: 1;
	counter-increment: solve-move;
}

.solve-moves li::after {
	color: var(--muted);
	font-size: 0.58rem;
	font-weight: 550;
	content: counter(solve-move);
}

.solve-sequence-heading {
	margin-bottom: 0.35rem;
	color: var(--muted);
	font-size: 0.76rem;
	font-weight: 650;
	letter-spacing: 0.04em;
}

.solve-sequence {
	display: block;
	margin-bottom: 1.1rem;
	padding: 0.6rem 0.7rem;
	border-radius: 0.35rem;
	color: #f7f7f4;
	background: #161616;
	font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
	font-size: 0.82rem;
	line-height: 1.55;
	overflow-wrap: break-word;
}

.solve-note {
	margin-bottom: 0;
	color: var(--muted);
	font-size: 0.8rem;
	line-height: 1.5;
}

.solve-note code {
	padding: 0 0.2rem;
	border-radius: 0.2rem;
	background: #e8e8e3;
}

.viewer-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(390px, 0.9fr);
	border: 1px solid var(--line);
	background: var(--surface);
}

.viewer-panel {
	min-width: 0;
	padding: clamp(1rem, 2.5vw, 1.5rem);
}

.viewer-panel + .viewer-panel {
	border-left: 1px solid var(--line);
}

.panel-heading {
	min-height: 3.6rem;
	margin-bottom: 0.8rem;
}

.toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	min-height: 2.6rem;
	color: #454540;
	font-size: 0.84rem;
	white-space: nowrap;
}

.toggle input {
	width: 1rem;
	height: 1rem;
	margin: 0;
}

.three-container {
	width: 100%;
	min-height: 460px;
	overflow: hidden;
	border: 1px solid var(--line);
	background: #f1f1ee;
	touch-action: none;
}

.three-container canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.camera-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.7rem;
}

.camera-controls button {
	min-height: 2.35rem;
	padding-inline: 0.8rem;
	font-size: 0.82rem;
}

.camera-controls button[aria-pressed='true'] {
	border-color: #111111;
	color: #ffffff;
	background: #111111;
}

.camera-note {
	margin: 0.55rem 0 0;
	color: var(--muted);
	font-size: 0.78rem;
}

.collection-view {
	padding: 2rem 0 2.5rem;
}

.collection-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1.5rem;
	margin-bottom: 1rem;
}

.collection-heading h2 {
	margin-bottom: 0.35rem;
	font-size: clamp(1.65rem, 4vw, 2.6rem);
	letter-spacing: -0.035em;
}

.collection-heading p {
	max-width: 48rem;
	margin-bottom: 0;
	color: var(--muted);
	line-height: 1.5;
}

.collection-three-container {
	min-height: clamp(520px, 62vw, 720px);
}

.collection-three-container:active {
	cursor: grabbing;
}

.collection-key {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.4rem;
	margin-top: 0.85rem;
}

.collection-key-item {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 2.25rem;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: 0;
	background: #ffffff;
	font-size: 0.78rem;
	font-weight: 680;
}

button.collection-key-item:hover {
	border-color: #111111;
}

.collection-key-item::before {
	position: absolute;
	left: 0.6rem;
	width: 0.42rem;
	height: 0.42rem;
	border-radius: 50%;
	background: #292929;
	content: '';
}

.collection-key-item[data-mount='gold']::before {
	background: #d9a300;
}

.collection-key-item[data-detail='true'] {
	box-shadow: inset 0 0 0 2px #111111;
}

.all-nets-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	border-top: 1px solid var(--line);
	border-left: 1px solid var(--line);
}

.all-net {
	min-width: 0;
	padding: 0.9rem;
	border-right: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	background: #ffffff;
}

.all-net-heading {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
}

.all-net-heading h3 {
	margin: 0;
	font-size: 1rem;
}

.all-net-heading span {
	color: var(--muted);
	font-size: 0.68rem;
}

.net-solve-button {
	min-height: 1.7rem;
	padding-inline: 0.55rem;
	border-radius: 999px;
	font-size: 0.68rem;
	font-weight: 650;
	white-space: nowrap;
}

.compact-net {
	gap: 0.25rem;
	margin: 0.7rem auto 0;
}

.compact-net .face figcaption {
	margin-bottom: 0.18rem;
	font-size: 0.62rem;
}

.compact-net .face-grid {
	gap: 1px;
	padding: 2px;
}

.compact-net .sticker {
	font-size: clamp(0.42rem, 0.7vw, 0.6rem);
}

.fallback {
	margin-top: 0.8rem;
	color: #7c2800;
}

.copy-status {
	min-height: 1.25rem;
	margin: -0.4rem 0 0.65rem;
	color: var(--muted);
	font-size: 0.8rem;
}

.text-notation {
	max-height: 72vh;
	margin: 0;
	padding: clamp(1rem, 3vw, 1.5rem);
	overflow: auto;
	border: 1px solid var(--line);
	color: #f7f7f4;
	background: #161616;
	font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
	font-size: clamp(0.72rem, 1.4vw, 0.9rem);
	line-height: 1.55;
	tab-size: 2;
	white-space: pre;
}

.cube-net {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-template-rows: repeat(3, auto);
	gap: clamp(0.35rem, 1vw, 0.7rem);
	align-items: center;
	width: 100%;
	max-width: 38rem;
	margin: clamp(1rem, 4vw, 2rem) auto;
}

.face {
	min-width: 0;
	margin: 0;
}

.face[data-face='U'] {
	grid-area: 1 / 2;
}

.face[data-face='L'] {
	grid-area: 2 / 1;
}

.face[data-face='F'] {
	grid-area: 2 / 2;
}

.face[data-face='R'] {
	grid-area: 2 / 3;
}

.face[data-face='Rear'] {
	grid-area: 2 / 4;
}

.face[data-face='D'] {
	grid-area: 3 / 2;
}

.face figcaption {
	margin-bottom: 0.3rem;
	color: #575752;
	font-size: 0.72rem;
	font-weight: 650;
	text-align: center;
}

.face-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2px;
	aspect-ratio: 1;
	padding: 3px;
	border-radius: 0.25rem;
	background: #151515;
}

.face-row {
	display: contents;
}

.sticker {
	position: relative;
	display: grid;
	place-items: center;
	min-width: 0;
	border-radius: 0.15rem;
	color: var(--sticker-text);
	background: var(--sticker-color);
	font-size: clamp(0.54rem, 1.3vw, 0.72rem);
	font-weight: 730;
	line-height: 1;
	text-shadow: 0 1px 1px rgb(0 0 0 / 12%);
}

.physical-overlay {
	position: absolute;
	z-index: 2;
	top: var(--overlay-top);
	left: var(--overlay-left);
	width: var(--overlay-width);
	height: var(--overlay-height);
	border-radius: 0.08rem;
	background: #111111;
	box-shadow: 0 0 0 1px rgb(255 255 255 / 8%);
	transform: rotate(var(--overlay-rotation));
	transform-origin: center;
	pointer-events: none;
}

.sticker.unknown {
	background:
		linear-gradient(45deg, transparent 44%, #666662 45% 55%, transparent 56%),
		linear-gradient(-45deg, transparent 44%, #666662 45% 55%, transparent 56%), #a8a8a2;
}

.legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.45rem 0.85rem;
	color: #50504b;
	font-size: 0.74rem;
}

.legend-item {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
}

.swatch {
	width: 0.72rem;
	height: 0.72rem;
	border: 1px solid rgb(0 0 0 / 30%);
	border-radius: 0.15rem;
	background: var(--sticker-color);
}

.evidence {
	padding-top: 2.5rem;
}

.evidence-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0;
	margin-top: 1.2rem;
	border-top: 1px solid var(--line);
	border-left: 1px solid var(--line);
}

.evidence-item {
	min-width: 0;
	padding: 0.85rem;
	border-right: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	background: #ffffff;
}

.evidence-item dt {
	margin-bottom: 0.25rem;
	font-weight: 700;
}

.evidence-item dd {
	margin: 0;
	color: var(--muted);
	font-size: 0.8rem;
	line-height: 1.4;
}

.evidence-kind {
	display: inline-block;
	margin-left: 0.35rem;
	color: #383834;
	font-size: 0.69rem;
	font-weight: 550;
}

.provenance {
	padding: 1.3rem 0;
}

.provenance summary {
	width: fit-content;
	cursor: pointer;
	font-weight: 650;
}

.provenance-body {
	max-width: 54rem;
	padding-top: 1rem;
	color: #4c4c47;
	font-size: 0.9rem;
	line-height: 1.6;
}

.provenance-body code {
	padding: 0.1rem 0.25rem;
	border-radius: 0.2rem;
	background: #e8e8e3;
}

.provenance-body a {
	color: #164f9e;
}

footer {
	padding: 1.5rem 0 3rem;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 0.78rem;
}

@media (max-width: 850px) {
	.viewer-grid {
		grid-template-columns: 1fr;
	}

	.viewer-panel + .viewer-panel {
		border-top: 1px solid var(--line);
		border-left: 0;
	}

	.three-container {
		min-height: 400px;
	}

	.collection-three-container {
		min-height: 540px;
	}

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

@media (max-width: 560px) {
	.site-header,
	main,
	footer {
		width: min(100% - 1.15rem, 1180px);
	}

	.site-header {
		padding-top: 3rem;
	}

	.selected-summary,
	.section-heading,
	.panel-heading,
	.collection-heading {
		align-items: flex-start;
	}

	.selected-summary {
		flex-direction: column;
	}

	.selected-badges {
		justify-content: flex-start;
	}

	.panel-heading {
		min-height: 0;
	}

	.viewer-panel {
		padding: 0.8rem;
	}

	.three-container {
		min-height: 340px;
	}

	.collection-three-container {
		min-height: 460px;
	}

	.collection-heading {
		flex-direction: column;
		gap: 0.35rem;
	}

	.view-switcher {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.view-switcher button {
		padding-inline: 0.35rem;
		font-size: 0.76rem;
	}

	.all-nets-grid {
		grid-template-columns: 1fr;
	}

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

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