/* kl-map.css: "Where we're based" 3D map of central Kuala Lumpur (pairs with js/kl-map.js) */
.kl-map {
  --kl-bg: #0f1118;
  --kl-purple: #7c4dff;
  --kl-lilac: #b8a2ff;
  --kl-ink: #ffffff;
  --kl-muted: #a3a9bf;
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 300px;
  max-height: 560px;
  overflow: hidden;
  border-radius: 24px;
  background: radial-gradient(ellipse at 50% 70%, #1c1f33 0%, var(--kl-bg) 70%);
  border: 1px solid rgba(124, 77, 255, 0.35);
  box-shadow: 0 24px 60px rgba(15, 17, 24, 0.35), 0 0 40px rgba(124, 77, 255, 0.12);
  font-family: var(--pp-font-body, "Satoshi", system-ui, sans-serif);
  color: var(--kl-ink);
}
@media (max-width: 700px) {
  .kl-map { aspect-ratio: 4 / 5; max-height: 640px; border-radius: 18px; }
}
.kl-map__canvas,
.kl-map__fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.kl-map__canvas { cursor: grab; touch-action: pan-y; outline: none; opacity: 0; transition: opacity 0.6s ease; }
.kl-map--ready .kl-map__canvas { opacity: 1; }
.kl-map--dragging .kl-map__canvas { cursor: grabbing; }
.kl-map__canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--kl-lilac); }

.kl-map__ui { position: absolute; inset: 0; pointer-events: none; }
.kl-map__caption {
  position: absolute;
  left: clamp(16px, 3vw, 28px);
  top: clamp(16px, 3vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 20px 16px;
  border-radius: 18px;
  background: rgba(27, 31, 42, 0.82);
  border: 1px solid rgba(124, 77, 255, 0.55);
  backdrop-filter: blur(6px);
}
.kl-map__kicker { font-weight: 700; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--kl-lilac); }
.kl-map__title {
  font-family: var(--pp-font-display, "Clash Display", "Satoshi", system-ui, sans-serif);
  font-weight: 600;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.kl-map__labels { position: absolute; inset: 0; }
.kl-map__label { /* anchored at a landmark's top by js */
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  will-change: transform;
}
.kl-map__label.is-on { opacity: 1; }
.kl-map__label i {
  position: absolute;
  left: -1px;
  bottom: 0;
  width: 2px;
  height: 26px;
  background: linear-gradient(0deg, rgba(184, 162, 255, 0), rgba(184, 162, 255, 0.9));
}
.kl-map__label b {
  position: absolute;
  left: -14px;
  bottom: 26px;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 700;
  font-size: 13px;
  background: rgba(15, 17, 24, 0.86);
  border: 1px solid rgba(184, 162, 255, 0.75);
}

.kl-map__hint {
  position: absolute;
  left: clamp(16px, 3vw, 28px);
  bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--kl-muted);
  background: rgba(15, 17, 24, 0.7);
  transition: opacity 0.4s ease;
}
.kl-map--touched .kl-map__hint,
.kl-map--static .kl-map__hint { opacity: 0; }
.kl-map__credit {
  position: absolute;
  right: 12px;
  bottom: 10px;
  pointer-events: auto;
  font-size: 11px;
  color: #c9cddb;
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(10, 12, 18, 0.65);
}
.kl-map__credit:hover { color: #fff; text-decoration: underline; }

.kl-map--loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 3px solid rgba(184, 162, 255, 0.25);
  border-top-color: var(--kl-lilac);
  animation: kl-spin 0.9s linear infinite;
}
@keyframes kl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .kl-map--loading::after { animation: none; }
}
@media (max-width: 700px) {
  .kl-map__caption { left: 12px; top: 12px; padding: 9px 13px 10px; gap: 3px; border-radius: 14px; }
  .kl-map__kicker { font-size: 10px; }
  .kl-map__title { font-size: 19px; }
}

/* =====================================================================
   Contact ("Book me"): map, calendar and contact buttons as one piece.
   The map is the stage; the calendar and the Book-me buttons float over
   its lower edge as glass panels, with the city still visible (and
   draggable) above and between them. Phones: the map is a band at the
   top and the panels rise up over its bottom edge.
   Note: no backdrop-filter/transform on .book-grid itself, because the
   date pop-up (.book-pop, position: fixed) lives inside it.
   ===================================================================== */
