/* 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; }
