:root {
  --bg: #eceef2;
  --text: #434b57;
  --muted: #9ea6b1;
  --active: #22262d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background: var(--bg);
}

#map {
  position: fixed;
  inset: 0;
}

.brand-mark {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 5;
  width: clamp(54px, 7vw, 88px);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background-image: url("./assets/circle-greek-frame-round-meander-border-decoration-elements-pattern-png.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.9;
  filter: drop-shadow(0 6px 14px rgba(30, 44, 67, 0.16));
  pointer-events: none;
}

.notes-toggle {
  position: fixed;
  right: 28px;
  top: 118px;
  z-index: 6;
  border: 1px solid rgba(133, 143, 157, 0.2);
  border-radius: 999px;
  background: rgba(247, 245, 240, 0.9);
  color: #4f5968;
  padding: 0.58rem 0.92rem;
  font-family: "Outfit", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 20px rgba(36, 42, 50, 0.08);
}

.notes-toggle.is-active {
  color: #22262d;
  border-color: rgba(79, 89, 104, 0.26);
}

.floating-rail {
  position: fixed;
  left: 28px;
  top: 34px;
  z-index: 5;
}

.rail-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.rail-link {
  border: none;
  background: transparent;
  text-align: left;
  color: #8791a0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
  padding: 0;
  cursor: pointer;
  transition: color 120ms ease, transform 120ms ease;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.68);
}

.rail-link:hover {
  color: #5d6777;
  transform: translateX(2px);
}

.rail-link.is-active {
  color: var(--active);
}

.map-legend {
  position: fixed;
  left: 28px;
  bottom: 28px;
  z-index: 5;
  min-width: 148px;
  padding: 12px 14px;
  border: 1px solid rgba(133, 143, 157, 0.18);
  border-radius: 14px;
  background: rgba(247, 245, 240, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 20px rgba(36, 42, 50, 0.08);
}

.legend-title {
  margin: 0 0 10px;
  color: #7d8794;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #4f5968;
  font-size: 0.88rem;
}

.legend-item + .legend-item {
  margin-top: 8px;
}

.legend-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.legend-line {
  width: 18px;
  height: 0;
  border-top-width: 3px;
  border-top-style: solid;
  border-radius: 999px;
}

.legend-line-trail {
  border-top-color: #2f8f6b;
  opacity: 0.5;
}

.legend-line-track {
  border-top-color: #b14a3b;
}

.legend-line-hill {
  border-top-color: #ecaa24;
}

.notes-panel {
  position: fixed;
  top: 156px;
  right: 28px;
  z-index: 6;
  width: min(520px, calc(100vw - 56px));
  max-height: calc(100vh - 196px);
  padding: 18px 20px 16px;
  border: 1px solid rgba(133, 143, 157, 0.16);
  border-radius: 16px;
  background: rgba(247, 245, 240, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(36, 42, 50, 0.08);
  overflow: hidden;
}

.notes-panel-header {
  margin-bottom: 18px;
}

.notes-eyebrow {
  margin: 0 0 4px;
  color: #7d8794;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.notes-title {
  margin: 0;
  color: #363e49;
  font-size: 1.05rem;
  font-weight: 500;
}

.notes-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(133, 143, 157, 0.14);
}

.notes-filter {
  border: none;
  background: transparent;
  color: #7d8794;
  padding: 0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.notes-filter.is-active {
  color: #22262d;
}

.notes-list {
  display: grid;
  gap: 0;
  max-height: calc(100vh - 302px);
  overflow: auto;
  padding-right: 4px;
}

.notes-item {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(133, 143, 157, 0.14);
  border-radius: 0;
  background: transparent;
  padding: 12px 0 14px;
  text-align: left;
  cursor: pointer;
}

.notes-item:hover {
  background: transparent;
}

.notes-item-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.notes-item-title {
  margin: 0;
  color: #363e49;
  font-size: 1.02rem;
  font-weight: 500;
}

.notes-item-leader {
  flex: 1 1 auto;
  border-bottom: 1px dotted rgba(133, 143, 157, 0.34);
  transform: translateY(-0.18rem);
}

.notes-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #8a93a0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.notes-item-meta-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.notes-item-meta.is-calisthenics {
  color: #4b84db;
}

.notes-item-meta.is-trail {
  color: #2f8f6b;
}

.notes-item-meta.is-track {
  color: #b14a3b;
}

.notes-item-meta.is-hill {
  color: #ecaa24;
}

.notes-empty {
  padding: 14px 0;
  color: #7d8794;
  font-size: 0.86rem;
  background: transparent;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9;
  background: rgba(32, 37, 44, 0.9);
  color: #f4f6f9;
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font-size: 0.78rem;
}

.hidden {
  display: none !important;
}

.mapboxgl-popup-content {
  border: 1px solid #d4d8de;
  border-radius: 2px;
  box-shadow: 0 8px 20px rgba(36, 42, 50, 0.14);
  font-family: "Outfit", sans-serif;
}

.popup-title {
  margin: 0;
  font-size: 0.94rem;
  color: #363e49;
}

.popup-meta {
  margin: 0.24rem 0 0;
  color: #7d8794;
  font-size: 0.76rem;
  text-transform: lowercase;
}

@media (max-width: 760px) {
  .brand-mark {
    right: 12px;
    top: 10px;
    width: clamp(46px, 14vw, 66px);
  }

  .floating-rail {
    left: 14px;
    top: 18px;
  }

  .notes-toggle {
    right: 12px;
    top: 84px;
  }

  .rail-link {
    font-size: clamp(1.75rem, 8vw, 2.4rem);
  }

  .mapboxgl-ctrl-top-right {
    right: 10px;
    top: 10px;
  }

  .map-legend {
    left: 12px;
    bottom: 12px;
    min-width: 136px;
    padding: 10px 12px;
  }

  .notes-panel {
    top: 126px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 152px);
  }

  .notes-list {
    max-height: calc(100vh - 278px);
  }

  .notes-filter {
    font-size: 1.16rem;
  }

  .notes-item-head {
    align-items: flex-start;
  }

  .notes-item-meta {
    white-space: normal;
    text-align: right;
  }
}
