/* ==========================================================================
   Zakros InterArts — explorable sitemap
   Builds on site.css (fonts, header, .btn, tokens).
   --fg follows the section under the pointer; each node carries its own
   section colour in --c.
   ========================================================================== */

body[data-page="sitemap"] { --fg: #ffffff; height: 100svh; overflow: hidden; }

body[data-page="sitemap"] .site-header,
.hud, .map-tools { transition: color .2s; }

/* ---------- Canvas ---------- */
.map {
  position: fixed; inset: 0; overflow: hidden;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.map.dragging { cursor: grabbing; }
.map.dragging .node { pointer-events: none; }

/* Soft black edges top and bottom so the header and breadcrumb stay readable */
.map::before, .map::after {
  content: ""; position: absolute; left: 0; right: 0; z-index: 5; pointer-events: none;
}
.map::before { top: 0; height: 130px; background: linear-gradient(#000 35%, transparent); }
.map::after  { bottom: 0; height: min(42svh, 330px); background: linear-gradient(transparent, #000 72%); }

.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

/* ---------- Connectors ---------- */
.edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.edges path {
  fill: none; stroke: var(--c); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  transition: stroke .15s;
}
.focusing .edges path:not(.lit) { stroke: color-mix(in srgb, var(--c) 26%, #000); }
.edges path.lit { stroke-width: 2.5; }

/* ---------- Nodes ---------- */
.node {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 8px;
  color: var(--c); white-space: nowrap;
}
.node a {
  display: block; color: inherit; text-decoration: none;
  -webkit-user-drag: none;
  transition: opacity .15s, background-color .12s, color .12s;
}
.node a:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }

/* sections */
.lv0 a {
  padding: 4px 0 2px;
  font: 400 76px/1 var(--display);
  letter-spacing: -.04em; text-transform: uppercase;
}
/* the three main links: same pill as the hero pages */
.lv1 a {
  height: 46px; padding: 0 26px;
  border: 2px solid currentColor;
  font: 400 26px/42px var(--cond);
}
/* deeper pages */
.lv2 a, .lv3 a { padding: 6px 11px 5px; }
.lv2 a { font: 500 22px/1 var(--cond); }
.lv3 a { font: 400 19px/1 var(--cond); }

.lv1 a:hover, .lv2 a:hover, .lv3 a:hover,
.lv1.here a, .lv2.here a, .lv3.here a { background: var(--c); color: #000; }

.focusing .node:not(.lit) a { opacity: .26; }

/* ---------- Breadcrumb ---------- */
.hud {
  position: fixed; left: var(--mx); bottom: clamp(18px, 5svh, 46px); z-index: 10;
  max-width: min(68vw, 1100px);
  color: var(--fg); pointer-events: none;
}
.hud-path {
  margin: 0 0 10px; min-height: 1.2em;
  font: 400 clamp(16px, 1.6vw, 24px)/1.2 var(--cond);
}
.hud-path span + span::before { content: "/"; margin: 0 .45em; opacity: .55; }
.hud-title {
  margin: 0;
  font: 400 calc(clamp(44px, 7.4vw, 112px) * var(--fit, 1))/.98 var(--display);
  letter-spacing: -.035em; text-transform: uppercase; text-wrap: balance;
}
.hud-meta {
  margin: 14px 0 0;
  font: 500 clamp(12px, 1.1vw, 16px)/1.35 var(--cond);
  letter-spacing: .07em; text-transform: uppercase;
}
.hud-meta span + span::before { content: "·"; margin: 0 .6em; }

/* ---------- Tools ---------- */
.map-tools {
  position: fixed; right: var(--mx); bottom: clamp(18px, 5svh, 46px); z-index: 10;
  display: flex; gap: 8px; color: var(--fg);
}
.map-tools .btn { min-width: var(--pill); padding: 0 18px; background: #000; }
.map-tools .btn:hover { background: var(--fg); }

@media (max-width: 820px) {
  .hud { max-width: none; right: var(--mx); }
  .map-tools { bottom: auto; top: calc(var(--header-h) + 6px); }
  .map-tools .btn { height: 38px; min-width: 38px; padding: 0 13px; font-size: 18px; }
}

/* Layout selection shares the existing map controls and visual style. */
.layout-picker{display:flex;align-items:center;gap:10px;padding:0 12px;border:1px solid currentColor;background:#000;font:400 16px/1 var(--cond);color:inherit;min-width:0}
.layout-picker select{height:var(--pill);width:116px;padding:0 2px;border:0;border-radius:0;background:#000;color:inherit;font:inherit;cursor:pointer}
.layout-picker select:focus-visible{outline:1px solid currentColor;outline-offset:2px}
.layout-picker option{background:#000;color:inherit}
@media(max-width:820px){.map-tools{gap:6px;max-width:calc(100vw - 2 * var(--mx));flex-wrap:wrap;justify-content:flex-end}.layout-picker{font-size:14px;padding:0 9px;gap:6px}.layout-picker select{height:36px;width:98px}}
