/* The early brand development board: a pan-and-zoom canvas of the Figma page, cut into tiles. */
:root {
  --canvas: #434343;   /* Figma's canvas grey; the tiles carry the same colour, so empty areas need no tiles */
  --bar: rgba(0, 0, 0, 0.8);
  --fg: #fff;
  --text: #b4b4b4;
  --dim: #7e7e7e;
  --crimson: #CB2742;
  --f: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --bar-h: 56px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 400 14px/1.4 var(--f); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--crimson); outline-offset: 2px; border-radius: 4px; }

/* ---------- top bar: back, title, zoom ---------- */
.brd__bar { position: fixed; z-index: 10; inset: 0 0 auto 0; height: var(--bar-h); display: flex; align-items: center; gap: 20px; padding: 0 12px 0 16px; background: var(--bar); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid #222; }
.brd__back { flex: 0 0 auto; font-weight: 500; color: var(--fg); text-decoration: none; white-space: nowrap; }
.brd__back span { color: var(--dim); margin-right: 2px; }
.brd__title { flex: 0 1 auto; min-width: 0; margin: 0; font-size: 15px; font-weight: 600; color: var(--fg); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brd__title span { display: block; font-size: 12px; font-weight: 400; color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.brd__ctl { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; margin-left: auto; }
.brd__ctl button { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--fg); font-size: 18px; line-height: 1; transition: background-color 150ms ease, transform 160ms var(--ease); }
.brd__ctl button:active { transform: scale(0.94); }
.brd__ctl .brd__fit { font-size: 13px; font-weight: 500; }
.brd__ctl output { min-width: 48px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text); }
@media (hover: hover) and (pointer: fine) {
  .brd__ctl button:hover { background: #1d1d1d; }
}

/* ---------- the canvas ---------- */
.brd__stage { position: fixed; inset: 0; overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.brd__stage:focus-visible { outline-offset: -4px; }
.brd__stage.is-dragging { cursor: grabbing; }
.brd__world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.brd__world.is-moving { will-change: transform; }   /* only while it moves, so tiles and labels re-render sharp once it settles */
.brd__lvl { position: absolute; left: 0; top: 0; }
.brd__lvl.is-off { display: none; }
.brd__lvl img { position: absolute; display: block; pointer-events: none; opacity: 0; transition: opacity 240ms ease; }
.brd__lvl img.is-in { opacity: 1; }
/* area labels sit at their area's top-left corner in board units, at a constant screen size (board.js scales them back) */
.brd__label { position: absolute; transform-origin: 0 0; padding: 6px 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.66); color: var(--fg); font-size: 13px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; pointer-events: none; }
.brd__label small { display: block; font-size: 11px; font-weight: 400; color: var(--text); }
.brd__world.is-far .brd__label { padding: 3px 8px; font-size: 12px; }
.brd__world.is-far .brd__label small { display: none; }
.brd__world.is-tiny .brd__label { display: none; }

/* ---------- bottom: the jump dock and a first-visit hint ---------- */
.brd__dock { position: fixed; z-index: 10; left: 50%; bottom: 16px; translate: -50% 0; display: flex; gap: 2px; max-width: calc(100vw - 24px); padding: 5px; border-radius: 14px; background: var(--bar); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px #262626, 0 12px 32px -12px rgba(0, 0, 0, 0.7); overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.brd__dock::-webkit-scrollbar { display: none; }
.brd__dock button { flex: 0 0 auto; padding: 8px 12px; border-radius: 9px; font-size: 13px; color: var(--text); white-space: nowrap; transition: color 150ms ease, background-color 150ms ease, transform 160ms var(--ease); }
.brd__dock button:active { transform: scale(0.96); }
.brd__dock button.is-on { color: var(--fg); background: #2a2a2a; }
@media (hover: hover) and (pointer: fine) { .brd__dock button:hover { color: var(--fg); background: #1d1d1d; } .brd__dock button.is-on:hover { background: #2a2a2a; } }
.brd__hint { position: fixed; z-index: 10; left: 50%; bottom: 74px; translate: -50% 0; margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--bar); font-size: 12px; color: var(--text); white-space: nowrap; pointer-events: none; transition: opacity 500ms ease; }
.brd__hint.is-gone { opacity: 0; }

@media (max-width: 1000px) { .brd__title span { display: none; } }
@media (max-width: 760px) {
  .brd__title { display: none; }
  .brd__ctl output { display: none; }
}
@media (max-width: 600px) { .brd__hint { max-width: calc(100vw - 32px); white-space: normal; text-align: center; font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { .brd__lvl img, .brd__hint { transition: none; } }
