/* About page (about.html). Colours come from CSS variables set by themes.js. */
:root {
  --hdr: calc(57px + env(safe-area-inset-top));
  --sea: #0b1a30; --land: #15233a; --panel: #0f1b30; --panel-edge: #1e2f4a;
  --ink: #c9d6ea; --ink-dim: #7f93b2; --accent: #6fa3e8; --accent-ink: #08111f;
}

/* Show only the chosen language (text for both is in the HTML so search engines see it all) */
html[data-lang="da"] body [lang="en"],
html[data-lang="en"] body [lang="da"] { display: none; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 12px; }
body {
  margin: 0;
  background: var(--panel);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  padding-bottom: env(safe-area-inset-bottom);
  transition: background-color .4s, color .4s;
}
main { min-width: 0; padding: 8px 0 32px; }
a { color: var(--accent); }

/* Top bar: back to the map, plus theme and language switches */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-edge);
  transition: background-color .4s, border-color .4s;
}
.back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px 9px 10px; border-radius: 12px;
  font-size: 14px; font-weight: 650; letter-spacing: .02em; text-decoration: none;
  color: var(--accent-ink); background: var(--accent);
  transition: filter .15s, transform .15s, background-color .4s;
}
.back:hover { filter: brightness(1.1); transform: translateX(-2px); }
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.switches { display: flex; gap: 8px; }
.to-map { display: flex; justify-content: center; padding: 8px 20px calc(48px + env(safe-area-inset-bottom)); }

/* Same two-way switches as in the game */
.switch {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  width: 78px; height: 36px; border-radius: 11px; overflow: hidden;
  background: color-mix(in srgb, var(--ink) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--panel-edge) 90%, transparent);
}
.switch .thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 8px;
  background: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transition: transform .38s cubic-bezier(.65,0,.25,1), background-color .4s;
}
.switch[data-kind="theme"].is-day .thumb,
.switch[data-kind="lang"].is-en .thumb { transform: translateX(100%); }
.switch button {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink-dim); cursor: pointer;
  transition: color .3s; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.switch button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.switch[data-kind="theme"] button.active { color: var(--accent-ink); }
.switch[data-kind="lang"] .thumb { background: color-mix(in srgb, var(--accent) 38%, transparent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.switch[data-kind="lang"] .flag { width: 21px; height: auto; max-height: 15px; border-radius: 3px; stroke: none; box-shadow: 0 0 0 1px rgba(0,0,0,.25); opacity: .55; transition: opacity .3s, transform .3s; }
.switch[data-kind="lang"] button.active .flag { opacity: 1; transform: scale(1.06); }

/* Fade/slide in on load, fade out when leaving */
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
main, .to-map { animation: page-in .5s cubic-bezier(.2,.7,.2,1) both; }
body.leaving { opacity: 0; transition: opacity .28s ease; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { main, .to-map { animation: none; } body.leaving { transition: none; } }

.hero { padding: 28px 0 8px; }
.eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-dim); }
h1 { margin: 0 0 18px; font-size: clamp(26px, 5.4vw, 38px); line-height: 1.15; letter-spacing: -.01em; font-weight: 750; }
.hero p { margin: 0 0 14px; font-size: 17px; }

h2 { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-dim); }

/* Word glossary */
.terms { margin-top: 36px; }
.terms dl { margin: 14px 0 0; display: grid; gap: 12px; }
.term {
  padding: 16px 18px;
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}
.term dt { margin: 0 0 4px; font-size: 17px; font-weight: 700; color: var(--accent); }
.term dd { margin: 0; font-size: 15px; }

/* Jump links */
.toc { margin-top: 40px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chips a {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--ink); border: 1px solid var(--panel-edge);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  transition: background-color .2s, border-color .2s, color .2s;
}
.chips a:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* The ten areas */
.group { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--panel-edge); }
.group header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; }
.group .num { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.group h2 { font-size: clamp(24px, 4.6vw, 30px); letter-spacing: -.005em; text-transform: none; color: var(--ink); font-weight: 750; }
.group .count { margin: 0; font-size: 13px; color: var(--ink-dim); }
.summary { margin: 10px 0 20px; font-size: 17px; }
.districts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.district {
  padding: 16px 18px 14px;
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}
.district { min-width: 0; }
.district h3 { overflow-wrap: break-word; margin: 0 0 6px; font-size: 16px; line-height: 1.3; font-weight: 700; }
.district p { margin: 0; font-size: 14.5px; line-height: 1.6; color: color-mix(in srgb, var(--ink) 88%, transparent); }

.more { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--panel-edge); }
.more ul { margin: 14px 0; padding-left: 20px; }
.more li { margin-bottom: 6px; }
.credit { margin-top: 24px; font-size: 13px; color: var(--ink-dim); }

