/* tempire.photos — field-journal gallery (J5).
   Paper and ink, a full-bleed mosaic, signage-condensed titles, data in mono,
   one trail-blaze accent. Motion: staggered wipe-in, scroll reveals, hover
   zoom, a viewer that grows out of the tile you clicked. */

:root {
	--paper: #efece5;
	--paper-2: #e6e2d8;
	--ink: #141412;
	--mute: #77736a;
	--line: rgba(20, 20, 18, .14);
	--blaze: #ff4f1a;
	--night: #0f0f0e;
	--night-line: rgba(239, 236, 229, .1);
	--gap: 8px;
	--edge: clamp(16px, 3.2vw, 48px);
	--ease: cubic-bezier(.2, .8, .2, 1);
	--display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
	--serif: 'Newsreader', Georgia, serif;
	--mono: 'Spline Sans Mono', ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	min-height: 100vh;
	background: var(--paper);
	color: var(--ink);
	font: 400 15px/1.5 var(--serif);
	-webkit-font-smoothing: antialiased;
	display: flex;
	flex-direction: column;
}
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }

/* Paper grain over everything, very faint. */
.grain {
	position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .07;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
	0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
	60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---- header ---------------------------------------------------------- */
.top {
	display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
	padding: clamp(20px, 3vw, 36px) var(--edge) 18px;
	border-bottom: 1px solid var(--line);
}
.brand img { width: clamp(120px, 13vw, 170px); height: auto; }
.brand { opacity: 0; transform: translateY(-8px); animation: drop .7s var(--ease) .05s forwards; }
.stats { margin: 0 0 6px; color: var(--mute); text-align: right; opacity: 0; animation: fade .6s var(--ease) .35s forwards; }
.stats b { color: var(--ink); font-weight: 500; }

/* ---- folders: the open folder's name beside the counts, top right, underlined
   like the footer's link; it drops down the list of folders (a paper card,
   ink edge, blaze foot, wiping down like the map). Quiet until asked. ---- */
.top-right { display: flex; align-items: baseline; justify-content: flex-end; margin: 0 0 6px; }
.top-right .stats { margin: 0; }
/* z-index here, not on the list: the fade makes .folders a stacking context, so the list's own z-index stays inside it */
.folders { position: relative; z-index: 30; display: inline-flex; align-items: baseline; opacity: 0; animation: fade .6s var(--ease) .35s forwards; }
.folders .sep { margin: 0 1.1em; color: var(--mute); }
.folder-btn {
	display: inline-flex; align-items: center; gap: 7px; padding: 0 0 3px; border: 0; border-bottom: 1px solid var(--blaze);
	background: none; color: var(--ink); font-weight: 500; cursor: pointer;
}
.folder-btn .chev { display: inline-flex; transition: transform .35s var(--ease); }
.folders.open .folder-btn .chev { transform: rotate(180deg); }
.folder-list {
	position: absolute; top: calc(100% + 12px); left: 0; z-index: 30; min-width: 230px; margin: 0; padding: 6px 0; list-style: none;
	background: var(--paper); border: 1px solid var(--ink);
	box-shadow: 0 1px 1px rgba(20, 20, 18, .15), 0 18px 30px -14px rgba(20, 20, 18, .55);
	clip-path: inset(-2px -40px 100% -40px); transition: clip-path .4s var(--ease);
}
.folder-list.in { clip-path: inset(-2px -40px -60px -40px); }
.folder-list::after { content: ''; position: absolute; left: -1px; right: -1px; bottom: -1px; height: 3px; background: var(--blaze); }
.folder-list a { display: flex; justify-content: space-between; gap: 28px; padding: 11px 16px; color: var(--mute); text-decoration: none; white-space: nowrap; transition: color .25s, background .25s; }
.folder-list a:hover { color: var(--ink); background: var(--paper-2); }
.folder-list a[aria-current] { color: var(--ink); }
.folder-list a[aria-current] .nm::before { content: '■ '; color: var(--blaze); }
.folder-list .ct { color: var(--mute); letter-spacing: .1em; }
.folder-list a:focus-visible { outline-offset: -4px; }

main { flex: 1; }

/* ---- section heads ------------------------------------------------- */
.lead {
	display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
	padding: 28px var(--edge) 14px;
}
.lead { flex-wrap: wrap; }
.lead .label { margin: 0; color: var(--mute); }
.lead .label i { font-style: normal; color: var(--blaze); }
.lead .label .sub { margin-left: 1.6em; }
.lead .label b { color: var(--ink); font-weight: 500; }

/* ---- tiles / map switch: an ink knob slides under the chosen view ---- */
.switch { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ink); opacity: 0; animation: fade .6s var(--ease) .3s forwards; }
.switch button {
	position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
	padding: 9px 16px 10px; border: 0; background: none; color: var(--mute); cursor: pointer;
	font: inherit; letter-spacing: inherit; text-transform: inherit; transition: color .45s var(--ease);
}
.switch button:hover { color: var(--ink); }
.switch button[aria-pressed="true"] { color: var(--paper); cursor: default; }
.switch .ico { display: inline-flex; }
.switch .knob { position: absolute; top: 0; bottom: 0; left: 0; width: 50%; background: var(--ink); transition: transform .55s var(--ease); }
.switch .knob::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--blaze); }
.switch[data-on="map"] .knob { transform: translateX(100%); }
.switch button:focus-visible { outline-offset: -5px; }

