:root {
  --forest: #3e6247;        /* the green of the points and the button */
  --forest-deep: #22352a;   /* the ink of the panel */
  --cream: #fbf8ec;         /* discs, labels and panel */
  --cream-line: rgba(34, 53, 42, 0.12);
  --copper: #b9783f;        /* the one accent: the kind of place */
  --night: #0f1712;         /* behind the map */
  --spot: clamp(30px, min(4vw, 6.4vh), 50px);
  --serif: 'Fraunces Variable', Georgia, serif;
  --sans: 'Mona Sans Variable', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--night);
  overflow: hidden;
}

body {
  font-family: var(--sans);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  background: var(--night);
}

.stage.is-dragging { cursor: grabbing; }

/* the map: one element moved by GSAP (x, y), its photo and its points inside */
.map {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.map__photo {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.map__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.04) brightness(0.94);
}

.map__ext {
  position: absolute;
  background-image: url('mappa.webp');
  filter: saturate(0.92) contrast(1.04) brightness(0.94);
}

.map__ext--r {
  left: calc(100% - 1px);
  top: 0;
  width: 50%;
  height: 100%;
  background-size: 200% 100%;
  background-position: right center;
  transform: scaleX(-1);
}

.map__ext--b {
  left: 0;
  top: calc(100% - 1px);
  width: 100%;
  height: 50%;
  background-size: 100% 200%;
  background-position: center bottom;
  transform: scaleY(-1);
}

.map__spots {
  position: absolute;
  inset: 0;
}

/* a point of interest: the button stays still, its child scales */
.spot {
  position: absolute;
  width: var(--spot);
  height: var(--spot);
  margin: calc(var(--spot) / -2) 0 0 calc(var(--spot) / -2);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.spot:focus-visible { outline: none; }
.spot:focus-visible .spot__disc { box-shadow: 0 0 0 2px var(--forest), 0 0 0 4px var(--cream); }

.spot__scale {
  position: absolute;
  inset: 0;
  transform: scale(0);
}

.spot__halo {
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 248, 236, 0.28) 0%, rgba(251, 248, 236, 0) 62%);
  opacity: 0;
}

.spot__disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffffff 0%, var(--cream) 46%, #ece7d2 100%);
  box-shadow:
    0 1px 1px rgba(10, 18, 12, 0.22),
    0 4px 10px -2px rgba(10, 18, 12, 0.38),
    0 14px 26px -10px rgba(10, 18, 12, 0.5);
}

/* the lens: the ground under the point, blurred and a little grey, clipped to a circle that opens */
.spot__lens {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  clip-path: circle(calc(var(--a, 0) * 47.5%) at 50% 50%);
}

.spot__ground {
  position: absolute;
  left: 0;
  top: 0;
  background-image: url('mappa.webp');
  background-size: 100% 100%;
  filter: blur(var(--blur, 5px)) saturate(0.78) brightness(1.04);
  transform-origin: 0 0;
}

.spot__grey {
  position: absolute;
  inset: 0;
  background: rgb(51, 51, 51);
  opacity: var(--grey, 0.2);
  mix-blend-mode: normal;
}

.spot__glass {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, 0.28) 100%);
}

.spot__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20%;
  height: 20%;
  margin: -10% 0 0 -10%;
  border-radius: 50%;
  background: var(--forest);
}

/* the clouds' shadows: soft dark shapes that drift over the map, the points and the lenses */
.shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  mix-blend-mode: multiply;
}

.shade__cloud {
  position: absolute;
  left: 0;
  top: 0;
  width: 60vmax;
  height: 38vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(14, 26, 18, 0.5), rgba(14, 26, 18, 0.22) 55%, rgba(14, 26, 18, 0) 100%);
  filter: blur(14px);
  will-change: transform;
}

.mist {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.mist__puff {
  position: absolute;
  width: 46vmax;
  height: 30vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(250, 250, 245, 0.62), rgba(250, 250, 245, 0.2) 55%, rgba(250, 250, 245, 0) 100%);
  filter: blur(10px);
}

.mist__puff--a { right: -20vmax; top: -16vmax; }
.mist__puff--b { left: -22vmax; bottom: -18vmax; }

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(8, 14, 10, 0.55), rgba(8, 14, 10, 0) 22%),
    linear-gradient(to top, rgba(8, 14, 10, 0.4), rgba(8, 14, 10, 0) 24%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.32) 100%);
}

