:root {
  --line: 3px;
  --gap: 0.5rem;
}

.home-square {
  display: grid;
  grid-template-areas:
    "art bus"
    "sleepy bus";
  grid-template-columns: 3fr 2fr;
  grid-template-rows: 3fr 2fr;
  gap: var(--gap);
  aspect-ratio: 1 / 0.9;
}

.tile {
  position: relative;
  overflow: visible;
  border: var(--line) solid var(--ink);
  color: var(--ink);
}

.tile-art {
  grid-area: art;
}

.tile-sleepy {
  grid-area: sleepy;
}

.tile-bus {
  grid-area: bus;
}

.tile-bg {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.bg-aboutme-grass {
  left: 45%;
  top: 68%;
  width: 95%;
  height: auto;
  transform: translate(-50%, -50%);
}

.bg-busstop-grass {
  left: 45%;
  bottom: 0;
  height: 70%;
  width: auto;
  transform: translateX(-50%);
}

.pic {
  position: absolute;
  z-index: 3;
  display: block;
  left: var(--left, 50%);
  top: var(--top, 50%);
  width: var(--w, 80%);
  color: var(--ink);
  transform: translate(-50%, -50%) rotate(var(--tilt, 0deg))
    scale(var(--zoom, 1));
  transition: transform 0.2s;
}

.pic img {
  display: block;
  width: 100%;
  height: auto;
}

.pic:hover,
.pic:focus-visible {
  --tilt: var(--tilt-hover, -3deg);
  --zoom: var(--zoom-hover, 1.05);
  z-index: 5;
}

.pic:hover img,
.pic:focus-visible img {
  filter: var(--glow);
}

.pic:focus-visible {
  outline: none;
}

.pic-artgallery {
  --left: 50%;
  --top: 50%;
  --w: 75%;
  --tilt: -4deg;
  --tilt-hover: 0deg;
}

.pic-aboutme {
  --left: 50%;
  --top: 42%;
  --w: 95%;
  --tilt: -3deg;
  --tilt-hover: -5deg;
}

.pic-music {
  --left: 76%;
  --top: 19%;
  --w: 42%;
  --tilt: 0deg;
  --tilt-hover: 3deg;
}

.pic-guestbook {
  --left: 20%;
  --top: 26%;
  --w: 30%;
  --tilt: -4deg;
  --tilt-hover: -8deg;
}

.pic-journal {
  --left: 30%;
  --top: 67%;
  --w: 75%;
  --tilt: 0deg;
  --tilt-hover: -3deg;
}

.tile-label {
  position: absolute;
  left: 50%;
  bottom: -4px;
  z-index: 6;
  padding: 2px 6px;
  background: #fff;
  border: 1px solid var(--ink);
  font-size: 0.8rem;
  white-space: nowrap;
  transform: translateX(-50%);
  display: none;
}

.pic:hover .tile-label,
.pic:focus-visible .tile-label {
  display: block;
}

.social-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: var(--gap);
  padding: 4px 2px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-slot {
  position: relative;
  width: 26px;
  height: 26px;
  font-size: 0.7rem;
}

.icon-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 560px) {
  .tile-label {
    font-size: 0.65rem;
  }

  .social-bar {
    gap: 10px;
  }

  .social-link {
    font-size: 0.8rem;
  }
}
