:root {
  --ink: #2d2a25;
  --muted: #736d62;
  --paper: #fffdf8;
  --ground: #f1ede4;
  --line: #d8d0c3;
  --rust: #974f38;
  --rust-dark: #743b2b;
  --shadow: 0 22px 70px rgba(52, 42, 30, 0.09);
  --site-font: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --site-body-size: 1.0625rem;
  --site-body-leading: 1.8;
}

* { box-sizing: border-box; }

html {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 3%, rgba(151, 79, 56, 0.055), transparent 28rem),
    var(--ground);
  font-family: var(--site-font);
  font-size: var(--site-body-size);
  line-height: var(--site-body-leading);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button, input { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: 1rem;
  transform: translateY(-160%);
  background: var(--ink);
  color: #fff;
  padding: .75rem 1rem;
  border-radius: .4rem;
}

.skip-link:focus { transform: none; }

.masthead {
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(115, 109, 98, .25);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  text-decoration: none;
}

.brand strong {
  display: block;
  font-family: var(--site-font);
  font-weight: 400;
  font-size: 1.1rem;
  letter-spacing: .02em;
}

.brand small {
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.brand-mark::after {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--rust);
  border-radius: 50%;
}

.brand-mark i {
  position: absolute;
  width: 1px;
  height: 25px;
  background: var(--ink);
  opacity: .7;
}

.brand-mark i:nth-child(2) { transform: rotate(60deg); }
.brand-mark i:nth-child(3) { transform: rotate(120deg); }

.quiet-link,
.text-action {
  color: var(--rust-dark);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: .15rem;
}

.quiet-link { font-size: .86rem; }

.intro {
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
  padding: clamp(4.6rem, 10vw, 8.5rem) 0 clamp(4rem, 8vw, 7rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 5rem;
  align-items: end;
}

.intro-copy { max-width: 850px; }

.eyebrow {
  margin: 0 0 1.15rem;
  color: var(--rust-dark);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: var(--site-font);
  font-weight: 400;
  text-wrap: balance;
}

h1 {
  margin: 0;
  max-width: 840px;
  font-size: clamp(3rem, 6.4vw, 6.45rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.lede {
  max-width: 720px;
  margin: 2rem 0 2.1rem;
  color: #59544c;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  line-height: 1.65;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: var(--ink);
  color: #fff;
  padding: .95rem 1.2rem;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-size: .86rem;
  font-weight: 750;
  letter-spacing: .025em;
  transition: background .18s, transform .18s;
}

.primary-action:hover { background: var(--rust-dark); transform: translateY(-1px); }

.intro-note {
  border-left: 1px solid var(--line);
  padding: 0 0 .25rem 1.5rem;
  color: var(--muted);
}

.note-number {
  display: block;
  margin-bottom: .3rem;
  color: var(--rust);
  font-family: var(--site-font);
  font-weight: 400;
  font-size: 4.8rem;
  line-height: .8;
}

.intro-note p { margin: .8rem 0 0; line-height: 1.55; font-size: .9rem; }
.intro-note strong { color: var(--ink); }

.explorer {
  background: var(--paper);
  border-block: 1px solid var(--line);
  padding: clamp(3.5rem, 6vw, 6rem) max(1.5rem, calc((100vw - 1200px) / 2));
}

.explorer-heading {
  margin-bottom: 2rem;
}

.explorer-heading h2,
.context h2 {
  margin: 0;
  line-height: 1.4;
  letter-spacing: -.035em;
}

.explorer-heading h2 {
  font-size: clamp(1.45rem, 2.1vw, 1.75rem);
  letter-spacing: -.02em;
}

.context h2 {
  font-size: clamp(2rem, 3.5vw, 3.6rem);
}

.explorer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr);
  min-height: 655px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.map-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 2.2rem);
  background:
    linear-gradient(rgba(255,255,255,.72), rgba(255,255,255,.72)),
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(92, 82, 69, .045) 36px),
    #f5f1e8;
  border-right: 1px solid var(--line);
}

.card-kicker {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.card-kicker span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: .64rem;
}

.map-shell {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 355px;
  padding: 1rem;
}

.map-shell svg {
  width: min(100%, 650px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 11px 12px rgba(47, 42, 34, .12));
}

.map-shell svg [data-province] {
  cursor: pointer;
  transition: filter .16s ease, opacity .16s ease;
}

.map-shell svg [data-province].is-hover {
  filter: brightness(1.08) saturate(1.08) !important;
  stroke: #fff !important;
  stroke-width: 1.25px !important;
}

.map-shell svg [data-province].is-dimmed { opacity: .35; }

.map-shell svg [data-province].is-selected {
  filter: brightness(.96) saturate(1.22) drop-shadow(0 0 2px rgba(30, 25, 19, .35)) !important;
  stroke: #fff !important;
  stroke-width: 1.45px !important;
}

.map-loading { color: var(--muted); font-size: .9rem; }

.province-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-bottom: 0;
}

.province-button {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 48px;
  padding: .65rem .75rem;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.62);
  color: #4d4942;
  text-align: left;
  font-size: .86rem;
  font-weight: 690;
  cursor: pointer;
  transition: background .16s, color .16s;
}

.province-button:nth-child(3n) { border-right: 0; }
.province-button:hover { background: #fff; }
.province-button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.province-swatch {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--swatch);
  outline: 1px solid rgba(0,0,0,.12);
}

.collection-panel {
  min-width: 0;
  background: #fff;
  padding: clamp(1.7rem, 3vw, 2.5rem);
  overflow-x: hidden;
  overflow-y: auto;
}

.panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.panel-index {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.panel-index::before { content: ""; width: 24px; height: 2px; background: var(--province-color); }

.panel-meta {
  color: var(--muted);
  font-size: .8rem;
  white-space: nowrap;
}

.collection-panel h3 {
  margin: 0;
  font-size: clamp(2.15rem, 4vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -.035em;
}

.province-subtitle {
  margin: .45rem 0 1rem;
  color: var(--rust-dark);
  font-family: var(--site-font);
  font-size: 1.04rem;
  font-style: italic;
}

.province-intro {
  margin: 0 0 1.35rem;
  color: #5f5a52;
  line-height: 1.8;
}

.province-landing {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.8rem;
  color: var(--rust-dark);
  font-size: .9rem;
  font-weight: 780;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: .12rem;
}

.collection-list { border-top: 1px solid var(--line); }

.collection-item {
  scroll-margin-top: 1.5rem;
  border-bottom: 1px solid var(--line);
  padding: 1.05rem 0;
}

.collection-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  text-decoration: none;
}

.collection-link strong { display: block; overflow-wrap: anywhere; font-family: var(--site-font); font-size: 1.08rem; font-weight: 600; }
.collection-link small { display: block; margin-top: .22rem; color: var(--muted); font-size: .82rem; }
.collection-arrow { color: var(--rust); font-size: 1rem; transition: transform .16s; }
.collection-link:hover .collection-arrow { transform: translate(2px, -2px); }

.place-list {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .7rem 0 0;
  padding: 0;
  list-style: none;
}

.place-list li {
  padding: .28rem .48rem;
  border: 1px solid #e4ddd2;
  background: #faf8f3;
  color: #676159;
  font-size: .78rem;
}

.subcollections {
  margin: .8rem 0 0;
  border-left: 2px solid color-mix(in srgb, var(--province-color), white 42%);
  padding-left: .9rem;
}

.subcollections summary {
  color: var(--rust-dark);
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  list-style-position: outside;
}

.subcollection-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .1rem .8rem;
  margin-top: .55rem;
}

.subcollection-links a {
  padding: .34rem 0;
  color: #5f5a52;
  font-size: .82rem;
  overflow-wrap: anywhere;
  text-decoration: none;
  border-bottom: 1px dotted #cfc5b7;
}

.subcollection-links a:hover { color: var(--rust-dark); }

.collection-item.is-highlighted {
  animation: soft-highlight 1.6s ease;
}

@keyframes soft-highlight {
  0%, 100% { background: transparent; }
  25% { background: color-mix(in srgb, var(--province-color), white 88%); }
}

.context {
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 5rem;
  align-items: start;
}

.context p:not(.eyebrow) {
  margin: 0;
  color: #5f5a52;
  line-height: 1.75;
}

.context .text-action { grid-column: 2; justify-self: start; font-size: .85rem; }

footer {
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 1.4rem 0 2rem;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.5;
}

footer p { margin: 0; }
.attribution { max-width: 710px; text-align: right; }

:focus-visible { outline: 3px solid rgba(151, 79, 56, .45); outline-offset: 3px; }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; gap: 2.5rem; }
  .intro-note { max-width: 280px; }
  .explorer-grid { grid-template-columns: 1fr; }
  .map-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .collection-panel { overflow: visible; }
  .context { grid-template-columns: 1fr; }
  .context .text-action { grid-column: 1; }
}

@media (max-width: 620px) {
  :root { --site-body-size: 1.02083333rem; }
  .masthead, .intro, .context, footer { width: min(100% - 2rem, 1200px); }
  .masthead { min-height: 78px; }
  .brand small { display: none; }
  .quiet-link { font-size: 0; }
  .quiet-link span { font-size: 1rem; }
  .intro { padding-top: 4rem; }
  h1 { font-size: clamp(2.75rem, 14vw, 4.2rem); }
  .intro-note { display: none; }
  .explorer { padding-inline: 1rem; }
  .explorer-grid { min-height: 0; }
  .map-shell { min-height: 270px; padding-inline: 0; }
  .province-controls { grid-template-columns: 1fr 1fr; }
  .province-button:nth-child(3n) { border-right: 1px solid var(--line); }
  .province-button:nth-child(2n) { border-right: 0; }
  .panel-topline { align-items: flex-start; flex-direction: column; gap: .5rem; }
  .subcollection-links { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
  .attribution { text-align: left; }
}

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

/* Compact presentation for embedding in papuaheritage.com via ?embed=1. */
.embed-mode,
.embed-mode body {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.embed-mode::-webkit-scrollbar,
.embed-mode body::-webkit-scrollbar {
  display: none;
}

.embed-mode body {
  background: var(--paper);
}

.embed-mode .masthead,
.embed-mode .intro,
.embed-mode .context,
.embed-mode footer {
  display: none;
}

.embed-mode .explorer {
  min-height: 100svh;
  padding: clamp(1rem, 2.5vw, 2rem);
  border: 0;
}

.embed-mode .explorer-heading {
  margin-bottom: 1.25rem;
}

.embed-mode .explorer-grid {
  grid-template-columns: minmax(0, 1.28fr) minmax(340px, .72fr);
  min-height: 610px;
  box-shadow: 0 10px 42px rgba(52, 42, 30, .08);
}

.embed-mode .map-card,
.embed-mode .collection-panel {
  padding: clamp(1.1rem, 2.5vw, 1.8rem);
}

.embed-mode .map-shell {
  min-height: 370px;
}

.embed-mode .map-shell svg {
  width: min(100%, 680px);
}

@media (max-width: 900px) {
  .embed-mode .explorer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .embed-mode .explorer {
    padding: .65rem;
  }

  .embed-mode .explorer-heading {
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .embed-mode .explorer-grid {
    min-height: 0;
  }
}
