/* The map viewer, shared by all nine map pages, in the language of Abdul's site
   (abdulalali-site/DESIGN.md): dark by default, the home page's 44px top bar (top-bar.css), one
   quiet 44px viewer row, and the map as the only object. The white artboard stays white with a
   hairline, like a print on a light table. */
:root{
  --bg:#fcfcfb; --ink:#141415; --ink-2:#5f6166; --ink-3:#9a9ca1; --line:rgba(20,20,21,.08); --edge:rgba(20,20,21,.14);
  --font:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,sans-serif;
  --gut:16px;
  color-scheme:light;
}
:root[data-theme="dark"]{
  --bg:#0b0b0c; --ink:#ececed; --ink-2:#9b9da2; --ink-3:#66686d; --line:rgba(236,236,237,.09); --edge:rgba(236,236,237,.16);
  color-scheme:dark}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{background:var(--bg);-webkit-text-size-adjust:100%}
html,body{height:100%;margin:0;overflow:hidden;overscroll-behavior:none}
/* Fixed, so iOS never rubber-bands the page under the map. */
body{position:fixed;inset:0;display:flex;flex-direction:column;background:var(--bg);color:var(--ink);
  font:13px/1.4 var(--font);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
a{color:inherit;text-decoration:none;touch-action:manipulation}
:focus-visible{outline:2px solid var(--ink-2);outline-offset:2px;border-radius:4px}

/* The top bar: exactly one 44px row, so the two rows of chrome stay at 88px on a phone. */
.top{flex:none;height:44px;padding:0 var(--gut);user-select:none;-webkit-user-select:none}

/* The viewer row: "← Maps", the map's name, its count, and the essay. */
.bar{flex:none;display:flex;align-items:center;gap:12px;height:44px;padding:0 var(--gut);border-bottom:1px solid var(--line);
  white-space:nowrap;user-select:none;-webkit-user-select:none}
.bar a{display:flex;align-items:center;height:44px;padding:0 6px;margin:0 -6px;color:var(--ink-2);flex:none}
.bar a:active{opacity:.6}
@media (hover:hover) and (pointer:fine){.bar a:hover{color:var(--ink)}}
.name{margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:15px;line-height:1.3;font-weight:500;color:var(--ink)}
.count{flex:none;color:var(--ink-3);font-variant-numeric:tabular-nums}
.bar .essay{margin-left:auto;text-decoration:underline;text-decoration-color:var(--line);text-decoration-thickness:1px;text-underline-offset:3px}
@media (hover:hover) and (pointer:fine){.bar .essay:hover{text-decoration-color:currentColor}}
/* Phones: tighter, so the longest name ("Agentic Identity") fits whole at 390. */
@media (max-width:420px){:root{--gut:12px}.bar{gap:8px}}

/* The viewer: the page handles every gesture itself, so the browser does none. */
#viewer{position:relative;flex:1 1 auto;min-height:0;overflow:hidden;touch-action:none;cursor:grab;
  user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#viewer.grabbing{cursor:grabbing}
#frame{position:absolute;left:0;top:0;background:#fff;box-shadow:0 0 0 1px var(--line);pointer-events:none}
#content{position:absolute;left:0;top:0;transform-origin:0 0}
/* Composited only while moving, so the map re-renders sharp at its new scale when it stops. */
#content.moving{will-change:transform}
/* Hidden until the script has placed it, so the map never flashes at full size. */
#viewer:not(.ready) #content,#viewer:not(.ready) #frame{visibility:hidden}
#map{display:block;width:100%;height:100%;pointer-events:none;-webkit-user-drag:none}

/* The hint and the controls share one row, so they can never overlap. */
.dock{position:absolute;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));display:flex;align-items:flex-end;
  justify-content:space-between;gap:8px;pointer-events:none}
.hint{margin:0;min-width:0;height:36px;padding:0 12px;border-radius:10px;background:var(--bg);box-shadow:0 0 0 1px var(--edge);
  color:var(--ink-2);line-height:36px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:opacity .16s ease,visibility .16s}
.hint.off{opacity:0;visibility:hidden}
.hint .touch{display:none}
@media (pointer:coarse){.hint .touch{display:inline}.hint .mouse{display:none}}
.controls{flex:none;display:flex;margin-left:auto;border-radius:12px;background:var(--bg);box-shadow:0 0 0 1px var(--edge);pointer-events:auto;cursor:default}
.controls button{width:44px;height:44px;padding:0;border:0;border-radius:12px;background:none;color:var(--ink);font:inherit;font-size:20px;line-height:1;
  cursor:pointer;touch-action:manipulation;user-select:none;-webkit-user-select:none}
.controls button.fit{width:52px;font-size:13px;font-weight:500}
.controls button:active{opacity:.6}
.error{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;color:var(--ink-2);font-size:15px}
.error[hidden]{display:none}
@media (prefers-reduced-motion:reduce){.hint{transition:none}}
