:root {
  color-scheme: light;
  --ink: #080808;
  --muted: #5c5f66;
  --paper: #f7f7f3;
  --paper-2: #eceee7;
  --accent: #2563eb;
  --focus: #111827;
  --node-shadow: 0 28px 80px rgb(10 10 10 / 0.12);
  --node-radius: 28px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    repeating-linear-gradient(
      90deg,
      rgb(8 8 8 / 0.018) 0,
      rgb(8 8 8 / 0.018) 1px,
      transparent 1px,
      transparent 54px
    ),
    repeating-linear-gradient(
      0deg,
      rgb(8 8 8 / 0.014) 0,
      rgb(8 8 8 / 0.014) 1px,
      transparent 1px,
      transparent 54px
    ),
    linear-gradient(135deg, var(--paper), var(--paper-2));
  color: var(--ink);
  font-family:
    "Aptos",
    "Segoe UI",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.hub {
  position: relative;
  min-height: 100dvh;
  isolation: isolate;
  overflow: hidden;
}

.hub::before {
  content: "";
  position: absolute;
  inset: 4vmin;
  z-index: -2;
  border: 1px solid rgb(8 8 8 / 0.08);
  border-radius: 42px;
  pointer-events: none;
}

.hub-canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.seo-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.node-field {
  position: relative;
  min-height: 100dvh;
}

.node {
  position: absolute;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--node-radius);
  background: rgb(255 255 255 / 0.58);
  box-shadow: var(--node-shadow), inset 0 1px 0 rgb(255 255 255 / 0.78);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  cursor: grab;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  transform:
    translate3d(var(--float-x, 0), var(--float-y, 0), 0)
    scale(var(--node-scale, 1));
  transition:
    box-shadow 180ms ease,
    background 180ms ease,
    filter 180ms ease;
  will-change: transform;
}

.node.is-dragging {
  cursor: grabbing;
  box-shadow:
    0 34px 92px rgb(10 10 10 / 0.18),
    inset 0 1px 0 rgb(255 255 255 / 0.9);
}

.node::after {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid rgb(8 8 8 / 0.08);
  border-radius: inherit;
  pointer-events: none;
}

.node:focus-visible {
  box-shadow:
    0 0 0 4px rgb(255 255 255 / 0.92),
    0 0 0 7px rgb(17 24 39 / 0.72),
    var(--node-shadow);
}

.node:hover {
  background: rgb(255 255 255 / 0.72);
  filter: saturate(1.08);
}

.node:active {
  --node-scale: 0.985;
}

.node img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.node-main {
  top: 50%;
  left: 50%;
  width: clamp(250px, 34vw, 520px);
  min-height: clamp(116px, 12vw, 166px);
  padding: clamp(24px, 3.8vw, 48px);
  translate: -50% -50%;
  background: rgb(255 255 255 / 0.7);
}

.node-main img {
  max-width: 100%;
}

.node-main.is-bubbling {
  animation: bubble-pop 560ms cubic-bezier(0.2, 1.35, 0.25, 1);
}

.branch-node {
  width: clamp(150px, 18vw, 260px);
  min-height: clamp(96px, 10vw, 148px);
  padding: clamp(18px, 2.4vw, 34px);
}

.studio-node {
  top: clamp(15%, 21vh, 26%);
  left: clamp(7%, 15vw, 20%);
}

.signage-node {
  right: clamp(7%, 15vw, 20%);
  bottom: clamp(14%, 20vh, 24%);
}

@keyframes bubble-pop {
  0% {
    transform:
      translate3d(var(--float-x, 0), var(--float-y, 0), 0)
      scale(1);
  }

  34% {
    transform:
      translate3d(var(--float-x, 0), var(--float-y, 0), 0)
      scale(1.085);
  }

  60% {
    transform:
      translate3d(var(--float-x, 0), var(--float-y, 0), 0)
      scale(0.965);
  }

  100% {
    transform:
      translate3d(var(--float-x, 0), var(--float-y, 0), 0)
      scale(1);
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .hub::before {
    inset: 14px;
    border-radius: 28px;
  }

  .node-field {
    min-height: 100dvh;
  }

  .node-main {
    top: 49%;
    width: min(78vw, 360px);
    min-height: 112px;
    padding: 24px;
  }

  .branch-node {
    width: min(44vw, 185px);
    min-height: 86px;
    padding: 16px;
  }

  .studio-node {
    top: 17%;
    left: 8%;
  }

  .signage-node {
    right: 8%;
    bottom: 16%;
  }
}

@media (max-width: 430px) {
  .node-main {
    width: 82vw;
  }

  .branch-node {
    width: 48vw;
  }

  .studio-node {
    left: 6%;
  }

  .signage-node {
    right: 6%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
