:root {
  color-scheme: light;
  --paper: #f5f2e9;
  --ink: #172018;
  --forest: #17291e;
  --forest-deep: #132319;
  --sage: #dce4cc;
  --olive: #cad98d;
  --lime: #dbef71;
  --line: #314032;
  --muted: #4a594b;
  --content: 1372px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 0.25em; }
:focus-visible { outline: 2px solid #446629; outline-offset: 4px; }
.grid-paper :focus-visible { outline-color: var(--lime); }
p { margin: 0; }
h1, h2, h3, figure { margin: 0; }
.shell { width: min(var(--content), calc(100% - 76px)); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 5;
  background: var(--lime);
  padding: 12px;
}

.masthead {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--ink);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 17px;
  text-decoration: none;
  font-size: clamp(1.1rem, 2.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
}
.seed { width: 38px; height: 32px; position: relative; border-right: 1px solid var(--line); }
.seed::before, .seed::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 20px;
  top: 4px;
  background: var(--ink);
}
.seed::before {
  left: 1px;
  border-radius: 0 100% 0 100%;
  transform: rotate(-10deg);
}
.seed::after {
  left: 14px;
  border-radius: 100% 0 100% 0;
  transform: rotate(9deg);
}
.masthead nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 30px; }
.masthead nav a { font-size: 0.96rem; font-weight: 650; text-decoration: none; }
.masthead nav a:hover, .reading-header a:hover { text-decoration: underline; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
  align-items: stretch;
  gap: clamp(22px, 2.6vw, 42px);
  padding-block: 19px;
}
.intro-copy { align-self: center; padding-block: 18px; }
.intro h1 {
  font-size: clamp(2.55rem, 6.25vw, 6rem);
  line-height: 0.98;
  font-weight: 850;
  letter-spacing: -0.079em;
}
.subtitle {
  font-size: clamp(1.1rem, 2vw, 1.75rem);
  line-height: 1.16;
  font-weight: 760;
  letter-spacing: -0.04em;
  margin-top: 18px;
}
.intro-copy > p:last-child {
  font-size: clamp(1rem, 1.55vw, 1.27rem);
  line-height: 1.48;
  margin-top: 20px;
  max-width: 52ch;
}
.cover {
  min-height: clamp(240px, 23vw, 350px);
  background: var(--lime);
  overflow: hidden;
  position: relative;
}
.cover img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 73% 44%;
  display: block;
}

