/* Same colours and look as SVGmap and City Model */
:root {
  color-scheme: light;
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --bg: #e4e4e4;
  --surface: #ffffff;
  --surface-hover: #f3f6fa;
  --border: #e2e2e2;
  --border-strong: #b5b5b5;
  --text: #333333;
  --text-2: #555555;
  --text-3: #777777;
  --emboss: 0 1px 0 rgb(255 255 255 / 0.85);
  --link: #2470c6;
  --link-hover: #1a548f;
  --accent: #2b7bd6;
  --bar-1: #fcfcfc;
  --bar-2: #e9e9e9;
  --bar-border: #cdcdcd;
  --bar-highlight: rgb(255 255 255 / 0.75);
  --header-1: #45484e;
  --header-2: #2a2c30;
  --icon-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #19191b;
    --surface: #2b2c2f;
    --surface-hover: #35383d;
    --border: #232426;
    --border-strong: #111213;
    --text: #e3e3e3;
    --text-2: #bcbcbc;
    --text-3: #979797;
    --emboss: 0 -1px 0 rgb(0 0 0 / 0.6);
    --link: #74aee9;
    --link-hover: #a0c8f2;
    --accent: #4a8ed8;
    --bar-1: #3c3d41;
    --bar-2: #323337;
    --bar-border: #1c1d1f;
    --bar-highlight: rgb(255 255 255 / 0.06);
    --header-1: #2f3034;
    --header-2: #1d1e21;
    --icon-shadow: 0 1px 3px rgb(0 0 0 / 0.7);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 14px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--link);
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 44px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid #000;
  background: linear-gradient(var(--header-1), var(--header-2));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.1),
    0 1px 3px rgb(0 0 0 / 0.25);
}

.brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: -0.01em;
  text-decoration: none;
  text-shadow: 0 -1px 0 #000;
}

.brand:hover {
  color: #fff;
}

.brand-name,
.brand-name:hover {
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 40px;
  margin: 0 -8px;
  padding: 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.brand-mark:active img {
  transform: translateY(1px);
}

.brand img {
  border-radius: 4px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
}

.header-links {
  display: flex;
  align-items: center;
  flex: none;
  gap: 4px;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border: 1px solid #16171a;
  border-radius: 4px;
  background: linear-gradient(#55585e, #3b3d42);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12);
  color: #e6e6e6;
  font-size: 12px;
  font-weight: bold;
  text-decoration: none;
  text-shadow: 0 -1px 0 #000;
  white-space: nowrap;
}

.header-icon {
  justify-content: center;
  flex: none;
  width: 30px;
  padding: 0;
}

.header-github {
  justify-content: center;
  flex: none;
  gap: 6px;
}

@media (max-width: 300px) {
  .header-github {
    width: 30px;
    padding: 0;
  }

  .header-github-label {
    display: none;
  }
}

.header-btn:hover {
  background: linear-gradient(#61646b, #45474d);
  color: #fff;
}

.header-btn:active {
  background: #222326;
  box-shadow: inset 0 2px 5px rgb(0 0 0 / 0.6);
}

main {
  max-width: 760px;
  margin: 24px auto 32px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.15);
}

.intro {
  padding: 4px 20px 16px;
}

.site-note {
  max-width: 760px;
  margin: 24px auto 32px;
  padding: 0 16px;
  color: var(--text-2);
  font-size: 12px;
  text-align: center;
}

.site-note p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.25;
  margin: 16px 0 6px;
  text-shadow: var(--emboss);
}

.intro p {
  margin: 0;
  color: var(--text-2);
}

/* Same as the collapsible section bars in the SVGmap sidebar, minus the arrow */
h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0;
  padding: 6px 20px;
  border-top: 1px solid var(--bar-border);
  border-bottom: 1px solid var(--bar-border);
  background: linear-gradient(var(--bar-1), var(--bar-2));
  box-shadow: inset 0 1px 0 var(--bar-highlight);
  font-size: 13px;
  text-shadow: var(--emboss);
}

