:root {
  --paper: #fbf7ef;
  --ink: #2b2620;
  --muted: #6e6455;
  --line: #d9cfbd;
  --accent: #c2462e;
  --font: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); overscroll-behavior: none; }
#map { position: fixed; inset: 0; }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
[hidden] { display: none !important; }
a { color: var(--accent); }

.panel {
  position: fixed; z-index: 1000; background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .15);
}

/* Cream to match the wordmark image, so the image sits seamlessly in the box. */
.intro {
  top: max(12px, env(safe-area-inset-top)); left: 12px; width: min(360px, calc(100vw - 24px)); padding: 6px 6px 8px;
  background: #f8efdd;
}
/* iPhone Safari sizes an image in <summary> by its natural 1024px unless everything around it is told to shrink. */
.intro details, .intro summary { display: block; width: 100%; min-width: 0; }
.intro:has(details[open]) { z-index: 1002; } /* open "about" sits in front of the photo panel */
.intro summary { list-style: none; cursor: pointer; }
.intro summary::-webkit-details-marker { display: none; }
.intro .title { display: block; width: 100%; max-width: 100%; height: auto; }
.intro .sub { display: block; padding: 4px 8px 0; font-size: .85rem; color: var(--muted); }
.intro .sub::after { content: " · about"; color: var(--accent); }
.intro details[open] .sub::after { content: ""; }
.intro p { font-size: .9rem; line-height: 1.45; margin: .7em 8px 0; }

.submit-btn {
  position: fixed; z-index: 1000; left: 50%; transform: translateX(-50%);
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 8px));
  padding: 14px 22px; border-radius: 26px; white-space: nowrap;
  background: var(--accent); color: #fff; text-decoration: none; font-size: 1rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.sheet-open .submit-btn { display: none; }
.sheet-full .intro { display: none; } /* the expanded sheet gets the whole screen */

.pin {
  background: var(--accent); border: 3px solid var(--paper); border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .4); transition: transform .2s;
  color: #fff; font: bold 13px/26px -apple-system, system-ui, sans-serif; text-align: center;
}
.pin.empty { background: #9a9184; } /* a place that still needs a vision */
.pin.active { transform: scale(1.3); background: var(--ink); }
.pin.cluster { line-height: 34px; font-size: 14px; box-shadow: 0 0 0 5px rgba(194, 70, 46, .3), 0 1px 5px rgba(0, 0, 0, .4); }

/* Phones: a tall sheet parked low so the photo and title peek up; script slides it with transform. */
#sheet { position: fixed; z-index: 1001; left: 0; right: 0; bottom: 0; }
.card {
  position: fixed; left: 0; right: 0; bottom: 0; height: 92dvh; overflow: hidden;
  background: var(--paper); border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .2);
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  touch-action: none; overscroll-behavior: contain;
}
.card.expanded { overflow-y: auto; touch-action: pan-y; }
.card.dragging { transition: none; }
.grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto; position: relative; top: 8px; }
.card > .grip { position: absolute; left: 0; right: 0; z-index: 2; background: rgba(255, 255, 255, .8); }
.close {
  position: absolute; z-index: 2; top: 12px; right: 12px; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}