/* ---- album mosaic ---------------------------------------------------- */
.mosaic {
	list-style: none; margin: 0; padding: 0 var(--edge) var(--edge);
	display: grid; gap: var(--gap);
	grid-template-columns: repeat(12, 1fr);
	grid-auto-rows: clamp(170px, 19vw, 300px);
	grid-auto-flow: dense;
}
.mosaic > li { grid-column: span 4; }
.mosaic > li:nth-child(12n+1), .mosaic > li:nth-child(12n+8) { grid-column: span 8; grid-row: span 2; }
.mosaic.n-1 > li { grid-column: 1 / -1; grid-row: span 2; }
.mosaic.n-2 > li:nth-child(1) { grid-column: span 7; grid-row: span 2; }
.mosaic.n-2 > li:nth-child(2) { grid-column: span 5; grid-row: span 2; }

.tile { position: relative; overflow: hidden; background: var(--paper-2); }
.tile > a { position: absolute; inset: 0; display: block; text-decoration: none; color: var(--paper); outline-offset: -3px; }
.tile img {
	width: 100%; height: 100%; object-fit: cover;
	transform: scale(1.02); transition: transform 1.2s var(--ease), filter .6s var(--ease);
}
.tile .shade {
	position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(15, 15, 14, 0) 45%, rgba(15, 15, 14, .72) 100%);
	transition: opacity .6s var(--ease);
}
.tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(14px, 2vw, 28px); transform: translateY(10px); transition: transform .6s var(--ease); }
.tile .no { color: var(--blaze); display: block; margin-bottom: 6px; }
.tile h2 {
	margin: 0; font: 800 clamp(30px, 4.4vw, 72px)/.88 var(--display); text-transform: uppercase; letter-spacing: .005em;
	text-wrap: balance; overflow-wrap: break-word;
}
.mosaic.n-1 h2, .mosaic > li:nth-child(12n+1) h2 { font-size: clamp(44px, 8vw, 132px); }
.tile .meta { margin: 10px 0 0; color: rgba(239, 236, 229, .78); }
.tile .bar { display: block; width: 28px; height: 3px; margin-top: 14px; background: var(--blaze); transition: width .6s var(--ease); }

/* reveal (J17): hidden until in view, then the photo comes up from coarse blocks to sharp —
   gallery.js draws .depix over it at the photo's own scale */
.tile, .ph { visibility: hidden; }
.tile.in, .ph.in { visibility: visible; }
.depix { position: absolute; left: 0; top: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; transition: opacity .2s linear; }
.depix.out { opacity: 0; }
.tile .depix { transform: scale(1.02); }
.ph .depix { transform: scale(1.01); }
@media (hover: hover) {
	.tile.in:hover img { transform: scale(1.08); transition-delay: 0s; filter: saturate(1.08) contrast(1.04); }
	.tile:hover .cap { transform: translateY(0); }
	.tile:hover .bar { width: 72px; }
}

