:root {
  --bg: #F1F2EF;
  --surface: #FFFFFF;
  --ink: #1B1C19;
  --muted: #6C6E68;
  --line: #DADBD6;
  --soft: #E4E5E0;

  --v-ink: #EAEAE5;
  --v-muted: #A3A49E;
  --v-line: rgba(255,255,255,.09);

  --pad: clamp(16px, 3.2vw, 44px);
  --gap: clamp(10px, 1.1vw, 16px);
  --radius: 10px;
  --bar-h: 60px;
  --tabs-h: 49px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121311;
    --surface: #1B1C1A;
    --ink: #ECEDE8;
    --muted: #94968F;
    --line: #2B2C29;
    --soft: #1F201E;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Top bar + tabs ---------- */
.bar {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--pad) 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.tabs {
  position: sticky; top: calc(var(--bar-h) + env(safe-area-inset-top)); z-index: 30;
  display: flex; gap: 28px; padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
}
/* Header and tabs share one frosted surface. Before the tabs stick, each
   element carries its own; once they meet, a single backdrop spans both so
   there is no seam where two blurs overlap. */
.bar, .tabs, .chrome {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
}
.chrome {
  position: fixed; top: 0; left: 0; right: 0; z-index: 29;
  height: calc(var(--bar-h) + env(safe-area-inset-top) + var(--tabs-h));
  border-bottom: 1px solid var(--line);
  pointer-events: none; visibility: hidden;
}
body.stuck .chrome { visibility: visible; }
body.stuck .bar, body.stuck .tabs { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.stuck .tabs { border-bottom-color: transparent; }
/* While a photo is open, the page chrome would show through the viewer's blur unblurred
   (an element with its own backdrop blur isn't re-blurred), so step it out of the way. */
html.viewing .bar, html.viewing .tabs, html.viewing .chrome { visibility: hidden; }

.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.brand .logo { display: block; height: 19px; width: auto; aspect-ratio: 1936 / 720; }
.actions { display: flex; align-items: center; gap: 6px; position: relative; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer;
  height: 36px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 0.9rem; font-weight: 500;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .88; }
.btn svg.i { width: 18px; height: 18px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn:hover { background: var(--soft); }


.tab {
  position: relative; height: 48px; display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 0.95rem; font-weight: 500;
}
.tab svg.i { width: 18px; height: 18px; }
.tab { transition: color .25s ease; -webkit-tap-highlight-color: transparent; }
.tab[aria-selected="true"] { color: var(--ink); }
/* One underline that slides to the active tab, like Instagram's profile tabs */
.tab-ink {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--ink); pointer-events: none;
  transform-origin: 0 0; transition: transform .32s cubic-bezier(.3,.7,.2,1), width .32s cubic-bezier(.3,.7,.2,1);
}
.tab-ink.no-anim { transition: none; }

/* ---------- Intro ---------- */
.intro { padding: clamp(28px, 7vw, 120px) var(--pad) clamp(28px, 4.5vw, 64px); }
.intro h1 {
  margin: 0; max-width: 14ch;
  font-weight: 300; font-size: clamp(2.6rem, 7.4vw, 6.75rem);
  line-height: 0.98; letter-spacing: -0.035em;
}
.intro .lede { margin: 1.4rem 0 0; max-width: 44ch; font-size: clamp(1.05rem, 1.4vw, 1.3rem); line-height: 1.45; }
.intro .byline { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Gallery ---------- */
.gallery { padding: 0 var(--pad) 96px; position: relative; isolation: isolate; } /* keeps entrance z-indexes under the header */
.year + .year { margin-top: var(--gap); }
.year-h {
  position: relative; z-index: 9999; /* photos slide in from behind it */
  margin: 0; padding: 12px 0 8px; background: var(--bg);
  font-weight: 500; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums;
}
.masonry { display: flex; align-items: flex-start; gap: var(--gap); }
.masonry .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.tile {
  position: relative; display: block; width: 100%; overflow: hidden;
  border-radius: var(--radius); background: var(--soft);
}
.tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s ease; }
.tile img.ok { opacity: 1; }
.tile .cap {
  position: absolute; inset: auto 0 0 0; padding: 32px 14px 12px;
  color: #fff; font-size: 0.85rem; text-align: left;
  background: linear-gradient(to top, rgba(0,0,0,.5), rgba(0,0,0,0));
  opacity: 0; transition: opacity .2s;
}
.tile:hover .cap, .tile:focus-visible .cap { opacity: 1; }
.tile:focus-visible { outline-offset: 2px; }
/* Marks a post with several photos */
.tile .multi { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; color: #fff; stroke-width: 1.7; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }

/* ---------- Empty ---------- */
.empty { padding: 0 var(--pad) 96px; max-width: 620px; }
.empty h2 { font-weight: 400; font-size: 1.5rem; letter-spacing: -0.01em; margin: 0 0 8px; }
.empty p { color: var(--muted); margin: 0 0 24px; max-width: 48ch; }
.empty .row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Map ---------- */
.map-wrap {
  position: relative; margin: var(--gap) var(--pad) 40px;
  height: calc(100dvh - var(--bar-h) - var(--tabs-h) - var(--gap) - 40px - env(safe-area-inset-top));
  min-height: 420px; border-radius: 14px; overflow: hidden; background: var(--soft);
}
#map { position: absolute; inset: 0; }
/* Leaflet's panes use z-index 400–700; isolate every map so it can't rise above the viewer or feed. */
.map-wrap, .mini-map { isolation: isolate; }
.map-note {
  position: absolute; left: 12px; top: 12px; z-index: 500;
  padding: 7px 14px; border-radius: 999px; font-size: 0.82rem;
  background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.map-empty {
  position: absolute; inset: 0; z-index: 600; display: grid; place-items: center; padding: 24px; text-align: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}
.map-empty p { max-width: 36ch; margin: 0; }
.leaflet-container { font-family: var(--font); background: var(--soft); }
.leaflet-control-attribution {
  font-size: 10px; line-height: 1.6; white-space: nowrap; padding: 0 6px !important;
  border-radius: 6px 0 0 0;
  background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--muted);
}
.leaflet-control-attribution a { color: var(--muted); }
.leaflet-bar { border: 0 !important; box-shadow: 0 1px 3px rgba(0,0,0,.14) !important; border-radius: 10px !important; overflow: hidden; }
.leaflet-bar a { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line) !important; width: 34px !important; height: 34px !important; line-height: 34px !important; }

.pin-wrap { background: none; border: 0; }
.pin-box { position: relative; display: block; width: 100%; height: 100%; }
.pin {
  display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  border: 2px solid #fff; background: #bbb; box-shadow: 0 2px 10px rgba(0,0,0,.28);
  transition: transform .15s;
}
/* Leaflet sets width:auto on marker images, which left portrait thumbnails half-filled. */
.leaflet-container .pin img { width: 100% !important; height: 100% !important; object-fit: cover; }
.pin-wrap:hover .pin { transform: scale(1.08); }
.pin-n {
  position: absolute; top: -4px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; display: grid; place-items: center;
  background: #1B1C19; color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  border: 2px solid #fff;
}
.mini-map { width: 100%; height: 100%; }

/* ---------- Desktop viewer ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 100; color: var(--v-ink);
  display: none; grid-template-columns: minmax(0, 1fr) min(400px, 34vw);
  background: rgba(14, 14, 13, .84);
  -webkit-backdrop-filter: blur(48px) saturate(1.3);
  backdrop-filter: blur(48px) saturate(1.3);
}
.viewer.open { display: grid; animation: fade-in .22s ease-out; }
@keyframes fade-in { from { opacity: 0; } }
.v-stage { position: relative; min-width: 0; height: 100dvh; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.v-stage.zoomed { cursor: grab; }
.v-stage.grabbing { cursor: grabbing; }
.v-frame { position: absolute; inset: 0; }
.v-img {
  position: absolute; left: 50%; top: 50%; max-width: none;
  transform: translate(-50%, -50%);
  pointer-events: none; -webkit-user-drag: none;
  box-shadow: 0 24px 70px -24px rgba(0,0,0,.65);
}
.v-img.anim { transition: width .3s var(--ease), height .3s var(--ease), transform .3s var(--ease); }
.v-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4;
  height: calc(60px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0;
  display: flex; align-items: center; justify-content: space-between; pointer-events: none;
}
.v-top > * { pointer-events: auto; }
.v-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--v-ink); transition: background-color .15s; }
.v-btn:hover { background: rgba(255,255,255,.1); }
.v-btn:disabled { opacity: .25; cursor: default; background: none; }
.v-count { font-size: 0.85rem; color: var(--v-muted); font-variant-numeric: tabular-nums; padding-right: 12px; }
.v-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; }
.v-prev { left: 20px; }
.v-next { right: 20px; }

.pill {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 2px; padding: 4px;
  border-radius: 999px; color: var(--v-ink);
  background: rgba(24, 24, 22, .66); border: 1px solid rgba(255,255,255,.08);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.pill button {
  height: 34px; min-width: 34px; padding: 0 10px; border-radius: 999px;
  display: inline-grid; place-items: center; font-size: 0.85rem; font-weight: 500;
  transition: background-color .15s;
}
.pill button:hover:not(:disabled) { background: rgba(255,255,255,.1); }
.pill button:disabled { opacity: .3; cursor: default; }
.pill svg.i { width: 18px; height: 18px; }
.z-pct { min-width: 50px; text-align: center; font-size: 0.82rem; color: var(--v-muted); font-variant-numeric: tabular-nums; }
.z-sep { width: 1px; height: 18px; background: rgba(255,255,255,.14); margin: 0 4px; }
.pill .wide { padding: 0 14px; }

.v-bigmap { position: absolute; inset: 0; z-index: 3; background: #1C1C1A; }
/* Legend and set dots sit just under the photo (top is set from JS) */
.v-under {
  position: absolute; left: 50%; top: 0; z-index: 4; transform: translateX(-50%);
  width: min(640px, calc(100% - 48px)); display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; pointer-events: none; transition: opacity .2s;
}
.v-under.off { opacity: 0; }
.v-legend { margin: 0; font-size: 1.02rem; line-height: 1.45; color: var(--v-ink); text-wrap: balance; }
.v-dots { display: flex; gap: 6px; }
.v-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.3); transition: background-color .2s; }
.v-dots i.on { background: #fff; }
.viewer.map-big .v-nav, .viewer.map-big #vZoom, .viewer.map-big .v-under { display: none; }
.host { position: absolute; inset: 0; z-index: 0; } /* contain Leaflet's high pane z-indexes */

.v-info {
  height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  background: rgba(255,255,255,.035); border-left: 1px solid var(--v-line);
  padding: 76px 32px 48px;
}
.v-info h2 { margin: 0; font-weight: 400; font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.02em; }
.v-sub { margin: 6px 0 0; color: var(--v-muted); }
.v-date { margin: 2px 0 0; color: var(--v-muted); }
.v-expo { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 28px 0 4px; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.v-gear { margin: 0; color: var(--v-muted); }
.v-block { border-top: 1px solid var(--v-line); margin-top: 28px; padding-top: 24px; }
.v-slot { position: relative; height: 200px; border-radius: var(--radius); overflow: hidden; background: #1C1C1A; }
.v-slot .leaflet-control-attribution, .v-bigmap .leaflet-control-attribution { background: rgba(0,0,0,.5) !important; color: #aaa; }
.v-slot .leaflet-control-attribution a, .v-bigmap .leaflet-control-attribution a { color: #ccc; }
.v-bigmap .leaflet-bar a { background: rgba(28,28,26,.9) !important; color: #eee !important; border-color: rgba(255,255,255,.08) !important; }
.slot-btn {
  position: absolute; top: 8px; right: 8px; z-index: 700;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(20,20,19,.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background-color .15s;
}
.slot-btn:hover { background: rgba(40,40,38,.9); }
.slot-btn svg.i { width: 18px; height: 18px; }
.swap { position: absolute; inset: 0; z-index: 700; display: block; width: 100%; }
.swap img { width: 100%; height: 100%; object-fit: cover; }
.swap span {
  position: absolute; left: 8px; bottom: 8px; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem;
  color: #fff; background: rgba(20,20,19,.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.coords { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 12px; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.c-row { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.c-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.c-item svg.i { width: 16px; height: 16px; stroke-width: 1.4; opacity: .7; }
.v-info .c-item { color: var(--v-muted); }
.coords a { text-underline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.v-info details summary { cursor: pointer; color: var(--v-muted); font-size: 0.92rem; list-style: none; display: flex; justify-content: space-between; }
.v-info details summary::-webkit-details-marker { display: none; }
.v-info details summary::after { content: "+"; }
.v-info details[open] summary::after { content: "–"; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 16px 0 0; font-size: 0.9rem; }
.facts dt { opacity: .66; }
.facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* ---------- Mobile feed ---------- */
.feed {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.feed.open { animation: feed-in .24s var(--ease); }
@keyframes feed-in { from { opacity: 0; transform: translateY(12px); } }
.feed-bar {
  position: sticky; top: 0; z-index: 5;
  height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0;
  display: flex; align-items: center; gap: 4px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid var(--line);
}
.feed-bar h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.feed-bar .icon-btn { width: 44px; height: 44px; }
.post { padding-bottom: 24px; }
.post-head { padding: 8px 6px 8px 16px; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.post-head > div { display: flex; flex-direction: column; min-width: 0; }
.post-share { flex: none; width: 44px; height: 44px; color: var(--muted); }
.post-head strong { font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.post-head span { font-size: 0.82rem; color: var(--muted); line-height: 1.35; }
.post-media { position: relative; background: var(--soft); overflow: hidden; touch-action: pan-x pan-y; }
.post-media > .slide { height: 100%; }
.track {
  display: flex; height: 100%; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; touch-action: pan-x pan-y;
}
.track::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.post-count {
  position: absolute; top: 12px; right: 12px; z-index: 1; padding: 3px 10px; border-radius: 999px;
  color: #fff; background: rgba(20,20,19,.62); font-size: 0.78rem; font-variant-numeric: tabular-nums; pointer-events: none;
}
.dots { display: flex; justify-content: center; gap: 5px; margin: -2px 0 10px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background-color .2s; }
.dots i.on { background: var(--ink); }
.post-legend { margin: 0 0 10px; line-height: 1.5; }
.post-media img, .slide img {
  width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
}
.post-media img.ok, .slide img.ok { opacity: 1; }
.post-body { padding: 12px 16px 0; }
.post-expo { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 1rem; font-variant-numeric: tabular-nums; }
.post-gear, .post-date { margin: 2px 0 0; color: var(--muted); font-size: 0.88rem; }
.post-more { margin-top: 10px; padding: 6px 0; font-size: 0.88rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.post-more::after { content: "+"; }
.post-more[aria-expanded="true"]::after { content: "–"; }
.post-extra { margin-top: 2px; }
.post-map { position: relative; height: 210px; border-radius: var(--radius); overflow: hidden; background: var(--soft); margin-top: 14px; }
.post-body > .coords { color: var(--muted); }
.post-body > .coords a { color: var(--ink); }

.pinch-dim { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0); pointer-events: none; }
.pinch-img { position: fixed; z-index: 1001; max-width: none; transform-origin: 0 0; pointer-events: none; object-fit: contain; will-change: transform; }

/* ---------- Browse, trips, sharing ---------- */
.tab-browse { margin-left: auto; }
/* What's filtered: a count, one chip per filter (tap to remove it), and a way to remove them all */
.scope { padding: 14px var(--pad) 2px; }
.scope-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scope p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.scope .btn { height: 32px; padding: 0 14px; font-size: 0.85rem; }
.scope-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 8px 0 13px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 0.86rem; font-weight: 500; max-width: 100%;
}
.chip small { font-size: 0.72rem; font-weight: 400; opacity: .65; }
.chip svg.i { width: 15px; height: 15px; opacity: .7; flex: none; }
.chip:hover svg.i { opacity: 1; }
.tab-n {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center;
  background: var(--ink); color: var(--bg); font-size: 0.7rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.tab-n[hidden] { display: none; }
main { position: relative; overflow-x: clip; } /* room for Photos and Map to slide past each other */

.browse {
  width: min(620px, calc(100vw - 24px)); max-height: min(80dvh, 720px); padding: 0; border: 0; border-radius: 16px;
  background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px -20px rgba(0,0,0,.45);
}
.browse[open] { display: flex; flex-direction: column; }
.browse::backdrop { background: rgba(0,0,0,.35); }
.browse-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 4px 22px; }
.browse-head h2 { margin: 0; font-weight: 400; font-size: 1.3rem; letter-spacing: -0.01em; }
.browse-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 22px 22px; flex: 1; min-height: 0; }
.browse-body h3 { margin: 18px 0 10px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.facet {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 0.9rem; transition: border-color .15s, background-color .15s;
}
.facet span { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.facet:hover { border-color: var(--muted); }
.facet:disabled { opacity: .35; cursor: default; }
.facet:disabled:hover { border-color: var(--line); }
.browse-foot {
  display: flex; justify-content: space-between; gap: 10px; padding: 12px 22px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.browse-foot .btn:disabled { opacity: .4; cursor: default; }
.facet.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.facet.on span { color: inherit; opacity: .7; }
.facet.strong { font-weight: 500; }
.facet-row { display: flex; flex-wrap: wrap; gap: 8px; }
.facet-place { margin-bottom: 12px; }
.facet-sub { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 14px; }
.facet-sub .facet { padding: 5px 11px; font-size: 0.84rem; }

.trips { padding: var(--gap) var(--pad) 96px; }
.trip-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: clamp(16px, 2vw, 28px); }
.trip-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; }
.trip-cover { display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.trip-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.trip-card:hover .trip-cover img { transform: scale(1.02); }
.trip-meta { display: flex; flex-direction: column; gap: 2px; }
.trip-meta strong { font-weight: 500; font-size: 1.05rem; }
.trip-meta small { color: var(--muted); font-size: 0.88rem; }

.trip-head { padding: 18px var(--pad) 18px; }
.trip-back { font-size: 0.88rem; color: var(--muted); }
.trip-back::before { content: "← "; }
.trip-title { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.trip-title h2 { margin: 0; font-weight: 300; font-size: clamp(1.9rem, 4vw, 3.2rem); line-height: 1.05; letter-spacing: -0.03em; }
.trip-sub, .trip-desc { margin: 8px 0 0; }
.trip-sub { color: var(--muted); }
.trip-desc { max-width: 60ch; line-height: 1.55; }
.trip-map {
  position: relative; isolation: isolate; height: clamp(240px, 40vh, 440px);
  margin: 0 var(--pad) var(--gap); border-radius: 14px; overflow: hidden; background: var(--soft);
}
#tripMap { position: absolute; inset: 0; }
.v-top-r { display: inline-flex; align-items: center; gap: 2px; }

/* ---------- Opening animation ---------- */
.splash {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center;
  background: var(--bg); color: var(--ink);
  animation: splash-out .5s ease 2.8s forwards; /* whole intro ≈ 3.3 s, shutter included */
}
.splash-in { display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 2vw, 22px); }
.sp-pov {
  display: block; width: clamp(180px, 30vw, 380px); height: auto; aspect-ratio: 1936 / 720; color: var(--ink);
  animation: fade-in .8s ease-out .35s both; /* a short pause, then the logo fades in; the byline follows */
}
.sp-by {
  color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.25rem);
  animation: rise-in .7s cubic-bezier(.2,.7,.2,1) 1s both;
}
.sp-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; } /* the whole screen flashes */
.sp-seams { fill: none; stroke: var(--bg); stroke-width: 9; stroke-linecap: round; }
.sp-pov { transform-origin: 50% 50%; }
@keyframes rise-in { from { opacity: 0; transform: translateY(-22px); } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
/* Photos wait under the splash, then drop into place (see animateTiles in app.js) */
html.pre-enter #gallery .tile { opacity: 0; }

/* ---------- Overlays ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 300; max-width: min(520px, calc(100vw - 32px));
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 0.9rem;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.35);
}

/* ---------- Tablet: viewer stacks image above details ---------- */
@media (min-width: 641px) and (max-width: 900px) {
  .viewer.open { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .v-stage { height: 68dvh; }
  .v-info { height: auto; overflow: visible; border-left: 0; border-top: 1px solid var(--v-line); padding: 28px 24px 56px; }
  .v-prev { left: 8px; }
  .v-next { right: 8px; }
}

/* ---------- Mobile: Instagram-like profile grid ---------- */
@media (max-width: 640px) {
  :root { --bar-h: 52px; }
  .bar { justify-content: center; }
  .bar .actions { position: absolute; right: var(--pad); top: env(safe-area-inset-top); height: var(--bar-h); }
  .brand .logo { height: 18px; }
  .bar .btn .label { display: none; }
  .bar .btn.primary { width: 36px; padding: 0; justify-content: center; }
  .intro { padding-top: 20px; padding-bottom: 24px; }
  .intro h1 { font-size: clamp(2.3rem, 11vw, 3rem); }
  .intro .lede { margin-top: 0.9rem; font-size: 1.02rem; }
  .intro .byline { font-size: 0.9rem; }
  .tabs { gap: 0; padding: 0; }
  .tab { flex: 1; justify-content: center; gap: 6px; font-size: 0.9rem; }
  .tab-browse { margin-left: 0; }
  .scope { padding: 12px 12px 4px; }
  .browse-foot { padding-left: 16px; padding-right: 16px; }
  .browse-foot .btn { justify-content: center; white-space: nowrap; }
  .browse-foot .btn.primary { flex: 1; }
  .trips { padding: 12px 12px 72px; }
  .trip-cards { grid-template-columns: 1fr 1fr; gap: 16px 10px; }
  .trip-meta strong { font-size: 0.95rem; }
  .trip-meta small { font-size: 0.8rem; }
  .trip-head { padding: 14px 16px; }
  .trip-map { margin: 0 0 2px; border-radius: 0; height: 260px; }
  .browse { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 85dvh; }
  .gallery { padding: 0 0 72px; }
  .year + .year { margin-top: 2px; }
  .year-h { padding: 10px 12px 6px; font-size: 0.8rem; }
  .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
  .grid .tile { aspect-ratio: 3 / 4; border-radius: 0; }
  .grid .cap { display: none; }
  .grid .multi { top: 6px; right: 6px; width: 18px; height: 18px; }
  .map-wrap { margin: 0; border-radius: 0; height: calc(100dvh - var(--bar-h) - var(--tabs-h) - env(safe-area-inset-top)); }
}

@media (prefers-reduced-motion: reduce) {
  .splash { display: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