/* the head */
.head {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  justify-content: center;
  padding: clamp(12px, 3vh, 26px) clamp(14px, 3vw, 30px);
  pointer-events: none;
}

.brand {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: var(--cream);
}

.brand__mark {
  width: clamp(16px, 2.6vh, 22px);
  height: clamp(16px, 2.6vh, 22px);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand__name {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 40;
  font-size: clamp(17px, min(2.4vw, 3.6vh), 24px);
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand__sub {
  font-size: clamp(7px, 1.2vh, 9px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-variation-settings: 'wdth' 110;
  font-weight: 500;
  opacity: 0.8;
}

.enquire {
  position: absolute;
  right: clamp(14px, 3vw, 30px);
  top: clamp(14px, 3.4vh, 30px);
  pointer-events: auto;
  color: var(--cream);
  text-decoration: none;
  font-size: clamp(9px, 1.4vh, 11px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 560;
  padding: 0.9em 1.3em 0.85em;
  border-radius: 999px;
  border: 1px solid rgba(251, 248, 236, 0.32);
  background: rgba(20, 32, 24, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.4s cubic-bezier(.19, 1, .22, 1), border-color 0.4s cubic-bezier(.19, 1, .22, 1);
}

@media (hover: hover) {
  .enquire:hover { background: rgba(251, 248, 236, 0.16); border-color: rgba(251, 248, 236, 0.6); }
}

.compass {
  position: absolute;
  left: clamp(14px, 3vw, 30px);
  bottom: clamp(14px, 3.4vh, 30px);
  width: clamp(34px, 6vh, 46px);
  height: clamp(34px, 6vh, 46px);
  pointer-events: none;
}

.compass svg { width: 100%; height: 100%; overflow: visible; }
.compass__ring { fill: rgba(20, 32, 24, 0.3); stroke: rgba(251, 248, 236, 0.5); stroke-width: 1; }
.compass__n { fill: var(--cream); }
.compass__s { fill: rgba(251, 248, 236, 0.35); }
.compass__letter { fill: var(--cream); font-size: 6.4px; font-weight: 600; letter-spacing: 0.05em; font-family: var(--sans); }

.hint {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 3.4vh, 30px);
  transform: translateX(-50%);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.85em 1.3em 0.8em 1em;
  border-radius: 999px;
  background: var(--cream);
  color: var(--forest-deep);
  font-size: clamp(9px, 1.45vh, 11px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 560;
  white-space: nowrap;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.hint svg { width: 1.5em; height: 1.5em; fill: none; stroke: var(--forest); stroke-width: 1.4; }

/* the label next to a point under the pointer */
.tag {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  gap: 3px;
  padding: 0.75em 1em 0.7em;
  border-radius: 6px;
  background: var(--cream);
  color: var(--forest-deep);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12), 0 12px 26px -12px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  will-change: transform, opacity;
}

.tag__arrow {
  position: absolute;
  top: 50%;
  left: -4px;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  background: var(--cream);
  transform: rotate(45deg);
  border-radius: 1px;
}

.tag.is-left .tag__arrow { left: auto; right: -4px; }

.tag__kind {
  font-size: clamp(7px, 1.2vh, 9px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--copper);
}

.tag__name {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 24;
  font-size: clamp(13px, 2.1vh, 16px);
  line-height: 1.05;
}

/* the side panel: two masks moving in opposite directions */
.panel {
  position: absolute;
  top: clamp(12px, 2.6vh, 22px);
  right: clamp(12px, 2.6vh, 22px);
  width: min(360px, 38vw);
  max-height: calc(100% - 2 * clamp(12px, 2.6vh, 22px));
  overflow: hidden;
  border-radius: 14px;
  background: var(--cream);
  color: var(--forest-deep);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 2px 4px rgba(0, 0, 0, 0.12),
    0 30px 60px -24px rgba(0, 0, 0, 0.7);
  visibility: hidden;
  cursor: auto;
}

.panel__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.8vh, 16px);
  padding: clamp(16px, 3vh, 28px) clamp(16px, 2.2vw, 26px);
  overflow: hidden;
}

.panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel__kind {
  font-size: clamp(8px, 1.3vh, 10px);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--copper);
}

.close {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--cream-line);
  background: transparent;
  color: var(--forest-deep);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.35s cubic-bezier(.19, 1, .22, 1), transform 0.5s cubic-bezier(.19, 1, .22, 1);
}

.close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

@media (hover: hover) {
  .close:hover { background: rgba(34, 53, 42, 0.07); transform: rotate(90deg); }
}

.panel__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 380;
  font-variation-settings: 'opsz' 72;
  font-size: clamp(22px, min(3vw, 4.6vh), 38px);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.panel__text {
  margin: 0;
  font-size: clamp(11px, 1.75vh, 14px);
  line-height: 1.5;
  color: rgba(34, 53, 42, 0.78);
  max-width: 34ch;
}

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--cream-line);
  border-bottom: 1px solid var(--cream-line);
}