/* ---- the map: topo sheet on paper, photos pinned as prints ------------- */
.atlas { padding: 0 var(--edge) var(--edge); }
.atlas-frame { position: relative; isolation: isolate; height: 70vh; min-height: 360px; background: var(--paper-2); clip-path: inset(100% 0 0 0); }
.atlas-frame.in { clip-path: inset(0); transition: clip-path 1.1s var(--ease); }
.atlas-frame::after { content: ''; position: absolute; inset: 0; z-index: 1001; border: 1px solid var(--line); pointer-events: none; }
.atlas-map { position: absolute; inset: 0; background: var(--paper); font: inherit; }
[data-basemap="topo"] .leaflet-tile-pane { filter: grayscale(1) sepia(.32) brightness(.96) contrast(.88); }
.atlas-map a { color: var(--ink); }
.atlas-readout {
	position: absolute; top: 14px; left: 14px; z-index: 1000; margin: 0; padding: 7px 11px 7px 26px; pointer-events: none;
	background: rgba(239, 236, 229, .88); border: 1px solid var(--line); color: var(--ink); letter-spacing: .1em;
	font-variant-numeric: tabular-nums; white-space: pre;
}
.atlas-readout::before { content: ''; position: absolute; left: 10px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; background: var(--blaze); }
.atlas-readout:empty { display: none; }
.atlas-map .leaflet-top.leaflet-right .leaflet-control { margin: 14px 14px 0 0; }
/* full screen (J18): the viewer map's corner button (.lb-expand); the map fills the window under the viewer (z 50) */
.atlas-map .leaflet-control.atlas-expand { width: 36px; height: 36px; }
.atlas-map .leaflet-top.leaflet-right .atlas-expand + .leaflet-control { margin-top: 8px; }
.atlas-frame.full { position: fixed; inset: 0; z-index: 40; height: auto !important; min-height: 0; }
body.map-full { overflow: hidden; }
.atlas-map .leaflet-bottom.leaflet-left .leaflet-control { margin: 0 0 14px 14px; }
.atlas-map .leaflet-bar { border: 1px solid var(--ink); border-radius: 0; box-shadow: none; }
.atlas-map .leaflet-bar a {
	width: 34px; height: 34px; border-radius: 0 !important; border-bottom-color: var(--line);
	background: var(--paper); color: var(--ink); font: 300 20px/33px var(--mono); transition: background .25s, color .25s;
}
.atlas-map .leaflet-bar a:hover { background: var(--ink); color: var(--paper); }
.atlas-map .leaflet-bar a.leaflet-disabled { background: var(--paper); color: rgba(20, 20, 18, .25); }
.atlas-map .leaflet-control-scale-line {
	background: rgba(239, 236, 229, .85); border: 1px solid var(--ink); border-top: 0; color: var(--ink);
	font: 400 10px/1.6 var(--mono); letter-spacing: .08em; padding: 0 6px;
}
.atlas-map .leaflet-control-scale-line:not(:first-child) { border-top: 1px solid var(--ink); border-bottom: 0; margin-top: -1px; }
.atlas-map .leaflet-control-attribution { background: rgba(239, 236, 229, .85); color: var(--mute); font: 9px/1.7 var(--mono); padding: 0 6px; }

