/* Once: an archive drawer over the globe. Warm ink, paper cards, one sepia-gold accent. */
:root {
  --ink: #1b1713;
  --glass: rgba(27, 23, 19, .86);
  --paper: #f3ebdd;
  --paper-2: #e6dac4;
  --fg: #f5eee2;
  --muted: #b9ad9a;
  --line: rgba(245, 238, 226, .14);
  --gold: #d9a54a;
  --gold-ink: #2a1c05;
  --pin: #e8b25a;
  --display: "Young Serif", Georgia, serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--fg); font: 15px/1.5 var(--body); overflow: hidden; }
button, input { font: inherit; color: inherit; }
a { color: var(--gold); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#map { position: fixed; inset: 0; }
.maplibregl-canvas { cursor: pointer; }
.maplibregl-ctrl-attrib { display: none; }

/* top bar */
.bar { position: fixed; z-index: 5; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; pointer-events: none; }
.bar > * { pointer-events: auto; }
.brand { font: 400 1.5rem/1 var(--display); color: var(--fg); text-decoration: none; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px 9px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.search { position: relative; flex: 1 1 260px; max-width: 420px; display: flex; align-items: center; gap: 8px; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 11px 0; outline: none; }
.search input::placeholder { color: var(--muted); }
.hits { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: #241f1a; border: 1px solid var(--line); border-radius: 12px; max-height: 60vh; overflow: auto; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.hits li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.hits li small { color: var(--muted); white-space: nowrap; }
.hits li[aria-selected="true"], .hits li:hover { background: rgba(217, 165, 74, .16); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: .9rem; }
.chip svg { width: 16px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 2; }
.toggle input { accent-color: var(--gold); margin: 0; }
.lang { display: flex; gap: 2px; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-left: auto; }
.lang button { border: 0; background: none; border-radius: 999px; padding: 4px 9px; font-size: .74rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.lang button.on { background: rgba(245, 238, 226, .12); color: var(--fg); }

/* the first thing you read */
.intro { position: fixed; z-index: 4; left: 16px; bottom: calc(26px + var(--safe-b)); max-width: 420px; background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.intro h1 { margin: 0 0 8px; font: 400 1.55rem/1.15 var(--display); text-wrap: balance; }
.intro p { margin: 0; color: #d8cdbb; }
.intro .count { margin-top: 10px; color: var(--gold); font-weight: 600; font-size: .88rem; font-variant-numeric: tabular-nums; }

/* the drawer of photos */
.panel { position: fixed; z-index: 6; top: calc(70px + var(--safe-t)); right: 12px; bottom: calc(12px + var(--safe-b)); width: min(440px, calc(100% - 24px)); background: var(--paper); color: var(--ink); border-radius: 16px; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; }
.kicker { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8a6a2e; }
.panel h2 { margin: 2px 0 2px; font: 400 1.5rem/1.15 var(--display); text-wrap: balance; }
.p-sub { margin: 0; color: #6b5f50; font-size: .9rem; }
.x { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(27, 23, 19, .18); background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; }
.decades { display: flex; gap: 6px; overflow-x: auto; padding: 0 18px 12px; scrollbar-width: none; }
.decades::-webkit-scrollbar { display: none; }
.decades button { flex: none; border: 1px solid rgba(27, 23, 19, .2); background: none; border-radius: 999px; padding: 5px 11px; font-size: .84rem; cursor: pointer; color: var(--ink); font-variant-numeric: tabular-nums; }
.decades button small { color: #8a7c69; margin-left: 3px; }
.decades button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.decades button.on small { color: var(--paper-2); }
.grid { flex: 1; min-height: 0; overflow-y: auto; padding: 0 18px 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; gap: 10px; align-content: start; }
.grid button { border: 0; padding: 0; background: var(--paper-2); border-radius: 8px; overflow: hidden; cursor: pointer; display: grid; text-align: left; color: var(--ink); }
.grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; filter: sepia(.15); background: #d8ccb5; }
.grid span { font-size: .78rem; padding: 6px 8px 7px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid span b { font-weight: 700; margin-right: 4px; }
.p-note { margin: 0 18px 14px; font-size: .85rem; color: #6b5f50; }
.more { margin: 0 18px 18px; border: 1px solid rgba(27, 23, 19, .25); background: none; border-radius: 999px; padding: 9px; cursor: pointer; color: var(--ink); font-weight: 600; }
@media (max-width: 760px) {
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 62vh; border-radius: 16px 16px 0 0; padding-bottom: var(--safe-b); }
  .intro { left: 12px; right: 12px; bottom: calc(14px + var(--safe-b)); max-width: none; padding: 14px 16px; }
  .intro h1 { font-size: 1.25rem; }
  .intro p { font-size: .9rem; }
  .bar .toggle span { display: none; }
  .lang { margin-left: 0; }
}

/* one photo, large */
.viewer { position: fixed; inset: 0; z-index: 20; background: rgba(14, 11, 8, .94); display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; padding: calc(12px + var(--safe-t)) 8px calc(12px + var(--safe-b)); }
.viewer figure { margin: 0; display: grid; gap: 12px; justify-items: center; max-height: 100%; min-width: 0; }
.viewer img { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 6px; background: #2a241d; }
.viewer figcaption { max-width: 760px; display: grid; gap: 4px; text-align: center; }
.viewer figcaption b { font: 400 1.2rem/1.3 var(--display); }
#v-meta { color: var(--gold); font-size: .9rem; }
.v-desc { color: #d3c8b6; font-size: .88rem; }
.v-credit { color: var(--muted); font-size: .78rem; }
.v-credit a { color: inherit; }
.v-actions { margin-top: 6px; }
.v-close { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; color: var(--fg); border-color: var(--line); }
.nav { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(245, 238, 226, .06); font-size: 1.6rem; line-height: 1; cursor: pointer; justify-self: center; }
@media (max-width: 760px) { .viewer { grid-template-columns: 40px 1fr 40px; } .nav { width: 36px; height: 36px; } }

.toast { position: fixed; z-index: 30; top: calc(74px + var(--safe-t)); left: 50%; transform: translateX(-50%); background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font-size: .9rem; max-width: calc(100% - 32px); text-align: center; }
.credit { position: fixed; z-index: 3; right: 8px; bottom: 3px; font-size: .64rem; color: rgba(245, 238, 226, .62); text-shadow: 0 1px 2px #000; }
.credit a { color: inherit; }
@media (max-width: 760px) { .credit { display: none; } }
/* then and now side by side */
.compare { display: grid; gap: 12px; justify-items: center; min-width: 0; max-height: 100%; overflow: auto; }
.compare .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 1200px; }
.compare figure { margin: 0; display: grid; gap: 6px; justify-items: center; align-content: start; min-width: 0; }
.compare figure small { color: var(--gold); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; }
.compare img { width: 100%; max-height: 58vh; object-fit: contain; border-radius: 6px; background: #2a241d; }
.compare figcaption { color: var(--muted); font-size: .78rem; text-align: center; }
.compare figcaption b { color: var(--fg); font-weight: 500; display: block; font-size: .9rem; }
.compare figcaption a { color: inherit; }
.strip { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; padding-bottom: 4px; }
.strip button { flex: none; width: 74px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: #2a241d; cursor: pointer; }
.strip button.on { border-color: var(--gold); }
.strip img { width: 100%; height: 100%; object-fit: cover; }
.grid .today-msg { grid-column: 1 / -1; color: #6b5f50; font-size: .9rem; padding: 18px 4px; }
@media (max-width: 760px) { .compare .pair { grid-template-columns: 1fr; } .compare img { max-height: 34vh; } }
.viewer [hidden], .compare[hidden] { display: none !important; }

/* walk: the photo on the left, the map following on the right */
.go-walk { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 9px 16px; background: var(--ink); color: var(--paper); font-weight: 600; cursor: pointer; }
.go-walk svg { width: 18px; height: 18px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.go-walk svg circle { fill: var(--gold); stroke: none; }
.chip.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 600; }
.chip.gold svg { fill: var(--gold-ink); stroke: none; }
.chip.gold.on { background: var(--fg); border-color: var(--fg); }
body.walking .bar, body.walking .intro, body.walking .credit { display: none; }
.walk { position: fixed; z-index: 15; left: 0; top: 0; bottom: 0; width: min(60vw, calc(100vw - 340px)); background: #120f0c; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; box-shadow: 12px 0 40px rgba(0, 0, 0, .5); }
.w-bg { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(28px) brightness(.38) sepia(.3); }
.w-photo { position: absolute; inset: 0; display: grid; place-items: center; padding: 96px 28px 270px; }
.w-photo img { grid-area: 1 / 1; max-width: 100%; max-height: calc(100vh - 400px); object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); opacity: 0; transition: opacity .7s ease; }
.w-photo img.in { opacity: 1; }
.w-photo img.kb { animation: kb 9s ease-out both; }
@keyframes kb { from { transform: scale(1); } to { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .w-photo img.kb { animation: none; } }
.w-spin { grid-area: 1 / 1; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(245, 238, 226, .2); border-top-color: var(--gold); opacity: 0; transition: opacity .2s; animation: spin 0.9s linear infinite; }
.walk.loading .w-spin { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.w-bar { height: 3px; border-radius: 2px; background: rgba(245, 238, 226, .1); overflow: hidden; position: relative; }
.w-bar::after { content: ''; position: absolute; inset: 0; background: var(--gold); transform: scaleX(0); transform-origin: left; }
.w-bar.run::after { animation: fill linear forwards; animation-duration: inherit; }
@keyframes fill { to { transform: scaleX(1); } }
.w-keys { margin-left: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; opacity: .8; }
.walks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.walks small { width: 100%; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.walks .chip { padding: 6px 12px; }
.w-top { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: calc(16px + var(--safe-t)) 20px 28px; background: linear-gradient(#120f0ce6, #120f0c00); }
.w-top .kicker { color: var(--gold); }
.w-top h2 { margin: 2px 0 2px; font: 400 1.6rem/1.15 var(--display); text-wrap: balance; }
.w-meta { margin: 0; color: #d8cdbb; font-size: .9rem; }
.w-top .x { color: var(--fg); border-color: var(--line); background: rgba(18, 15, 12, .5); }
.w-bottom { position: relative; grid-row: 3; display: grid; gap: 10px; padding: 34px 20px calc(16px + var(--safe-b)); background: linear-gradient(#120f0c00, #120f0cf2 28%); }
.w-years { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.w-years button { flex: none; position: relative; width: 64px; height: 48px; padding: 0; border: 2px solid transparent; background: #2a241d; border-radius: 6px; overflow: hidden; cursor: pointer; font-variant-numeric: tabular-nums; }
.w-years button img { width: 100%; height: 100%; object-fit: cover; display: block; filter: sepia(.2); }
.w-years button b { position: absolute; left: 0; right: 0; bottom: 0; font-size: .68rem; font-weight: 600; background: linear-gradient(#0000, #000c); padding: 6px 0 1px; }
.w-years button.today { width: auto; padding: 0 12px; background: rgba(245, 238, 226, .08); border: 1px solid var(--line); }
.w-years button.today b { position: static; background: none; padding: 0; font-size: .8rem; }
.w-years button.on { border-color: var(--gold); }
.w-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.w-label { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.w-near { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.w-near button { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: rgba(245, 238, 226, .05); border-radius: 10px; padding: 7px 10px; cursor: pointer; min-width: 0; }
.w-near button:hover { border-color: var(--gold); }
.w-near button.seen { opacity: .55; }
.w-near svg { width: 20px; height: 20px; flex: none; fill: var(--gold); transition: transform .3s; }
.w-near span { min-width: 0; display: grid; }
.w-near b { font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-near small { color: var(--muted); font-size: .74rem; }
.w-credit { color: var(--muted); font-size: .72rem; }
.w-credit a { color: inherit; }
@media (max-width: 760px) {
  .walk { right: 0; width: auto; bottom: auto; height: 64vh; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); }
  .w-photo { padding: 78px 12px 220px; }
  .w-photo img { max-height: calc(64vh - 310px); }
  .w-keys { display: none; }
  .w-top { padding: calc(12px + var(--safe-t)) 14px 20px; }
  .w-top h2 { font-size: 1.25rem; }
  .w-bottom { padding: 24px 14px 10px; gap: 8px; }
  .w-near { display: flex; overflow-x: auto; scrollbar-width: none; }
  .w-near button { flex: none; width: 200px; }
  .w-label, .w-credit { display: none; }
}
