:root {
  --ink: #0F2F38;
  --ink-soft: #3F5C65;
  --paper: #F5F9F7;
  --white: #FFFFFF;
  --land: #DCEAE3;
  --park: #B6D8C3;
  --river: #2A7E95;
  --free: #0A6F50;
  --sun: #F7BE2C;
  --rule: #C3D5CD;
  --alert: #FFF3CF;
  --display: "Familjen Grotesk", "Trebuchet MS", sans-serif;
  --text: "Source Serif 4", Georgia, serif;
  --gutter: clamp(16px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { overscroll-behavior-y: none; }

html {
  background: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--text);
  overflow-x: clip;
}

main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
}

p { margin: 0 0 1em; }

a { color: inherit; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--sun);
  border-radius: 2px;
}

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

.mast {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.mast__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 1.125rem/1.1 var(--display);
  text-decoration: none;
  margin-right: auto;
}

.mast__nav { display: flex; gap: 20px; }
.mast__nav a { font: 500 .9375rem/1.3 var(--display); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.mast__nav a:hover { border-bottom-color: var(--river); }

.mast__call {
  padding: 8px 14px;
  background: var(--sun);
  color: var(--ink);
  font: 700 .9375rem/1.2 var(--display);
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
}
.mast__call span { font-weight: 400; }
.mast__call:hover { background: #FFD25A; }

.mast__toggle {
  display: none;
  background: none;
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 6px 12px;
  font: 700 .9375rem var(--display);
  color: var(--ink);
  cursor: pointer;
}

.opening {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
}

.opening__copy {
  padding: clamp(32px, 5vw, 72px) clamp(24px, 3.5vw, 56px) clamp(32px, 5vw, 72px) var(--gutter);
  align-self: center;
}

.opening h1 {
  font-size: clamp(2.25rem, 4.2vw, 3.75rem);
  letter-spacing: -.015em;
  margin-bottom: .5em;
}

.opening__copy > p { max-width: 34rem; font-size: 1.125rem; }

.opening__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.btn {
  display: inline-block;
  padding: 13px 20px;
  font: 700 1rem/1.2 var(--display);
  text-decoration: none;
  cursor: pointer;
  border-radius: 6px;
  border: 2px solid var(--ink);
}
.btn--solid { background: var(--ink); color: var(--white); }
.btn--solid:hover { background: var(--river); border-color: var(--river); }
.btn--line { background: transparent; color: var(--ink); }
.btn--line:hover { background: var(--land); }

.atlas {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
  font-family: var(--display);
}

.atlas__plate {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  background: var(--land);
}

.atlas svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.atlas__land { fill: var(--land); }
.atlas__park { fill: var(--park); }
.atlas__river { fill: none; stroke: var(--river); stroke-width: 34; stroke-linecap: round; stroke-linejoin: round; }

.atlas__area, .atlas__river-name {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: .8125rem;
  color: var(--ink-soft);
  pointer-events: none;
  white-space: nowrap;
}
.atlas__river-name { font-style: italic; color: #175A6E; }

.pin {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translate(-16px, -50%);
  text-decoration: none;
  z-index: 2;
}

.pin b {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--white);
  font: 700 .9375rem/1 var(--display);
  border: 2px solid var(--white);
  transition: transform .15s ease;
}
.pin--free b { background: var(--free); border-radius: 50%; }
.pin--paid b { background: var(--ink); border-radius: 5px; }

.pin span {
  padding: 2px 7px;
  background: var(--white);
  border-radius: 3px;
  font-size: .8125rem;
  font-weight: 700;
  white-space: nowrap;
}

.pin--left { flex-direction: row-reverse; transform: translate(calc(-100% + 16px), -50%); }
.pin--under { flex-direction: column; gap: 3px; transform: translate(-50%, -16px); }
.pin:hover b, .pin.is-lit b { transform: scale(1.2); }
.pin.is-dim { opacity: .22; }

.atlas__key {
  flex: 1 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding: 10px 16px;
  background: var(--white);
  font-size: .875rem;
  line-height: 1.3;
}
.atlas__key > span { display: inline-flex; align-items: center; gap: 6px; }
.atlas__note { color: var(--ink-soft); }

.key { display: inline-block; width: 13px; height: 13px; }
.key--free { background: var(--free); border-radius: 50%; }
.key--paid { background: var(--ink); border-radius: 2px; }

.lifeline {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: "lead one" "lead two";
  column-gap: clamp(24px, 3.5vw, 56px);
  row-gap: 8px;
  padding: 28px var(--gutter);
  background: var(--ink);
  color: var(--white);
}

.lifeline__lead {
  grid-area: lead;
  margin: 0;
  font: 700 clamp(1.375rem, 2.4vw, 1.875rem)/1.2 var(--display);
  max-width: 22ch;
}

.lifeline__line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; }
.lifeline__line a {
  color: var(--sun);
  font: 700 clamp(1.5rem, 2.6vw, 2rem)/1.2 var(--display);
  text-decoration: none;
  min-width: 8.2em;
}
.lifeline__line a:hover { text-decoration: underline; }
.lifeline__line p { margin: 0; flex: 1 1 18rem; }
.lifeline :focus-visible { outline-color: var(--white); box-shadow: none; }

.ledger { padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(32px, 4vw, 56px); }

.ledger__head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
  margin-bottom: 24px;
}
.ledger__head h2 { font-size: clamp(1.875rem, 3.2vw, 2.75rem); margin-bottom: .5em; }
.ledger__head p { max-width: 42rem; margin-bottom: 0; }