/* a pin: the print, a short ink stem, the blaze dot on the spot */
.pin-body { position: absolute; inset: 0; display: block; }
.pin-body::before { content: ''; position: absolute; left: 30.5px; top: 60px; width: 1px; height: 9px; background: var(--ink); }
.pin-body::after { content: ''; position: absolute; left: 27px; top: 68px; width: 8px; height: 8px; border-radius: 50%; background: var(--blaze); box-shadow: 0 0 0 1.5px var(--ink); }
.pin .print {
	position: absolute; left: 0; top: 0; width: 62px; height: 62px; padding: 3px; background: var(--paper);
	box-shadow: 0 1px 1px rgba(20, 20, 18, .2), 0 12px 22px -10px rgba(20, 20, 18, .6);
	transform: rotate(var(--r, 0deg)); transform-origin: 50% 100%;
	transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.pin .print img { width: 100%; height: 100%; object-fit: cover; background: var(--paper-2); transition: opacity .25s; }
.pin .print.hidden-for-flight img { opacity: 0; }
.pin { cursor: zoom-in; }
.pin.pile { cursor: pointer; }
.pin:focus-visible { outline: 2px solid var(--blaze); outline-offset: 4px; }
.pin .count {
	position: absolute; top: -9px; right: -11px; z-index: 2; min-width: 24px; height: 24px; padding: 0 6px;
	display: grid; place-items: center; background: var(--blaze); color: var(--ink);
	font-size: 11px; font-weight: 500; letter-spacing: .04em; box-shadow: 0 0 0 2px var(--paper);
}
.pin .tag {
	position: absolute; left: 31px; bottom: calc(100% + 12px); z-index: 3; display: grid; gap: 4px;
	padding: 7px 10px 8px; white-space: nowrap; background: var(--ink); color: var(--paper); font-size: 10px; pointer-events: none;
	opacity: 0; transform: translate(-50%, 6px); transition: opacity .3s var(--ease), transform .4s var(--ease);
}
.pin .tag b { font-weight: 500; }
.pin .tag span { color: rgba(239, 236, 229, .6); }
.pin .tag i { max-width: 260px; overflow: hidden; text-overflow: ellipsis; font: italic 300 13px/1.25 var(--serif); letter-spacing: 0; text-transform: none; color: rgba(239, 236, 229, .88); }
.pin:hover .tag, .pin:focus-visible .tag { opacity: 1; transform: translate(-50%, 0); }
@media (hover: hover) {
	.pin:not(.pile):hover .print { transform: translateY(-7px) scale(1.07); box-shadow: 0 2px 2px rgba(20, 20, 18, .15), 0 24px 34px -14px rgba(20, 20, 18, .65); }
	.pin.pile:hover .print { transform: translateY(-5px) rotate(calc(var(--r, 0deg) * 1.7)); }
}
/* the timeline's photo (J14): its pin lifted, ringed in blaze, its label shown */
.pin-body.now .print { transform: translateY(-9px) scale(1.14); box-shadow: 0 0 0 2px var(--blaze), 0 24px 34px -14px rgba(20, 20, 18, .65); }
.pin-body.now .tag { opacity: 1; transform: translate(-50%, 0); }

/* the album map's timeline (J14): a band along the top of the map, first photo
   to last in real time; ticks are photos, marks are days (or hours) */
.atlas-frame.timed { --band: 62px; }
.atlas-frame.timed .atlas-map { top: var(--band); }
.atlas-frame.timed .atlas-readout { top: calc(var(--band) + 14px); }
.atlas-time {
	position: absolute; top: 0; left: 0; right: 0; height: var(--band); z-index: 1000;
	display: grid; grid-template-columns: 12.5em 1fr; gap: 0 18px; padding: 0 24px 0 18px;
	background: var(--paper); border-bottom: 1px solid var(--line);
}
.time-now { align-self: center; margin: 0; display: grid; gap: 4px; color: var(--mute); letter-spacing: .1em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.time-now b { color: var(--ink); font-weight: 500; }
.time-now .d { color: var(--ink); }
.time-track { position: relative; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.time-rail { position: absolute; left: 10px; right: 10px; top: 0; bottom: 0; }
.time-rail::before { content: ''; position: absolute; left: -10px; right: -10px; top: 38px; height: 1px; background: var(--ink); }
.time-marks { position: absolute; inset: 0; pointer-events: none; }
.time-mark { position: absolute; top: 30px; width: 1px; height: 8px; background: rgba(20, 20, 18, .3); }
.time-mark.day { top: 9px; height: 29px; background: rgba(20, 20, 18, .22); }
.time-mark.start { top: 0; height: 0; background: none; }
.time-mark i { position: absolute; left: 5px; top: 0; font: 400 9.5px/1 var(--mono); font-style: normal; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; color: var(--mute); }
.time-mark:not(.day):not(.start) i { top: -21px; }
.time-mark.day i, .time-mark.start i { color: var(--ink); }
.time-mark.start i { left: -10px; top: 9px; }
.time-tick { position: absolute; top: 32px; width: 2px; height: 13px; margin-left: -1px; background: var(--ink); }
.time-knob {
	position: absolute; top: 38px; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; cursor: grab;
	background: var(--blaze); box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px var(--paper);
	transition: left .3s var(--ease), transform .2s var(--ease), background .2s;
}
.time-knob.idle { background: var(--paper); }
.time-knob.held { cursor: grabbing; transform: scale(1.2); transition: left .12s var(--ease), transform .2s var(--ease); }   /* drawn onto a tick */
.time-knob.held.free { transition: transform .2s var(--ease); }   /* between ticks: under the finger */
.time-knob:focus-visible { outline: 2px solid var(--blaze); outline-offset: 5px; }

/* first view: the map wipes up, then the pins drop in one after another */
.atlas-frame.intro .pin-body { animation: pin-drop .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 650ms); }
@keyframes pin-drop { from { opacity: 0; transform: translateY(-30px); } 55% { opacity: 1; } to { opacity: 1; transform: none; } }
/* Leaflet.markercluster's own stylesheet, which is only these two rules */
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow { transition: transform .3s ease-out, opacity .3s ease-in; }
.leaflet-cluster-spider-leg { transition: stroke-dashoffset .3s ease-out, stroke-opacity .3s ease-in; }

.lb-count a { text-decoration: none; border-bottom: 1px solid rgba(255, 79, 26, .45); transition: color .3s, border-color .3s; }
.lb-count a:hover { color: var(--paper); border-color: var(--paper); }

/* ---- album page ------------------------------------------------------ */
.album-head { padding: clamp(22px, 3vw, 40px) var(--edge) clamp(18px, 2.4vw, 28px); }
.back { text-decoration: none; color: var(--mute); display: inline-flex; gap: 10px; align-items: center; transition: color .3s; }
.back:hover { color: var(--blaze); }
.album-journal { margin: 1rem 0 0; }
.album-journal a { text-decoration: underline; text-underline-offset: 0.2em; }
.back span { display: inline-block; transition: transform .4s var(--ease); }
.back:hover span { transform: translateX(-5px); }
.album-head h1 {
	margin: 14px 0 0; font: 900 clamp(52px, 8.6vw, 150px)/.84 var(--display); text-transform: uppercase; letter-spacing: -.005em;
	text-wrap: balance; overflow-wrap: break-word;
}
.album-head h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .04em; }
.album-head h1 .w > span { display: inline-block; transform: translateY(105%); animation: rise .9s var(--ease) forwards; animation-delay: calc(var(--w, 0) * 70ms + 80ms); }
.album-desc { max-width: 60ch; margin: 16px 0 0; font: italic 300 clamp(18px, 1.7vw, 24px)/1.35 var(--serif); color: var(--ink); text-wrap: pretty; white-space: pre-line; opacity: 0; animation: fade .8s var(--ease) .35s forwards; }
.album-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--line); opacity: 0; animation: fade .8s var(--ease) .45s forwards; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 48px; margin: 0; }
.facts div { min-width: 120px; }
.facts dt { color: var(--mute); margin-bottom: 4px; }
.facts dd { margin: 0; font: 500 13px/1.4 var(--mono); letter-spacing: .06em; }

