@font-face {
  font-display: swap;
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600;
  src: url("./assets/fonts/montserrat-600.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  src: url("./assets/fonts/montserrat-700.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400;
  src: url("./assets/fonts/open-sans-400.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 600;
  src: url("./assets/fonts/open-sans-600.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --ink: #fafafa;
  --muted: #a3a3a3;
  --paper: #171717;
  --paper-deep: #262626;
  --water: #247ba0;
  --water-light: #61b9d8;
  --brand-primary: #f5ff00;
  --selection: #ffffff;
  --line: rgba(255, 255, 255, 0.1);
  font-family: "Open Sans", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}

* {
  scrollbar-color: #3f3f3f var(--paper);
  scrollbar-width: thin;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  background: var(--water);
  color: var(--ink);
  left: 1rem;
  padding: 0.7rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 2000;
}

.skip-link:focus {
  top: 1rem;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 390px) 1fr;
  height: 100%;
}

.sidebar {
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: clamp(1.5rem, 3vw, 3.25rem) clamp(1.25rem, 2.8vw, 2.75rem) 1.5rem;
  position: relative;
  z-index: 700;
}

.brand-link {
  display: inline-block;
  flex: 0 0 auto;
  height: 50px;
  position: relative;
  width: 128px;
}

.brand-logo {
  clip-path: inset(0 0 50% 0);
  display: block;
  height: auto;
  inset: 0;
  pointer-events: none;
  position: absolute;
  width: 128px;
}

.brand-logo-primary {
  background: var(--brand-primary);
  clip-path: inset(50% 0 0 0);
  display: block;
  height: 50px;
  inset: 0;
  -webkit-mask: url("./assets/logo/oliver-heisel-wordmark.png") top left / 128px auto no-repeat;
  mask: url("./assets/logo/oliver-heisel-wordmark.png") top left / 128px auto no-repeat;
  pointer-events: none;
  position: absolute;
  width: 128px;
}

.eyebrow,
.panel-kicker {
  color: var(--water-light);
  font-size: 0.7rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 0 0 0.6rem;
  text-transform: uppercase;
}

h1 {
  font-family: "Montserrat", sans-serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0;
}

.intro {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
  margin: 1.35rem 0 0;
  max-width: 31ch;
}

.search-section {
  margin-top: 2rem;
  position: relative;
}

.search-section label {
  display: block;
  font-size: 0.72rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.search-wrap {
  position: relative;
}

.search-wrap svg {
  fill: none;
  height: 18px;
  left: 0.8rem;
  pointer-events: none;
  position: absolute;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
}

.search-wrap input {
  appearance: none;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 44px;
  outline: none;
  padding: 0.7rem 2.5rem 0.7rem 2.4rem;
  width: 100%;
}

.search-wrap input:focus {
  border-color: var(--water);
  box-shadow: 0 0 0 3px rgba(36, 123, 160, 0.35);
}

.search-wrap input::placeholder {
  color: #777;
}

.search-wrap input:disabled {
  cursor: wait;
  opacity: 0.58;
}

.search-results {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
  left: 0;
  list-style: none;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
  padding: 0.3rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 900;
}

.search-results button {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: block;
  padding: 0.65rem 0.7rem;
  text-align: left;
  width: 100%;
}

.search-results button:hover,
.search-results button:focus-visible {
  background: rgba(36, 123, 160, 0.3);
  outline: none;
}

.search-results strong,
.search-results small {
  display: block;
}

.search-results small {
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

.stats {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 1.55rem 0;
  padding: 0.9rem 0;
}

.stats div + div {
  border-left: 1px solid var(--line);
  padding-left: 0.85rem;
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  font-family: "Montserrat", sans-serif;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.stats span {
  color: var(--muted);
  font-size: 0.68rem;
  margin-top: 0.12rem;
}

.feature-panel {
  background: var(--paper-deep);
  border-left: 3px solid var(--water);
  border-radius: 0 7px 7px 0;
  padding: 1rem 1.1rem;
}

.feature-panel h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
}

.alternate-names {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
  margin: 0.45rem 0 0;
}

.feature-panel > p:not(.panel-kicker) {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.detail-list {
  margin: 1rem 0 0;
}

.detail-list div {
  align-items: baseline;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.48rem 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.7rem;
}

.detail-list dd {
  font-size: 0.72rem;
  font-weight: 700;
  margin: 0;
  max-width: 60%;
  overflow-wrap: anywhere;
  text-align: right;
}

.panel-hint {
  border-top: 1px solid var(--line);
  font-style: italic;
  margin-bottom: 0;
  padding-top: 0.65rem;
}

.sidebar-footer {
  font-size: 0.7rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

.footer-links {
  display: grid;
  gap: 0.4rem;
  margin-left: auto;
}

.footer-links a {
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.35rem 0.5rem;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  border-color: var(--water-light);
  color: var(--water-light);
}

.footer-identity {
  align-items: flex-end;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: 1.1rem;
  padding-top: 1rem;
}

.map-shell,
#map {
  height: 100%;
  min-height: 0;
  position: relative;
}

.map-shell {
  background: #0f0f0f;
}

#map {
  z-index: 1;
}

.leaflet-container {
  background: #0f0f0f;
  font-family: inherit;
}

.leaflet-rivers-pane {
  filter: brightness(0) saturate(100%) invert(25%) sepia(41%) saturate(1260%) hue-rotate(153deg) brightness(52%) contrast(108%);
}

.leaflet-terrain-pane {
  filter: grayscale(1) contrast(1.12) brightness(0.78);
}

.leaflet-control-attribution {
  background: rgba(23, 23, 23, 0.9) !important;
  color: var(--muted);
}

.leaflet-control-attribution a {
  color: var(--water-light);
}

.leaflet-bar {
  border: 1px solid var(--line) !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: rgba(23, 23, 23, 0.94) !important;
  border-bottom-color: var(--line) !important;
  color: var(--ink);
}

.leaflet-control-zoom a:hover {
  background: var(--paper-deep) !important;
}

.leaflet-control-scale-line {
  background: rgba(23, 23, 23, 0.82);
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  text-shadow: 0 1px 2px #000;
}

.leaflet-tooltip.lake-tooltip {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 750;
  padding: 0.35rem 0.55rem;
}

.leaflet-tooltip-top.lake-tooltip::before {
  border-top-color: var(--paper-deep);
}

.map-toolbar {
  align-items: center;
  display: flex;
  gap: 0.55rem;
  position: absolute;
  right: 1rem;
  top: 1rem;
  z-index: 600;
}

.map-toolbar button,
.map-toolbar span {
  align-items: center;
  backdrop-filter: blur(8px);
  background: rgba(23, 23, 23, 0.94);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.32);
  color: var(--ink);
  display: flex;
  min-height: 38px;
}

.map-toolbar button {
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
}

.map-toolbar button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.map-toolbar button:hover:not(:disabled) {
  background: var(--paper-deep);
}

.map-toolbar button.is-active {
  background: var(--water);
  border-color: var(--water-light);
}

.map-toolbar button.is-active:hover {
  background: #2d8caf;
}

.map-toolbar button:focus-visible {
  outline: 3px solid rgba(36, 123, 160, 0.55);
  outline-offset: 2px;
}

.map-toolbar svg {
  fill: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-width: 1.8;
  width: 15px;
}

.map-toolbar span {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  padding: 0.55rem 0.65rem;
}

.load-panel {
  align-items: center;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 7px;
  bottom: 1.2rem;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  display: grid;
  gap: 0.8rem;
  grid-template-columns: auto 1fr;
  left: 50%;
  max-width: calc(100% - 2rem);
  padding: 0.9rem 1rem;
  position: absolute;
  transform: translateX(-50%);
  transition: opacity 220ms ease, transform 220ms ease;
  width: 360px;
  z-index: 800;
}

.load-panel.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
}

.load-panel.is-error {
  background: #8c2f1b;
}

.load-mark {
  animation: pulse 1s ease-in-out infinite alternate;
  background: var(--water);
  border-radius: 50%;
  height: 12px;
  width: 12px;
}

.load-panel strong,
.load-panel span {
  display: block;
}

.load-panel strong {
  font-size: 0.78rem;
}

.load-panel span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.67rem;
  margin-top: 0.15rem;
}

.progress-track {
  background: rgba(255, 255, 255, 0.18);
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
}

.progress-track span {
  background: var(--water);
  height: 100%;
  margin: 0;
  transition: width 150ms linear;
  width: 3%;
}

.legend {
  backdrop-filter: blur(8px);
  background: rgba(23, 23, 23, 0.93);
  border: 1px solid var(--line);
  border-radius: 6px;
  bottom: 1.15rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.65rem;
  gap: 0.75rem;
  left: 1rem;
  padding: 0.55rem 0.7rem;
  position: absolute;
  z-index: 600;
}

.legend span {
  align-items: center;
  display: flex;
  gap: 0.35rem;
}

.swatch {
  border: 1px solid var(--water-light);
  display: inline-block;
  height: 10px;
  width: 15px;
}

.swatch.lake {
  background: var(--water);
}

.line-swatch {
  border-top: 3px solid var(--selection);
  display: inline-block;
  width: 16px;
}

.river-swatch {
  border-top: 3px solid #0d465c;
  display: inline-block;
  width: 16px;
}

.terrain-swatch {
  background: linear-gradient(135deg, #aeb4b5 0 34%, #4b5153 34% 58%, #7c8385 58%);
  border: 1px solid #aeb4b5;
  display: inline-block;
  height: 10px;
  width: 15px;
}

noscript {
  background: #8c2f1b;
  bottom: 1rem;
  color: white;
  left: 50%;
  padding: 1rem;
  position: absolute;
  transform: translateX(-50%);
  z-index: 1000;
}

@keyframes pulse {
  to {
    opacity: 0.35;
    transform: scale(0.72);
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 640px;
  }

  .sidebar {
    display: grid;
    flex: 0 0 auto;
    gap: 0 1rem;
    grid-template-columns: 1fr 1fr;
    max-height: 45%;
    padding: 1.1rem 1rem;
  }

  .masthead,
  .stats,
  .sidebar-footer {
    grid-column: 1 / -1;
  }

  .brand-link {
    height: 43px;
    width: 110px;
  }

  .brand-logo {
    width: 110px;
  }

  .brand-logo-primary {
    height: 43px;
    -webkit-mask-size: 110px auto;
    mask-size: 110px auto;
    width: 110px;
  }

  h1 {
    font-size: 2.35rem;
  }

  .intro {
    display: none;
  }

  .search-section {
    align-self: start;
    margin-top: 1rem;
  }

  .stats {
    margin: 0.85rem 0;
  }

  .feature-panel {
    margin-top: 1rem;
  }

  .sidebar-footer {
    padding-top: 0.8rem;
  }

  .footer-identity {
    margin-top: 0;
    padding-top: 0.7rem;
  }

  .feature-panel h2 {
    font-size: 1.4rem;
  }

  .map-shell {
    flex: 1 1 auto;
    min-height: 55%;
  }

  .legend {
    bottom: 0.75rem;
    left: 0.75rem;
  }

  .map-toolbar {
    right: 0.75rem;
    top: 0.75rem;
  }

  .load-panel {
    bottom: 3.6rem;
  }
}

@media (max-width: 470px) {
  .sidebar {
    display: block;
    max-height: 41%;
  }

  .search-section {
    margin-top: 0.9rem;
  }

  .map-shell {
    min-height: 59%;
  }

  .legend span:nth-child(4) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