h2 span {
  color: var(--text-3);
  font-size: 11px;
  font-weight: normal;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

li + li {
  border-top: 1px solid var(--border);
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  color: inherit;
  text-decoration: none;
}

.row:hover {
  color: inherit;
  background: var(--surface-hover);
}

.row:focus-visible {
  outline-offset: -2px;
}

.row img {
  flex: none;
  border-radius: 9px;
  box-shadow: var(--icon-shadow);
}

.text {
  flex: 1;
  min-width: 0;
}

.name {
  display: block;
  font-size: 15px;
  font-weight: bold;
  text-shadow: var(--emboss);
}

.row:hover .name {
  color: var(--link);
}

.desc {
  display: block;
  color: var(--text-2);
  font-size: 13px;
}

.host {
  flex: none;
  color: var(--text-3);
  font-size: 12px;
}

@media (max-width: 800px) {
  main {
    margin: 0;
    border-width: 0 0 1px;
    border-radius: 0;
  }

  .intro,
  h2,
  .row {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 600px) {
  .host {
    display: none;
  }
}

/* The original layout stays in place, ready to return when gravity ends. */
html.gravity-active {
  overflow: hidden;
  overscroll-behavior: none;
}

.gravity-active body > :is(header, main, .site-note) {
  visibility: hidden;
  pointer-events: none;
}

.gravity-stage {
  position: fixed;
  z-index: 1000;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  touch-action: none;
}

.gravity-stage::after {
  position: absolute;
  right: 0;
  bottom: var(--gravity-floor-gap, calc(48px + env(safe-area-inset-bottom, 0px)));
  left: 0;
  height: 1px;
  background: var(--border-strong);
  box-shadow: 0 1px 12px rgb(43 123 214 / 0.15);
  content: '';
  pointer-events: none;
}

.gravity-toolbar {
  position: absolute;
  z-index: 3;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 3px 14px rgb(0 0 0 / 0.15);
  transform: translateX(-50%);
}

.gravity-caption {
  margin-right: 12px;
}

.gravity-caption h2 {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: 14px;
}

.gravity-caption p {
  margin: 0;
  color: var(--text-3);
  font-size: 11px;
}

.gravity-toolbar button {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: linear-gradient(var(--bar-1), var(--bar-2));
  color: var(--text);
  font: 600 12px/1.5 var(--font);
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}

.gravity-toolbar button:hover {
  background: var(--surface-hover);
}

.gravity-toolbar button[aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--link);
}

.gravity-toolbar .gravity-restore {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.gravity-toolbar .gravity-restore:hover {
  background: var(--link-hover);
}

.gravity-hint {
  position: absolute;
  right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
  pointer-events: none;
}

.gravity-piece {
  position: absolute;
  top: 0;
  left: 0;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}

.gravity-piece.is-grabbed {
  z-index: 2;
  cursor: grabbing;
}

.gravity-piece a,
.gravity-piece button {
  cursor: inherit;
}

.gravity-piece-content {
  transform-origin: top left;
}

.gravity-piece-content > :is(h1, h2, p) {
  margin: 0;
}

.gravity-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.gravity-link:hover {
  color: inherit;
}

.gravity-link:hover .name {
  color: var(--link);
}

.gravity-project-text .gravity-link,
.gravity-project-host .gravity-link,
.gravity-footer p {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.12);
}

.gravity-project-icon img {
  display: block;
  border-radius: 9px;
  box-shadow: var(--icon-shadow);
}

.gravity-project-host .host {
  display: block;
}

.gravity-heading h2 {
  border: 1px solid var(--bar-border);
  border-radius: 4px;
}

.gravity-brand .brand {
  padding: 2px 10px;
  border-radius: 5px;
  background: linear-gradient(var(--header-1), var(--header-2));
  box-shadow: var(--icon-shadow);
}

.gravity-footer p {
  color: var(--text-2);
  font-size: 12px;
  text-align: center;
}

.gravity-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.gravity-error {
  position: fixed;
  z-index: 1001;
  right: 16px;
  bottom: 16px;
  left: 16px;
  width: auto;
  height: auto;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  clip-path: none;
  text-align: center;
  white-space: normal;
}

@media (max-width: 600px) {
  .gravity-toolbar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .gravity-caption {
    width: 100%;
    margin: 0;
    text-align: center;
  }

  .gravity-caption h2 {
    display: block;
  }
}