#entdecken, #hintergruende, .reading details { scroll-margin-top: 14px; }
.view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-block: 1px solid var(--ink);
  padding-block: 5px;
}
.reading { margin-top: 20px; border-top: 1px solid var(--ink); }
.reading-header {
  padding-block: 17px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 25px;
}
.reading-header h2 {
  font-size: clamp(1.75rem, 3.1vw, 2.8rem);
  letter-spacing: -0.069em;
  line-height: 1;
  font-weight: 820;
}
.reading-header nav { display: flex; flex-wrap: wrap; gap: 12px 19px; }
.reading-header nav a { font-weight: 650; text-decoration: none; font-size: 0.9rem; }
.reading details { border-top: 1px solid #a3ab96; }
.reading summary {
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 1px;
  cursor: pointer;
  font-size: clamp(1.02rem, 1.75vw, 1.35rem);
  font-weight: 730;
  letter-spacing: -0.025em;
}
.reading summary::-webkit-details-marker { display: none; }
.reading summary::after { content: "+" / ""; flex: 0 0 24px; text-align: center; font: 700 1.15rem var(--mono); }
.reading details[open] summary::after { content: "−" / ""; }
.reading summary:hover { color: #3d5d36; }
.reading-body { max-width: 80ch; padding-bottom: 20px; line-height: 1.56; font-size: 1rem; }
.reading-body > p + p { margin-top: 10px; }
.equation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 15px;
  margin-block: 14px;
  background: var(--sage);
  border-left: 3px solid #617753;
  padding: 12px 14px;
  font-size: 0.92rem;
}
.equation strong { display: inline-block; margin-right: 4px; }
.reading-definitions { margin: 0; }
.reading-definitions div { display: grid; grid-template-columns: minmax(0, 0.34fr) minmax(0, 1fr); gap: 3px 15px; padding-block: 5px; }
.reading-definitions dt { font-weight: 720; }
.reading-definitions dd { margin: 0; }
.sources { border-top: 1px solid #a3ab96; display: grid; gap: 7px; padding-block: 22px; }
.sources h3 { font-size: 1.02rem; }
.sources ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; font-size: 0.91rem; }
.page-footer { border-top: 1px solid var(--ink); padding-block: 16px 25px; display: flex; justify-content: flex-end; }
.page-footer a { font-size: 0.92rem; font-weight: 700; }

.view-switch { display: flex; align-items: stretch; }
.view-switch button {
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px clamp(14px, 2.05vw, 30px);
  background: transparent;
  font-size: clamp(1rem, 1.53vw, 1.23rem);
  cursor: pointer;
}
.view-switch button:hover { background: #e8ecd7; }
.view-switch button[aria-selected="true"] {
  background: var(--lime);
  border-bottom-color: var(--ink);
  font-weight: 740;
}
.view-note, .case-note h3, .district-caption, .district-count {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.045em;
}
.view-note { color: var(--muted); margin-right: 2px; text-transform: uppercase; }

.stage { display: grid; margin-top: 7px; border: 1px solid var(--ink); }
.map-stage, .district-stage { grid-template-columns: minmax(0, 1.46fr) minmax(0, 1fr); }
.grid-paper {
  background-color: var(--forest);
  background-image:
    linear-gradient(90deg, #c6eb941b 1px, transparent 1px),
    linear-gradient(#c6eb941b 1px, transparent 1px),
    linear-gradient(90deg, #c6eb9410 1px, transparent 1px),
    linear-gradient(#c6eb9410 1px, transparent 1px);
  background-size: 16px 16px, 16px 16px, 80px 80px, 80px 80px;
  background-position: center;
  color: var(--paper);
}
.map { min-height: 444px; position: relative; isolation: isolate; }
.connections { display: block; width: 100%; height: 100%; position: absolute; inset: 0; pointer-events: none; }
.map-core {
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(112px, 13.5vw, 182px);
  aspect-ratio: 1;
  top: 47%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  text-align: center;
  color: var(--ink);
  background: var(--olive);
  box-shadow: 0 0 0 1px #c1d486;
  font-size: clamp(1.25rem, 2.55vw, 2.24rem);
  font-weight: 820;
  line-height: 0.98;
  letter-spacing: -0.064em;
}
.map-core::before, .map-core::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
}
.map-core::before { inset: -15px; border: 1px solid #cad98d5c; }
.map-core::after { inset: 9px; border: 1px solid #6377475c; }
.map-core span { position: relative; }

.map-node, .place {
  color: #f0f3e5;
  background: none;
  border: 0;
  padding: 0;
  display: grid;
  justify-items: center;
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1;
  cursor: pointer;
}
.node-icon, .place-dot {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid #adb88e;
  background: var(--forest-deep);
  outline: 1px solid transparent;
  outline-offset: 4px;
  transition: background-color 220ms ease, border-color 220ms ease, outline-color 220ms ease, scale 220ms ease;
}
.node-icon canvas, .place-dot canvas, #level-icon { display: block; width: 29px; height: 29px; }
.map-node:hover .node-icon, .place:hover .place-dot { scale: 1.09; outline-color: #c8dc8b; }
.map-node[aria-pressed="true"] .node-icon, .place[aria-pressed="true"] .place-dot {
  border-color: var(--lime);
  background: var(--lime);
  outline-color: #dbef7179;
}
.map-node[aria-pressed="true"] canvas, .place[aria-pressed="true"] canvas { filter: brightness(.17) saturate(1.4); }

.node-label, .place-label {
  display: block;
  width: max-content;
  max-width: var(--label-width, 172px);
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 6px;
  background: var(--forest-deep);
  font-size: clamp(0.83rem, 1.4vw, 1.1rem);
  text-align: center;
  overflow-wrap: break-word;
  line-height: 1.08;
  font-weight: 650;
  letter-spacing: -0.024em;
  transition: color 220ms ease;
}
.map-node[aria-pressed="true"] .node-label, .place[aria-pressed="true"] .place-label { color: var(--lime); }
.node-1 { top: 20%; left: 23%; }
.node-2 { top: 20%; left: 77%; }
.node-3 { top: 63%; left: 79%; }
.node-4 { top: 84%; left: 50%; }
.node-5 { top: 63%; left: 21%; }

.panel { background: var(--sage); }
.level-detail, .district-detail { border-left: 1px solid var(--ink); padding: clamp(22px, 2.75vw, 40px); }
.panel h2 {
  font-size: clamp(2rem, 4.05vw, 3.65rem);
  line-height: 1.02;
  font-weight: 820;
  letter-spacing: -0.063em;
  overflow-wrap: break-word;
}
.panel p { font-size: clamp(1rem, 1.5vw, 1.19rem); line-height: 1.46; }
.level-heading { display: grid; gap: 15px; }
#level-icon { width: 38px; height: 38px; }
.level-detail > p { margin-top: 14px; }
.case-note { margin-top: 23px; border-top: 1px solid var(--line); padding-top: 14px; }
.case-note h3 { font-weight: 700; text-transform: uppercase; margin-bottom: 8px; }

.district-map { min-height: 440px; position: relative; isolation: isolate; overflow: hidden; }
.district-map > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; z-index: -1; }
.place-1 { left: 20%; top: 34%; }
.place-2 { left: 85%; top: 30%; }
.place-3 { left: 47%; top: 55%; }
.place-4 { left: 20%; top: 79%; }
.place-5 { left: 79%; top: 75%; }
.place-dot { width: 46px; height: 46px; box-shadow: 0 0 0 3px #132319b5; }
.place-dot canvas { width: 25px; height: 25px; }
.place[aria-pressed="true"] { z-index: 3; }
.place-label { font-size: clamp(0.77rem, 1.15vw, 0.98rem); top: calc(100% + 4px); }
.place-focus {
  position: absolute;
  width: 160px;
  height: 114px;
  top: 50%;
  left: 50%;
  border: 1px solid #dbef718a;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) perspective(240px) rotateX(36deg) scale(.76);
  pointer-events: none;
  background: radial-gradient(ellipse, #ddfa7440, transparent 69%);
  transition: transform 420ms cubic-bezier(.2,.72,.22,1), opacity 360ms ease;
}
.place[aria-pressed="true"] .place-focus, .place-changed .place-focus {
  opacity: 1;
  transform: translate(-50%, -50%) perspective(240px) rotateX(36deg) scale(1);
}
.place-changed .place-focus { background: radial-gradient(ellipse, #dbef7178, #dbef7126 55%, transparent 72%); }
.place-changed:not([aria-pressed="true"]) .place-dot { background: #577048; border-color: var(--lime); }
.place-changed .place-dot::after {
  content: "✓";
  position: absolute;
  top: -4px;
  right: -5px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--forest);
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  font: bold 0.79rem var(--mono);
  animation: marker-appear 360ms cubic-bezier(.2,1.4,.45,1) both;
}
.place-changed .place-focus::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 2px solid var(--lime);
  border-radius: inherit;
  animation: district-ripple 850ms ease-out both;
}
@keyframes marker-appear { from { transform: scale(.35); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes district-ripple { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.44); opacity: 0; } }

.district-detail { display: flex; flex-direction: column; align-items: flex-start; }
.district-caption {
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 630;
  margin-bottom: 15px;
}
.district-detail h2 { font-size: clamp(2rem, 3.45vw, 3.23rem); }
.district-detail h2 + p { margin-top: 12px; }
.idea-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 5px 0;
  margin-top: 12px;
  font-size: clamp(0.95rem, 1.4vw, 1.13rem);
  text-align: left;
  font-weight: 750;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.idea-toggle:hover { color: #3c6134; }
.switch-track {
  flex: 0 0 45px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #bdcaad;
  transition: background-color 200ms ease;
  position: relative;
}
.switch-track::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 4px;
  left: 4px;
  border-radius: 50%;
  background: var(--forest);
  transition: transform 240ms cubic-bezier(.15,.8,.35,1);
}
.idea-active .switch-track { background: var(--lime); }
.idea-active .switch-track::after { transform: translateX(19px); }

.district-result {
  display: grid;
  grid-template-columns: 21px 1fr;
  gap: 7px;
  align-items: start;
  width: 100%;
  margin-block: 9px 14px;
  padding: 12px 14px;
  background: #e9eedc;
  border-left: 2px solid #839677;
  transition: background-color 210ms ease, border-color 210ms ease;
}
.idea-active .district-result { background: #edf2c8; border-left-color: #486b36; }
.district-result > span { font-size: 1.12rem; font-weight: 760; }
.district-result p { font-size: clamp(0.93rem, 1.3vw, 1.06rem); }
.district-next, .district-reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 5px;
  min-height: 38px;
  border: 0;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 730;
  cursor: pointer;
}
.district-next { margin-top: auto; align-self: flex-end; }
.district-next span:last-child { transition: transform 170ms ease; }
.district-next:hover span:last-child { transform: translateX(4px); }
.district-next:hover, .district-reset:enabled:hover { text-decoration: underline; text-underline-offset: 0.22em; }
.district-reset:disabled { opacity: .42; cursor: default; }
.district-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 14px;
  min-height: 48px;
  padding: 3px 16px;
  border-top: 1px solid var(--ink);
}
.district-count { display: flex; align-items: center; gap: 10px; }
.district-meter { display: inline-flex; gap: 3px; }
.district-meter span {
  width: 14px;
  height: 6px;
  border: 1px solid #839677;
  background: #dce4cc;
  transition: background-color 240ms ease, border-color 240ms ease;
}
.district-meter span.active { background: #607c52; border-color: #49623f; }

@media (max-width: 920px) {
  .shell { width: calc(100% - 42px); }
  .map { min-height: 408px; }
}

@media (max-width: 730px) {
  .shell { width: calc(100% - 32px); }
  .masthead { min-height: 56px; }
  .intro { grid-template-columns: 1fr; gap: 15px; padding-block: 13px; }
  .intro-copy { padding-block: 7px 3px; }
  .intro h1 { font-size: clamp(2.68rem, 9.8vw, 4.7rem); }
  .subtitle { margin-top: 10px; }
  .intro-copy > p:last-child { margin-top: 11px; }
  .cover { min-height: clamp(132px, 34vw, 245px); }
  .cover img { object-position: 70% 45%; }
  .map-stage, .district-stage { grid-template-columns: 1fr; }
  .map { min-height: clamp(320px, 72vw, 408px); }
  .map-core { width: clamp(91px, 22vw, 143px); font-size: clamp(1.25rem, 4.4vw, 1.85rem); }
  .map-core::before { inset: -9px; }
  .node-icon { width: 47px; height: 47px; }
  .node-icon canvas { width: 26px; height: 26px; }
  .node-label { font-size: clamp(0.75rem, 2.7vw, 1rem); }
  .node-4 { top: 78%; }
  .level-detail, .district-detail { border-left: 0; border-top: 1px solid var(--ink); }
  .district-map { min-height: auto; aspect-ratio: 1.5; }
  .district-detail { min-height: 345px; }
  .reading-header { display: grid; }
}

@media (max-width: 485px) {
  .masthead { gap: 9px; }
  .masthead nav { gap: 8px 12px; }
  .masthead nav a { font-size: 0.76rem; }
  .brand { gap: 8px; }
  .seed { width: 27px; height: 25px; }
  .seed::before, .seed::after { width: 10px; height: 16px; }
  .seed::after { left: 10px; }
  .view-note { display: none; }
  .map { --label-width: 118px; }
  .node-3 { left: 77%; }
  .node-5 { left: 22%; }
  .place { --label-width: 98px; }
  .place-dot { width: 44px; height: 44px; }
  .place-label { font-size: 0.7rem; }
  .place-focus { width: 100px; height: 76px; }
  .district-footer { padding-inline: 9px; gap: 1px 8px; }
  .district-count { font-size: 0.65rem; letter-spacing: 0; gap: 6px; }
  .district-meter span { width: 8px; }
  .district-reset { font-size: 0.75rem; }
  .reading-definitions div { grid-template-columns: 1fr; }
  .reading-header nav { gap: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