/* justified photo rows: every photo whole, rows exactly filling the width */
.justified { padding: 0 var(--edge) var(--edge); }
.justified .row { display: flex; gap: var(--gap); margin-bottom: var(--gap); }
.justified .row.last { justify-content: center; }
.ph { position: relative; display: block; overflow: hidden; background: var(--paper-2); flex: none; cursor: zoom-in; outline-offset: -3px; }
.ph img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.01); transition: transform 1.1s var(--ease), opacity .3s; }
.ph::after {
	content: attr(data-label); position: absolute; left: 12px; bottom: 10px; color: var(--paper);
	font: 400 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
	opacity: 0; transform: translateY(6px); transition: .45s var(--ease); text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}
@media (hover: hover) {
	.ph.in:hover img { transform: scale(1.06); transition-delay: 0s; }
	.ph:hover::after { opacity: 1; transform: none; }
}
.ph.hidden-for-flight img { opacity: 0; }
/* a photo's title and caption from Photos, always shown, on the album tiles' shade (J16) */
.ph-cap {
	position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 5px; padding: 40px 12px 11px; pointer-events: none;
	background: linear-gradient(180deg, rgba(15, 15, 14, 0), rgba(15, 15, 14, .74)); color: var(--paper);
}
.ph-cap b { font-weight: 500; font-size: 11px; line-height: 1.2; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-cap i { font: italic 300 15px/1.3 var(--serif); color: rgba(239, 236, 229, .9); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ph.hidden-for-flight .ph-cap { opacity: 0; }

/* ---- categories (J10): trail signs; the blaze marks the one you're on ---- */
.trail { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); opacity: 0; animation: fade .8s var(--ease) .55s forwards; }
.signs { position: relative; display: flex; align-items: flex-end; gap: 8px clamp(22px, 3vw, 46px); padding-bottom: 2px; }
.sign {
	position: relative; flex: none; display: inline-flex; align-items: flex-start; gap: 7px;
	padding: 0 0 10px; border: 0; background: none; color: var(--mute); cursor: pointer; white-space: nowrap;
	font: 700 clamp(26px, 2.7vw, 40px)/.86 var(--display); text-transform: uppercase; letter-spacing: .01em;
	transition: color .45s var(--ease);
}
.sign .ct { font-size: 10px; line-height: 1; letter-spacing: .1em; margin-top: .12em; }
.sign:hover, .sign[aria-pressed="true"] { color: var(--ink); }
.sign[aria-pressed="true"] { cursor: default; }
.sign::after { content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 3px; background: var(--blaze); transition: width .6s var(--ease); }
@media (hover: hover) { .sign:not([aria-pressed="true"]):hover::after { width: 28px; } }
.sign.cats { margin-left: auto; padding-left: clamp(18px, 2.4vw, 34px); border-left: 1px solid var(--line); }
.sign.cats::after { left: clamp(18px, 2.4vw, 34px); }
.sign.cats[aria-pressed="true"]::after { width: calc(100% - clamp(18px, 2.4vw, 34px)); }
.signs .blaze { position: absolute; left: 0; bottom: 2px; width: 0; height: 3px; background: var(--blaze); pointer-events: none; transition: transform .55s var(--ease), width .55s var(--ease); }

/* All: one column per category, scrolling with the page under pinned names */
.columns { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 0 clamp(10px, 1.3vw, 18px); padding: 0 var(--edge) var(--edge); }
.col { min-width: 0; }
.col-head { position: sticky; top: 0; z-index: 3; margin: 0 0 var(--gap); padding: 14px 0 0; background: var(--paper); border-bottom: 1px solid var(--ink); }
.col-head .sign { font-size: clamp(20px, 1.8vw, 28px); padding-bottom: 9px; }
.col-body { display: flex; flex-direction: column; gap: var(--gap); }
.col .ph { width: 100%; }

.empty { padding: 18vh var(--edge); text-align: center; color: var(--mute); }
.empty h2 { font: 800 clamp(40px, 7vw, 96px)/.9 var(--display); text-transform: uppercase; color: var(--ink); margin: 0 0 14px; }

/* ---- footer ---------------------------------------------------------- */
.foot {
	display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
	padding: 22px var(--edge) 28px; border-top: 1px solid var(--line); color: var(--mute);
}
.foot p { display: inline; margin: 0; }
.foot a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--blaze); }

