/* Turkartet: Christian Halvorsen, blad 1 */
:root {
  --paper: #f4f0e2;
  --card: #fbf9f1;
  --ink: #1f2a30;
  --ink-soft: #46535b;
  --brown-ink: #77451f;
  --blue-ink: #1d6492;
  --green: #23463a;
  --leaf: #cfe2b2;
  --trail: #d3222a;
  --trail-ink: #b3191f;
  --serif: 'Alegreya', Georgia, 'Times New Roman', serif;
  --sans: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  --m: 8px;
  --dock: 66px;
  --lane: 58px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  padding-bottom: calc(var(--dock) + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 var(--sans);
}
img { max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }

a { color: inherit; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--blue-ink);
  outline-offset: 3px;
  border-radius: 2px;
}
h2[tabindex]:focus { outline: none; }
h2[tabindex]:focus-visible { outline: 3px solid var(--blue-ink); }

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 50;
  background: var(--ink); color: var(--card);
  padding: 12px 16px; font-weight: 700;
}
.skip:focus { top: 12px; }

/* ---------- the sheet and its layers ---------- */
.sheet { position: relative; overflow: hidden; background: #e3ebcf; }
@supports (overflow: clip) { .sheet { overflow: clip; } }
.map { position: absolute; inset: 0; z-index: 0; }
.map canvas { position: absolute; left: 0; display: block; }
.creases {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    repeating-linear-gradient(to bottom,
      rgba(255,255,255,.16) 0, rgba(255,255,255,0) 26px,
      rgba(70,50,30,0) 800px, rgba(70,50,30,.07) 858px,
      rgba(255,255,255,.7) 858px, rgba(255,255,255,.7) 859px,
      rgba(70,50,30,.2) 859px, rgba(70,50,30,.2) 860px),
    linear-gradient(to right,
      rgba(255,255,255,.14) 0, rgba(255,255,255,0) 22px,
      rgba(70,50,30,0) calc(100% - 40px), rgba(70,50,30,.06) calc(100% - 2px),
      rgba(255,255,255,.7) calc(100% - 2px), rgba(255,255,255,.7) calc(100% - 1px),
      rgba(70,50,30,.2) calc(100% - 1px), rgba(70,50,30,.2) 100%);
  background-size: 100% 860px, 50% 100%;
}
.route { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; overflow: visible; }
.hero, main, .margin { position: relative; z-index: 3; }

/* route drawing */
.route .planned { fill: none; stroke: var(--trail); stroke-width: 1.6; stroke-dasharray: .1 5.5; stroke-linecap: round; opacity: .62; }
.route .leg-halo { fill: none; stroke: rgba(251,249,241,.72); stroke-width: 6.5; stroke-linecap: round; stroke-linejoin: round; }
.route .leg { fill: none; stroke: var(--trail); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.route .wm { opacity: 0; transition: opacity .35s ease; }
.route .wm.is-on { opacity: 1; }
.route .lbl { font: 700 16px var(--sans); fill: var(--ink); paint-order: stroke; stroke: rgba(251,249,241,.92); stroke-width: 4.5px; stroke-linejoin: round; }
.route .lbl--nature { font: italic 700 18px var(--serif); }
.route .lbl-fig { font: 500 14.5px var(--sans); fill: var(--brown-ink); paint-order: stroke; stroke: rgba(251,249,241,.92); stroke-width: 4px; stroke-linejoin: round; }
.route .hiker-ring { fill: none; stroke: var(--trail); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .route .hiker.is-moving .hiker-ring { animation: ping 1.1s ease-out; }
}
@keyframes ping { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(2.1); } }

/* ---------- cover (map title panel) ---------- */
.cover {
  position: relative;
  margin: calc(var(--m) + 8px) calc(var(--m) + 6px) 0;
  padding: 16px 18px 14px;
  background: var(--green);
  color: var(--paper);
  box-shadow: 4px 5px 0 rgba(31,42,48,.2);
}
.cover__series { font: 700 13px/1 var(--sans); letter-spacing: .34em; text-transform: uppercase; color: var(--leaf); margin-bottom: 10px; }
h1 { font: 800 clamp(40px, 11.6vw, 58px)/.94 var(--serif); letter-spacing: -.012em; margin-bottom: 10px; }
.cover__sub { font: italic 500 19px/1.32 var(--serif); margin-bottom: 12px; max-width: 31em; }
.cover__meta { display: flex; flex-wrap: wrap; gap: 2px 18px; padding-top: 9px; border-top: 1px solid rgba(244,240,226,.38); font: 500 16px/1.4 var(--sans); color: var(--leaf); }

/* ---------- stops, waypoints ---------- */
.wp { position: absolute; display: block; width: 0; height: 0; pointer-events: none; }
.via { display: none; }
.stop { position: relative; padding-top: 232px; }
.stop > .pin { left: 43%; top: 118px; }
.stop--start { padding-top: 212px; }
.stop--start > .pin { left: 36%; top: 104px; }
.lane { left: -30px; }
.lane-a { top: -38px; }
.lane-b { top: 50%; left: -24px; }
.lane-c { top: calc(100% - 2px); }

/* ---------- cards (field notebook pages) ---------- */
.card, .legend, .plate {
  position: relative;
  background-color: var(--card);
  background-image:
    linear-gradient(rgba(47,127,176,.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47,127,176,.075) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
  border: 1px solid rgba(31,42,48,.32);
  box-shadow: 4px 5px 0 rgba(31,42,48,.15);
}
.card { margin: 0 calc(var(--m) + 6px) 0 var(--lane); max-width: 560px; padding: 18px 18px 12px; }
.card p { margin-bottom: 12px; }
.role { font: italic 400 1rem/1.35 var(--sans); color: var(--brown-ink); margin-bottom: 4px !important; }
h2 { font: italic 700 clamp(29px, 8vw, 38px)/1.04 var(--serif); margin-bottom: 12px; text-wrap: balance; }
h3 { font: 700 1.1rem/1.3 var(--sans); margin-bottom: 4px; }

.spot { padding: 9px 0; border-block: 1px dashed rgba(119,69,31,.5); color: var(--brown-ink); }
.spot svg { vertical-align: -3px; margin-right: 2px; }
.spot b { font-weight: 700; color: var(--ink); }

.links { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 2px 0 0 !important; }
.links a, .more a, .contact a, .margin a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 700;
  text-decoration: underline; text-decoration-color: var(--trail); text-decoration-thickness: 2px; text-underline-offset: 5px;
}
.links a:hover, .more a:hover, .contact a:hover, .margin a:hover { color: var(--trail-ink); text-decoration-thickness: 3px; }
.more { margin: 4px 0 0 !important; padding-top: 6px; border-top: 1px dashed rgba(31,42,48,.35); }
.card--rest .more { margin-top: 14px !important; padding: 12px 0 8px; font-style: italic; color: var(--brown-ink); }
.more a { margin-left: 4px; }

/* screenshots taped to the page */
.shots { position: relative; margin: -48px -6px 18px 8px; }
.shot { position: relative; background: #fff; padding: 5px; border: 1px solid rgba(31,42,48,.25); box-shadow: 2px 3px 0 rgba(31,42,48,.17); transform: rotate(-1.3deg); }
.is-left .shot { transform: rotate(1.1deg); }
.shot img { display: block; width: 100%; height: auto; }
.shot::before {
  content: ''; position: absolute; left: 50%; top: -10px; width: 74px; height: 20px;
  background: rgba(226,214,160,.82); border-inline: 1px dashed rgba(119,69,31,.35);
  transform: translateX(-50%) rotate(-2.5deg);
}
.shot--phone { position: absolute; right: -2px; bottom: -20px; width: 27%; transform: rotate(3.2deg) !important; }
.shot--phone::before { width: 40px; top: -9px; transform: translateX(-50%) rotate(4deg); }

/* start card */
.portrait {
  float: right; position: relative; width: 100px; margin: -46px -4px 4px 14px;
  background: #fff; padding: 5px 5px 6px; border: 1px solid rgba(31,42,48,.25); box-shadow: 2px 3px 0 rgba(31,42,48,.17);
  transform: rotate(2.6deg);
}
.portrait img { display: block; width: 100%; height: auto; }
.portrait::before {
  content: ''; position: absolute; left: 50%; top: -7px; width: 15px; height: 15px; margin-left: -7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #f0686d 0 18%, var(--trail) 45%, #8e1318 100%);
  box-shadow: 1px 2px 2px rgba(31,42,48,.4);
}

/* legend */
.legend { margin: 44px calc(var(--m) + 6px) 0 var(--lane); max-width: 560px; padding: 16px 16px 14px; font-size: 16px; line-height: 1.38; }
.legend h2 { font: italic 700 25px/1.1 var(--serif); margin-bottom: 12px; }
.legend dl > div { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; padding: 6px 0; }
.legend dt { height: 24px; }
.legend dt svg { display: block; }
.legend__foot { margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(31,42,48,.3); }
.legend__foot p { font: italic 500 16.5px/1.3 var(--serif); margin-top: 6px; }
.scalebar { display: block; max-width: 100%; height: auto; }

/* rest stop */
.card--rest { padding-top: 20px; }
.card--rest::after {
  content: ''; position: absolute; right: -14px; top: -26px; width: 88px; height: 84px; border-radius: 50%;
  border: 5px solid rgba(119,69,31,.2); border-top-color: rgba(119,69,31,.09); border-left-width: 3px;
  box-shadow: inset 0 0 0 1px rgba(119,69,31,.1); transform: rotate(24deg); pointer-events: none;
}
.creed h3 { margin-top: 16px; padding-top: 14px; border-top: 1px dashed rgba(31,42,48,.35); font: italic 700 1.28rem/1.2 var(--serif); }
.creed h3:first-child { margin-top: 4px; }

/* signpost */
.card--sign { background: none; border: 0; box-shadow: none; padding: 0; }
.plate { padding: 16px 18px 10px; }
.plate p { margin-bottom: 8px; }
.signpost { position: relative; margin: 0; padding: 22px 0 34px 16px; filter: drop-shadow(3px 4px 0 rgba(31,42,48,.2)); }
.signpost::before {
  content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 13px;
  background: linear-gradient(90deg, #7b6044, #58422c 70%, #4a3724);
  border-radius: 3px 3px 0 0;
}
.signpost li {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 1px;
  min-height: 62px; margin: 0 0 9px -8px; padding: 9px 36px 10px 34px;
  background: var(--green); color: var(--paper);
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 50%, calc(100% - 24px) 100%, 0 100%);
}
.signpost li::before { content: ''; position: absolute; left: 13px; top: 50%; width: 9px; height: 9px; margin-top: -5px; border-radius: 50%; background: #b9c4b2; box-shadow: inset -1px -1px 0 rgba(0,0,0,.35); }
.signpost li:nth-child(odd) { transform: rotate(-.7deg); }
.signpost li:nth-child(even) { transform: rotate(.6deg); width: 94%; }
.arm__name { font: 700 1.1rem/1.2 var(--sans); }
.arm__name small { display: block; font: 400 1rem/1.25 var(--sans); color: #dfe8d4; }
.arm__price { font: italic 500 1.12rem/1.25 var(--serif); color: var(--leaf); }
.plate--pack h3 { font: italic 700 1.28rem/1.2 var(--serif); margin-bottom: 8px; }
.plate--pack li { position: relative; padding: 0 0 8px 20px; }
.plate--pack li::before { content: ''; position: absolute; left: 2px; top: .52em; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--trail); }

/* the cabin */
.card--hut { padding-top: 6px; border-top-color: transparent; }
.roof { position: absolute; left: -15px; bottom: calc(100% - 1px); width: calc(100% + 30px); height: 62px; display: block; overflow: visible; }
.contact { margin-bottom: 2px !important; }
.contact .mail { font: italic 700 clamp(21px, 6.3vw, 30px)/1.1 var(--serif); overflow-wrap: anywhere; }
.contact--tel a { margin-left: 4px; }
.doornote {
  position: relative; margin: 20px -4px 18px 6px; padding: 20px 16px 6px;
  background: #f7efc2; border: 1px solid rgba(119,69,31,.35); box-shadow: 2px 3px 0 rgba(31,42,48,.17);
  transform: rotate(-.8deg);
}
.doornote::before {
  content: ''; position: absolute; left: 50%; top: -7px; width: 15px; height: 15px; margin-left: -7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #f0686d 0 18%, var(--trail) 45%, #8e1318 100%);
  box-shadow: 1px 2px 2px rgba(31,42,48,.4);
}
.doornote h3 { font: italic 700 1.4rem/1.15 var(--serif); margin-bottom: 6px; }
.doornote p { margin-bottom: 6px; }
.shelf { padding-top: 12px; border-top: 1px dashed rgba(31,42,48,.35); }
.shelf h3 { margin-bottom: 6px; }
.shelf li { font: italic 500 1.06rem/1.3 var(--serif); padding: 3px 0 3px 16px; border-left: 3px solid var(--green); margin-bottom: 6px; }

main { padding-bottom: 90px; }

/* ---------- bottom margin of the sheet ---------- */
.margin {
  background: var(--paper);
  border-top: 2px solid var(--ink);
  box-shadow: 0 -4px 0 var(--paper), 0 -5px 0 var(--ink);
  padding: 22px calc(var(--m) + 12px) 26px;
  display: grid; gap: 12px; font-size: 16px; line-height: 1.45;
}
.margin__brand { display: flex; align-items: center; gap: 12px; }
.margin__brand img { width: 46px; height: auto; flex: none; }
.margin__brand b { font: 800 1.25rem/1 var(--serif); }
.margin__legal { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; }
.margin a { font-weight: 500; }

/* ---------- height profile dock ---------- */
.profile {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--dock) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--paper);
  border-top: 2px solid var(--ink);
  box-shadow: 0 -4px 0 var(--paper), 0 -5px 0 rgba(31,42,48,.55), 0 -14px 22px rgba(31,42,48,.1);
  display: grid; grid-template-columns: 50px minmax(0, 1fr) 50px; grid-template-rows: auto minmax(0, 1fr);
}
.profile__step { grid-row: 1 / 3; display: grid; place-items: center; width: 50px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; touch-action: manipulation; }
.profile__step:first-child { grid-column: 1; }
.profile__step:last-child { grid-column: 3; }
.profile__step:disabled { opacity: .28; cursor: default; }
.profile__head { grid-column: 2; grid-row: 1; display: flex; align-items: baseline; justify-content: center; gap: 9px; padding-top: 7px; min-width: 0; white-space: nowrap; }
.profile__title { font: italic 500 16px/1.2 var(--serif); color: var(--brown-ink); }
.profile__now { font: 700 17px/1.2 var(--sans); overflow: hidden; text-overflow: ellipsis; }
.profile__chart { grid-column: 2; grid-row: 2; position: relative; margin: 3px 4px 8px; min-height: 0; }
.profile__stops { display: none; }
.profile__plot { position: absolute; inset: 0; }
#plot { display: block; width: 100%; height: 100%; overflow: visible; }
#plot .area { fill: rgba(168,98,47,.16); }
#plot .line { fill: none; stroke: #a8622f; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
#plot .walked-area { fill: rgba(211,34,42,.2); }
#plot .walked { fill: none; stroke: var(--trail); stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
#plot .lead { stroke: rgba(31,42,48,.45); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 2 3; }
#plot .base { stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.profile__marker {
  position: absolute; left: 0; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--trail); box-shadow: 0 0 0 2px var(--card), 0 0 0 3.2px var(--ink);
  will-change: transform;
}

