:root {
	--gut: clamp(16px, 3.6vw, 56px);
	--index: clamp(290px, 23.5vw, 340px);
	--col-gap: clamp(20px, 2.4vw, 36px);
	--mini: clamp(116px, 9vw, 132px);
	--strip: 50px;
	--band: clamp(66px, 9.6vh, 92px);
	--mark-h: clamp(64px, 6.1vw, 88px);
	--mark-max: 360px;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 760px) {
	:root { --gut: 16px; --mark-h: 56px; --mark-max: 250px; --mini: 78px; }
}

body { min-height: 100dvh; overflow-x: clip; }
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: color-mix(in oklab, var(--ink) 22%, transparent); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

@scope (body) to (.towns) {
	.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

	.bar { display: grid; grid-template-columns: minmax(0, 1fr) var(--mini); align-items: center; column-gap: var(--col-gap); padding: 14px max(var(--gut), env(safe-area-inset-right)) 14px max(var(--gut), env(safe-area-inset-left)); border-bottom: 1px solid var(--rule); }

	.id { display: grid; align-content: end; justify-items: start; gap: 8px; min-width: 0; }
	.mark { margin: 0; line-height: 0; }
	.mark a { display: inline-block; color: var(--ink); text-decoration: none; border-radius: 4px; }
	.mark-art { display: flex; align-items: center; width: min(var(--mark-h) * 3.854, var(--mark-max)); height: var(--mark-h); }
	.mark-art svg { display: block; width: 100%; height: auto; overflow: visible; }
	.line { justify-self: stretch; contain: inline-size; max-width: 22em; margin: 0; font: italic 400 17px/1.3 var(--serif); color: var(--dim); text-wrap: balance; }


	.strip { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: calc(var(--index) + var(--col-gap)) minmax(0, 1fr); align-items: stretch; height: var(--strip); padding: 0 max(var(--gut), env(safe-area-inset-right)) 0 max(var(--gut), env(safe-area-inset-left)); border-bottom: 1px solid var(--rule); background: var(--ground); }
	.strip button { position: relative; display: inline-flex; align-items: center; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; white-space: nowrap; transition: color 0.15s; }
	.strip button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); opacity: 0; scale: 0.3 1; transition: opacity 0.18s, scale 0.3s var(--ease); }
	.strip button[aria-pressed="true"]::after { opacity: 1; scale: 1 1; }
	.strip button:focus-visible { outline: none; }
	.strip button:focus-visible::before { content: ""; position: absolute; inset: 8px -6px; border-radius: 4px; outline: 2px solid var(--accent); }
	.west { justify-self: start; color: var(--ink); font: italic 500 21px/1 var(--serif); letter-spacing: -0.01em; }
	.strip[data-chosen] .west { color: var(--dim); }
	.strip[data-chosen] .west:hover { color: var(--ink); }
	.names { position: relative; display: flex; justify-content: space-between; gap: 6px 18px; min-width: 0; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; list-style: none; }
	.names::-webkit-scrollbar { display: none; }
	.names li { flex: none; }
	.names button { color: var(--dim); font: 600 14px/1 var(--sans); letter-spacing: 0.01em; }
	.names button:hover, .names button[aria-pressed="true"] { color: var(--ink); }

	.mini { position: relative; display: block; width: var(--mini); aspect-ratio: 1; align-self: center; overflow: hidden; border-radius: var(--radius); background: var(--ground-2); color: var(--ink); text-decoration: none; isolation: isolate; }
	.mini::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ink) 16%, transparent); pointer-events: none; }
	.mini img { display: block; width: 100%; height: 100%; transition: transform 0.6s var(--ease), filter 0.3s; }
	.mini-go { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; background: color-mix(in oklab, var(--ground) 90%, transparent); color: var(--ink); font: 650 14px/1 var(--sans); letter-spacing: 0.02em; white-space: nowrap; box-shadow: 0 1px 2px rgb(27 38 44 / 0.14), 0 6px 16px rgb(27 38 44 / 0.12); transition: background-color 0.18s, color 0.18s, gap 0.25s var(--ease); pointer-events: none; }
	.mini-go::after { content: ""; width: 6px; height: 6px; margin-right: -2px; border: solid currentColor; border-width: 1.6px 1.6px 0 0; rotate: 45deg; opacity: 0; transition: opacity 0.18s, translate 0.25s var(--ease); translate: -4px 0; }
	.mini:is(:hover, :focus-visible) img { transform: scale(1.045); filter: brightness(0.96); }
	.mini:is(:hover, :focus-visible) .mini-go { gap: 9px; background: var(--ink); color: var(--ground); }
	.mini:is(:hover, :focus-visible) .mini-go::after { opacity: 1; translate: 0 0; }

	.reels { display: grid; gap: 7px; padding: 10px 0 30px; }
	.band { display: grid; grid-template-columns: calc(var(--gut) + var(--index) + var(--col-gap)) minmax(0, 1fr); min-height: var(--band); }
	.label { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; padding: 2px var(--col-gap) 2px var(--gut); }
	.label h2 { position: relative; margin: 0; font: italic 500 21px/1.1 var(--serif); letter-spacing: -0.005em; }
	.label h2::before { content: ""; position: absolute; left: -19px; top: 50%; width: 10px; height: 10px; margin-top: -4px; border-radius: 50%; background: var(--c); }
	.kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 1), auto); grid-auto-flow: column; column-gap: 16px; margin: 0; padding: 0; list-style: none; }
	.kinds a { display: flex; align-items: baseline; gap: 8px; font: 500 13px/1.36 var(--sans); text-decoration: none; transition: color 0.15s, opacity 0.2s; }
	.kinds .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.kinds .n { margin-left: auto; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
	.kinds a:hover .k { color: var(--accent-ink); text-decoration: underline 1px var(--accent); text-underline-offset: 3px; }
	.kinds a.zero { opacity: 0.45; }

	.reel { position: relative; min-width: 0; overflow: hidden; contain: size; }
	.reel.loop { -webkit-mask: linear-gradient(to right, transparent, #000 22px, #000 calc(100% - 72px), transparent); mask: linear-gradient(to right, transparent, #000 22px, #000 calc(100% - 72px), transparent); }
	.track { display: flex; height: 100%; width: max-content; }
	.track.leaving { position: absolute; top: 0; left: 0; pointer-events: none; }
	.tile { position: relative; flex: none; display: block; height: 100%; aspect-ratio: 3 / 2; margin-right: 6px; overflow: hidden; border-radius: 4px; background: color-mix(in oklab, var(--c) 28%, var(--ground-2)); color: #fff; text-decoration: none; transition: opacity 0.25s; }
	.tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
	.tile .cap { position: absolute; inset: auto 0 0 0; display: grid; gap: 2px; padding: 20px 9px 7px; background: linear-gradient(to top, rgb(16 22 26 / 0.84), rgb(16 22 26 / 0)); opacity: 0; translate: 0 6px; transition: opacity 0.18s, translate 0.18s; pointer-events: none; }
	.tile .cap b { font: italic 500 14px/1.2 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.tile .cap small { font-size: 11px; letter-spacing: 0.02em; opacity: 0.88; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.tile:is(:hover, :focus-visible) .cap { opacity: 1; translate: 0 0; }
	.tile:is(:hover, :focus-visible) img { transform: scale(1.04); }
	.tile:focus-visible { outline-offset: -2px; }
	.reel.focusing .tile:not(.lit) { opacity: 0.22; }
	.track.still { padding-right: var(--gut); }
	.none { display: flex; flex-wrap: wrap; align-content: center; align-items: baseline; gap: 6px 14px; height: 100%; min-width: min(560px, 100%); margin: 0 var(--gut) 0 0; padding: 10px 20px; border-radius: 4px; background: color-mix(in oklab, var(--c) 13%, var(--ground)); color: var(--dim); }
	.none p { margin: 0; font: italic 400 16px/1.35 var(--serif); }
	.none a { font: 600 13px/1.4 var(--sans); color: var(--ink); }
	.none a:hover { color: var(--accent-ink); }
	.reel.hand { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gut); }
	.reel.hand .tile { scroll-snap-align: start; }


	.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; padding: 18px max(var(--gut), env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(var(--gut), env(safe-area-inset-left)); border-top: 1px solid var(--rule); font-size: 13.5px; }
	.foot-mark { font: italic 500 17px/1 var(--serif); text-decoration: none; }
	.foot nav { display: flex; flex-wrap: wrap; gap: 0 4px; margin-right: -10px; }
	.foot nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--dim); font-weight: 600; text-decoration: none; }
	.foot nav a:hover { color: var(--accent-ink); text-decoration: underline; }
	.foot .foot-states { flex: 1 1 100%; order: 3; justify-content: flex-start; gap: 0 2px; margin: 0 0 0 -10px; padding-top: 6px; border-top: 1px solid color-mix(in oklab, var(--rule) 60%, transparent); }
	.foot .foot-states a { min-height: 40px; font-weight: 500; }


	@media (hover: none) {
		.tile .cap { opacity: 1; translate: 0 0; padding-top: 16px; }
		.tile .cap small { display: none; }
	}

	@media (max-width: 760px) {
		.bar { align-items: start; padding-top: 14px; padding-bottom: 8px; }
		.id { gap: 6px; }
		.line { font-size: 15.5px; }
		.mini { align-self: start; }
		.strip { display: flex; gap: 18px; padding-right: 0; }
		.west { flex: none; font-size: 19px; }
		.names { flex: 1; justify-content: flex-start; padding-right: var(--gut); -webkit-mask: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
		.mini-go { padding: 6px 11px; font-size: 13px; }
		.reels { gap: 16px; padding-top: 14px; }
		.band { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 6px; }
		.label { flex-direction: row; align-items: center; gap: 10px; padding: 0 0 0 var(--gut); }
		.label h2 { flex: none; padding-left: 16px; font-size: 19px; }
		.label h2::before { left: 0; width: 9px; height: 9px; }
		.reel { contain: none; }
		.kinds { display: flex; gap: 6px; min-width: 0; overflow-x: auto; padding: 0 var(--gut) 0 0; scrollbar-width: none; -webkit-mask: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
		.kinds::-webkit-scrollbar { display: none; }
		.kinds li { flex: none; }
		.kinds a { min-height: 36px; align-items: center; gap: 6px; padding: 0 11px; border-radius: 999px; background: color-mix(in oklab, var(--c) 15%, var(--ground)); font-size: 13.5px; }
		.kinds .n { margin-left: 0; }
		.reel { height: 108px; }
		.track.still, .reel.hand .track { padding-left: var(--gut); }
		.none { margin-left: var(--gut); padding: 10px 16px; }
		.none p { font-size: 15px; }
		.foot { justify-content: center; text-align: center; }
		.foot nav { justify-content: center; margin-right: 0; }
		.foot .foot-states { justify-content: center; margin-left: 0; }
	}
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: 0.001ms !important; }
}
