/* Homepage only. A live flight over a night map is the stage, distance is the type. */
.homepage {
  --lav: var(--bs-accent);
}
.homepage .primary { background: var(--lav); color: var(--bs-on-accent); }
.homepage .primary:hover { background: #c6b6f4; color: var(--bs-on-accent); }
.homepage .button { font-weight: 500; letter-spacing: -0.012em; min-height: 44px; padding: 0 20px; transition: background-color var(--bs-duration-fast) var(--bs-ease), transform 320ms var(--bs-ease); }
.homepage .button:active { transform: scale(0.97); }

.stage { display: flex; flex-direction: column; height: clamp(720px, 100svh, 1440px); overflow: hidden; position: relative; }
.homepage > .nav { left: 0; padding-right: calc(var(--bs-space-5) + 32px + var(--bs-space-3)); position: absolute; right: 0; top: 0; z-index: 3; }
.homepage > .nav nav a { color: rgba(245, 245, 247, 0.82); font-size: 13px; font-weight: 400; }
.homepage > .nav nav a:hover { color: #f5f5f7; }
.homepage > .nav .brand span { font-size: 15px; }
.film, .film img { height: 100%; inset: 0; position: absolute; width: 100%; }
/* The headline covers the rest, so drawing the map there would only cost frames. */
.map-live { height: 66%; left: 0; overflow: hidden; position: absolute; top: 0; width: 100%; }
.film { overflow: hidden; }
.film img { object-fit: cover; object-position: 50% 0; }
.map-live { opacity: 0; transition: opacity 900ms var(--bs-ease); }
.map-live.is-on { opacity: 1; }
/* All MapLibre needs from its stylesheet here, which saves a request. */
.maplibregl-canary { background-color: salmon; }
.maplibregl-canvas { left: 0; position: absolute; top: 0; }
.stage::after {
  background:
    linear-gradient(to top, #000 36%, rgba(0, 0, 0, 0.86) 42%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.16) 58%, transparent 66%),
    linear-gradient(to bottom, #000, rgba(0, 0, 0, 0.9) 44px, rgba(0, 0, 0, 0.5) 80px, transparent 132px);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}
/* The open pin and its card sit over the map, so they can animate. */
.map-pin { --accent: var(--lav); height: auto; left: var(--x, 0); opacity: 0; pointer-events: none; position: absolute; top: var(--y, 0); transform: translate(-50%, -90.1%); transform-origin: 50% 90.1%; transition: transform 320ms var(--bs-ease); width: var(--pin-width, 72px); z-index: 2; }
.map-pin[data-kind="meetup"] { --accent: var(--bs-meetup); }
.map-pin.is-on { opacity: 1; }
.map-pin.is-open { transform: translate(-50%, -90.1%) scale(var(--open, 1.14)); transition: transform 460ms var(--bs-ease); }
.map-pin svg { display: block; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45)); overflow: visible; width: 100%; }
.map-pin text { dominant-baseline: central; font-family: var(--bs-font); text-anchor: middle; }
.pin-stem, .pin-ring { fill: var(--accent); }
.pin-disk { fill: #111114; }
.pin-track { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 3; }
.pin-ring { fill: none; stroke: var(--accent); stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--life, 0)); stroke-linecap: round; stroke-width: 3; }
.pin-face.is-time { fill: #1d1d1f; }
.pin-face.is-person { fill: #5b2bd0; }
.pin-face.is-anon { fill: #2c2c2e; }
.pin-mask { fill: #e5e5ea; }
.pin-text.is-time { fill: var(--bs-meetup); font-size: 11.5px; font-weight: 700; }
.pin-text.is-person { fill: #fff; font-size: 16px; font-weight: 600; }
.hub-edge { fill: #fff; }
.hub-fill { fill: #5b2bd0; }
.hub-number { fill: #fff; font-size: 19px; font-weight: 700; }
.pin-badge.is-hub circle { fill: #5b2bd0; stroke: #fff; stroke-width: 1.75; }
.pin-badge.is-hub text { fill: #fff; font-size: 10.5px; font-weight: 600; }
.pin-badge circle { fill: #111114; }
.pin-badge .pin-badge-fill { fill: #fff; }
.pin-badge text { fill: #1d1d1f; font-size: 10.5px; font-weight: 600; }

/* A light card, like the notes, so the post is the first thing read on the dark map. */
.map-card {
  background: #f5f5f7;
  border-radius: var(--bs-radius-md);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 3px;
  left: var(--x, 0);
  margin-left: -6px;
  max-width: 300px;
  opacity: 0;
  padding: 11px 14px 12px;
  pointer-events: none;
  position: absolute;
  top: var(--y, 0);
  transform: translateX(-10px);
  transition: opacity 200ms var(--bs-ease), transform 200ms var(--bs-ease);
  width: max-content;
  z-index: 2;
}
.map-card.is-open { opacity: 1; transform: none; transition: opacity 320ms var(--bs-ease) 160ms, transform 460ms var(--bs-ease) 160ms; }
.map-card p { margin: 0; }
.card-text { color: #16161d; font-size: 15px; font-weight: 600; letter-spacing: -0.008em; line-height: 20px; }
.card-place { color: #5f6072; font-size: 12px; line-height: 16px; order: 1; }
.card-place span { font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-place span::before { content: "\00b7\00a0"; }
/* A hub leads with its place, then the post. */
.map-card.is-hub { margin-left: 8px; }
.is-hub .card-place { color: #16161d; font-weight: 600; order: 0; }
.hub-meta { border-bottom: 1px solid #dcdce4; color: #5f6072; font-size: 12px; line-height: 16px; margin-bottom: 6px !important; padding-bottom: 8px; }
.card-when { align-self: flex-start; background: var(--bs-meetup); border-radius: 6px; color: var(--bs-on-meetup); font-size: 12px; font-weight: 600; line-height: 16px; margin-top: 3px !important; padding: 0 6px; }

.hero { margin: auto auto 0; padding-bottom: 56px; position: relative; width: 100%; z-index: 2; }
.hero h1 { font-size: clamp(44px, 5.6vw, 92px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.03; margin: 0; text-wrap: initial; }
.hero h1 em { color: var(--lav); font-style: normal; white-space: nowrap; }
.hero-row { align-items: flex-start; display: flex; flex-direction: column; gap: var(--bs-space-5); margin-top: var(--bs-space-4); }
.hero-sub { color: #a1a1a6; font-size: clamp(17px, 1.45vw, 21px); letter-spacing: -0.012em; line-height: 1.38; margin: 0; max-width: 34em; text-wrap: pretty; }
.hero-actions { align-items: center; display: flex; flex: none; flex-direction: row-reverse; gap: var(--bs-space-5); }
.map-foot { align-items: center; bottom: var(--bs-space-3); display: flex; gap: var(--bs-space-3); justify-content: flex-end; left: max(var(--bs-space-5), calc((100% - var(--shell)) / 2 + var(--bs-space-5))); position: absolute; right: max(var(--bs-space-5), calc((100% - var(--shell)) / 2 + var(--bs-space-5))); z-index: 2; }
.map-steps { display: flex; gap: 6px; margin-right: auto; }
.map-steps[hidden] { display: none; }
.map-steps i { background: rgba(255, 255, 255, 0.24); border-radius: var(--bs-radius-pill); display: block; height: 2px; transition: background-color 600ms var(--bs-ease); width: 20px; }
.map-steps i.is-on { background: #f5f5f7; }
.map-credit { color: rgba(235, 235, 245, 0.42); font-size: 11px; line-height: 15px; margin: 0; }
.map-credit a, .footer-credit a { color: inherit; text-underline-offset: 2px; }
.map-credit a:hover, .footer-credit a:hover { color: var(--bs-text-primary); }
/* In the nav row: on a short phone the stage is taller than the screen. */
.map-toggle { align-items: center; background: rgba(255, 255, 255, 0.12); border: 0; border-radius: 50%; color: #f5f5f7; cursor: pointer; display: inline-flex; height: 32px; justify-content: center; padding: 0; position: absolute; right: max(var(--bs-space-5), calc((100% - var(--shell)) / 2 + var(--bs-space-5))); top: 20px; transition: background-color var(--bs-duration-fast) var(--bs-ease), transform 320ms var(--bs-ease); width: 32px; z-index: 4; }
.map-toggle::after { content: ""; inset: -6px; position: absolute; }
.map-toggle:active { transform: scale(0.92); }
.map-toggle[hidden] { display: none; }
.map-toggle:hover { background: rgba(255, 255, 255, 0.2); }
.map-toggle span { border-inline: 2.5px solid currentColor; display: block; height: 10px; width: 8px; }
.map-toggle[data-paused] span { border-block: 5px solid transparent; border-inline: 0; border-left: 8px solid currentColor; height: 0; margin-left: 2px; width: 0; }

.hero h1, .hero-sub, .hero-actions { animation: hero-rise 700ms var(--bs-ease) both; }
.hero-sub { animation-delay: 60ms; }
.hero-actions { animation-delay: 120ms; }
@keyframes hero-rise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  .hero h1, .hero-sub, .hero-actions { animation: none; }
  .map-pin, .map-pin *, .map-card { transition: none !important; }
}

@media (max-width: 700px) {
  .map-live { height: 60%; }
  .stage::after {
    background:
      linear-gradient(to top, #000 40%, rgba(0, 0, 0, 0.86) 45%, rgba(0, 0, 0, 0.5) 52%, rgba(0, 0, 0, 0.16) 60%, transparent 68%),
      linear-gradient(to bottom, #000, rgba(0, 0, 0, 0.9) 40px, rgba(0, 0, 0, 0.5) 72px, transparent 112px);
  }
  /* Longer headlines grow the stage instead of running into the card over the pin. */
  .stage { height: auto; min-height: max(100svh, 780px); padding-top: 440px; }
  .hero { padding-bottom: 56px; }
  .hero h1 { font-size: clamp(32px, 9.4vw, 38px); }
  :lang(en) .hero h1 { text-wrap: balance; }
  :lang(en) .hero h1 br { display: none; }
  .hero-row { align-items: stretch; flex-direction: column; gap: var(--bs-space-4); }
  .hero-actions { align-items: stretch; flex-direction: column-reverse; gap: var(--bs-space-1); }
  .map-card { margin-left: 0; max-width: 296px; transform: translateY(-10px); }
  .map-card.is-hub { margin-left: 0; }
  .homepage .button { min-height: 48px; }
  .map-foot { left: var(--bs-space-4); right: var(--bs-space-4); }
  .map-steps { display: none; }
  .map-credit { flex: 1; }
}
@media (max-width: 380px) {
  .stage { min-height: max(100svh, 880px); }
}
@media (max-width: 360px) {
  .stage { min-height: max(100svh, 780px); padding-top: 376px; }
  .hero h1 { font-size: 30px; }
  .hero-sub { color: #a1a1a6; font-size: clamp(17px, 1.45vw, 21px); letter-spacing: -0.012em; line-height: 1.38; margin: 0; max-width: 34em; text-wrap: pretty; }
  .homepage > .nav .brand span { clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; width: 1px; }
}