/* ---------- wide layout ---------- */
@media (min-width: 1000px) {
  :root { --m: 34px; --dock: 106px; }
  body { font-size: 18px; }
  .creases { background-size: 100% 860px, 25% 100%; }

  .hero { min-height: calc(100vh - var(--dock)); padding: calc(var(--m) + 22px) 0 34px calc(var(--m) + 40px); }
  .cover { margin: 0; width: 610px; padding: 22px 26px 18px; }
  h1 { font-size: 53px; white-space: nowrap; }
  .cover__sub { font-size: 20px; }

  .lane { display: none; }
  .via { display: block; }

  .stop--start { position: static; width: 610px; margin-top: 22px; padding-top: 0; }
  .stop--start > .pin { left: max(59%, 772px); top: 330px; }
  .stop--start > .via-b { left: max(61.5%, 800px); top: calc(100% - 10px); }
  .card--start { margin: 0; max-width: none; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding: 24px 26px 14px; }
  .portrait { float: none; width: 150px; margin: 4px 0 0; align-self: start; transform: rotate(-2.2deg); }

  .legend { margin: 26px 0 0; width: 610px; max-width: none; padding: 18px 20px 14px; font-size: 15.5px; }

  main { padding-bottom: 150px; }
  main .stop { display: flex; align-items: flex-start; margin-top: 190px; padding-top: 0; min-height: 600px; }
  main .stop:first-child { margin-top: 150px; }
  main .card { margin: 0; width: min(540px, 42vw); max-width: none; padding: 24px 26px 14px; }
  main .stop--big .card { width: min(600px, 45vw); }
  .is-left .card { margin-left: calc(var(--m) + 46px); }
  .is-right .card { margin-left: auto; margin-right: calc(var(--m) + 46px); }
  .is-left > .via-a { left: 62%; top: 3%; }
  .is-left > .pin { left: 71%; top: 45%; }
  .is-left > .via-b { left: 76%; top: 93%; }
  .is-right > .via-a { left: 38%; top: 3%; }
  .is-right > .pin { left: 29%; top: 45%; }
  .is-right > .via-b { left: 24%; top: 93%; }
  .stop--big.is-right > .via-0 { left: 40%; top: -92px; }
  .stop--big.is-right > .via-a { left: 35%; top: 4%; }
  .stop--big.is-right > .pin { left: 26%; top: 42%; }
  .stop--hut.is-left > .pin { left: 68%; top: 60%; }

  h2 { font-size: 40px; }
  .shots { margin: -54px -12px 22px 14px; }
  .shot { padding: 7px; }
  .shot--phone { right: -26px; bottom: -30px; width: 25%; }

  /* signpost with arms to both sides */
  main .card--sign { width: min(600px, 46vw); padding: 0; }
  .signpost { padding: 26px 0 44px; margin: 0; }
  .signpost::before { left: calc(50% - 7px); }
  .signpost li { width: calc(50% + 8px); min-height: 66px; }
  .signpost li:nth-child(odd) { margin: 0 0 8px calc(50% - 15px); }
  .signpost li:nth-child(even) {
    width: calc(50% + 8px); margin: 0 0 8px 7px; padding: 9px 34px 10px 38px; text-align: right; align-items: flex-end;
    clip-path: polygon(24px 0, 100% 0, 100% 100%, 24px 100%, 0 50%);
  }
  .signpost li:nth-child(even)::before { left: auto; right: 12px; }
  .plate { padding: 20px 24px 12px; }

  .card--hut { margin-top: 62px !important; }
  .roof { height: 74px; left: -18px; width: calc(100% + 36px); }
  .doornote { margin: 22px -22px 20px 28px; padding: 22px 22px 8px; }

  .margin { grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 40px; padding: 24px calc(var(--m) + 40px) 30px; }

  .profile { grid-template-columns: 178px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); padding: 0 calc(var(--m) + 18px) 0 calc(var(--m) + 6px); height: var(--dock); }
  .profile__step { display: none; }
  .profile__head { grid-column: 1; grid-row: 1; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; padding: 0; }
  .profile__title { font-size: 22px; font-weight: 700; color: var(--ink); }
  .profile__now { font: 500 16px/1.2 var(--sans); color: var(--brown-ink); }
  .profile__chart { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; margin: 8px 0 10px; }
  .profile__stops { display: block; position: relative; flex: none; height: 30px; }
  .profile__stops li { position: absolute; top: 0; left: 0; transform: translateX(-50%); white-space: nowrap; }
  .profile__stops li:first-child { transform: translateX(-30%); }
  .profile__stops li:last-child { transform: translateX(-82%); }
  .profile__stops a { display: block; padding: 5px 7px; font: 500 15px/20px var(--sans); text-decoration: none; }
  .profile__stops a span { color: var(--brown-ink); font-weight: 400; }
  .profile__stops a:hover { text-decoration: underline; text-decoration-color: var(--trail); text-decoration-thickness: 2px; text-underline-offset: 4px; }
  .profile__stops a[aria-current] { font-weight: 700; color: var(--trail-ink); }
  .profile__plot { position: relative; inset: auto; flex: 1; min-height: 0; }
}

@media (min-width: 1320px) {
  .hero { padding-right: calc(var(--m) + 40px); }
  .legend { position: absolute; right: calc(var(--m) + 40px); bottom: 26px; width: 304px; margin: 0; padding: 16px 18px 12px; line-height: 1.32; }
  .legend h2 { font-size: 23px; margin-bottom: 8px; }
  .legend dl > div { padding: 5px 0; gap: 10px; }
  .legend__foot { margin-top: 6px; padding-top: 10px; }
}

@media (min-width: 620px) and (max-width: 999px) {
  :root { --lane: 84px; }
  .lane { left: -44px; }
  .lane-b { left: -34px; }
  .stop > .pin { left: 58%; }
  .stop--start { padding-top: 250px; }
  .stop--start > .pin { left: 50%; top: 150px; }
  .cover { max-width: 600px; }
}

@media (prefers-reduced-motion: reduce) {
  .route .wm { transition: none; }
}