.sieve { display: flex; flex-wrap: wrap; gap: 8px; }
.sieve button {
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font: 500 .9375rem/1.2 var(--display);
  cursor: pointer;
}
.sieve button:hover { background: var(--land); }
.sieve button[aria-pressed="true"] { background: var(--ink); color: var(--white); font-weight: 700; }
.sieve__count { flex-basis: 100%; font-size: .9375rem; color: var(--ink-soft); }

.ledger__group {
  font-size: 1.25rem;
  padding: 28px 0 10px;
  border-bottom: 3px solid var(--ink);
}

.row {
  display: grid;
  grid-template-columns: 44px minmax(0, 5fr) minmax(0, 4fr) minmax(170px, 2fr);
  gap: 8px clamp(16px, 2.5vw, 36px);
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
}
.row[hidden], .ledger__group[hidden] { display: none; }
.row:target { background: linear-gradient(90deg, var(--alert), transparent 70%); }

.row__num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--white);
  background: var(--ink);
  border-radius: 5px;
  font: 700 .9375rem/1 var(--display);
}
.row__num--free { background: var(--free); border-radius: 50%; }

.row__main h4 { font-size: 1.375rem; margin-bottom: 4px; }
.row__who { margin-bottom: .6em; color: var(--ink-soft); font-size: .9375rem; }
.row__main p:last-child { margin-bottom: 0; }

.row__facts { margin: 0; font-size: .9375rem; line-height: 1.45; }
.row__facts div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; padding-bottom: 10px; }
.row__facts dt { color: var(--ink-soft); }
.row__facts dd { margin: 0; }

.row__reach { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: .9375rem; overflow-wrap: anywhere; }
.row__tel {
  font: 700 1.25rem/1.2 var(--display);
  white-space: nowrap;
}

.ledger__empty { margin: 28px 0 0; max-width: 46rem; }

.reading {
  display: grid;
  grid-template-columns: minmax(200px, 270px) minmax(0, 46rem);
  justify-content: start;
  gap: clamp(32px, 6vw, 96px);
  padding: clamp(32px, 5vw, 64px) var(--gutter) clamp(56px, 7vw, 96px);
  background: var(--white);
  border-top: 1px solid var(--rule);
}

.contents { position: sticky; top: 88px; align-self: start; font-size: .9375rem; }
.contents summary { font: 700 1.125rem var(--display); cursor: pointer; margin-bottom: 10px; }
.contents ol { list-style: none; margin: 0; padding: 0; }
.contents li { border-top: 1px solid var(--rule); }
.contents a { display: block; padding: 7px 0; text-decoration: none; line-height: 1.3; }
.contents a:hover { color: var(--river); text-decoration: underline; }

.prose section { margin-bottom: clamp(40px, 5vw, 60px); }
.prose h2 { font-size: clamp(1.625rem, 2.6vw, 2.125rem); margin-bottom: .55em; }
.prose h3 { font-size: 1.1875rem; margin: 1.2em 0 .35em; }
.prose ul { margin: 0; padding-left: 1.2em; }
.prose li { margin-bottom: .35em; }

.prose__alert {
  padding: 16px 18px;
  background: var(--alert);
  border-left: 5px solid var(--sun);
}

.check { padding: clamp(20px, 3vw, 36px); background: var(--paper); border-radius: 10px; }

