:root {
  color-scheme: dark;
  --obsidian: #0B1018;
  --gunmetal: #22262D;
  --graphite: #2E343D;
  --titanium: #8C939E;
  --platinum: #C9CED6;
  --ice: #A8D4EA;
  --ice-deep: #6FA8CC;
  --white: #F5F7FA;
  --glass: rgba(34, 38, 45, .62);
  --hair: rgba(201, 206, 214, .12);
  --head: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "DM Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --panel-w: 360px;
  --foot: 64px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--obsidian);
  color: var(--white);
  font-family: var(--body);
  -webkit-text-size-adjust: 100%;
}

#app {
  position: fixed;
  inset: 0;
  background: radial-gradient(900px 600px at 40% 30%, #1a2430, #0B1018 70%);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

canvas:active {
  cursor: grabbing;
}

.hud {
  position: absolute;
  z-index: 3;
  color: var(--white);
  transition: opacity .3s;
}

body.clean .hud,
body.clean .credit,
body.clean #hotspots,
body.embed .hud,
body.embed .credit {
  opacity: 0;
  pointer-events: none;
}

body.embed #hotspots {
  display: none;
}

/* header */
.title {
  display: flex;
  align-items: center;
  gap: 16px;
  left: calc(28px + env(safe-area-inset-left));
  top: calc(20px + env(safe-area-inset-top));
}

.mlogo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--hair), 0 6px 22px rgba(0, 0, 0, .5);
}

.title h1 {
  margin: 0;
  font-family: var(--head);
  font-size: 32px;
  line-height: 1;
  letter-spacing: 8px;
  font-weight: 600;
}

.title p {
  margin: 0;
  text-transform: uppercase;
}

.title .by {
  margin-top: 7px;
  font-size: 10.5px;
  letter-spacing: 3.5px;
  color: var(--platinum);
}

.title .sub {
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--ice);
}

.links {
  top: calc(26px + env(safe-area-inset-top));
  right: calc(var(--panel-w) + 56px + env(safe-area-inset-right));
  display: flex;
  gap: 8px;
}

/* buttons */
button,
.links a {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .5px;
  line-height: 1.2;
  color: var(--white);
  background: var(--glass);
  border: 1px solid rgba(140, 147, 158, .5);
  padding: 10px 18px;
  min-height: 40px;
  border-radius: 99px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}

button:hover,
.links a:hover {
  background: rgba(46, 52, 61, .9);
  border-color: var(--platinum);
}

button[aria-pressed="true"] {
  color: var(--ice);
  border-color: rgba(168, 212, 234, .55);
  box-shadow: 0 2px 0 -.5px var(--ice), 0 8px 16px -8px rgba(168, 212, 234, .7);
}

button.solid {
  background: rgba(34, 38, 45, .8);
  color: var(--ice);
  border-color: rgba(168, 212, 234, .55);
}

button:focus-visible,
.links a:focus-visible,
.hs:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 3px;
}

.ic {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

button.mini {
  min-height: 34px;
  padding: 6px 14px;
  font-size: 12px;
}

/* mode bar */
.modebar {
  left: calc((100% - var(--panel-w) - 28px) / 2);
  bottom: calc(var(--foot) + 18px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modebar .sep {
  width: 1px;
  height: 22px;
  background: var(--hair);
  margin: 0 4px;
}

.caption {
  left: calc((100% - var(--panel-w) - 28px) / 2);
  bottom: calc(var(--foot) + 76px);
  transform: translateX(-50%);
  margin: 0;
  width: min(520px, calc(100vw - var(--panel-w) - 80px));
  text-align: center;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--platinum);
  text-shadow: 0 1px 10px rgba(11, 16, 24, .9);
  pointer-events: none;
}

/* panel */
.panel {
  top: calc(104px + env(safe-area-inset-top));
  right: calc(24px + env(safe-area-inset-right));
  bottom: calc(var(--foot) + 18px);
  width: var(--panel-w);
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--hair);
  border-radius: 14px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, .35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}

.handle {
  display: none;
}

.panel-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 6px 16px 0;
  border-bottom: 1px solid var(--hair);
  flex: none;
}

.tabs button {
  background: none;
  border: 0;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  color: var(--platinum);
  padding: 12px 8px;
  margin-right: 12px;
  min-height: 44px;
  backdrop-filter: none;
  box-shadow: none;
}

.tabs button[aria-selected="true"] {
  color: var(--ice);
  border-bottom-color: var(--ice);
}

[role="tabpanel"] {
  overflow-y: auto;
  padding: 14px 16px 18px;
  flex: 1;
  overscroll-behavior: contain;
}

.hint-line {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--platinum);
}

.hint-line a {
  color: var(--ice);
}

.links-m {
  display: none;
}

.plist {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.plist button {
  width: 100%;
  justify-content: space-between;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  background: rgba(46, 52, 61, .45);
  border-color: var(--hair);
  text-align: left;
}

.plist button small {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--titanium);
}

.plist button[aria-pressed="true"] small {
  color: var(--ice);
}

