/* Noch gut · site styles
   Layout: one reading column for the story, a two-part explorer (map, panel) that
   becomes a single column on phones. Light is the default; dark only when the visitor asks. */

@font-face { font-family: "Geist"; src: url("../fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F5F6F2;
  --surface: #FFFFFF;
  --sunk: #ECEEE8;
  --line: #E1E4DD;
  --line-strong: #CDD2C9;
  --ink: #17201A;
  --ink-2: #4F5A53;
  --ink-3: #7C877F;
  --accent: #2C7A4B;
  --accent-hover: #236640;
  --on-accent: #FFFFFF;
  --accent-soft: #E3F0E7;
  --m0: #FFFFFF;          /* district with dates left */
  --m-done: #E6E8E2;      /* no dates left */
  --m-stroke: #D5DAD2;
  --m-border: rgba(23, 32, 26, .5);
  --focus: #2C7A4B;
  --shadow: 0 1px 2px rgba(23, 32, 26, .06), 0 0 0 1px rgba(23, 32, 26, .05);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 14px;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F1311;
  --surface: #161B18;
  --sunk: #1E2521;
  --line: #29312C;
  --line-strong: #3A443E;
  --ink: #E9EEEA;
  --ink-2: #AEB8B1;
  --ink-3: #7F8A83;
  --accent: #6CC48E;
  --accent-hover: #86D3A4;
  --on-accent: #0D1A12;
  --accent-soft: #1C3326;
  --m0: #1B211D;
  --m-done: #232A26;
  --m-stroke: #313A35;
  --m-border: rgba(233, 238, 234, .55);
  --focus: #6CC48E;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .06);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.55; font-feature-settings: "ss01"; }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); line-height: 1.15; }
h3 { font-size: 1.05rem; letter-spacing: -0.01em; }
p { margin: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 8px; z-index: 30; }
.skip:focus { left: 12px; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: var(--gutter); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.narrow { max-width: 760px; }
section { padding-block: clamp(56px, 8vw, 104px); scroll-margin-top: 60px; }
.kicker { font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 12px; }
.sec-lead { color: var(--ink-2); margin-top: 12px; max-width: 60ch; }
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top-in { max-width: 1200px; margin: 0 auto; height: 60px; display: flex; align-items: center; gap: 24px; padding-left: var(--gutter); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -0.02em; font-size: 1.1rem; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 28px; height: 28px; flex: none; }
.nav { display: flex; gap: 22px; margin-right: auto; }
.nav a { color: var(--ink-2); text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1.5px; text-underline-offset: 6px; font-size: .95rem; transition: color .15s ease, text-decoration-color .15s ease; }
.nav a:hover { color: var(--ink); text-decoration-color: var(--accent); }
.top-tools { display: flex; align-items: center; gap: 8px; }
@media (max-width: 860px) { .nav { display: none; } .top-tools { margin-left: auto; } }

.seg { display: inline-flex; background: var(--sunk); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--ink-2); font: 500 .92rem var(--font); padding: 8px 14px; border-radius: 8px; cursor: pointer; min-height: 38px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.panel > .seg { align-self: flex-start; }
.seg-sm button { display: inline-flex; align-items: center; gap: 6px; }
.seg-sm button svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.seg-sm button { font-family: var(--mono); font-size: .8rem; padding: 6px 10px; min-height: 34px; }
.panel .seg-sm button { font-family: var(--font); font-size: .88rem; }

.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 12px; font: 500 1rem var(--font); text-decoration: none; cursor: pointer; border: 0; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }

/* hero */
.hero { padding-block: clamp(48px, 9vw, 120px) clamp(40px, 6vw, 80px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: end; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
.hero-title { font-size: clamp(3.4rem, 2rem + 6vw, 6.5rem); line-height: .95; letter-spacing: -0.045em; font-weight: 600; }
.hero-sub { display: block; font-size: clamp(1.4rem, 1rem + 1.6vw, 2.1rem); letter-spacing: -0.02em; color: var(--ink-3); font-weight: 500; margin-top: 14px; line-height: 1.2; }
.lead { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); color: var(--ink-2); margin: 26px 0 30px; max-width: 34em; line-height: 1.5; }

.status { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.status-label { font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.status-date { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin-top: 6px; }
.status-body { color: var(--ink-2); margin-top: 6px; }
.status-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.status-list li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.status-list .d { font-family: var(--mono); color: var(--ink-2); font-size: .85rem; padding-top: 2px; }
.status-list a { color: var(--ink); text-decoration: none; }
.status-list a:hover { color: var(--accent); }
.status-over { border-left: 0; }

/* story */
.story { background: var(--surface); border-block: 1px solid var(--line); }
.story-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(28px, 6vw, 96px); }
@media (max-width: 860px) { .story-grid { grid-template-columns: minmax(0, 1fr); } }
.story-head h2 { position: sticky; top: 90px; }
.story-body { display: flex; flex-direction: column; gap: 1.1em; max-width: 36em; font-size: 1.12rem; line-height: 1.7; color: var(--ink-2); }
.story-body .story-first { font-size: 1.35rem; line-height: 1.55; color: var(--ink); letter-spacing: -0.01em; }
.sign { font-family: var(--mono); font-size: .9rem; color: var(--ink-3); margin-top: .4em; }
.sign::before { content: "— "; }

/* explorer */
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.explore-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-areas: "map panel"; align-items: start; }
.map-card { grid-area: map; position: sticky; top: 76px; }
.panel { grid-area: panel; align-self: stretch; contain: size; } /* size from the map row, never from its own list */
@media (max-width: 960px) {
  .explore-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "map" "panel"; }
  .panel { contain: none; }
  .panel > .dlist, .panel > .slist { max-height: 60vh; }
  .map-card { position: static; }
}

.map-card { padding: 12px; }
.map-box { position: relative; border-radius: 10px; overflow: hidden; background: var(--sunk); }
#mapSvg { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 1189; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.map-box.zoomed #mapSvg { touch-action: none; }
#mapSvg.dragging { cursor: grabbing; }
#mapSvg .ot { stroke: var(--m-stroke); stroke-width: 1; vector-effect: non-scaling-stroke; transition: fill .2s ease; cursor: pointer; }
#mapSvg .ot.dim { cursor: default; }
#mapSvg .ot.hover { stroke: var(--ink-2); stroke-width: 1.5; }
#mapSvg .ot.sel { stroke: var(--ink); stroke-width: 2.25; }
#mapSvg .bz { fill: none; stroke: var(--m-border); stroke-width: 1.4; vector-effect: non-scaling-stroke; pointer-events: none; }
#mapSvg .lbl { font-family: var(--font); font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-linejoin: round; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
#mapSvg .lbl.soft { fill: var(--ink-2); font-weight: 500; }
#mapSvg .lbl.sel { fill: var(--on-accent); stroke: var(--accent); }
.map-ctrl { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-ctrl .icon-btn { box-shadow: var(--shadow); border-color: transparent; }
.map-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .85rem; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); z-index: 2; }
.map-tip .mono { opacity: .8; margin-left: 6px; }
.map-toast { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: .85rem; padding: 7px 12px; border-radius: 8px; max-width: calc(100% - 24px); text-align: center; z-index: 2; }
.map-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 12px 4px 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--ink-2); align-items: center; }
.legend .sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; box-shadow: inset 0 0 0 1px var(--m-stroke); }
.hint { font-size: .78rem; color: var(--ink-3); }