.q {
  margin: 0;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid var(--rule);
}
.q legend { padding: 0; font-weight: 700; float: left; width: 100%; margin-bottom: 10px; }
.q__opts { clear: both; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.q__opts label { position: relative; display: block; cursor: pointer; }
.q__opts input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.q__opts span {
  display: block;
  padding: 9px 4px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 5px;
  text-align: center;
  font: 500 .875rem/1.2 var(--display);
}
.q__opts label:hover span { border-color: var(--ink); }
.q__opts input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--white); font-weight: 700; }
.q__opts input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 2px var(--sun); }
.q.is-missing legend { color: #A32A12; }
.q.is-missing .q__opts span { border-color: #A32A12; }

.check__error { color: #A32A12; font-weight: 700; margin: 12px 0 0; }
.check__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.check__result {
  margin-top: 22px;
  padding: 20px;
  background: var(--ink);
  color: var(--white);
  border-radius: 6px;
}
.check__result:focus { outline: none; }
.check__result strong { display: block; font: 700 1.625rem/1.2 var(--display); margin-bottom: 6px; color: var(--sun); }
.check__result p { margin: 0 0 .7em; }
.check__result p:last-child { margin-bottom: 0; }
.check__small { margin: 18px 0 0; font-size: .9375rem; color: var(--ink-soft); }

.routes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 18px; }
.routes__item { padding-top: 12px; border-top: 4px solid var(--river); font-size: 1rem; }
.routes__item:first-child { border-top-color: var(--free); }
.routes__item:last-child { border-top-color: var(--ink); }
.routes__item h3 { margin-top: 0; }
.routes__item p { margin: 0; }

.asks { padding-left: 1.4em; margin: 0 0 1em; }
.asks li { margin-bottom: .45em; }

.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { padding: 14px 0; font-weight: 700; cursor: pointer; }
.faq summary:hover { color: var(--river); }
.faq details p { margin: 0 0 16px; }

.base { flex-shrink: 0; padding: 40px var(--gutter) 32px; background: var(--ink); color: var(--white); }
.base__top {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 16px clamp(24px, 4vw, 64px);
  padding-bottom: 22px;
  border-bottom: 1px solid #3B5A63;
}
.base__name { display: flex; align-items: center; gap: 10px; margin: 0; font: 700 1.25rem/1.2 var(--display); }
.base__statement { margin: 0; font: 500 clamp(1.25rem, 2.2vw, 1.625rem)/1.3 var(--display); }
.base__small { columns: 2; column-gap: clamp(24px, 4vw, 64px); padding-top: 22px; font-size: .9375rem; color: #D7E4DF; }
.base__small p { break-inside: avoid; margin: 0 0 .9em; }
.base__small a { color: var(--sun); }
.base :focus-visible { outline-color: var(--white); box-shadow: none; }

.lost {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 110px) var(--gutter);
}
.lost h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); margin-bottom: .4em; }

@media (max-width: 1180px) {
  .mast { gap: 16px; }
  .mast__call span { display: none; }
  .row { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); }
  .row__reach { grid-column: 2 / -1; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
}

@media (max-width: 960px) {
  .mast { flex-wrap: wrap; }
  .mast__toggle { display: block; order: 2; }
  .mast__brand { order: 1; }
  .mast__call { order: 3; }
  .mast__nav {
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    display: none;
  }
  .mast__nav.is-open { display: flex; }
  .mast__nav a { padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 0; }

  .opening { grid-template-columns: minmax(0, 1fr); }
  .opening__copy { padding: 32px var(--gutter); }

  .lifeline { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lead" "one" "two"; row-gap: 14px; }
  .lifeline__lead { max-width: none; }
  .lifeline__line { flex-direction: column; }
  .lifeline__line p { flex: none; }

  .ledger__head { grid-template-columns: minmax(0, 1fr); }

  .reading { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .contents { position: static; padding: 12px 14px; background: var(--paper); border-radius: 6px; }
  .contents summary { margin-bottom: 0; }
  .contents[open] summary { margin-bottom: 10px; }
}

@media (max-width: 720px) {
  body { font-size: 1.0625rem; }
  .mast__brand span { font-size: 1rem; }
  .mast__call { flex: 1 1 100%; text-align: center; padding: 10px; }
  .mast__call span { display: inline; }
  html { scroll-padding-top: 130px; }

  .pin b { width: 28px; height: 28px; font-size: .875rem; }
  .pin, .pin--left, .pin--under { flex-direction: row; transform: translate(-14px, -50%); }
  .pin span, .atlas__area, .atlas__river-name { display: none; }

  .row { grid-template-columns: 40px minmax(0, 1fr); }
  .row__facts, .row__reach { grid-column: 2; }
  .routes { grid-template-columns: minmax(0, 1fr); }
  .base__top { grid-template-columns: minmax(0, 1fr); }
  .base__small { columns: 1; }
  .q__opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pin b { transition: none; }
}
