:root {
  --sand: #f3ebe0;
  --cream: #fffaf4;
  --ochre: #c45c26;
  --rust: #8b3a1a;
  --earth: #241b14;
  --dust: #6b5344;
  --sky: #3d6b7a;
  --line: rgba(36, 27, 20, 0.12);
  --card: rgba(255, 250, 244, 0.96);
  --shadow: 0 20px 50px rgba(36, 27, 20, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--earth);
  background:
    radial-gradient(1100px 560px at 10% -10%, #efd3b0 0%, transparent 55%),
    radial-gradient(900px 480px at 100% 0%, #c7dfe6 0%, transparent 45%),
    linear-gradient(180deg, #f7efe5 0%, var(--sand) 55%, #e7dbc9 100%);
  line-height: 1.55;
}
a { color: var(--ochre); }
.wrap { width: min(1280px, calc(100% - 1.5rem)); margin: 0 auto; }

.hero { padding: 2rem 0 1rem; }
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  background: rgba(61, 107, 122, 0.12); color: var(--sky);
  font-size: 0.8rem; font-weight: 600;
}
.badge .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #2f9e6b;
  box-shadow: 0 0 0 4px rgba(47, 158, 107, 0.18);
  animation: pulse 2s ease infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(47, 158, 107, 0); } }

h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(2rem, 4.8vw, 3.2rem);
  line-height: 1.05; margin: 0.75rem 0 0.4rem;
}
h1 span { color: var(--ochre); }
.lede { font-size: 1.02rem; color: var(--dust); max-width: 48rem; margin: 0 0 1rem; }

.controls {
  display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1rem;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.75rem 1.1rem; border-radius: 999px; font-weight: 600;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; font: inherit;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--ochre); color: #fff; box-shadow: 0 10px 24px rgba(196, 92, 38, 0.28); }
.btn-ghost { background: rgba(255,255,255,0.55); border-color: var(--line); color: var(--earth); }
.btn-play { background: var(--earth); color: var(--cream); min-width: 8.5rem; }
.btn-play.playing { background: var(--rust); }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.55rem;
  margin-bottom: 1rem;
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.7rem 0.85rem; box-shadow: var(--shadow);
}
.stat strong { display: block; font-family: Fraunces, Georgia, serif; font-size: 1.1rem; }
.stat span { color: var(--dust); font-size: 0.78rem; }

/* Big map */
.map-shell {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: linear-gradient(165deg, #a9cbd8 0%, #d5e6ec 40%, #e8d7b8 100%);
  /* Tight frame around mainland + Tasmania */
  width: 100%;
  aspect-ratio: 1.28 / 1;
  max-height: min(58vh, 620px);
  height: auto;
}
#mapSvg {
  width: 100%;
  height: 100%;
  display: block;
  vertical-align: top;
}
#mapSvg .ocean { fill: #9fc4d3; }
#mapSvg .land {
  fill: #d4a574;
  stroke: #8b5a2b;
  stroke-width: 0.55;
  vector-effect: non-scaling-stroke;
}
#mapSvg .route-full {
  fill: none; stroke: rgba(196, 92, 38, 0.2); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
#mapSvg .route-progress {
  fill: none; stroke: #c45c26; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.12));
}
#mapSvg .stop-dot {
  fill: #8b3a1a; stroke: #fff; stroke-width: 1.5;
  cursor: pointer; opacity: 0.55;
  transition: opacity 0.2s ease, r 0.2s ease;
}
#mapSvg .stop-dot:hover, #mapSvg .stop-dot.active { opacity: 1; }
#mapSvg .stop-dot.active { fill: #2f9e6b; }
#mapSvg .stop-dot.visited { opacity: 0.9; }
#mapSvg .stop-dot.has-media { stroke: #e8b84a; stroke-width: 2; }
#mapSvg .bike-icon { pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25)); }

.map-hud {
  position: absolute; left: 0.9rem; top: 0.9rem; right: 0.9rem;
  display: flex; justify-content: space-between; gap: 0.6rem; pointer-events: none;
}
.hud-chip {
  pointer-events: auto;
  background: rgba(255, 250, 244, 0.94);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  color: var(--dust);
  max-width: min(360px, 80%);
  backdrop-filter: blur(6px);
}
.hud-chip b { display: block; color: var(--earth); font-size: 1rem; margin-bottom: 0.15rem; }
.progress-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: rgba(36,27,20,0.1);
}
.progress-bar > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--ochre), #2f9e6b);
  transition: width 0.25s ease;
}

