:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #16202b;
  --muted: #5a6775;
  --border: #e1e7ef;
  --focus: #0047bb;
  --bergen-x: 14.5%;
  --bergen-y: 20%;
  --stavanger-x: 20%;
  --stavanger-y: 65.5%;
  --kristiansand-x: 48.5%;
  --kristiansand-y: 93.5%;
  --oslo-x: 76%;
  --oslo-y: 36%;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161d;
    --surface: #171f28;
    --text: #eef3f8;
    --muted: #aeb8c4;
    --border: #323e4a;
    --focus: #7db2ff;
    color-scheme: dark;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, Cambria, "Times New Roman", serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: #20262b;
  color: #ffffff;
  border-radius: 0.4rem;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: min(52rem, calc(100% - 2rem));
  margin: 0 auto;
}

.wrap-list {
  width: min(52rem, calc(100% - 2rem));
}

.site-header {
  padding: 1.75rem 0 0.5rem;
}

.language-switch {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
}

.language-switch a {
  color: var(--muted);
  text-decoration: none;
}

.language-switch a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

h1,
h2,
h3,
p,
ul,
li {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.08;
}

h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.95rem, 4.2vw, 2.85rem);
  letter-spacing: -0.04em;
}

.page-title {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.title-logo {
  display: block;
  width: auto;
  height: clamp(3.15rem, 6.8vw, 4.3rem);
  flex: none;
  transform: translateY(0.18rem);
}

.intro {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.16rem;
}

main {
  padding: 1.25rem 0 1.25rem;
}

.site-footer {
  padding: 0 0 1.5rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.footer-row p {
  margin-bottom: 0;
}

.footer-license,
.footer-links {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
}

.github-link svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.footer-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.footer-icon-link img {
  display: block;
  width: 1rem;
  height: 1rem;
  object-fit: contain;
}

.map-section {
  margin-bottom: 1.5rem;
}

.map-figure {
  margin: 1.5rem 0 0;
}

.map-canvas {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--surface) 76%, var(--bg));
  aspect-ratio: 4 / 3;
}

.map-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: saturate(0) contrast(0.92) brightness(0.96);
  opacity: 0.72;
}

.map-point {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  transform: translate(-50%, -50%);
}

.map-dot {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--bg) 82%, transparent);
  transition: transform 140ms ease, background-color 140ms ease;
}

.map-name {
  padding: 0.08rem 0.24rem;
  border-radius: 0.22rem;
  font-size: 1.14rem;
  text-shadow: 0 1px 0 color-mix(in srgb, var(--bg) 80%, transparent);
}

.map-point:hover .map-dot,
.map-point:focus-visible .map-dot {
  background: var(--focus);
  box-shadow: 0 0 0 0.28rem rgba(0, 71, 187, 0.18);
  transform: scale(1.14);
}

.map-point.is-linked-active .map-dot {
  background: var(--focus);
  box-shadow: 0 0 0 0.28rem rgba(0, 71, 187, 0.18);
  transform: scale(1.14);
}

.map-point.is-linked-active .map-name {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.map-point-bergen {
  left: var(--bergen-x);
  top: var(--bergen-y);
}

.map-point-stavanger {
  left: var(--stavanger-x);
  top: var(--stavanger-y);
}

.map-point-kristiansand {
  left: var(--kristiansand-x);
  top: var(--kristiansand-y);
}

.map-point-oslo {
  left: var(--oslo-x);
  top: var(--oslo-y);
}

@media (prefers-color-scheme: dark) {
  .map-name {
    color: #ffffff;
    background: rgba(16, 22, 29, 0.42);
    text-shadow:
      0 1px 0 rgba(0, 0, 0, 0.55),
      0 0 0.35rem rgba(0, 0, 0, 0.35);
  }

  .map-dot {
    box-shadow: 0 0 0 0.22rem rgba(16, 22, 29, 0.88);
  }

  .title-logo {
    filter: invert(1) brightness(1.05);
  }
}

.map-attribution {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.section {
  padding: 0;
}

.chapter-grid {
  display: grid;
  gap: 0.7rem;
}

.chapter-card {
  background: transparent;
}

.chapter-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem;
  gap: 1rem;
  align-items: baseline;
  padding: 1.1rem 0;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 140ms ease, border-color 140ms ease;
}

.chapter-link header {
  min-width: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 1.34rem;
}

.chapter-link h3 {
  text-decoration: none;
}

.chapter-link:hover h3 {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.chapter-link p {
  margin-bottom: 0;
  color: color-mix(in srgb, var(--text) 68%, var(--bg));
  font-size: 0.96rem;
  text-align: right;
  white-space: nowrap;
}

.chapter-link:hover {
  border-color: var(--text);
}

.chapter-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.chapter-link.is-linked-active {
  border-color: var(--text);
}

.chapter-link.is-linked-active h3 {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .chapter-link {
    transition: none;
  }
}

@media (max-width: 700px) {
  .chapter-link {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .chapter-link p {
    text-align: left;
    white-space: normal;
  }

  .map-name {
    font-size: 0.95rem;
  }

  .footer-row {
    display: block;
  }

  .footer-repo {
    margin-top: 0.6rem;
  }
}

@media (max-width: 540px) {
  .wrap,
  .wrap-list {
    width: min(52rem, calc(100% - 1rem));
  }

  .site-header {
    padding: 1.25rem 0 0.35rem;
  }

  .page-title {
    gap: 0.55rem;
  }

  main {
    padding: 0.75rem 0 1rem;
  }

  h1 {
    font-size: 1.65rem;
  }
}
