/* HERO: the living town */
.hero {
  min-height: max(100svh, 720px); padding: calc(var(--head-h) + 8px) 0 32px; display: flex; align-items: center;
  background:
    radial-gradient(60% 70% at 72% 58%, rgba(11, 143, 227, .10), transparent 70%),
    radial-gradient(40% 40% at 88% 20%, rgba(244, 160, 28, .10), transparent 70%),
    linear-gradient(180deg, #e3ecf7 0%, var(--sky) 70%);
  overflow: clip;
}
.hero__grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.25fr); align-items: center; position: relative; z-index: 1; }
.hero__copy { position: relative; z-index: 2; padding-block: 24px; }
.hero__title { font-size: clamp(2.5rem, 4.7vw, 5.1rem); line-height: 1.0; letter-spacing: -0.03em; font-weight: 750; margin-bottom: 26px; }
.hero__title .hl { position: relative; z-index: 0; white-space: nowrap; }
.hero__title .hl::before { content: ""; position: absolute; z-index: -1; left: -.04em; right: -.06em; bottom: .04em; height: .3em; background: var(--lime); border-radius: 0 .16em 0 0; transform-origin: left center; transform: scaleX(var(--hl, 1)); }
.hero__lede { margin-bottom: 30px; }
.hero__ctas { margin-bottom: 34px; }

.hero__near {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center;
  padding: 16px 20px; background: var(--paper); border-radius: var(--r); box-shadow: 0 18px 40px -24px rgba(18, 26, 58, .35);
  max-width: 460px;
}
.hero__near-dot { grid-row: span 2; width: 46px; height: 46px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--near-c, var(--orange)); position: relative; transition: background-color .5s var(--ease); }
.hero__near-dot::after { content: ""; position: absolute; inset: 15px; border-radius: 50%; background: var(--paper); }
.hero__near-text { line-height: 1.35; min-height: 2.7em; display: block; }
.hero__near-text small { display: block; font-size: .8rem; font-weight: 700; color: var(--grey); letter-spacing: .02em; }
.hero__near-text strong { font-weight: 700; }
.hero__near-text [data-near-offer] { color: #3a4266; }
.hero__near-count { grid-column: 2; font-size: .92rem; color: var(--grey); }
.hero__near-count strong { color: var(--ink); font-weight: 800; }

/* the town */
.hero__town { position: relative; width: calc(100% + 11vw); margin: 0 -11vw 0 0; perspective: 1800px; }
.hero__copy { padding-right: 12px; }
.town-stage { position: relative; aspect-ratio: 1260 / 940; transform-style: preserve-3d; will-change: transform; }
.town-svg { width: 100%; height: 100%; overflow: visible; }
.town-pins { position: absolute; inset: 0; transform: translateZ(24px); transform-style: preserve-3d; pointer-events: none; }
.town-pins .pin { pointer-events: auto; }
.town-clouds { position: absolute; inset: 0; transform: translateZ(90px); pointer-events: none; }

.pin {
  --c: var(--orange);
  position: absolute; width: 46px; height: 58px; margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
  transform: translate(-50%, -100%); z-index: 1;
}
.pin--blue { --c: var(--blue); }
.pin--lime { --c: var(--lime-deep); }
.pin__head {
  position: absolute; left: 3px; top: 0; width: 40px; height: 40px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--c); box-shadow: 0 10px 18px -8px rgba(18, 26, 58, .55), inset 0 0 0 3px rgba(255,255,255,.9);
  display: grid; place-items: center; transition: transform .45s var(--ease);
}
.pin__head svg { width: 20px; height: 20px; transform: rotate(45deg); fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pin::before { /* shadow dot where the pin points */
  content: ""; position: absolute; left: 50%; bottom: 0; width: 18px; height: 6px; margin-left: -9px; border-radius: 50%; background: rgba(18, 26, 58, .25);
}
.pin::after { /* ripple */
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 44px; height: 18px; margin-left: -22px; border-radius: 50%;
  border: 2px solid var(--c); opacity: 0; transform: scale(.3);
}
.pin.is-open { z-index: 3; }
.pin.is-open .pin__head { transform: rotate(-45deg) translate(4px, -4px) scale(1.08); }
.pin.is-open::after { animation: pinRipple 1.6s var(--ease) infinite; }
@keyframes pinRipple { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.6); } }

