:root {
  color-scheme: light;
  --paper: #f4f0ec;
  --ink: #000;
  --gutter: clamp(20px, 2.15vw, 40px);
  --type: .6875rem; /* 11px at the standard browser setting, matching your sites. */
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body {
  margin: 0; color: var(--ink); background: var(--paper);
  font: 400 var(--type)/1.4 "neue-haas-grotesk-text", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
::selection { color: var(--paper); background: var(--ink); }
.top-row {
  position: fixed; top: 0; left: 0; right: 0; z-index: 4;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; min-height: 44px; padding: 0 var(--gutter);
  pointer-events: none;
}
.top-row > * { pointer-events: auto; }
.top-left { justify-self: start; }
.top-center { justify-self: center; }
.top-right { justify-self: end; }
#stage { position: relative; margin: 0 var(--gutter); min-height: 60vh; }
#sites { padding: 0; margin: 0; list-style: none; }
#sites li { width: max-content; max-width: 100%; margin: 0 auto; }
#sites a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 10px; overflow-wrap: anywhere; }
#connections, #group-labels { display: none; }
.enhanced #sites li { position: absolute; top: 0; left: 0; margin: 0; will-change: transform; }
.enhanced #sites a { touch-action: none; user-select: none; }
.enhanced #sites li.dragging { z-index: 3; }
.enhanced #sites li.dragging a { cursor: grabbing; }
.enhanced #connections { display: block; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .5s; }
.enhanced[data-mode="connect"] #connections { opacity: 1; }
#connections path { fill: none; stroke: var(--ink); stroke-width: .65; opacity: .3; vector-effect: non-scaling-stroke; }
[data-mode="connect"] #sites a { background: var(--paper); }
.enhanced #group-labels { display: block; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; }
.enhanced[data-mode="gather"] #group-labels { opacity: .5; }
.group-label { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; transition: left .3s ease, top .3s ease; }
.controls {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 12px max(14px, env(safe-area-inset-bottom));
  background: var(--paper);
}
.controls nav { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: clamp(8px, 2.5vw, 20px); }
.controls button { flex-shrink: 0; border: 0; background: none; margin: 0; padding: 0 2px; min-height: 44px; cursor: pointer; text-underline-offset: 5px; white-space: nowrap; }
.controls button:hover, .controls button[aria-pressed="true"] { text-decoration: underline; }
.domain-label {
  grid-area: 1 / 1;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 2s ease, transform 2s ease;
}
.domain-label.leaving { opacity: 0; transform: translateY(-10px); }
.domain-label.entering { opacity: 0; transform: translateY(10px); }
.domain-measure { grid-area: 1 / 1; visibility: hidden; pointer-events: none; }
#sites a.has-alts { display: grid; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  [data-mode="column"] #sites a,
  [data-mode="gather"] #sites a { min-height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  #connections, #group-labels, .domain-label, .group-label { transition: none !important; }
}
