:root {
  --bg: #0d0d0d;
  --primary: #e8e8e8;
  --accent: #fff;
  --line: #444;
  --px-per-ft: 0.4;
  --min-gap: 12px;
  --max-gap: 800px;
  --sky-top: #0b1a3e;
  --sky-bottom: #4a90c2;
  --mountain-opacity: 0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: transparent;
  color: var(--primary);
}

#scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

#sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--sky-top), var(--sky-bottom));
  transition: background 0.3s ease;
}

#mountains {
  position: absolute;
  bottom: -50vh;
  left: 0;
  right: 0;
  height: calc(60% + 50vh);
  opacity: var(--mountain-opacity);
  transition: opacity 0.15s ease;
}

#mountains::before,
#mountains::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
}

#mountains::before {
  background: linear-gradient(175deg, transparent 40%, rgba(200,210,220,0.9) 60%);
  clip-path: polygon(
    0% 100%, 0% 55%, 8% 30%, 15% 45%, 22% 20%, 30% 40%,
    38% 15%, 45% 35%, 52% 10%, 58% 28%, 65% 5%, 72% 25%,
    80% 12%, 88% 30%, 95% 18%, 100% 35%, 100% 100%
  );
}

#mountains::after {
  background: linear-gradient(175deg, transparent 30%, rgba(160,175,195,0.8) 55%);
  clip-path: polygon(
    0% 100%, 0% 60%, 5% 45%, 12% 55%, 20% 32%, 28% 48%,
    35% 25%, 42% 42%, 50% 20%, 57% 38%, 63% 18%, 70% 35%,
    78% 22%, 85% 40%, 92% 28%, 100% 45%, 100% 100%
  );
}

a { color: var(--accent); text-decoration: none; }

header {
  position: relative;
  padding: 1.2rem 1rem 1rem;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.header-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.header-link {
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
}

.header-link:hover,
.header-link:focus {
  color: #fff;
}

.header-sep {
  color: rgba(255,255,255,0.3);
}

.external-icon {
  width: 0.75em;
  height: 0.75em;
  fill: currentColor;
  margin-left: 0.2em;
  vertical-align: baseline;
}

h1 { margin: 0; font-size: 1.6rem; }

main {
  position: relative;
  max-width: 700px;
  margin: 2rem auto;
  padding-left: 52px;
}

main::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
  z-index: 0;
}

.item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.marker {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  margin-left: -52px;
  border-radius: 50%;
  background: rgba(13,13,13,0.8);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.content {
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.content h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.content h3 a {
  color: var(--primary);
  transition: color 0.2s;
}

.content h3 a:hover,
.content h3 a:focus {
  color: #fff;
  text-decoration: underline;
}

.meta {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: 0.25rem;
}

.recent-dot {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.4em;
  border-radius: 50%;
  background: #e02020;
  vertical-align: middle;
}

svg { width: 24px; height: 24px; fill: var(--accent); }

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.4rem 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(34,34,34,0.9), rgba(24,24,24,0.7));
  color: #fff;
  font-size: 0.85rem;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(4px);
}

.toast.show { opacity: 1; }

#toastTop { top: 16px; }
#toastBottom { bottom: 16px; }

#currentElev {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 30vmin;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.12);
  text-shadow: 0 2px 8px rgba(255,255,255,0.3);
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  font-variant-numeric: tabular-nums;
}
