:root {
  --paper: #F4F5F7;
  --surface: #FFFFFF;
  --ink: #0E1013;
  --ink-2: #5E646C;
  --ink-3: #8A9098;
  --line: #E4E7EB;
  --pin: #FF3B30;
  --panel: #111418;
  --display: "Familjen Grotesk", system-ui, sans-serif;
  --body: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --sheet-w: 420px;
  --top-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--mono); letter-spacing: -0.01em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── Header ───────────────────────────────── */
.top {
  height: var(--top-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 3;
}
.brand img { height: 22px; display: block; }
.brand-tag { color: var(--ink-2); font-size: 14px; padding-left: 18px; border-left: 1px solid var(--line); line-height: 22px; }
.search {
  margin-left: auto; width: min(420px, 40vw);
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 14px;
  background: var(--paper); border-radius: 12px;
  border: 1px solid transparent;
  transition: border-color .15s, background .15s;
}
.search:focus-within { background: var(--surface); border-color: var(--ink); }
.search svg { width: 17px; height: 17px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; flex: none; }
.search input { border: 0; background: none; outline: none; width: 100%; font: 400 15px var(--body); color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.top-count { color: var(--ink-2); font-size: 13px; white-space: nowrap; }

/* ── Layout ───────────────────────────────── */
.layout { display: grid; grid-template-columns: 1fr var(--sheet-w); height: calc(100% - var(--top-h)); }
.map-wrap { position: relative; min-height: 0; }
.map { position: absolute; inset: 0; background: #E9ECEF; }
.map-note {
  position: absolute; left: 16px; bottom: 16px; margin: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; color: var(--ink-2); max-width: 360px;
}
.sheet {
  background: var(--surface); border-left: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 28px 40px;
}

/* ── Pins: each one is a lit LED pixel ───── */
.pin, .cluster {
  position: absolute; transform: translate(-50%, -50%);
  border: 0; padding: 0; cursor: pointer; background: none;
}
.pin { width: 30px; height: 30px; display: grid; place-items: center; }
.pin::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(14,16,19,.45);
  transition: transform .18s ease;
}
.pin::after {
  content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: var(--pin);
  box-shadow: 0 0 6px 1px rgba(255,59,48,.9);
}
.pin:hover::before { transform: scale(1.18); }
.pin.is-selected::before { transform: scale(1.5); box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(255,59,48,.4), 0 2px 6px rgba(14,16,19,.4); }
.pin-name {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 500 12px/1 var(--body); color: #fff; letter-spacing: 0;
  padding: 5px 9px 5px 10px; border-radius: 999px;
  background: rgba(14,16,19,.88);
  box-shadow: 0 0 0 1.5px #fff, 0 2px 6px rgba(14,16,19,.3);
  pointer-events: auto;
}
.pin:hover .pin-name { background: var(--ink); }
.pin.is-selected .pin-name { left: 26px; background: var(--pin); font-weight: 600; }
.cluster {
  min-width: 38px; height: 38px; padding: 0 11px; border-radius: 19px;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font: 500 13px var(--mono);
  box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(14,16,19,.35);
  transition: transform .18s ease;
}
.cluster::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pin); box-shadow: 0 0 5px rgba(255,59,48,.9); }
.cluster:hover { transform: translate(-50%, -50%) scale(1.08); }

/* ── Sheet: overview ──────────────────────── */
.eyebrow { font: 500 12px var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 10px; }
.sheet h1 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; margin: 0; font-size: 34px; line-height: 1.05; }
.sheet h1.h-site { font-size: 30px; line-height: 1.08; }
.lede { color: var(--ink-2); margin: 12px 0 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 24px 0 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div { padding: 14px 0; }
.stats div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.stats strong { display: block; font: 600 26px/1 var(--display); letter-spacing: -0.02em; }
.stats span { font-size: 13px; color: var(--ink-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2);
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.state { margin-top: 18px; }
.state-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.state-head h2 { font: 600 15px var(--display); margin: 0; }
.state-head h2 a { color: inherit; text-decoration: none; }
.state-head h2 a:hover { text-decoration: underline; }
.state-head span { font: 400 12px var(--mono); color: var(--ink-3); }
.row {
  color: inherit; text-decoration: none;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%;
  text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 11px 6px; margin: 0; cursor: pointer; border-radius: 0;
}
.row:hover { background: var(--paper); }
.row b { font-weight: 500; }
.row small { grid-column: 1; color: var(--ink-2); font-size: 13px; }
.row .spec { grid-row: 1 / span 2; grid-column: 2; align-self: center; font: 400 12px var(--mono); color: var(--ink-2); text-align: right; }
.empty { color: var(--ink-2); padding: 20px 0; }

/* ── Sheet: one site ──────────────────────── */
.back {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none;
  color: var(--ink-2); font-size: 14px; padding: 0; margin-bottom: 22px; cursor: pointer;
}
.back:hover { color: var(--ink); }
.where { color: var(--ink-2); margin: 10px 0 0; }
.tabs { display: flex; gap: 6px; margin: 24px 0 0; flex-wrap: wrap; }

/* signature: the screen drawn to scale next to a person */
.scale {
  margin: 16px 0 0; padding: 22px 18px 14px;
  background: var(--paper); border-radius: 16px;
}
.scale svg { display: block; width: 100%; height: auto; overflow: visible; }
.scale figcaption { font: 400 12px var(--mono); color: var(--ink-3); margin-top: 10px; }

.specs { display: grid; grid-template-columns: 1fr 1fr; margin: 22px 0 0; border-top: 1px solid var(--line); }
.specs div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.specs div:nth-child(odd) { padding-right: 12px; }
.specs div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.specs dt { font-size: 12px; color: var(--ink-2); }
.specs dd { margin: 2px 0 0; font: 500 16px var(--mono); letter-spacing: -0.01em; }

.story { margin: 22px 0 0; font-size: 16px; line-height: 1.55; }
.story .tag { font: 400 11px var(--mono); color: var(--ink-3); margin-left: 6px; }

.wa {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 26px; height: 50px; border-radius: 14px;
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 500;
  transition: background .15s;
}
.wa:hover { background: #262a30; }
.wa svg { width: 18px; height: 18px; fill: #fff; }
.fine { font-size: 12px; color: var(--ink-3); margin-top: 10px; text-align: center; }

a { color: var(--ink); }
.lede a { color: var(--ink); }
.back { text-decoration: none; }
.gallery { display: grid; grid-template-columns: 2fr 1fr; grid-auto-rows: 110px; gap: 6px; margin: 20px 0 0; border-radius: 16px; overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--paper); }
.gallery img:first-child { grid-row: span 2; }
.gallery img:only-child { grid-column: 1 / -1; grid-row: auto; height: 240px; }
.gallery img:nth-child(2):last-child { grid-row: span 2; }
.screen-panel[hidden] { display: none; }
.row[hidden], .state[hidden] { display: none; }

/* ── Phone ────────────────────────────────── */
@media (max-width: 820px) {
  :root { --top-h: auto; }
  body { height: auto; }
  .top { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 10px 14px; }
  .brand-tag { display: none; }
  .top-count { margin-left: auto; }
  .search { order: 3; width: 100%; margin: 0; }
  .layout { display: block; height: auto; }
  .map-wrap { height: 52vh; }
  .sheet { border-left: 0; border-top: 1px solid var(--line); padding: 22px 16px 40px; }
  .sheet h1 { font-size: 28px; }
  .sheet h2 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