.book-banner .kl-map::before { /* soft fade under the panels so they read cleanly */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 62%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(12, 13, 20, 0.92) 0%, rgba(12, 13, 20, 0.55) 45%, rgba(12, 13, 20, 0) 100%);
}
.book-banner .book-grid { position: relative; z-index: 2; }
.book-banner .book-cal,
.book-banner .book-actions {
  background: rgba(20, 22, 32, 0.76);
  border: 1px solid rgba(184, 162, 255, 0.28);
  border-radius: 20px;
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 26px 60px -24px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.book-banner .book-actions {
  padding: 1.15rem 1.15rem 1rem;
  justify-content: flex-start;
  gap: 0.7rem;
}
.book-banner .book-actions-title {
  text-align: left;
  margin: 0 0 0.15rem;
  color: #c3b2ff;
}
.book-banner .book-meta { margin: 0.2rem 0 0; text-align: left; font-size: 0.85rem; opacity: 0.8; }

@media (min-width: 861px) {
  /* One stage: calendar as a glass sidebar on the left, the city in the open area to the right,
     the Book-me buttons floating bottom-right. The stage is as tall as the calendar needs. */
  .book-banner .book-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "text" "stage";
  }
  .book-banner .book-text { grid-area: text; }
  .book-banner .kl-map {
    grid-area: stage;
    align-self: stretch;
    aspect-ratio: auto;
    height: auto;
    min-height: 640px;
    max-height: none;
    --kl-cal-w: min(470px, 42%);
    --kl-shift-x: -0.17; /* centre the skyline in the open area right of the calendar */
    --kl-shift-y: -0.13; /* and lower, so the tower tops clear the caption */
    --kl-sway: 8; /* narrower idle swing, so the towers stay in the open area */
  }
  .book-banner .kl-map::before { /* fade behind the calendar sidebar and under the Book-me panel */
    top: 0; height: auto;
    background:
      linear-gradient(to right, rgba(12, 13, 20, 0.9) 0%, rgba(12, 13, 20, 0.6) 34%, rgba(12, 13, 20, 0) 52%),
      linear-gradient(to top, rgba(12, 13, 20, 0.7) 0%, rgba(12, 13, 20, 0) 40%);
  }
  .book-banner .kl-map__caption { left: calc(var(--kl-cal-w) + clamp(32px, 3.5vw, 44px)); }
  .book-banner .book-grid {
    grid-area: stage;
    grid-template-columns: min(470px, 42%) minmax(0, 1fr) minmax(0, 330px);
    grid-template-rows: 1fr auto;
    grid-template-areas: "cal . ." "cal . act";
    gap: 1.25rem;
    padding: clamp(16px, 1.6vw, 20px);
    pointer-events: none; /* the open area lets you drag the map */
  }
  .book-banner .book-cal { grid-area: cal; pointer-events: auto; }
  .book-banner .book-actions { grid-area: act; pointer-events: auto; align-self: end; }
}

@media (max-width: 860px) {
  .book-banner .kl-map {
    aspect-ratio: auto;
    height: clamp(380px, 60vh, 480px);
    max-height: none;
    --kl-shift-y: 0.08;
  }
  .book-banner .kl-map::before { height: 45%; }
  .book-banner .book-grid { margin: -96px 0 0; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
  /* let the seven day columns shrink to the phone's width (they would hold the panel at ~350px) */
  .book-banner .book-cal { min-width: 0; padding-left: 0.6rem; padding-right: 0.6rem; }
  .book-banner .book-cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .book-banner .book-cal-grid > * { min-width: 0; overflow: hidden; }
}

/* Fireworks button ("Light up KL"), top-right of the map; icon only on small screens */
.kl-map__fx {
  position: absolute;
  top: clamp(16px, 3vw, 26px);
  right: clamp(16px, 3vw, 26px);
  z-index: 2;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 15px 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 87, 0.55);
  background: rgba(27, 31, 42, 0.82);
  color: #fff;
  font: 700 13px/1 var(--pp-font-body, "Satoshi", system-ui, sans-serif);
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 0 22px rgba(255, 200, 87, 0.16);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.kl-map__fx svg { width: 18px; height: 18px; color: #ffc857; flex: none; }
.kl-map__fx:hover { background: rgba(124, 77, 255, 0.55); border-color: #ffc857; box-shadow: 0 0 28px rgba(255, 200, 87, 0.35); }
.kl-map__fx:focus-visible { outline: 3px solid var(--kl-lilac); outline-offset: 3px; }
.kl-map__fx .kl-fx-burst { transform-origin: 15px 9px; transform-box: view-box; }
.kl-map--fx .kl-map__fx .kl-fx-burst { animation: klFxPop 0.9s ease-out infinite; }
@keyframes klFxPop { 0% { transform: scale(0.4); opacity: 0.4; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: 0.85; } }
.kl-map--static .kl-map__fx { display: none; } /* no 3D: no show */
@media (max-width: 700px) {
  .kl-map__fx { padding: 8px; min-width: 40px; justify-content: center; top: 12px; right: 12px; }
  .kl-map__fx span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .kl-map--fx .kl-map__fx .kl-fx-burst { animation: none; } }
