:root {
  --bg: #10180f;
  --ink: #f6f1e6;
  --muted: #b7c3b0;
  --line: #314232;
  --blaze: #ff6b2c;
  --blaze-ink: #2a1408;
  --gold: #e8c36a;
  --moss: #4e8a58;
  --paper: #f3eee3;
  --paper-2: #e7dfcf;
  --paper-ink: #1c2418;
  --paper-muted: #5c6658;
  --paper-line: #d3c9b4;
  --danger: #ff6b5a;
  --ok: #8fce6a;
  --shadow: 0 28px 60px rgba(6, 12, 6, 0.42);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: Outfit, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.sky,
.topo {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.sky {
  background:
    radial-gradient(900px 420px at 8% -8%, #2a4a30 0%, transparent 58%),
    radial-gradient(720px 380px at 108% 4%, #4a2a14 0%, transparent 52%),
    radial-gradient(500px 280px at 70% 100%, #1a3320 0%, transparent 60%);
}

.topo {
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cpath fill='none' stroke='%23f6f1e6' stroke-width='1' d='M-20 46c34-22 56 18 90 0s56 18 100 0M-20 96c34-22 56 18 90 0s56 18 100 0M-20 146c34-22 56 18 90 0s56 18 100 0'/%3E%3C/svg%3E");
}

.wrap {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 72px;
}

.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.logo-mark {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line);
}

.logo-type {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.05;
}

.logo-kicker {
  font-family: Fraunces, Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.logo-gpx {
  color: var(--blaze);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.lang {
  display: flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 24, 15, 0.65);
}

.lang button {
  background: transparent;
  color: var(--muted);
  border: 0;
  min-width: 44px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 999px;
}

.lang button.is-active {
  background: var(--blaze);
  color: var(--blaze-ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 28px 40px;
  align-items: center;
  margin-bottom: 28px;
}

.kicker {
  margin: 0 0 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}

h1 {
  font-family: Fraunces, Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}

h1 .to-gpx {
  display: block;
  color: var(--blaze);
}

.lead {
  margin: 0;
  max-width: 34em;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.course {
  min-width: 0;
}

.course svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.trail-sheet {
  fill: color-mix(in srgb, var(--paper) 14%, transparent);
  stroke: color-mix(in srgb, var(--gold) 35%, transparent);
}

.trail-glow {
  fill: none;
  stroke: var(--blaze);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.22;
}

.trail {
  fill: none;
  stroke: var(--blaze);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 720;
  stroke-dashoffset: 720;
  animation: draw-trail 1.6s 0.2s ease forwards;
}

.pin-start {
  fill: var(--ok);
}

.pin-finish {
  fill: var(--gold);
}

.wpt {
  fill: var(--paper);
  opacity: 0.85;
}

.flag {
  fill: var(--gold);
}

.map-label {
  font-family: Outfit, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  fill: var(--ink);
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  position: relative;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel--bookmark {
  background:
    linear-gradient(180deg, #fff8ec 0%, var(--paper) 42%);
  padding-top: 32px;
}

.panel--bookmark::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  width: 16px;
  height: 24px;
  background: var(--blaze);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}

.panel-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--paper-2);
  color: var(--paper-muted);
}

.panel h2 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blaze-ink);
  background: color-mix(in srgb, var(--blaze) 82%, white);
  border-radius: 999px;
  padding: 4px 9px;
}

.howto p {
  color: var(--paper-muted);
  margin: 0 0 12px;
  line-height: 1.55;
}

.howto p:last-child {
  margin-bottom: 0;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.copy-row .secondary {
  padding: 8px 12px;
  font-size: 13px;
}

.bookmark-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 4px 0 14px;
}

a.bookmarklet {
  display: inline-flex;
  align-items: center;
  background: var(--blaze);
  color: var(--blaze-ink);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  cursor: grab;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--blaze) 35%, transparent);
}

a.bookmarklet:active {
  cursor: grabbing;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--paper-muted);
  margin-bottom: 8px;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

input[type="url"],
input[type="text"] {
  flex: 1 1 240px;
  min-width: 0;
  background: #fffdf8;
  color: var(--paper-ink);
  border: 1px solid var(--paper-line);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
}

input:focus-visible,
button:focus-visible,
.chip:focus-visible,
a.bookmarklet:focus-visible {
  outline: 2px solid var(--blaze);
  outline-offset: 2px;
}

button,
.btn {
  appearance: none;
  border: 0;
  background: var(--blaze);
  color: var(--blaze-ink);
  font: inherit;
  font-weight: 600;
  padding: 13px 16px;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, filter 0.15s ease;
}

button:hover,
.btn:hover,
a.bookmarklet:hover,
.chip:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

button.secondary,
.btn.secondary {
  background: transparent;
  color: var(--paper-ink);
  border: 1px solid var(--paper-line);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  background: var(--paper-2);
  border: 1px solid var(--paper-line);
  color: var(--paper-muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.drop {
  position: relative;
  margin-top: 14px;
  border: 1.5px dashed var(--paper-line);
  border-radius: 16px;
  padding: 22px 16px;
  color: var(--paper-muted);
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 92px;
  background: color-mix(in srgb, var(--paper-2) 55%, white);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop span {
  pointer-events: none;
}

.drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop.is-over {
  border-color: var(--blaze);
  background: color-mix(in srgb, var(--blaze) 12%, var(--paper));
  color: var(--paper-ink);
}

.status {
  margin: 14px 0 0;
  min-height: 1.4em;
  color: var(--paper-muted);
  font-size: 14px;
  line-height: 1.45;
}

.status.error {
  color: #b42318;
}

.status.ok {
  color: #3b6d32;
}

.results {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.results:empty {
  display: none;
}

.results > .row .secondary {
  color: var(--ink);
  border-color: var(--line);
}

.result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 16px;
  align-items: center;
}

.result h2 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 22px;
}

.meta {
  color: var(--paper-muted);
  font-size: 14px;
  margin-top: 4px;
}

.km {
  display: inline-flex;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--blaze-ink);
  background: color-mix(in srgb, var(--blaze) 78%, white);
  border-radius: 999px;
  padding: 3px 9px;
}

.about {
  margin-top: 48px;
  max-width: 42em;
}

.about h2 {
  margin: 0 0 12px;
  font-family: Fraunces, Georgia, serif;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.about p,
.about li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.about p {
  margin: 0 0 10px;
}

.about ul {
  margin: 8px 0 0;
  padding-left: 1.2em;
}

.about a {
  color: var(--gold);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 36px;
  color: var(--muted);
  font-size: 13px;
}

.foot a {
  color: var(--gold);
}

@media (max-width: 860px) {
  .hero,
  .stage {
    grid-template-columns: 1fr;
  }

  .course {
    order: -1;
  }

  h1 {
    font-size: clamp(32px, 9vw, 48px);
  }
}

@media (max-width: 560px) {
  .wrap {
    width: min(100% - 24px, 1120px);
  }

  .result {
    grid-template-columns: 1fr;
  }

  .logo-kicker {
    font-size: 15px;
  }

  .panel {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trail {
    animation: none;
    stroke-dashoffset: 0;
  }

  button,
  .btn,
  a.bookmarklet,
  .chip {
    transition: none;
  }
}

@keyframes draw-trail {
  to {
    stroke-dashoffset: 0;
  }
}