/* ---- viewer ---------------------------------------------------------- */
.lb { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 400px); color: var(--paper); }
.lb[hidden] { display: none; }
.lb-backdrop { position: absolute; inset: 0; background: var(--night); opacity: 0; transition: opacity .45s var(--ease); }
.lb.open .lb-backdrop { opacity: 1; }
.lb-stage { position: relative; margin: 0; display: flex; align-items: center; justify-content: center; padding: 6vh max(4vw, 96px); min-height: 0; }
.lb-img { box-shadow: 0 40px 90px rgba(0, 0, 0, .55); opacity: 0; }
.lb.ready .lb-img { opacity: 1; }
.lb-img.swap { animation: swap .5s var(--ease); }
.lb-nav {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
	width: 56px; height: 56px; border: 1px solid var(--night-line); border-radius: 50%;
	background: rgba(15, 15, 14, .35); color: var(--paper); font: 300 22px/1 var(--mono); cursor: pointer;
	opacity: 0; transition: opacity .4s var(--ease) .2s, background .3s, border-color .3s;
}
.lb.open .lb-nav { opacity: 1; }
.lb-nav:hover { background: var(--blaze); border-color: var(--blaze); }
.lb-nav[disabled] { visibility: hidden; }
.lb-prev { left: 1.6vw; }
.lb-next { right: 1.6vw; }
.lb-info {
	position: relative; overflow-y: auto; padding: 11vh 30px 30px; border-left: 1px solid var(--night-line);
	opacity: 0; transform: translateX(36px); transition: opacity .55s var(--ease) .1s, transform .7s var(--ease) .1s;
}
.lb.open .lb-info { opacity: 1; transform: none; }
.lb-count { color: var(--blaze); margin: 0 0 18px; }
.lb-title { margin: 0; font: 800 clamp(34px, 3.4vw, 54px)/.9 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.lb-desc { margin: 14px 0 0; font: italic 300 19px/1.35 var(--serif); color: rgba(239, 236, 229, .82); }
.lb-desc:empty { display: none; }
.lb-facts { margin: 28px 0 0; }
.lb-facts > div { padding: 14px 0; border-top: 1px solid var(--night-line); }
.lb-facts dt { color: rgba(239, 236, 229, .45); margin-bottom: 6px; }
.lb-facts dd { margin: 0; }
.lb-day, .lb-trail-name { font: italic 300 18px/1.3 var(--serif); }
.lb-clock, .lb-mile { margin-top: 6px !important; color: rgba(239, 236, 229, .7); letter-spacing: .1em; }
.lb-coords { letter-spacing: .1em; color: rgba(239, 236, 229, .85); }
.lb-map { position: relative; height: 210px; margin: 4px 0 0; border: 1px solid var(--night-line); background: #1c1c1a; }   /* positioned here, so Leaflet sets no inline position the enlarged map would have to beat */
.lb-map[data-basemap="street"] .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(.92) contrast(.92); }
.lb-map .leaflet-control-attribution { background: rgba(15, 15, 14, .7); color: rgba(239, 236, 229, .55); font: 9px/1.6 var(--mono); }
.lb-map .leaflet-control-attribution a { color: rgba(239, 236, 229, .8); }
.lb-map .leaflet-bar a { background: var(--night); color: var(--paper); border-color: var(--night-line); }

/* corner buttons (J11): the photo's opens the full-size file, the map's enlarges it into the stage */
.lb-frame { position: relative; display: block; line-height: 0; }
.lb-expand {
	display: grid; place-items: center; width: 38px; height: 38px; padding: 0; cursor: pointer;
	border: 1px solid rgba(239, 236, 229, .28); background: rgba(15, 15, 14, .55); color: var(--paper);
	transition: background .3s, border-color .3s, color .3s, opacity .4s var(--ease);
}
.lb-expand:hover { background: var(--blaze); border-color: var(--blaze); color: var(--night); }
.lb-zoom { position: absolute; top: 10px; right: 10px; z-index: 1; opacity: 0; }
.lb.ready .lb-zoom { opacity: 1; }
.lb-map .leaflet-control.lb-expand { margin: 10px 10px 0 0; }
.lb-map .leaflet-control.map-basemap-toggle { margin-top: 6px; }
.map-basemap-toggle[aria-pressed="true"] { background: var(--blaze); border-color: var(--blaze); color: var(--night); }
.lb-stage .lb-map { position: absolute; inset: 0; z-index: 1; height: auto; margin: 0; border: 0; }
.lb-close {
	position: absolute; top: 18px; right: 22px; z-index: 3; background: none; border: 0; color: var(--paper); cursor: pointer;
	display: flex; gap: 10px; align-items: center; opacity: 0; transition: opacity .4s .2s, color .3s;
}
.lb.open .lb-close { opacity: 1; }
.lb-close:hover { color: var(--blaze); }
.lb-close kbd { font: inherit; padding: 3px 6px; border: 1px solid var(--night-line); }
.fly { position: fixed; z-index: 60; margin: 0; object-fit: cover; transform-origin: 0 0; pointer-events: none; will-change: transform; }

/* ---- keyframes --------------------------------------------------------- */
@keyframes drop { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }
@keyframes rise { to { transform: none; } }
@keyframes swap { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

/* ---- small screens ----------------------------------------------------- */
@media (max-width: 760px) {
	:root { --gap: 5px; }
	.mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 46vw; }
	.mosaic > li { grid-column: span 1; grid-row: span 1; }
	.mosaic > li:nth-child(5n+1), .mosaic.n-1 > li, .mosaic.n-2 > li { grid-column: 1 / -1; grid-row: span 2; }
	.mosaic > li:nth-child(12n+8) { grid-column: span 1; grid-row: span 1; }
	.tile h2 { font-size: clamp(26px, 9vw, 44px); }
	.mosaic > li:nth-child(5n+1) h2, .mosaic.n-1 h2 { font-size: clamp(40px, 14vw, 72px); }
	.tile .cap { transform: none; }
	.atlas-map .leaflet-bottom.leaflet-left { bottom: 34px; }   /* the attribution wraps to two lines */
	/* the timeline: the photo's date on its own line above the rail */
	.atlas-frame.timed { --band: 88px; }
	.atlas-time { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding: 11px 16px 0; }
	.time-now { display: flex; gap: 14px; align-self: start; }
	.stats { font-size: 10px; }
	/* the folder's name above the counts; its list opens leftwards from the right edge */
	.top-right { flex-direction: column; align-items: flex-end; gap: 10px; }
	.folders .sep { display: none; }
	.folder-btn { font-size: 10px; }
	.folder-list { left: auto; right: 0; }
	.lb { grid-template-columns: 1fr; grid-template-rows: 58vh auto; overflow-y: auto; }
	.lb-stage { padding: 52px 10px 10px; }
	.lb-info { border-left: 0; border-top: 1px solid var(--night-line); padding: 22px 20px 40px; overflow: visible; transform: translateY(24px); }
	.lb-nav { width: 44px; height: 44px; top: auto; bottom: 14px; transform: none; }
	.lb-prev { left: 12px; }
	.lb-next { right: 12px; }
	.lb-stage .lb-map { top: 52px; }   /* below Close, like the photo */
	/* categories: the row scrolls sideways under a pinned All; All's columns are swiped */
	.signs { overflow-x: auto; scrollbar-width: none; }
	.signs::-webkit-scrollbar, .columns::-webkit-scrollbar { display: none; }
	.sign { font-size: 24px; }
	.sign.cats { position: sticky; right: 0; z-index: 1; background: var(--paper); box-shadow: -22px 0 16px -4px var(--paper); }
	.columns { display: flex; align-items: flex-start; gap: 0; padding: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; transition: height .45s var(--ease); }
	.col { flex: 0 0 100%; padding: 0 var(--edge) var(--edge); scroll-snap-align: start; }
	.col-head { position: static; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
	.grain { animation: none; }
}

/* keyboard focus: the blaze, never the browser's blue */
a:focus-visible, button:focus-visible { outline: 2px solid var(--blaze); outline-offset: 3px; }
.tile > a:focus-visible, .ph:focus-visible { outline-offset: -4px; }
.lb :focus-visible { outline-color: var(--blaze); }
:focus:not(:focus-visible) { outline: none; }