.pin__card {
  position: absolute; left: 50%; bottom: calc(100% + 8px); width: max-content; max-width: 230px; padding: 10px 14px 11px;
  background: var(--paper); color: var(--ink); border-radius: var(--r-sm); text-align: left; line-height: 1.3; font-size: .9rem;
  box-shadow: 0 16px 30px -16px rgba(18, 26, 58, .5); pointer-events: none;
  display: none; transform: translate(-50%, 0); transform-origin: 50% 100%;
}
.pin.is-open .pin__card, .pin.is-closing .pin__card { display: block; }
.pin.is-open .pin__card { animation: cardIn .45s var(--ease) both; }
.pin.is-closing .pin__card { animation: cardOut .28s ease-in both; }
@keyframes cardIn { from { opacity: 0; transform: translate(-50%, 10px) scale(.86); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes cardOut { from { opacity: 1; transform: translate(-50%, 0) scale(1); } to { opacity: 0; transform: translate(-50%, 8px) scale(.9); } }
@keyframes cardInR { from { opacity: 0; transform: translateY(10px) scale(.86); } to { opacity: 1; transform: none; } }
@keyframes cardOutR { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(.9); } }
.pin__card strong { display: block; font-family: var(--display); font-weight: 700; font-size: .98rem; }
.pin__card span { display: block; color: #3a4266; }
.pin--r .pin__card { left: auto; right: -14px; transform: none; transform-origin: 90% 100%; }
.pin--r.is-open .pin__card { animation-name: cardInR; }
.pin--r.is-closing .pin__card { animation-name: cardOutR; }
.pin--r .pin__card::after { left: auto; right: 23px; }
.pin__card::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -7px; border: 7px solid transparent; border-top-color: var(--paper); }

/* clouds */
.cloud, .tcloud { position: absolute; display: block; border-radius: 999px; background: #fff; }
.cloud::before, .cloud::after, .tcloud::before, .tcloud::after { content: ""; position: absolute; border-radius: 50%; background: #fff; }
.cloud { height: 34px; opacity: .85; }
.cloud::before { width: 54%; aspect-ratio: 1; left: 16%; bottom: 30%; }
.cloud::after { width: 38%; aspect-ratio: 1; left: 48%; bottom: 25%; }
.cloud--a { width: 150px; top: 18%; left: 46%; animation: drift 48s linear infinite; }
.cloud--b { width: 110px; top: 30%; left: 80%; animation: drift 62s linear infinite -20s; opacity: .7; }
.cloud--c { width: 90px; top: 12%; left: 8%; animation: drift 55s linear infinite -30s; opacity: .6; }
.hero__sky { position: absolute; inset: 0; pointer-events: none; }
@keyframes drift { from { transform: translateX(-12vw); } to { transform: translateX(14vw); } }
.tcloud { height: 26px; opacity: .92; filter: drop-shadow(0 14px 10px rgba(18, 26, 58, .08)); }
.tcloud::before { width: 52%; aspect-ratio: 1; left: 18%; bottom: 28%; }
.tcloud::after { width: 36%; aspect-ratio: 1; left: 50%; bottom: 22%; }
.tcloud--1 { width: 120px; left: 14%; top: 14%; animation: drift2 26s ease-in-out infinite alternate; }
.tcloud--2 { width: 90px; left: 70%; top: 34%; animation: drift2 32s ease-in-out infinite alternate-reverse; }
@keyframes drift2 { from { transform: translateX(-40px); } to { transform: translateX(60px); } }

/* first paint states (JS reveals them; no-JS and reduced motion keep them visible) */
.js .hero [data-hero-in] { opacity: 0; transform: translateY(28px); }
.js .hero .hero__title { visibility: hidden; }
.js .hero .pin { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .js .hero [data-hero-in], .js .hero .pin { opacity: 1; transform: translate(-50%, -100%); }
  .js .hero [data-hero-in] { transform: none; }
  .js .hero .hero__title { visibility: visible; }
}

@media (max-width: 1100px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: var(--head-h); align-items: flex-start; }
  .hero__town { order: -1; width: 112%; margin: 0 -6%; }
  .hero__copy { padding-top: 0; margin-top: -2%; }
  .hero__title { font-size: clamp(2.3rem, 6.4vw, 3.6rem); margin-bottom: 18px; }
  .hero__near { display: none; }
}
@media (max-width: 640px) {
  .hero { min-height: auto; padding-bottom: 48px; }
  .hero__town { width: 132%; margin: -2% -16% 0; }
  .hero__title { font-size: 2.3rem; }
  .hero__lede { margin-bottom: 22px; font-size: 1.05rem; }
  .hero__ctas { margin-bottom: 0; }
  .pin { width: 34px; height: 44px; }
  .pin__head { width: 30px; height: 30px; left: 2px; }
  .pin__head svg { width: 15px; height: 15px; }
  .pin__card { font-size: .875rem; max-width: 190px; padding: 8px 11px 9px; }
  .pin__card strong { font-size: .9rem; }
}
