:root {
  --ground: #f4f4f5;
  --app: #f7f7f5;
  --block: #ebebe6;
  --road: #ffffff;
  --road-edge: #e0e0da;
  --park: #e2edd8;
  --tree: #cfe1c0;
  --water: #dce8f2;
  --ink: #111113;
  --soft: #6b6b73;
  --faint: #a1a1aa;
  --line: rgba(17, 17, 19, 0.08);
  --accent: #2f6bff;
  --open: #15803d;
  --star: #f5a524;
  --shadow: 0 30px 60px -28px rgba(17, 17, 19, 0.3), 0 2px 6px rgba(17, 17, 19, 0.05);
  --card-shadow: 0 24px 50px -20px rgba(17, 17, 19, 0.35), 0 2px 8px rgba(17, 17, 19, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  height: 100vh;
  display: grid;
  place-items: center;
}

/* the app screen */
.app {
  position: relative;
  width: min(94vw, 600px);
  height: min(92vh, 420px);
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--app);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}

.map {
  position: absolute;
  inset: -12%;
  will-change: transform;
}

.map__svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.m-ground { fill: var(--app); }
.m-water { fill: var(--water); }
.m-bank { fill: none; stroke: #cddcea; stroke-width: 1; }
.m-blocks rect { fill: var(--block); }
.m-park { fill: var(--park); }
.m-trees circle { fill: var(--tree); }
.m-path { fill: none; stroke: #f4f8ef; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1 5; }
.m-roads path { fill: none; stroke: var(--road-edge); stroke-width: 11; stroke-linecap: round; }
.m-roads.m-roads-in path { stroke: var(--road); stroke-width: 8.4; }
.m-names text {
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  font-size: 6.4px;
  font-weight: 520;
  letter-spacing: 0.02em;
  fill: #9a9a92;
}
.m-you path { fill: var(--accent); stroke: #ffffff; stroke-width: 1.8; stroke-linejoin: round; }

.veil {
  position: absolute; inset: 0;
  background: var(--app);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.route {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}
.route__line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linecap: butt;
  stroke-linejoin: round;
  opacity: 0;
}

/* the pins: GSAP moves the button, CSS draws the drop on its child */
.pin {
  position: absolute;
  z-index: 4;
  width: 34px; height: 34px;
  margin: -34px 0 0 -17px;
  border: 0;
  background: none;
  cursor: pointer;
  transform-origin: 50% 100%;
  -webkit-tap-highlight-color: transparent;
}

.pin__shape {
  position: absolute;
  left: 2px; top: 0;
  width: 30px; height: 30px;
  border-radius: 50% 50% 50% 4px;
  background: var(--ink);
  transform: rotate(-45deg);
  box-shadow: 0 8px 14px -6px rgba(17, 17, 19, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: background-color 0.25s ease;
}

.pin__body {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  transform: rotate(45deg);
}

.pin__body svg {
  width: 15px; height: 15px;
  fill: none; stroke: #ffffff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

.pin__name {
  position: absolute;
  left: 50%; top: calc(100% + 6px);
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.08);
}

.pin.is-on .pin__shape { background: var(--accent); }
.pin.is-on .pin__name { display: none; }

@media (hover: hover) {
  .pin:hover .pin__shape { background: #2a2a30; }
}

/* the bar on top of the map */
.top {
  position: absolute;
  z-index: 6;
  left: 12px; right: 12px; top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.brand {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 660; letter-spacing: -0.01em;
  padding: 8px 11px 8px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 3px rgba(17, 17, 19, 0.08), 0 0 0 1px var(--line);
}

.search {
  flex: 1;
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--soft);
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 3px rgba(17, 17, 19, 0.08), 0 0 0 1px var(--line);
  white-space: nowrap; overflow: hidden;
}

.brand svg, .search svg {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.brand svg { color: var(--accent); }

/* the card: its box is animated in pixels, its content keeps the final size and is cropped */
.place {
  position: absolute;
  z-index: 7;
  left: 0; top: 0;
  width: 0; height: 0;
  border-radius: 17px;
  background: var(--ink);
  overflow: hidden;
  visibility: hidden;
  box-shadow: var(--card-shadow);
}

.place__in {
  position: absolute;
  left: 0; top: 0;
  display: flex;
  gap: 14px;
  padding: 12px;
  opacity: 0;
}

.place__photo {
  position: relative;
  flex: none;
  width: 36%;
  border-radius: 11px;
  overflow: hidden;
  background: #e8e6e1;
}

.place__photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
}
.place__photo img.is-on { opacity: 1; }
/* a thin inner edge and a soft top light, like a print under glass */
.place__photo::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(15, 20, 30, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 40%);
}

.place__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding-right: 22px;
}

.place__kind { font-size: 11.5px; color: var(--soft); font-weight: 520; }
.place__name {
  font-size: clamp(17px, 2.8vw, 22px);
  font-weight: 680;
  font-stretch: 96%;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.place__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  font-size: 12px; color: var(--soft);
}
.place__meta b { color: var(--ink); font-weight: 640; }
.star { width: 13px; height: 13px; fill: var(--star); }
.sep { width: 1px; height: 11px; background: var(--line); margin: 0 4px; }
.open { color: var(--open); font-weight: 620; }

.place__do { display: flex; gap: 8px; margin-top: 6px; }

.go {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 15px 0 12px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: #ffffff;
  font: 620 12.5px/1 "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: 0 6px 14px -6px rgba(47, 107, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.go svg { width: 14px; height: 14px; fill: #ffffff; stroke: #ffffff; stroke-width: 1.4; stroke-linejoin: round; }

.save {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
}
.save svg { width: 15px; height: 15px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.save.is-on svg { fill: var(--ink); }

.close {
  position: absolute;
  right: 10px; top: 10px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(17, 17, 19, 0.05);
  cursor: pointer;
}
.close svg { width: 13px; height: 13px; fill: none; stroke: var(--soft); stroke-width: 1.8; stroke-linecap: round; }

@media (hover: hover) {
  .go:hover { filter: brightness(1.06); }
  .save:hover, .close:hover { background: #f4f4f5; }
}

.ghost {
  position: fixed; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: #111113; stroke: #ffffff; stroke-width: 1.4; stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  z-index: 9;
}

@media (max-width: 480px) {
  .app { border-radius: 18px; }
  .top { left: 9px; right: 9px; top: 9px; gap: 7px; }
  .brand { font-size: 0; gap: 0; padding: 8px; }
  .search { font-size: 11px; }
  .pin__name { font-size: 9.5px; padding: 2px 6px; }
  .place__in { gap: 10px; padding: 10px; }
  .place__text { gap: 4px; padding-right: 18px; }
  .place__kind, .place__meta { font-size: 10.5px; }
  .go { height: 30px; padding: 0 12px 0 10px; font-size: 11.5px; }
  .save { width: 30px; height: 30px; }
}
