:root {
  color-scheme: light dark;
  --paper: light-dark(#f5eedf, #16130e);
  --paper-2: light-dark(#ece2cb, #201b14);
  --card: light-dark(#fffaf0, #241f17);
  --ink: light-dark(#2a2118, #ede4d2);
  --muted: light-dark(#6a5c48, #b5a890);
  --line: light-dark(#d8c9a8, #3b3327);
  --accent: light-dark(#8b1e24, #e57a7f);
  --c-bishop: light-dark(#a3242c, #e3676e);
  --c-drenten: light-dark(#3d6b2c, #92c47c);
  --c-gevolg: light-dark(#9a630e, #e3ae52);
  --c-slagveld: light-dark(#2d4d73, #8aaedb);
  --field: light-dark(#efe4c6, #2a2419);
  --ridge: light-dark(#e2cf9c, #4a3e28);
  --marsh-fill: light-dark(#b9c39b, #36402a);
  --marsh-ink: light-dark(#5d6b42, #8a9b6a);
  --water: light-dark(#7ea3bf, #3e6584);
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 6px 20px rgb(60 40 10 / .08);
  --radius: 10px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --header-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { text-wrap: pretty; }
.wrap { max-width: 1180px; margin-inline: auto; padding-inline: 16px; }
section { padding-block: clamp(48px, 8vw, 96px); }
.sub { color: var(--muted); max-width: 70ch; margin-top: -.2em; }
.small { font-size: .875rem; color: var(--muted); }

#progress { position: fixed; inset: 0 0 auto; height: 3px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: 1001; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes grow-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
    #progress { animation: grow-progress auto linear; animation-timeline: scroll(root); }
  }
}

.site-header {
  position: sticky; top: 0; z-index: 1100;
  height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
  padding-inline: 16px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); }
.site-header nav { overflow-x: auto; scrollbar-width: none; min-width: 0; mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
.site-header ul { display: flex; gap: 0; list-style: none; margin: 0; padding: 0 24px 0 0; }
.site-header nav a { display: block; padding: 6px 8px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: .9rem; white-space: nowrap; }
.site-header nav a:hover, .site-header nav a:focus-visible { color: var(--ink); background: var(--paper-2); }

.hero { position: relative; min-height: min(88vh, 760px); display: grid; align-items: end; padding: 0; overflow: hidden; isolation: isolate; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 70%; z-index: -2; filter: sepia(.35) contrast(1.05); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(20 14 8 / .45) 0%, rgb(20 14 8 / .7) 45%, rgb(20 14 8 / .92) 100%); }
.hero-inner { max-width: 1180px; width: 100%; margin-inline: auto; padding: 120px 16px 56px; color: #f6efe0; }
.hero h1 { font-size: clamp(2.8rem, 9vw, 6.5rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: .2em; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 600; color: #e7c98a; margin: 0 0 .5em; }
.lede { font-size: clamp(1.05rem, 1.8vw, 1.3rem); max-width: 60ch; color: #efe6d4; }
.stats { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 28px 0; }
.stats dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: #d8c8a6; }
.stats dd { margin: 0; font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; }
.stats sup.cite { font-size: .42em; vertical-align: super; }
.stats sup a { color: #e7c98a; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 999px; background: #e7c98a; color: #2a1d0c; font-weight: 600; text-decoration: none; }
.btn:hover { background: #f2d9a3; }
.btn-ghost { background: transparent; color: #f6efe0; box-shadow: inset 0 0 0 1.5px rgb(246 239 224 / .6); }
.btn-ghost:hover { background: rgb(255 255 255 / .1); }
.hero-credit { position: absolute; right: 16px; bottom: 8px; margin: 0; font-size: .72rem; color: rgb(246 239 224 / .7); }

.intro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 48px; }
.intro-grid p:first-child::first-letter { font-family: var(--font-display); font-size: 3.4em; float: left; line-height: .9; padding: 4px 8px 0 0; color: var(--accent); font-weight: 800; }

sup.cite, .cite-inline { font-size: .68em; line-height: 0; margin-left: 1px; }
sup.cite a, .cite-inline a { text-decoration: none; font-weight: 600; }
sup.cite a:hover { text-decoration: underline; }

.story { background: var(--paper-2); border-block: 1px solid var(--line); padding-bottom: 0; }
.story-head { padding-bottom: 16px; }
.era-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { font: inherit; font-size: .88rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--muted); }
.chip.is-active, .chip[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip small { color: inherit; opacity: .7; margin-left: 4px; }

.story-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); max-width: 1400px; margin-inline: auto; }
.map-col { position: relative; }
.map-sticky { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); padding: 12px; }
#map { width: 100%; height: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.map-year { position: absolute; left: 28px; bottom: 28px; z-index: 500; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px 8px; box-shadow: var(--shadow); pointer-events: none; }
.map-year span { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; line-height: 1.1; }
.map-year small { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }
.map-tools { position: absolute; top: 24px; right: 24px; z-index: 500; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 70%; }
.map-tools button, .map-tools label { font: inherit; font-size: .82rem; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 6px; }
.map-tools input { accent-color: var(--accent); margin: 0; }
.legend { position: absolute; right: 24px; bottom: 28px; z-index: 500; list-style: none; margin: 0; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-size: .78rem; box-shadow: var(--shadow); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.events { list-style: none; margin: 0; padding: 24px 16px 40vh; counter-reset: ev; }
.event { position: relative; padding: 18px 20px 16px; margin-bottom: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; transition: border-color .2s, transform .2s; border-left: 4px solid var(--line); }
.event:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.event.is-active { border-left-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .event.is-active { transform: translateX(-4px); } }
.event time { font-family: var(--font-display); font-weight: 600; color: var(--accent); font-size: .95rem; }
.event h3 { margin: 2px 0 6px; font-size: 1.15rem; }
.event p { margin: 0; font-size: .97rem; }
.event img { margin-top: 12px; border-radius: 6px; height: 240px; width: 100%; object-fit: cover; object-position: center 35%; cursor: zoom-in; }
.event .era-start { position: absolute; top: -12px; left: 16px; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; background: var(--ink); color: var(--paper); padding: 2px 8px; border-radius: 4px; }
.event .places { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.event .places button { font: inherit; font-size: .75rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.event .places button:hover { color: var(--ink); border-color: var(--muted); }

.pin { width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 2px solid var(--card); box-shadow: 0 0 0 1px rgb(0 0 0 / .25); transition: transform .25s; }
.pin.is-on { transform: scale(1.5); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 35%, transparent), 0 0 0 1px rgb(0 0 0 / .3); }
.pin.is-dim { opacity: .45; }
@media (prefers-reduced-motion: no-preference) {
  .pin.is-on { animation: pulse 1.8s ease-out infinite; }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
}
.leaflet-tooltip.pin-label, .leaflet-tooltip.searchzone-label { background: none; border: 0; box-shadow: none; padding: 0 4px; }
.leaflet-tooltip.pin-label::before, .leaflet-tooltip.searchzone-label::before { display: none; }
.pin-label { font-family: var(--font-body); font-size: 11px; font-weight: 600; color: var(--ink); white-space: nowrap; text-shadow: 0 0 3px var(--paper), 0 0 3px var(--paper), 0 0 3px var(--paper); pointer-events: none; }
.leaflet-container { font-family: var(--font-body); background: var(--paper); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--ink); }
.leaflet-popup-content { margin: 14px 16px; font-size: .9rem; line-height: 1.5; }
.leaflet-popup-content h4 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 4px; }
.leaflet-popup-content p { margin: 0; }
.leaflet-control-attribution { font-size: 10px; }
.leaflet-tile-pane { filter: sepia(.35) saturate(.85); }
@media (prefers-color-scheme: dark) { .leaflet-tile-pane { filter: sepia(.2) brightness(.95); } }
.searchzone-label { font-size: 11px; font-weight: 600; color: var(--c-slagveld); white-space: nowrap; text-shadow: 0 0 3px var(--paper), 0 0 3px var(--paper); }

.battle-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 24px; }
.battle-figure { margin: 0; }
.battle-figure svg { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.battle-figure figcaption { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.river { fill: none; stroke: var(--water); stroke-width: 18; stroke-linecap: round; }
.ridge { fill: var(--ridge); }
.marsh { fill: var(--marsh-fill); }
.battle-figure .marsh { fill: url(#marsh) var(--marsh-fill); }
.lbl { font: 600 13px var(--font-body); fill: var(--muted); }
.marsh-lbl { fill: var(--marsh-ink); font-style: italic; }
.river-lbl { fill: var(--water); }
.army, .arrows path, .knights .unit { transition: transform 1.1s cubic-bezier(.4,.1,.2,1), opacity .6s; transform-box: view-box; }
.knights .unit { transform-box: fill-box; transform-origin: center; }
.knights rect { fill: var(--c-bishop); }
.knights line { stroke: var(--ink); stroke-width: 2; }
.knights .banner { fill: #f2efe6; stroke: var(--c-bishop); stroke-width: 2; }
.drenten circle { fill: var(--c-drenten); stroke: var(--card); stroke-width: 2; }
.arrows path { fill: none; stroke-width: 3; opacity: 0; }
.a-attack { stroke: var(--c-bishop); }
.a-counter { stroke: var(--c-drenten); }
.a-flight { stroke: var(--c-bishop); stroke-dasharray: 6 6; }
#battle-svg[data-step="2"] .knights { transform: translate(130px, -60px); }
#battle-svg[data-step="2"] .a-attack { opacity: 1; }
#battle-svg[data-step="3"] .knights { transform: translate(150px, -50px); }
#battle-svg[data-step="3"] .knights .unit:nth-child(odd) { transform: translateY(14px) rotate(10deg); opacity: .6; }
#battle-svg[data-step="3"] .drenten { transform: translate(-110px, 60px); }
#battle-svg[data-step="3"] .a-counter { opacity: 1; }
#battle-svg[data-step="4"] .knights { transform: translate(-60px, 60px); opacity: .55; }
#battle-svg[data-step="4"] .drenten { transform: translate(-200px, 140px); }
#battle-svg[data-step="4"] .a-flight { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .army, .arrows path, .knights .unit { transition: none; } }
.step-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.step-buttons button { font: inherit; font-size: .92rem; font-weight: 600; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); cursor: pointer; }
.step-buttons button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.step-text { margin-top: 16px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-height: 200px; }
.step-text h3 { margin-bottom: .3em; }
.step-text p { margin: 0 0 .6em; }

.impact { background: var(--paper-2); border-block: 1px solid var(--line); }
.impact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 24px; }
.impact-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.impact-card .tag { align-self: flex-start; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--c-gevolg); border: 1px solid currentColor; border-radius: 4px; padding: 1px 6px; margin-bottom: 8px; }
.impact-card h3 { margin-bottom: .25em; }
.impact-card p { margin: 0 0 12px; font-size: .95rem; flex: 1; }
.impact-card button { align-self: flex-start; font: inherit; font-size: .85rem; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; }
.pull { margin: 48px auto 0; max-width: 820px; text-align: center; }
.pull p { font-family: var(--font-display); font-size: clamp(1.3rem, 2.4vw, 1.75rem); line-height: 1.35; margin: 0 0 8px; }
.pull cite { color: var(--muted); font-style: normal; font-size: .9rem; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 24px; }
.people-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.person { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--side); border-radius: var(--radius); padding: 14px 16px; }
.person h3 { font-size: 1.08rem; margin-bottom: 2px; }
.person .role { margin: 0; font-size: .9rem; color: var(--muted); }
.person .fate { margin: 8px 0 0; font-size: .9rem; }
.person[hidden] { display: none; }

.debate-list { display: grid; gap: 12px; margin-top: 24px; }
.debate-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.debate-item summary { cursor: pointer; padding: 16px 20px; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.debate-item summary::-webkit-details-marker { display: none; }
.debate-item summary::after { content: "+"; font-family: var(--font-body); color: var(--muted); }
.debate-item[open] summary::after { content: "−"; }
.debate-body { padding: 0 20px 18px; }
.versions { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.versions li { padding: 10px 12px; background: var(--paper-2); border-radius: 8px; font-size: .95rem; }
.debate-body .note { margin: 12px 0 0; color: var(--muted); font-size: .92rem; }

.gallery-grid { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery-grid button { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); cursor: zoom-in; text-align: left; font: inherit; color: inherit; }
.gallery-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .4s; }
.gallery-grid button:hover img { transform: scale(1.04); }
.gallery-grid span { display: block; padding: 10px 12px; font-size: .9rem; font-weight: 600; }

#lightbox { border: 0; padding: 0; max-width: min(1100px, 94vw); max-height: 92vh; background: var(--card); color: var(--ink); border-radius: var(--radius); overflow: hidden; }
#lightbox::backdrop { background: rgb(10 6 2 / .78); backdrop-filter: blur(3px); }
#lightbox figure { margin: 0; }
#lightbox img { max-height: 78vh; width: auto; margin-inline: auto; }
#lightbox figcaption { padding: 12px 16px; font-size: .9rem; display: grid; gap: 2px; }
#lightbox figcaption span { color: var(--muted); }
#lightbox .close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgb(0 0 0 / .55); color: #fff; font-size: 1.5rem; cursor: pointer; }
html:has(dialog[open]) { overflow: hidden; }

.jubilee-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.jubilee-card { background: #2a2118; color: #f5eedf; border-radius: var(--radius); padding: 24px; }
.jubilee-card a { color: #e7c98a; }
.jubilee-card .big { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; margin: 0 0 12px; line-height: 1.1; }
.jubilee-card ul { padding-left: 18px; margin: 0 0 12px; }
.jubilee-card li { margin-bottom: 6px; }
.jubilee-card .small { color: rgb(245 238 223 / .72); }
.jubilee-card sup.cite a { color: #e7c98a; }

.sources h3 { margin-top: 28px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.source-list { padding-left: 2.4em; margin: 12px 0 0; }
.source-list li { margin-bottom: 8px; padding-left: 4px; }
.source-list li::marker { font-weight: 600; color: var(--accent); }
.source-list li:target { background: color-mix(in srgb, var(--c-gevolg) 22%, transparent); border-radius: 4px; }
.source-list .meta { display: block; color: var(--muted); font-size: .88rem; }
.site-footer { padding-block: 32px 48px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes rise { from { opacity: 0; translate: 0 24px; } }
    .impact-card, .person, .gallery-grid li, .debate-item { animation: rise auto ease-out backwards; animation-timeline: view(); animation-range: entry 0% entry 60%; }
  }
}

@media (max-width: 900px) {
  .story-grid { grid-template-columns: 1fr; }
  .map-sticky { top: var(--header-h); height: 46vh; padding: 8px; z-index: 5; background: var(--paper-2); }
  .map-col { position: sticky; top: var(--header-h); z-index: 5; }
  .map-year { left: 16px; bottom: 16px; padding: 4px 10px; }
  .map-year span { font-size: 1.3rem; }
  .map-tools { top: 14px; right: 14px; max-width: 75%; }
  .map-tools button, .map-tools label { font-size: .74rem; padding: 4px 7px; }
  .legend { display: none; }
  .events { padding-bottom: 20vh; }
  .battle-grid, .jubilee-grid { grid-template-columns: 1fr; }
  .site-header { gap: 12px; }
}

.narracio { margin: 48px auto 0; max-width: 860px; padding: 24px 28px; border-left: 4px solid var(--accent); background: var(--card); border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow); }
.narracio p { font-family: var(--font-display); font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.45; margin: 0 0 10px; font-style: italic; }
.narracio cite { color: var(--muted); font-style: normal; font-size: .88rem; }

.landscape { background: var(--paper-2); border-block: 1px solid var(--line); }
.landscape-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 28px; margin-top: 24px; align-items: start; }
#landscape-map { height: min(70vh, 620px); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--paper); }
#landscape-map .leaflet-tile-pane { filter: none; }
.year-buttons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.year-buttons button { font: 600 .95rem var(--font-display); padding: 10px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); cursor: pointer; }
.year-buttons button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.year-note { min-height: 4.8em; margin: 14px 0; font-size: .95rem; }
.overlay-controls { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 14px; margin: 0 0 18px; display: grid; gap: 6px; background: var(--card); }
.overlay-controls legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }
.overlay-controls label { display: flex; align-items: center; gap: 8px; font-size: .93rem; }
.overlay-controls input { accent-color: var(--accent); }
.overlay-controls .opacity { margin-top: 6px; }
.overlay-controls .opacity input { flex: 1; }
.landscape-points { padding-left: 18px; margin: 0; font-size: .94rem; }
.landscape-points li { margin-bottom: 8px; }

.related-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.related-card { position: relative; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--t); border-radius: var(--radius); padding: 16px 18px; }
.related-card[hidden] { display: none; }
.related-card.is-ane { background: #2a2118; color: #f5eedf; border-color: #2a2118; border-top-color: #e57a7f; }
.related-card.is-ane dt, .related-card.is-ane .r-theme { color: rgb(245 238 223 / .72); }
.related-card.is-ane sup.cite a { color: #e7c98a; }
.r-year { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: var(--t); }
.related-card.is-ane .r-year { color: #e7c98a; }
.related-card h3 { margin: 2px 0 2px; font-size: 1.1rem; }
.r-theme { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.related-card dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 10px 0; font-size: .9rem; }
.related-card dt { color: var(--muted); }
.related-card dd { margin: 0; }
.r-link { margin: 0; font-size: .92rem; border-top: 1px dashed var(--line); padding-top: 8px; }
.related-card.is-ane .r-link { border-color: rgb(245 238 223 / .3); }

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .related-card { animation: rise auto ease-out backwards; animation-timeline: view(); animation-range: entry 0% entry 60%; }
  }
}
@media (max-width: 900px) {
  .landscape-grid { grid-template-columns: 1fr; }
  #landscape-map { height: 60vh; }
}

.ahn-layer { filter: contrast(2.6) saturate(1.8); }
.ahn-key { color: var(--muted); font-size: .78rem; display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; }
.ahn-key i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.ahn-key .lo { background: #19d219; }
.ahn-key .hi { background: #f2f200; margin-left: 6px; }

.gear-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 24px 0 4px; }
.stat { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat strong { display: block; font-family: var(--font-display); font-size: 2rem; line-height: 1.1; color: var(--ink); }
.stat span { color: var(--muted); font-size: .92rem; }
.gear-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 20px; }
.gear-col { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--side); border-radius: var(--radius); padding: 18px 20px; }
.gear-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.gear-col li { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.gear-col h4 { margin: 0; font-size: 1.02rem; grid-row: 1; grid-column: 1; }
.gear-col .g-value { grid-row: 1; grid-column: 2; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--side); white-space: nowrap; }
.gear-col li p { grid-column: 1 / -1; margin: 4px 0 0; font-size: .93rem; }
.gear-note { margin-top: 18px; max-width: 75ch; color: var(--muted); font-size: .95rem; border-left: 3px solid var(--line); padding-left: 14px; }

.freedom-steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; counter-reset: f; }
.freedom-steps li { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--c-drenten); border-radius: var(--radius); padding: 16px 18px; }
.freedom-steps p { margin: 0; font-size: .95rem; }
.f-year { font-family: var(--font-display); font-weight: 700; color: var(--c-drenten); }
.freedom-groningen { margin-top: 18px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.freedom-groningen p { margin: 0; max-width: 80ch; }

.leaders { list-style: none; padding: 0; margin: 12px 0 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.leaders li { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; align-content: start; font-size: .92rem; }
.leaders span { color: var(--muted); font-size: .85rem; }
.leaders em { font-style: normal; font-size: .85rem; margin-top: 2px; }
.fallen-grid { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 24px; align-items: start; }
@media (max-width: 760px) { .fallen-grid { grid-template-columns: 1fr; } }
.fallen-chart { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.fallen-chart figcaption { font-weight: 600; margin-bottom: 10px; }
.bar { display: grid; grid-template-columns: 92px 1fr 28px; align-items: center; gap: 8px; width: 100%; font: inherit; font-size: .88rem; color: var(--ink); background: none; border: 0; border-radius: 6px; padding: 6px 4px; cursor: pointer; text-align: left; min-height: 32px; }
.bar:hover { background: var(--paper-2); }
.bar[aria-pressed="true"] { background: var(--paper-2); outline: 2px solid var(--accent); outline-offset: -2px; }
.bar-track { height: 10px; }
.bar-fill { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.fallen-list label { font-weight: 600; display: block; }
#fallen-search { width: 100%; font: inherit; padding: 10px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
#fallen-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#fallen { list-style: none; padding: 0; margin: 0; max-height: 460px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); align-content: start; }
#fallen li { padding: 7px 12px; border-bottom: 1px solid var(--line); display: grid; font-size: .9rem; }
#fallen li[hidden] { display: none; }
.f-from { color: var(--muted); font-size: .82rem; }

.chip.chip-key { cursor: default; border-left: 6px solid var(--side); }
.views-list { list-style: none; padding: 0 0 0 22px; margin: 8px 0 0; position: relative; display: grid; gap: 14px; }
.views-list::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.view { position: relative; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--side); border-radius: var(--radius); padding: 14px 18px; max-width: 80ch; }
.view::before { content: ""; position: absolute; left: -23px; top: 20px; width: 12px; height: 12px; border-radius: 50%; background: var(--side); box-shadow: 0 0 0 3px var(--paper); }
.v-year { font-family: var(--font-display); font-weight: 700; margin-right: 8px; }
.v-who { color: var(--muted); font-size: .88rem; }
.view h3 { margin: 4px 0 4px; font-size: 1.1rem; }
.view p { margin: 0; font-size: .95rem; }
.bar[data-region="Onbekend"] .bar-fill { background: var(--muted); }
.phases { margin-top: 20px; }
.phases ol { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--line); counter-reset: ph; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.phases li { counter-increment: ph; padding: 12px 16px; background: var(--card); display: grid; align-content: start; gap: 2px; font-size: .9rem; }
.phases strong::before { content: counter(ph) ". "; color: var(--c-drenten); }
.phases span { color: var(--muted); }

.term { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: help; text-decoration: underline dotted; text-decoration-color: var(--muted); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.term:hover, .term:focus-visible { text-decoration-color: var(--accent); color: var(--accent); }
.term:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
#term-pop { max-width: min(340px, calc(100vw - 32px)); padding: 14px 16px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 30px rgb(0 0 0 / .25); font-size: .93rem; line-height: 1.5; }
#term-pop strong { font-family: var(--font-display); font-size: 1.05rem; }
#term-pop p { margin: 6px 0 0; }
#term-pop .tp-more { font-size: .82rem; color: var(--muted); }
@supports (position-area: block-end) {
  #term-pop { inset: auto; margin: 6px 0; position-area: block-end span-inline-end; position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline; }
}
@supports not (position-area: block-end) {
  #term-pop { position: fixed; inset: auto 16px 16px 16px; max-width: none; margin: 0; width: auto; }
}
.glossary-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px 28px; margin: 24px 0 0; }
.glossary-list > div { border-top: 1px solid var(--line); padding-top: 10px; }
.glossary-list dt { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; }
.glossary-list dfn { font-style: normal; }
.glossary-list dd { margin: 4px 0 0; font-size: .93rem; }
.glossary-list > div:target { background: var(--paper-2); outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 4px; }
@media (max-width: 600px) {
  #term-pop { position: fixed; position-area: none; inset: auto 16px 16px 16px; margin: 0; width: auto; max-width: none; }
}
