@font-face {
  font-family: "Libre Franklin";
  src: url("/assets/fonts/libre-franklin-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("/assets/fonts/libre-franklin-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("/assets/fonts/libre-franklin-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #f4f0e8;
  --muted: #c9c2b6;
  --bg: #12161b;
  --bg-2: #1b2128;
  --line: rgba(244, 240, 232, 0.16);
  --accent: #e4d3b4;
  --card: rgba(10, 12, 14, 0.78);
  --nav-h: 4.25rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: #fff; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 0.8rem;
  z-index: 40;
}
.skip:focus { top: 0.5rem; }

.site-nav {
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--nav-h);
  padding: 0.6rem 1.25rem;
  background: rgba(18, 22, 27, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.is-home .site-nav { position: fixed; inset: 0 0 auto 0; }
.is-inner .site-nav { position: sticky; top: 0; }
.nav-mark {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
}
.nav-toggle, .nav-sub-toggle {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nav-toggle { display: none; margin-left: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.1rem;
  margin-left: auto;
}
.nav-links a, .nav-sub-toggle {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-links a[aria-current="page"] { color: var(--accent); }
.nav-sub { position: relative; }
.nav-sub-panel {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 9rem;
  padding: 0.4rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.nav-sub.is-open .nav-sub-panel,
.nav-sub:focus-within .nav-sub-panel { display: block; }
@media (hover: hover) and (pointer: fine) {
  .nav-sub:hover .nav-sub-panel { display: block; }
}
.nav-sub-panel a { display: block; padding: 0.4rem 0.6rem; }

.banner {
  height: min(calc(42vh * 2 / 3), calc(22rem * 2 / 3));
  min-height: calc(11rem * 2 / 3);
  background-size: cover;
  background-position: center;
  background-color: #1a1f26;
}
.page-demo {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.page-demo .banner { height: calc(8.5rem * 2 / 3); min-height: 0; flex: none; }
.page-demo .site-nav { flex: none; }
.page-demo main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page-demo .demo-lead { flex: none; }
.page-demo .site-foot { flex: none; }

.panel { position: relative; background: var(--bg); }
.panel:nth-child(1) { z-index: 1; }
.panel:nth-child(2) { z-index: 2; }
.panel:nth-child(3) { z-index: 3; }
.panel-bg {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  background-size: cover;
  background-position: center;
  background-color: #1a1f26;
}
.panel-content {
  position: relative;
  z-index: 1;
  margin-top: -100vh;
  margin-top: -100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--nav-h) + 2.5rem) 6vw 4.5rem;
}
.panel-card {
  width: min(calc(40rem * 1.5), 100%);
  padding: 1.4rem 1.5rem 1.6rem;
  background: var(--card);
}
.panel-card h1, .panel-card h2, .prose h1, .prose h2, .prose h3, .article-head h1 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.panel-card h1 { margin: 0 0 0.8rem; font-size: 2.4rem; }
.panel-card h2, .prose h2 { margin: 1.6rem 0 0.6rem; font-size: 1.45rem; }
.prose h3 { margin: 1.3rem 0 0.4rem; font-size: 1.15rem; }

.prose, .article-head {
  width: min(calc(42rem * 1.5), calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.2rem 0 3rem;
}
.article-head { padding-bottom: 0; }
.byline, .citation, .keywords, .abstract { color: var(--muted); }
.wayfinder { padding-left: 1.1rem; }
.wayfinder li { margin: 0.35rem 0; }
.text-missing, .empty-state {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--line);
  color: var(--muted);
}
.download { margin-top: 0.6rem; }

.site-foot {
  position: relative;
  z-index: 4;
  display: flex;
  gap: 1.2rem;
  padding: 1.2rem 6vw 1.6rem;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

.page-demo main { padding: 0; }
.demo-lead {
  width: min(calc(42rem * 1.5), calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1rem 0 0.4rem;
}
.demo-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem);
  flex: 1;
  min-height: 0;
  height: calc(100dvh - var(--nav-h) - (8.5rem * 2 / 3));
  border-top: 1px solid var(--line);
}
.demo-map { height: 100%; min-height: 0; background: #0e1216; }
.demo-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-2);
  border-left: 1px solid var(--line);
}
.demo-status { margin: 0; padding: 0.8rem 1rem 0; color: var(--muted); font-size: 0.9rem; }
.tabs { display: flex; gap: 0.3rem; padding: 0.7rem 0.8rem 0; }
.tabs button {
  font: inherit;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }
.tab-panel {
  overflow: auto;
  padding: 0.4rem 1rem 1.2rem;
}
.tab-panel h3 { margin: 0.8rem 0 0.3rem; font-size: 1.15rem; }
.teaser { color: var(--muted); }
.person-list { padding-left: 1.1rem; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.45rem;
}
.gallery-thumb {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.gallery-thumb img, .gallery-frame img {
  display: block;
  width: 100%;
  height: 7rem;
  object-fit: cover;
}
.gallery-page .gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.75rem;
}
.gallery-page .gallery-grid figure { margin: 0; }
.gallery-page .gallery-grid figure img,
.gallery-page .gallery-thumb img {
  width: 100%;
  height: 18rem;
  object-fit: cover;
}
.article-body figure { margin: 1.4rem 0; }
.article-body figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 36rem;
  margin-inline: auto;
}
.article-body figcaption, .caption { color: var(--muted); font-size: 0.92rem; }
.endnotes { margin-top: 2.5rem; color: var(--muted); font-size: 0.92rem; }
.endnotes li { margin: 0.45rem 0; }
.gallery-lightbox {
  width: min(68rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
.gallery-lightbox::backdrop { background: rgba(0, 0, 0, 0.72); }
.gallery-frame {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.8rem;
}
.gallery-frame img { grid-column: 2; height: auto; max-height: 72vh; object-fit: contain; }
.gallery-frame figcaption { grid-column: 1 / -1; }
.gallery-close { grid-column: 1 / -1; justify-self: end; }
.gallery-credit { display: block; }
.gallery-frame button, .nav-toggle {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

.leaflet-container { width: 100%; height: 100%; background: #0e1216; font: inherit; }
.leaflet-container img { max-width: none !important; max-height: none !important; }
.leaflet-div-icon.poh-marker { background: transparent; border: 0; }
.poh-marker span {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #f4f0e8;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
}
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(228, 211, 180, 0.35); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background: rgba(18, 22, 27, 0.92);
  color: var(--ink);
}
.leaflet-control-attribution {
  background: rgba(18, 22, 27, 0.82);
  color: var(--muted);
}
.leaflet-control-attribution a { color: var(--accent); }
.poh-popup .leaflet-popup-content-wrapper, .poh-popup .leaflet-popup-tip {
  background: var(--bg-2);
  color: var(--ink);
}
.poh-popup .leaflet-popup-content { margin: 0.8rem 0.9rem; }
.poh-photo { display: block; width: 100%; max-height: 10rem; object-fit: cover; margin-bottom: 0.5rem; }
.poh-code, .poh-title { margin: 0 0 0.3rem; }
.poh-title { font-weight: 600; }
.poh-teaser, .poh-cat { margin: 0.3rem 0; color: var(--muted); }
.poh-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.35rem;
  border-radius: 50%;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    padding: 0.6rem 1rem 1rem;
    background: rgba(18, 22, 27, 0.98);
    border-bottom: 1px solid var(--line);
  }
  .nav-links.is-open { display: flex; }
  .nav-sub-panel { position: static; border: 0; padding-left: 0.8rem; }
  .demo-stage { grid-template-columns: 1fr; height: auto; }
  .page-demo { display: block; }
  .demo-map { height: 70dvh; min-height: 70dvh; }
  .demo-side { border-left: 0; border-top: 1px solid var(--line); min-height: 22rem; }
  .panel-content { padding-left: 1rem; padding-right: 1rem; }
  .prose, .article-head, .demo-lead { width: min(calc(42rem * 1.5), calc(100% - 2rem)); }
}