#pane-view h3 {
  margin: 4px 0 10px;
  font-family: var(--head);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--platinum);
}

#pane-view h3:not(:first-child) {
  margin-top: 20px;
}

.views,
.toggles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.toggles {
  grid-template-columns: repeat(2, 1fr);
}

.views button,
.toggles button {
  padding: 9px 8px;
  font-size: 12.5px;
}

/* detail card */
.detail {
  padding: 16px;
  margin-bottom: 4px;
  background: rgba(11, 16, 24, .55);
  border: 1px solid rgba(168, 212, 234, .35);
  border-radius: 12px;
}

.d-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chip {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--obsidian);
  background: var(--ice);
  padding: 4px 10px;
  border-radius: 99px;
}

.detail h2 {
  margin: 12px 0 6px;
  font-family: var(--head);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.detail p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--platinum);
}

.detail dl {
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.detail dl>div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--hair);
}

.detail dt {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ice);
  padding-top: 2px;
}

.detail dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--white);
}

.detail dd.tbd {
  color: var(--titanium);
  font-style: italic;
}

.d-nav {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* hotspots */
#hotspots {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  transition: opacity .3s;
}

.hs {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  padding: 0;
  min-height: 0;
  border-radius: 50%;
  pointer-events: auto;
  background: rgba(11, 16, 24, .55);
  border: 1.5px solid var(--ice);
  box-shadow: 0 0 14px rgba(168, 212, 234, .55);
}

.hs::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--ice);
}

.hs::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(168, 212, 234, .5);
  animation: ping 2.4s ease-out infinite;
}

.hs span {
  position: absolute;
  left: 34px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 10px;
  font-size: 11.5px;
  letter-spacing: .4px;
  color: var(--white);
  background: rgba(11, 16, 24, .85);
  border: 1px solid var(--hair);
  border-radius: 99px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}

.hs:hover span,
.hs:focus-visible span,
.hs.on span {
  opacity: 1;
}

.hs.on {
  background: var(--ice);
}

.hs.on::before {
  background: var(--obsidian);
}

.hs.hide {
  display: none;
}

@keyframes ping {
  0% {
    transform: scale(.7);
    opacity: .9;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* footer */
.credit {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--foot);
  padding: 18px 24px calc(8px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--platinum);
  background: linear-gradient(to top, rgba(11, 16, 24, .95), rgba(11, 16, 24, 0));
  transition: opacity .3s;
}

.credit p {
  margin: 0 auto;
  max-width: 1100px;
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: .3px;
}

.credit .disc {
  color: var(--platinum);
}

.credit b {
  color: var(--white);
  font-weight: 600;
}

/* tablet / phone */
@media (max-width: 1000px) {
  :root {
    --panel-w: 320px;
  }

  .links {
    right: calc(var(--panel-w) + 40px);
  }
}

@media (max-width: 820px) {
  :root {
    --foot: 70px;
  }

  .title {
    left: calc(16px + env(safe-area-inset-left));
    top: calc(12px + env(safe-area-inset-top));
    gap: 12px;
  }

  .mlogo {
    width: 46px;
    height: 46px;
  }

  .title h1 {
    font-size: 22px;
    letter-spacing: 5px;
  }

  .title .by {
    font-size: 9px;
    letter-spacing: 2.5px;
    margin-top: 5px;
  }

  .title .sub {
    font-size: 9.5px;
    letter-spacing: 2.5px;
  }

  .links {
    display: none;
  }

  .links-m {
    display: block;
  }

  .modebar {
    left: 0;
    right: 0;
    bottom: auto;
    top: calc(74px + env(safe-area-inset-top));
    transform: none;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .modebar::-webkit-scrollbar {
    display: none;
  }

  .modebar>* {
    flex: none;
  }

  button {
    min-height: 44px;
  }

  .caption {
    left: 16px;
    right: 16px;
    width: auto;
    transform: none;
    bottom: auto;
    top: calc(128px + env(safe-area-inset-top));
    font-size: 12.5px;
  }

  .panel {
    top: auto;
    left: 0;
    right: 0;
    width: auto;
    bottom: var(--foot);
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
    max-height: 52px;
    transition: max-height .3s cubic-bezier(.2, .7, .2, 1);
  }

  .panel.open {
    max-height: 52vh;
  }

  .handle {
    display: flex;
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 0;
    background: none;
    backdrop-filter: none;
    box-shadow: none;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    font-size: 12px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--platinum);
  }

  .handle i {
    width: 38px;
    height: 4px;
    border-radius: 4px;
    background: var(--titanium);
  }

  .credit {
    padding: 12px 14px calc(8px + env(safe-area-inset-bottom));
    text-align: left;
  }

  .credit p {
    font-size: 9px;
    line-height: 1.4;
    letter-spacing: .1px;
  }

  .credit p:not(.disc) {
    display: none;
  }

  .detail dl>div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (max-height: 520px) and (orientation: landscape) and (min-width: 821px) {

  .title .sub,
  .caption {
    display: none;
  }

  .panel {
    top: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation: none !important;
  }
}