/* ---------- the tab ---------- */
.tab {
  position: fixed; z-index: 8; right: 1rem; bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer;
  font: 500 .72rem/1 "Space Grotesk", sans-serif; letter-spacing: .12em; text-transform: lowercase;
  opacity: 0; pointer-events: none; transition: opacity .6s, transform .3s;
}
body.revealed .tab { opacity: 1; pointer-events: auto; }
.tab:hover { transform: translateY(-2px); }
/* on hover the stamp turns a little, like it's being picked up */
.tab:hover .blotter { transform: rotate(-6deg) scale(1.06); }
body.acid .tab:hover .blotter { transform: rotate(-24deg) scale(.95); }
.tab:focus-visible .blotter { outline: 2px solid #7afcff; outline-offset: 3px; border-radius: 6px; }
.blotter { /* favicon/tab-trn.png: the stamp from the old site */
  display: block; width: 56px; height: 56px;
  background: url("../favicon/tab-trn.png") center / contain no-repeat;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, .55));
  transform: rotate(8deg);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.blotter i { display: none; }
body.acid .blotter { transform: rotate(-12deg) scale(.9); animation: spin-hue 6s linear infinite; }
@keyframes spin-hue { to { filter: drop-shadow(0 5px 12px rgba(0, 0, 0, .55)) hue-rotate(360deg); } }

.toast {
  position: fixed; z-index: 9; left: 50%; top: 22%; transform: translateX(-50%);
  margin: 0; padding: .6rem 1.1rem; border-radius: 999px;
  background: rgba(10, 4, 24, .75); border: 1px solid var(--edge);
  font-size: .95rem; font-style: italic; white-space: nowrap; pointer-events: none;
  animation: toast-in .5s ease;
}
.toast[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- while tripping ---------- */
/* the animated cover lives in the background shader, so the static wave steps aside */
body.acid #wave { opacity: 0; transition: opacity 4s ease; }
/* the rest of the site breathes along (gently; the cat animation itself is left untouched) */
body.acid .card { animation: breathe-ui 8s ease-in-out infinite; }
body.acid .name { animation: name-melt 6s ease-in-out infinite; }
body.acid .link, body.acid .dig, body.acid .now { animation: drift-ui 7s ease-in-out infinite; }
body.acid .link:nth-child(2n), body.acid .now { animation-delay: -2.3s; }
body.acid .link:nth-child(3n) { animation-delay: -4.6s; }
body.acid .sleeve { animation: breathe-ui 9s ease-in-out infinite; }
body.acid .crate-caption, body.acid .player { animation: breathe-centered 9s ease-in-out infinite; }

@keyframes breathe-ui {
  50% { transform: scale(calc(1 + .006 * var(--ui, 1))) rotate(calc(-.2deg * var(--ui, 1))) skewX(calc(.3deg * var(--ui, 1))); }
}
@keyframes breathe-centered {
  0%, 100% { transform: translateX(-50%); }
  50% { transform: translateX(-50%) scale(calc(1 + .008 * var(--ui, 1))) rotate(calc(.2deg * var(--ui, 1))); }
}
@keyframes drift-ui {
  33% { transform: translate(calc(1px * var(--ui, 1)), calc(-1.5px * var(--ui, 1))) rotate(calc(.25deg * var(--ui, 1))); }
  66% { transform: translate(calc(-1px * var(--ui, 1)), calc(1px * var(--ui, 1))) rotate(calc(-.2deg * var(--ui, 1))); }
}
@keyframes name-melt {
  0%, 100% { text-shadow: .045em .045em 0 #ff4fb8, .09em .09em 0 #6b2bd9, 0 0 40px rgba(0, 0, 0, .45); transform: none; }
  25% { text-shadow: -.04em .05em 0 #7afcff, .08em .1em 0 #ff4fb8, 0 0 46px rgba(255, 79, 184, .4); transform: skewX(calc(-1.5deg * var(--ui, 1))); }
  50% { text-shadow: .06em -.03em 0 #ffd36e, -.04em .08em 0 #7afcff, 0 0 50px rgba(122, 252, 255, .4); transform: scaleY(calc(1 + .02 * var(--ui, 1))); }
  75% { text-shadow: .03em .08em 0 #6b2bd9, .09em .02em 0 #ffd36e, 0 0 46px rgba(255, 211, 110, .4); transform: skewX(calc(1deg * var(--ui, 1))); }
}

@media (min-width: 701px) {
  body.sleeve-open .tab { right: calc(min(400px, 100vw) + 1rem); }
}
@media (max-width: 700px) {
  .tab { right: .8rem; }
  .blotter { width: 48px; height: 48px; }
  /* in the crate on phones the bottom is busy; sit at the top right */
  body.crate .tab { bottom: auto; top: max(.8rem, env(safe-area-inset-top)); flex-direction: row-reverse; }
  body.crate .blotter { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  body.acid .card, body.acid .name, body.acid .link, body.acid .dig, body.acid .now,
  body.acid .crate-caption, body.acid .player, body.acid .sleeve, body.acid .blotter { animation: none; }
}