/* Site list under map */
.sites-bar {
  margin-top: 0.65rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.55rem 0.75rem 0.6rem;
  box-shadow: var(--shadow);
}
.sites-bar h3 {
  margin: 0 0 0.55rem;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
}
.sites-scroll {
  display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.25rem;
  scrollbar-width: thin;
}
.site-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dust);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.site-chip:hover { border-color: var(--ochre); color: var(--earth); }
.site-chip.active {
  background: var(--earth); color: var(--cream); border-color: var(--earth);
}
.site-chip .km { opacity: 0.75; font-weight: 500; margin-left: 0.25rem; }

/* Detail panel BELOW map */
.detail {
  margin-top: 0.85rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  min-height: 0;
  overflow: hidden;
}
.detail:not(.has-content) .detail-body {
  padding-top: 0.35rem;
  padding-bottom: 0.75rem;
}
.detail-head {
  padding: 1.1rem 1.25rem 0.8rem;
  border-bottom: 1px solid var(--line);
}
.detail-head h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  margin: 0 0 0.3rem;
}
.detail-meta {
  display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.45rem;
}
.pill {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  padding: 0.16rem 0.5rem; border-radius: 999px;
  background: rgba(61, 107, 122, 0.12); color: var(--sky);
}
.pill.dist { background: rgba(196, 92, 38, 0.12); color: var(--rust); }
.pill.media { background: rgba(232, 184, 74, 0.22); color: #8a5e08; }
.detail-note { margin: 0; color: var(--dust); font-size: 0.98rem; }
.detail-body { padding: 0.95rem 1.15rem 1.25rem; }
.detail-empty { color: var(--dust); padding: 0.5rem 0 0.2rem; }
.posts { display: grid; gap: 0.75rem; }
.post {
  border: 1px solid var(--line); border-radius: 14px; padding: 0.8rem 0.9rem;
  background: rgba(255,255,255,0.5);
}
.post-date {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ochre);
}
.post-text { margin: 0.35rem 0 0.5rem; font-size: 0.95rem; white-space: pre-wrap; }
.post-media {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.45rem;
}
.post-media img, .post-media video {
  width: 100%; height: 130px; object-fit: cover; border-radius: 10px;
  background: #ddd; cursor: pointer;
}
.post a.tg { font-size: 0.82rem; font-weight: 600; text-decoration: none; }

.section-block { padding: 2.2rem 0 1rem; }
.section-title { font-family: Fraunces, Georgia, serif; font-size: 1.6rem; margin: 0 0 0.35rem; }
.section-sub { color: var(--dust); margin: 0 0 1rem; }
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.85rem; }
blockquote.q {
  margin: 0; padding: 1.05rem; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); position: relative;
}
blockquote.q::before {
  content: "“"; font-family: Fraunces, Georgia, serif; font-size: 2.4rem;
  color: var(--ochre); opacity: 0.4; position: absolute; top: 0.1rem; left: 0.6rem; line-height: 1;
}
blockquote.q p { margin: 0.6rem 0 0.5rem; }
blockquote.q footer { font-size: 0.78rem; color: var(--dust); }

footer.site {
  padding: 2rem 0 2.6rem; border-top: 1px solid var(--line); margin-top: 1.2rem;
  color: var(--dust); font-size: 0.88rem;
}
footer.site strong { color: var(--earth); }

.lb {
  position: fixed; inset: 0; background: rgba(20, 14, 10, 0.88);
  display: none; align-items: center; justify-content: center; z-index: 60; padding: 1rem;
}
.lb.show { display: flex; }
.lb img, .lb video { max-width: min(960px, 96vw); max-height: 90vh; border-radius: 12px; }
.lb-close {
  position: absolute; top: 1rem; right: 1.2rem; color: #fff; font-size: 1.6rem;
  cursor: pointer; font-weight: 700;
}
.error { color: #b91c1c; background: #fee2e2; padding: 0.75rem 1rem; border-radius: 12px; }

@media (max-width: 700px) {
  .map-shell {
    aspect-ratio: 1.15 / 1;
    max-height: 48vh;
  }
  .site-chip { font-size: 0.72rem; padding: 0.35rem 0.6rem; }
}