@media (max-width: 520px) {
  main { padding: 4px 0 24px; }
  .back span { font-size: 13px; }
  .districts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ------------------------------------------------------------------
   Page layout with the mini map
   wide screens: text column + a map that stays in view on the right
   narrow screens: the map becomes a strip pinned under the top bar
   ------------------------------------------------------------------ */
.layout { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.to-map { max-width: 1180px; margin: 0 auto; }

.minimap { position: sticky; top: var(--hdr); z-index: 9; order: -1; margin: 0 -20px; }
.mm-card {
  display: flex; align-items: center; gap: 14px;
  height: 150px; padding: 10px 20px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-edge);
  transition: background-color .4s, border-color .4s;
}
.layout { display: flex; flex-direction: column; }
.mm { height: 100%; width: auto; flex: none; max-width: 52%; overflow: visible; }
.mm-caption { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mm-group { font-size: 11px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.mm-district { font-size: 17px; font-weight: 700; line-height: 1.25; overflow-wrap: break-word; }
.mm-hint { font-size: 13px; color: var(--ink-dim); line-height: 1.4; }
.mm-caption.has-focus .mm-hint { display: none; }
.mm-caption:not(.has-focus) .mm-group, .mm-caption:not(.has-focus) .mm-district { display: none; }
.hint-touch { display: inline; }
.hint-hover { display: none; }
html[data-lang="da"] body .mm-hint [lang="en"], html[data-lang="en"] body .mm-hint [lang="da"] { display: none; }
@media (hover: hover) and (pointer: fine) {
  .hint-touch { display: none !important; }
  .hint-hover { display: inline; }
  html[data-lang="da"] body .hint-hover[lang="en"], html[data-lang="en"] body .hint-hover[lang="da"] { display: none; }
}

/* map drawing: land and lakes give the city its recognisable shape */
.mm path.land { fill: color-mix(in srgb, var(--ink) 5%, transparent); stroke: color-mix(in srgb, var(--ink) 14%, transparent); stroke-width: 1; pointer-events: none; }
.mm path.w { fill: var(--mm-water); stroke: none; pointer-events: none; opacity: .9; transition: fill .4s; }
.mm path.d {
  fill: color-mix(in srgb, var(--ink) 11%, transparent);
  stroke: color-mix(in srgb, var(--ink) 28%, transparent);
  stroke-width: 1.1; stroke-linejoin: round;
  cursor: pointer;
  transition: fill .22s ease, stroke .22s ease, opacity .22s ease;
}
.mm path.o { fill: none; stroke: color-mix(in srgb, var(--ink) 38%, transparent); stroke-width: 2.4; stroke-linejoin: round; pointer-events: none; transition: stroke .22s ease, stroke-width .22s ease; }
.mm.has-focus path.d { opacity: .7; }
.mm path.d.grp { fill: color-mix(in srgb, var(--accent) 34%, transparent); stroke: color-mix(in srgb, var(--accent) 70%, transparent); opacity: 1; }
.mm path.d.on { fill: var(--accent); stroke: var(--accent); opacity: 1; }
.mm path.o.on { stroke: var(--accent); stroke-width: 3.4; }

/* text that is linked to the map */
.group > header, .district, .chips a { transition: background-color .2s, border-color .2s, box-shadow .2s, transform .2s; }
.district { cursor: pointer; scroll-margin-top: calc(var(--hdr) + 170px); }
.group { scroll-margin-top: calc(var(--hdr) + 166px); }
.district.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: 0 0 0 1px var(--accent);
}
.group.is-active .num { color: var(--ink); }
.group.is-active > header h2 { color: var(--accent); }
.chips a.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

@media (min-width: 1020px) {
  .layout { display: grid; grid-template-columns: minmax(0, 700px) 380px; gap: 48px; justify-content: center; }
  .minimap { order: 0; margin: 0; top: calc(var(--hdr) + 20px); align-self: start; }
  .mm-card {
    flex-direction: column; align-items: stretch; height: auto; padding: 16px;
    border: 1px solid var(--panel-edge); border-radius: 18px;
    background: color-mix(in srgb, var(--ink) 5%, var(--panel));
    box-shadow: 0 12px 36px rgba(0,0,0,.18);
  }
  .mm { width: 100%; height: auto; max-width: none; }
  .mm-caption { min-height: 62px; }
  .district { scroll-margin-top: calc(var(--hdr) + 24px); }
  .group { scroll-margin-top: calc(var(--hdr) + 20px); }
}
@media (max-width: 520px) {
  .layout { padding: 0 16px; }
  .minimap { margin: 0 -16px; }
  .mm-card { padding: 8px 16px; height: 140px; }
  .mm-district { font-size: 16px; }
}

/* postal codes, notes and sources */
.post { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; }
.post .lbl { font-weight: 650; letter-spacing: .08em; text-transform: uppercase; font-size: 10.5px; margin-right: 4px; }
.post .codes { color: var(--ink); font-variant-numeric: tabular-nums; }
.group > .post { margin: -8px 0 18px; font-size: 14px; }
.note { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--accent); border-radius: 4px; font-size: 13.5px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sources { margin-top: 10px; font-size: 12px; color: var(--ink-dim); }
.sources ul { margin: 4px 0 0; padding-left: 16px; }
.sources li { margin-bottom: 3px; }