.facts div {
  padding: clamp(7px, 1.4vh, 12px) 0 clamp(7px, 1.4vh, 12px) 10px;
  border-left: 1px solid var(--cream-line);
}

.facts div:first-child { border-left: 0; padding-left: 0; }

.facts dt {
  font-size: clamp(7px, 1.15vh, 9px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(34, 53, 42, 0.5);
}

.facts dd {
  margin: 3px 0 0;
  font-family: var(--serif);
  font-variation-settings: 'opsz' 24;
  font-size: clamp(13px, 2vh, 17px);
}

.details { display: grid; }

.detail {
  border-bottom: 1px solid var(--cream-line);
}

.detail__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(7px, 1.4vh, 11px) 0;
  border: 0;
  background: none;
  color: var(--forest-deep);
  font: inherit;
  font-size: clamp(11px, 1.7vh, 13px);
  font-weight: 540;
  cursor: pointer;
  text-align: left;
}

.detail__icon {
  position: relative;
  width: 11px;
  height: 11px;
}

.detail__icon::before,
.detail__icon::after {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 11px;
  height: 1.2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.6s cubic-bezier(.19, 1, .22, 1);
}

.detail__icon::after { transform: rotate(90deg); }
.detail.is-open .detail__icon::after { transform: rotate(0deg); }

.detail__body {
  height: 0;
  overflow: hidden;
}

.detail__body p {
  margin: 0;
  padding: 0 0 clamp(8px, 1.6vh, 12px);
  font-size: clamp(10px, 1.6vh, 12.5px);
  line-height: 1.5;
  color: rgba(34, 53, 42, 0.72);
}

.book {
  margin-top: clamp(2px, 0.8vh, 8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.95em 1.2em 0.9em;
  border-radius: 999px;
  background: var(--forest);
  color: var(--cream);
  text-decoration: none;
  font-size: clamp(9px, 1.45vh, 11px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 560;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, 0 10px 20px -12px rgba(30, 50, 36, 0.9);
}

.book__words {
  position: relative;
  display: grid;
  overflow: hidden;
  height: 1.2em;
  line-height: 1.2em;
}

.book__words span {
  grid-area: 1 / 1;
  transition: transform 0.5s cubic-bezier(.19, 1, .22, 1);
}

.book__words span + span { transform: translateY(110%); }
.book__arrow { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s cubic-bezier(.19, 1, .22, 1); }

@media (hover: hover) {
  .book:hover .book__words span:first-child { transform: translateY(-110%); }
  .book:hover .book__words span + span { transform: translateY(0); }
  .book:hover .book__arrow { transform: translateX(3px); }
}

/* low and narrow boxes (the phone): the panel comes up from the bottom, the long details stay hidden */
.stage.is-low .panel {
  top: auto;
  left: 10px;
  right: 10px;
  bottom: 10px;
  width: auto;
  max-height: 64%;
}

.stage.is-low .panel__inner { gap: 8px; padding: 14px 16px; }
.stage.is-low .details { display: none; }
.stage.is-low .panel__text { max-width: none; }
.stage.is-low .compass { display: none; }
.stage.is-low .enquire { display: none; }
.stage.is-low .facts dd { font-size: 13px; }

/* the drawn pointer of the autopilot */
.pointer {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.pointer svg { width: 100%; height: 100%; fill: var(--cream); stroke: var(--forest-deep); stroke-width: 1.2; stroke-linejoin: round; }

@media (prefers-reduced-motion: reduce) {
  .book__words span, .book__arrow, .close, .detail__icon::after { transition: none; }
}