.panel { padding: 18px; display: flex; flex-direction: column; gap: 14px; min-height: 120px; }
.panel-head .label { font-family: var(--mono); font-size: .78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.panel-head h3 { font-size: 1.25rem; margin-top: 4px; }
.panel-head p { color: var(--ink-2); font-size: .92rem; margin-top: 2px; }
.dlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.panel > * { flex-shrink: 0; }
.panel > .dlist, .panel > .slist { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* always-visible scrollbar on the scrolling lists (phones hide the default overlay one, so you can't tell the list scrolls) */
.panel > .dlist, .panel > .slist, .lookup { scrollbar-width: thin; scrollbar-color: var(--ink-3) var(--sunk); padding-right: 8px; }
.panel > .dlist::-webkit-scrollbar, .panel > .slist::-webkit-scrollbar, .lookup::-webkit-scrollbar { width: 6px; }
.panel > .dlist::-webkit-scrollbar-track, .panel > .slist::-webkit-scrollbar-track, .lookup::-webkit-scrollbar-track { background: var(--sunk); border-radius: 3px; }
.panel > .dlist::-webkit-scrollbar-thumb, .panel > .slist::-webkit-scrollbar-thumb, .lookup::-webkit-scrollbar-thumb { background: var(--ink-3); border-radius: 3px; }
.dlist button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 6px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font: 400 1rem var(--font); text-align: left; cursor: pointer; border-radius: 0; }
.dlist button:hover { background: var(--accent-soft); }
.dlist button:disabled { color: var(--ink-3); cursor: default; background: transparent; }
.dlist .n { font-family: var(--mono); font-size: .85rem; color: var(--ink-2); }
.dlist .sub { display: block; font-size: .8rem; color: var(--ink-3); }
.dlist .group { font-family: var(--mono); font-size: .75rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 14px 6px 6px; border-bottom: 1px solid var(--line); }
.dlist .none-left { font-size: .85rem; color: var(--ink-3); padding: 10px 6px 12px; border-bottom: 1px solid var(--line); line-height: 1.5; }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--accent); font: 500 .92rem var(--font); cursor: pointer; padding: 6px 0; }
.back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.slist { list-style: none; margin: 0; padding: 0; columns: 2 220px; column-gap: 24px; }
.slist li { break-inside: avoid; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .98rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; }
.slist .when { font-family: var(--mono); font-size: .82rem; color: var(--ink-2); text-align: right; white-space: nowrap; }
.slist .empty { display: block; }
.panel > .slist { columns: auto; }
.slist small { display: block; font-family: var(--mono); font-size: .75rem; color: var(--ink-3); }
.empty { color: var(--ink-2); font-size: .95rem; }

