.map-page { max-width: 1500px; margin: auto; }
.map-hero { padding: 56px max(42px, calc((100vw - 1400px) / 2)) 62px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 90px; align-items: center; border-bottom: 1px solid var(--line); }
.map-folio { display: flex; gap: 0; margin-bottom: 30px; }
.map-folio span { padding: 0 12px; border-right: 1px solid var(--line); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.map-folio span:first-child { padding-left: 0; }
.map-folio span:last-child { border: 0; }
.map-hero h1 { max-width: 720px; margin: 0; font-family: var(--serif); font-size: clamp(48px, 4.7vw, 70px); font-weight: 400; line-height: 1.02; letter-spacing: -.045em; }
.map-hero > p { max-width: 520px; margin: 0 0 8px; font-size: 18px; line-height: 1.65; }
.map-workspace { border-bottom: 1px solid var(--line); }
.map-toolbar { min-height: 82px; padding: 14px max(42px, calc((100vw - 1400px) / 2)); display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); }
.map-toolbar label { position: relative; flex: 0 1 270px; }
.map-toolbar label span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.map-toolbar input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); background: rgba(255,255,255,.35); color: var(--ink); font: inherit; }
.map-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.map-filters button, .map-reset { padding: 9px 12px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 11px var(--sans); cursor: pointer; }
.map-filters button { display: inline-flex; align-items: center; gap: 7px; }
.map-filters button i { width: 8px; height: 8px; background: transparent; border: 1px solid var(--type-color); }
.map-filters button[data-filter="project"] i { width: 10px; height: 6px; background: var(--type-color); }
.map-filters button[data-filter="chapter"] i { border-width: 2px; }
.map-filters button[data-filter="organism"] i { border-radius: 50%; }
.map-filters button[data-filter="document"] i { background: var(--type-color); opacity: .68; }
.map-filters button[data-filter="theme"] i { transform: rotate(45deg); }
.map-filters button:hover, .map-filters button.is-active { background: var(--ink); color: var(--white); }
.map-reset { margin-left: auto; color: var(--blue); }
.map-stage { position: relative; min-height: 690px; background: #ede8df; overflow: hidden; }
.map-canvas { position: relative; min-width: 0; overflow: hidden; background-image: linear-gradient(rgba(8,21,46,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(8,21,46,.035) 1px, transparent 1px); background-size: 32px 32px; }
.map-canvas::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, transparent 15%, rgba(244,240,233,.48) 100%); }
.map-svg { position: relative; z-index: 1; display: block; width: 100%; height: 690px; overflow: visible; }
.map-edge { stroke: rgba(8,21,46,.24); stroke-width: .13; stroke-dasharray: .5 .55; transition: opacity .25s ease, stroke .25s ease, stroke-width .25s ease; }
.map-edge.is-active { stroke: var(--blue); stroke-width: .24; stroke-dasharray: none; opacity: 1; }
.map-edge.is-muted { opacity: .06; }
.map-edge.is-hidden { display: none; }
.map-node { cursor: pointer; outline: none; transition: opacity .25s ease; }
.map-node .node-hit { fill: transparent; stroke: none; pointer-events: all; }
.map-node .node-shape { color: var(--ink); transition: transform .22s ease, color .22s ease; transform-box: fill-box; transform-origin: center; }
.map-node .node-shape path, .map-node .node-shape rect, .map-node .node-shape circle { fill: var(--paper); stroke: currentColor; stroke-width: .22; vector-effect: non-scaling-stroke; }
.map-node .node-shape path { fill: none; }
.map-node text { fill: var(--ink); font: 600 1.32px var(--sans); letter-spacing: .015em; paint-order: stroke; stroke: var(--paper); stroke-width: .55; stroke-linejoin: round; pointer-events: none; }
.map-node .node-project rect { fill: #d8ff2f; }
.map-node .node-project path { stroke-width: .38; }
.map-node .node-project .node-project-code { fill: var(--ink); stroke: none; font: 700 1.9px var(--sans); letter-spacing: .12em; }
.map-node .node-chapter { color: var(--blue); }
.map-node .node-chapter .node-code { fill: var(--blue); stroke: none; font: 400 4.2px var(--serif); }
.map-node .node-chapter path { stroke-width: .28; }
.map-node .node-organism { color: var(--orange); }
.map-node .node-organism rect { fill: var(--paper); stroke-width: .32; }
.map-node .node-organism .node-organism-code { fill: var(--orange); stroke: none; font: 700 1.45px var(--sans); letter-spacing: .08em; }
.map-node .node-organism path { stroke-width: .18; }
.map-node .node-document { color: #776d61; }
.map-node .node-document path:first-child { fill: #e1d9cd; stroke-width: .3; }
.map-node .node-document path:last-child { stroke-width: .18; }
.map-node .node-theme { color: #2d7d68; }
.map-node .node-theme path:first-child { stroke: #b5d1c8; stroke-width: 1.6; opacity: .8; }
.map-node .node-theme path:last-child { stroke: #2d7d68; stroke-width: .18; }
.map-node:hover .node-shape, .map-node:focus-visible .node-shape, .map-node.is-selected .node-shape { transform: scale(1.22); color: var(--blue); }
.map-node.is-selected text { fill: var(--blue); font-weight: 700; }
.map-node.is-muted { opacity: .09; }
.map-node.is-hidden { display: none; }
.map-hint { position: absolute; z-index: 2; left: 24px; bottom: 20px; padding: 8px 11px; background: rgba(244,240,233,.88); border: 1px solid var(--line); font-size: 11px; }
.map-detail { position: absolute; z-index: 3; top: 0; right: 0; bottom: 0; width: min(390px, 34vw); padding: 42px 32px; border-left: 1px solid var(--line); background: rgba(244,240,233,.97); box-shadow: -18px 0 45px rgba(8,21,46,.06); overflow-y: auto; transform: translateX(101%); visibility: hidden; pointer-events: none; transition: transform .3s ease, visibility 0s linear .3s; }
.map-detail.is-open { transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.map-detail-close { position: absolute; top: 18px; right: 20px; border: 0; background: transparent; color: var(--ink); font-size: 25px; cursor: pointer; }
.map-detail-type { margin: 0 0 22px; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.map-detail h2 { margin: 0 0 24px; font: 400 34px/1.08 var(--serif); letter-spacing: -.035em; }
.map-detail-description { line-height: 1.7; }
.map-detail dl { margin-top: 38px; border-top: 1px solid var(--line); }
.map-detail dl div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.map-detail dt { margin-bottom: 5px; color: #697080; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.map-detail dd { margin: 0; font-size: 13px; }
.map-detail dd a { color: var(--blue); font-weight: 700; }
.map-detail-related { margin-top: 30px; }
.map-detail-related[hidden] { display: none; }
.map-detail-subhead { margin: 0 0 12px; color: #697080; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.map-detail-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.map-detail-links button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 1px solid var(--line); background: rgba(255,255,255,.4); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.map-detail-links button:hover, .map-detail-links button:focus-visible { border-color: var(--blue); background: rgba(255,255,255,.85); }
.map-link-dot { flex: none; width: 9px; height: 9px; background: var(--type-color); }
.map-detail-links span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.map-detail-links strong { font-size: 13px; font-weight: 700; line-height: 1.25; }
.map-detail-links em { font-style: normal; color: #697080; font-size: 11px; }
.map-explainer { padding: 110px max(42px, calc((100vw - 1400px) / 2)); display: grid; grid-template-columns: 1fr 1fr; gap: 90px; }
.map-explainer h2 { max-width: 580px; margin: 0; font: 400 clamp(44px, 4vw, 62px)/1.05 var(--serif); letter-spacing: -.04em; }
.map-explainer > div:last-child { max-width: 620px; font-size: 17px; line-height: 1.7; }

@media (max-width: 900px) {
  .map-hero { padding: 48px 24px 54px; grid-template-columns: 1fr; gap: 28px; }
  .map-toolbar { padding: 14px 24px; flex-wrap: wrap; }
  .map-toolbar label { flex-basis: 100%; }
  .map-reset { margin-left: 0; }
  .map-stage { min-height: 0; }
  .map-svg { height: 640px; }
  .map-detail { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; top: auto; width: auto; max-height: 70vh; overflow-y: auto; border-top: 1px solid var(--ink); border-left: 0; transform: translateY(105%); }
  .map-detail.is-open { transform: none; }
  .map-explainer { padding: 80px 24px; grid-template-columns: 1fr; gap: 35px; }
}

@media (max-width: 560px) {
  .map-folio { flex-wrap: wrap; row-gap: 7px; }
  .map-hero h1 { font-size: 50px; }
  .map-hero > p { font-size: 16px; }
  .map-filters { flex-wrap: nowrap; width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .map-filters button { white-space: nowrap; }
  .map-svg { width: 760px; max-width: none; height: 580px; }
  .map-canvas { overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; }
  .map-node text { font-size: 1.45px; }
}

@media (prefers-reduced-motion: reduce) {
  .map-node, .map-node circle, .map-edge, .map-detail { transition: none; }
}