.body { padding: 4px 16px 12px; }
.body h2 { font-size: 1.35rem; margin: 6px 0 4px; font-weight: normal; font-style: italic; }
.body h3 { font: 600 .75rem -apple-system, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.body p { margin: 0; font-size: 1rem; line-height: 1.5; white-space: pre-line; }
.body .note { color: var(--muted); }
.vision .vtitle { font-style: italic; font-size: 1.1rem; margin-bottom: 4px; }
.vision .vtitle:empty { display: none; }
.flip { display: flex; align-items: center; margin-left: auto; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.flip[hidden] { display: none; }
.actions .flip button { border: 0; background: none; min-width: 40px; padding: 8px 12px; font-size: 1.2rem; line-height: 1; }
.flip .pos { font: .9rem -apple-system, system-ui, sans-serif; font-variant-numeric: tabular-nums; min-width: 2.5em; text-align: center; }
.vision .credit { margin-top: 8px; font-size: .88rem; font-style: italic; color: var(--muted); }

.actions { display: flex; gap: 8px; margin: 12px 0 6px; }
.actions button {
  font: inherit; font-size: .95rem; min-height: 40px; padding: 8px 16px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.like .heart { color: var(--line); font-size: 1.1rem; transition: color .15s, transform .15s; display: inline-block; }
.like[aria-pressed="true"] .heart { color: var(--accent); transform: scale(1.15); }

.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid button { all: unset; display: grid; gap: 2px; cursor: pointer; width: 100%; }
.grid .pic { position: relative; display: block; }
.grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #e6dfd2; }
.grid .n {
  position: absolute; top: 6px; right: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--accent); color: #fff; font: bold 12px/22px -apple-system, system-ui, sans-serif; text-align: center;
}
.grid .t { font-size: .8rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.grid .d { font: .72rem -apple-system, system-ui, sans-serif; color: var(--muted); }
.suggest form { display: grid; gap: 8px; }
.suggest textarea {
  font: inherit; font-size: 1rem; padding: 10px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); width: 100%; box-sizing: border-box; resize: vertical;
}
.suggest button {
  justify-self: start; font: inherit; font-size: .95rem; min-height: 40px; padding: 8px 18px; border-radius: 20px;
  border: 0; background: var(--accent); color: #fff; cursor: pointer;
}
.suggest button:disabled { opacity: .5; }
.suggest .thanks { color: var(--muted); }
.suggest [hidden] { display: none; }
.empty .lead { font-style: italic; font-size: 1.15rem; margin-top: 14px; }
.empty .credit { font-size: .88rem; font-style: italic; color: var(--muted); }
.reimagine {
  display: block; width: 100%; margin-top: 16px; min-height: 44px; padding: 10px 18px; border-radius: 22px; cursor: pointer;
  font: inherit; font-size: 1rem; border: 1px solid var(--accent); background: #fff; color: var(--accent);
}
.reimagine.primary { background: var(--accent); color: #fff; }
.grid .n.empty { background: #9a9184; font-weight: normal; }

/* "Reimagine this place": a bottom sheet on phones, a small box on wider screens. */
dialog.grab {
  border: 0; padding: 20px 16px max(20px, env(safe-area-inset-bottom)); width: 100%; max-width: 420px;
  margin: auto auto 0; border-radius: 18px 18px 0 0; background: var(--paper); color: var(--ink);
  display: grid; gap: 10px; font-family: var(--font);
}
dialog.grab:not([open]) { display: none; }
dialog.grab::backdrop { background: rgba(0, 0, 0, .4); }
dialog.grab h3 { margin: 0; font-size: 1.2rem; font-style: italic; font-weight: normal; }
dialog.grab p { margin: 0 0 6px; font-size: .95rem; line-height: 1.45; color: var(--muted); }
dialog.grab button, dialog.grab .button {
  display: block; width: 100%; min-height: 46px; padding: 12px; border-radius: 23px; cursor: pointer; box-sizing: border-box;
  font: inherit; font-size: 1rem; text-align: center; text-decoration: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
}
dialog.grab .go { background: var(--accent); border-color: var(--accent); color: #fff; }
dialog.grab form { margin: 0; }
dialog.grab .cancel { border: 0; background: none; color: var(--muted); }
@media (min-width: 760px) { dialog.grab { margin: auto; border-radius: 14px; } }

.banner {
  left: 12px; right: 12px; margin: 0 auto; max-width: 420px; display: flex; align-items: center; gap: 8px; padding: 10px 6px 10px 14px;
  bottom: max(84px, calc(env(safe-area-inset-bottom) + 72px)); font-size: .95rem; line-height: 1.35;
}
.banner a { flex: 1; text-decoration: none; }
.banner .x { border: 0; background: none; font-size: 22px; line-height: 1; min-width: 40px; min-height: 40px; color: var(--muted); cursor: pointer; }
.sheet-open .banner { display: none; }
.submit-link { display: block; margin: 18px 0 4px; text-align: center; font-size: .95rem; }

.toast {
  position: fixed; z-index: 1100; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 20px; font-size: .9rem;
}

@property --pos { syntax: "<percentage>"; inherits: true; initial-value: 50%; }

/* Before/after slider: "before" sits on top, clipped to the left of --pos. Drag or tap anywhere on the photo. */
.compare {
  --pos: 50%; position: relative; overflow: hidden; background: #ddd; cursor: ew-resize;
  border-radius: 18px 18px 0 0; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.compare img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.compare .before { position: absolute; inset: 0; height: 100%; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare .divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px;
  background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .5); pointer-events: none;
}
.compare .divider::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--ink);
  display: grid; place-items: center; font-size: 20px; font-weight: bold; letter-spacing: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
.compare.animate { transition: --pos .35s ease; }
/* A place with no vision yet: just the Now photo. */
.compare.solo { cursor: default; }
.compare.solo .before { position: relative; clip-path: none; }
.compare.solo .after, .compare.solo .divider, .compare.solo .tag.right { display: none; }
.compare .tag {
  position: absolute; bottom: 10px; padding: 8px 12px; border-radius: 8px; font-size: .9rem;
  background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer;
}
.compare .tag.left { left: 10px; }
.compare .tag.right { right: 10px; }

/* Wider screens: a side panel instead of a bottom sheet. */
@media (min-width: 760px) {
  #sheet {
    inset: 16px 16px 16px auto; width: 440px; overflow-y: auto;
    border-radius: 14px; box-shadow: 0 4px 18px rgba(0, 0, 0, .2); background: var(--paper);
    transform: translateX(calc(100% + 24px)); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  }
  #sheet.open { transform: none; }
  .card {
    position: static; height: auto; overflow: visible; transform: none !important; transition: none;
    box-shadow: none; border-radius: 14px; touch-action: auto;
  }
  .card > .grip { display: none; }
  .compare { border-radius: 14px 14px 0 0; }
}