/* street lookup */
.street { background: var(--surface); border-block: 1px solid var(--line); }
.field { display: block; margin-top: 28px; }
.field-label { display: block; font-size: .9rem; color: var(--ink-2); margin-bottom: 8px; }
.field-box { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); }
.field-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-box svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; }
.field-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 1.1rem var(--font); }
.lookup { margin-top: 18px; display: flex; flex-direction: column; max-height: var(--map-h, min(60vh, 520px)); overflow-y: auto; overscroll-behavior: contain; }
.lookup .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.lookup .nm { font-weight: 500; }
.lookup .meta { font-size: .85rem; color: var(--ink-3); }
.lookup .dates { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.chip-date { font-family: var(--mono); font-size: .82rem; padding: 4px 9px; border-radius: 7px; background: var(--sunk); color: var(--ink-2); border: 0; }
.chip-date.past { text-decoration: line-through; color: var(--ink-3); background: transparent; }
button.chip-date { cursor: pointer; }
button.chip-date:hover { background: var(--accent-soft); color: var(--ink); }
.chip-date.next { background: var(--accent); color: var(--on-accent); }
.chip-date.next:hover { background: var(--accent-hover); color: var(--on-accent); }
.lookup .msg { color: var(--ink-2); font-size: .95rem; padding: 6px 0; }
@media (max-width: 560px) { .lookup .row { grid-template-columns: minmax(0, 1fr); } .lookup .dates { justify-content: flex-start; } }

/* kindly */
.rules { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 40px; counter-reset: rule; }
.rules li { counter-increment: rule; padding: 20px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: 4px 6px; }
.rules li::before { content: counter(rule, decimal-leading-zero); font-family: var(--mono); font-size: .85rem; color: var(--accent); grid-row: 1 / 3; padding-top: 2px; }
.rules p { color: var(--ink-2); font-size: .98rem; }
.note { margin-top: 20px; font-size: .88rem; color: var(--ink-3); max-width: 70ch; }
.more-title { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.8rem); margin-top: clamp(56px, 7vw, 88px); }
.more { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.more a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.more a:hover { box-shadow: 0 0 0 1.5px var(--accent); }
.more strong { font-weight: 600; }
.more span { color: var(--ink-2); font-size: .92rem; }
.more .url { margin-top: auto; padding-top: 8px; font-size: .78rem; color: var(--accent); }

/* about */
.about { border-top: 1px solid var(--line); padding-bottom: clamp(24px, 3vw, 40px); }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 32px 48px; margin-top: 32px; }
.about-grid h3 { margin-bottom: 12px; }
.about-grid p, .plain li { font-size: .92rem; color: var(--ink-2); }
.about-grid p + p { margin-top: 10px; }
.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.small { font-size: .82rem !important; color: var(--ink-3) !important; margin-top: 14px; font-family: var(--mono); }

/* decorative photo above the footer, inset to the page width; its top edge dissolves into the About section's background */
.scene { margin-top: -1px; line-height: 0; }
.scene img { display: block; width: 100%; border-radius: var(--r) var(--r) 0 0; height: clamp(220px, 34vw, 400px); object-fit: cover; object-position: center bottom;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 55%); mask-image: linear-gradient(to bottom, transparent 0, #000 55%); }
:root[data-theme="dark"] .scene img { filter: brightness(.62) saturate(.9); }
.foot { border-top: 1px solid var(--line); padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); font-size: .88rem; color: var(--ink-3); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; }
.foot-links a { color: var(--ink-2); }
