:root {
  --paper: #f4f2e9;
  --ink: #10271f;
  --mist: #bdd7ca;
  --mint: #99e2bd;
  --rust: #ee694f;
  --glass: rgba(8, 28, 22, .74);
  --line: rgba(244, 242, 233, .52);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { background: var(--ink); scroll-behavior: smooth; }
body { margin: 0; color: var(--paper); font-family: var(--sans); }
a { color: inherit; text-underline-offset: .22em; }
:focus-visible { outline: 3px solid var(--rust); outline-offset: 4px; }

.skip-link {
  position: fixed;
  z-index: 20;
  left: 1rem;
  top: -5rem;
  padding: .65rem .85rem;
  background: var(--paper);
  color: var(--ink);
}
.skip-link:focus { top: 1rem; }

.map {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink);
}
.map-art,
.map-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.map-art { z-index: -3; object-fit: cover; object-position: center; }
.map-shade {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(4,19,15,.9) 0%, rgba(4,19,15,.55) 31%, rgba(4,19,15,.18) 67%, rgba(4,19,15,.4) 100%),
    linear-gradient(180deg, rgba(4,19,15,.65) 0%, transparent 28%, transparent 68%, rgba(4,19,15,.75) 100%);
}

.map-header {
  position: absolute;
  z-index: 5;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  width: calc(100% - 5rem);
  margin: 0 2.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(244,242,233,.36);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.wordmark { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.wordmark-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0;
}

.map-content {
  position: relative;
  min-height: 100svh;
  width: 100%;
  padding: 5.5rem 2.5rem 6.75rem;
}
.map-title { position: absolute; z-index: 2; left: 3.4%; top: 15%; max-width: 31rem; }
.node-label {
  margin: 0 0 .55rem;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.map-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(4.8rem, 7.3vw, 8.5rem);
  font-weight: 500;
  line-height: .76;
  letter-spacing: -.065em;
  text-shadow: 0 .12em .6em rgba(0,0,0,.2);
}
.map-title h1 em { color: var(--mint); font-weight: 400; }

.connections { position: absolute; z-index: 0; inset: 8% 2.5% 11%; width: 95%; height: 81%; overflow: visible; }
.connections path { fill: none; stroke: var(--line); stroke-width: 1.1; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }

.map-node {
  position: absolute;
  z-index: 2;
  width: clamp(13rem, 17vw, 19rem);
  padding: .95rem 1rem 1rem 1.15rem;
  border: 1px solid rgba(244,242,233,.42);
  border-radius: .15rem;
  background: var(--glass);
  box-shadow: 0 1.1rem 4rem rgba(0,0,0,.16);
  backdrop-filter: blur(12px) saturate(.85);
  -webkit-backdrop-filter: blur(12px) saturate(.85);
}
.map-node::after { content: ""; position: absolute; inset: .4rem; border: 1px solid rgba(244,242,233,.1); pointer-events: none; }
.map-node h2 { margin: 0; font-family: var(--serif); font-size: clamp(1.25rem, 1.65vw, 1.9rem); font-weight: 500; line-height: 1; letter-spacing: -.025em; }
.map-node p { position: relative; z-index: 1; }
.map-node > p:last-child { margin: .55rem 0 0; color: var(--mist); font-size: .72rem; line-height: 1.35; }
.node-label { color: var(--mint); }
.node-pin {
  position: absolute;
  left: -1.7rem;
  top: 50%;
  width: .55rem;
  height: .55rem;
  margin-top: -.275rem;
  border: 2px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 0 0 .3rem rgba(244,242,233,.18);
}
.node-pin-accent { border-color: var(--rust); background: var(--rust); box-shadow: 0 0 0 .32rem rgba(238,105,79,.18); }
.node-date,
.node-value { margin: 0 0 .15rem; font-family: var(--serif); font-size: clamp(2.5rem, 4vw, 4.8rem); line-height: .9; letter-spacing: -.05em; }
.node-value-small { font-size: clamp(1.7rem, 2.5vw, 3rem); }
.names { margin-top: .7rem !important; color: var(--paper) !important; font-size: .65rem !important; letter-spacing: .03em; }

.node-meaning { left: 23%; top: 47%; }
.node-origin { left: 42%; top: 58%; border-color: rgba(238,105,79,.85); }
.node-bearers { left: 69%; top: 24%; }
.node-place { left: 78%; top: 51%; }
.node-people { left: 65%; top: 73%; }

@media (max-width: 1050px) {
  .map-title { top: 14%; }
  .map-title h1 { font-size: clamp(4rem, 8vw, 6rem); }
  .node-meaning { left: 19%; }
  .node-origin { left: 39%; }
  .node-bearers { left: 66%; }
  .node-place { left: 72%; }
  .node-people { left: 60%; }
}

@media (max-width: 760px) {
  .map { min-height: auto; overflow: visible; }
  .map-art, .map-shade { position: fixed; height: 100svh; }
  .map-art { object-position: 58% center; }
  .map-shade {
    background:
      linear-gradient(180deg, rgba(4,19,15,.42) 0%, rgba(4,19,15,.16) 32%, rgba(4,19,15,.66) 73%, rgba(4,19,15,.92) 100%),
      linear-gradient(90deg, rgba(4,19,15,.72) 0%, rgba(4,19,15,.18) 78%, rgba(4,19,15,.28) 100%);
  }
  .map-header {
    position: absolute;
    width: calc(100% - 2rem);
    margin: 0 1rem;
    padding: 1rem 0;
  }
  .map-content {
    display: flex;
    flex-direction: column;
    min-height: auto;
    padding: 0 1rem 1rem;
  }
  .map-content::before {
    content: "";
    position: absolute;
    z-index: 0;
    left: 1.98rem;
    top: calc(100svh + 1rem);
    bottom: 2rem;
    width: 1px;
    background: linear-gradient(180deg, var(--mint), rgba(244,242,233,.55) 46%, rgba(244,242,233,.08));
    box-shadow: 0 0 1.25rem rgba(153,226,189,.2);
  }
  .map-title,
  .map-node { position: relative; inset: auto; width: 100%; }
  .map-title {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    max-width: none;
    padding: 7rem 0 4.25rem;
  }
  .map-title h1 { max-width: 22rem; font-size: clamp(3.75rem, 17vw, 5.25rem); line-height: .8; }
  .connections { display: none; }
  .map-node {
    min-height: 10.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.6rem .35rem 1.6rem 3.7rem;
    border: 0;
    border-bottom: 1px solid rgba(244,242,233,.24);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    text-shadow: 0 2px 1.2rem rgba(0,0,0,.75);
  }
  .map-node::after { display: none; }
  .map-node h2 { font-size: 1.55rem; }
  .map-node > p:last-child { max-width: 19rem; font-size: .75rem; }
  .node-pin {
    left: .7rem;
    right: auto;
    top: 50%;
    margin-top: -.34rem;
    width: .68rem;
    height: .68rem;
    background: var(--ink);
    box-shadow: 0 0 0 .35rem rgba(244,242,233,.12), 0 0 1.25rem rgba(153,226,189,.35);
  }
  .node-pin-accent { background: var(--rust); box-shadow: 0 0 0 .38rem rgba(238,105,79,.16), 0 0 1.25rem rgba(238,105,79,.3); }
  .node-date, .node-value { font-size: 3rem; }
  .node-value-small { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.error-map { display: grid; place-items: center; padding: 2rem; }
.error-card { position: relative; z-index: 2; width: min(42rem, 100%); }
.error-card .overline { margin: 0 0 .55rem; color: var(--mint); font-size: .62rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.error-card h1 { margin: 0; font-family: var(--serif); font-size: clamp(8rem, 22vw, 18rem); font-weight: 500; line-height: .75; letter-spacing: -.08em; }
.error-card p:not(.overline) { font-family: var(--serif); font-size: 1.35rem; }
.error-card a { display: inline-block; margin-top: 1rem; font-size: .7rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
