/* The doors homepage (assets/home.js). Colors are the visit's (assets/visit-theme.js). */
html:has(body.home), body.home { height: 100%; overflow: hidden; }
body.home { opacity: 0; transition: opacity .6s, background-color .6s; }
body.home .logo, .home-shop, .home-foot .hint, .home-foot .hint b, .home-foot button { transition: color .6s; }
/* the hidden frame each composition is drawn in (assets/home.js) */
.pos-frame { position: fixed; left: -200vw; top: 0; width: 100vw; height: 100vh; border: 0; visibility: hidden; pointer-events: none; }
body.home.ready { opacity: 1; }
body.home .menu, body.home .menu-toggle, body.home .cart-link, body.home > .foot { display: none !important; }
/* the logo keeps the padding every other page gives it (site.css .side), so it never moves between pages */
body.home .side { position: fixed; bottom: auto; width: auto; background: none; box-shadow: none; display: block; z-index: 3; }

/* everything but the corner links sits in one screen-sized frame, so nothing (a door's label near the edge)
   can widen the page and make a phone zoom out */
.home-frame { position: fixed; inset: 0; overflow: hidden; }

/* the composition: the sketch's own SVG, drawn in the hidden frame and shown here as one image, no grain */
#mopey { transition: opacity .4s; }
#mopey.out { opacity: 0; }
#mopey { position: absolute; left: 50%; top: var(--top, 0px); transform: translateX(-50%) scale(var(--s, 1)); transform-origin: top center; }
#mopey img.piece { display: block; position: absolute; left: 0; top: 0; }

.doors { position: absolute; inset: 0; }
.door { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; display: block; outline: none; text-decoration: none; }
.door .ring { position: absolute; left: 50%; top: 50%; width: var(--ring); height: var(--ring); margin: calc(var(--ring) / -2) 0 0 calc(var(--ring) / -2);
  border-radius: 50%; border: calc(1px * var(--inv, 1)) solid var(--accent); opacity: .55; transform: scale(.85); transition: opacity .25s, transform .25s;
  animation: breathe 3.2s ease-in-out infinite; pointer-events: none; }
.door:hover .ring, .door:focus-visible .ring, .door.open .ring { opacity: 1; transform: scale(1.2); animation: none; }
@keyframes breathe { 50% { opacity: .2; transform: scale(1); } }
.door .lbl { position: absolute; top: 50%; left: calc(50% + var(--ring) / 2 + 12px * var(--inv, 1)); transform: translate(calc(var(--dx, 0px) * var(--inv, 1)), calc(-50% + var(--dy, 0px) * var(--inv, 1))) scale(var(--inv, 1)); transform-origin: left center;
  white-space: nowrap; font: 400 13px/1 var(--menu); letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  background: var(--bg); padding: 6px 9px; opacity: 0; pointer-events: none; transition: opacity .2s; }
/* which side a name sits on is chosen by home.js so no two names, circles or screen edges collide */
.door.side-l .lbl { left: auto; right: calc(50% + var(--ring) / 2 + 12px * var(--inv, 1)); transform-origin: right center; }
.door.side-t .lbl, .door.side-b .lbl { left: 50%; transform: translate(calc(-50% + var(--dx, 0px) * var(--inv, 1)), calc(var(--dy, 0px) * var(--inv, 1))) scale(var(--inv, 1)); } /* --dx: slid sideways to stay on screen */
.door.side-t .lbl { top: auto; bottom: calc(50% + var(--ring) / 2 + 8px * var(--inv, 1)); transform-origin: bottom center; }
.door.side-b .lbl { top: calc(50% + var(--ring) / 2 + 8px * var(--inv, 1)); transform-origin: top center; }
/* a showing name is part of its door: clicking the words goes there too */
.door:hover .lbl, .door:focus-visible .lbl, .door.open .lbl, body.reveal .door .lbl { opacity: 1; pointer-events: auto; cursor: pointer; }
body.touch .door .lbl::after { content: " \2192"; }
/* an invisible bridge over the gap between the circle and its name, so moving onto the words keeps them showing */
.door .lbl::before { content: ""; position: absolute; top: -6px; bottom: -6px; right: 100%; width: 18px; }
.door.side-l .lbl::before { right: auto; left: 100%; }
.door.side-t .lbl::before { right: 0; left: 0; width: auto; top: 100%; bottom: auto; height: 14px; }
.door.side-b .lbl::before { right: 0; left: 0; width: auto; top: auto; bottom: 100%; height: 14px; }

.home-shop { position: fixed; top: 53px; right: 64px; z-index: 3; font: 400 13px/1 var(--menu); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); text-decoration: none; }

/* the line and the two buttons share one baseline */
.home-foot { position: fixed; left: 64px; right: 64px; bottom: 28px; z-index: 3; display: flex; justify-content: space-between; align-items: baseline; gap: 20px; pointer-events: none; }
.home-foot > * { pointer-events: auto; }
.home-foot .hint { margin: 0; font: italic 300 17px/1.2 var(--body); color: var(--ink); }
.home-foot .hint b { font-style: normal; font-weight: 300; color: var(--accent); }
.home-foot .tools { display: flex; align-items: baseline; gap: 18px; font: 400 12px/1 var(--menu); letter-spacing: .14em; text-transform: uppercase; }
.home-foot button, .home-foot .tools a { all: unset; cursor: pointer; transition: opacity .2s, color .6s; color: var(--ink); padding: 6px 0; }
.home-foot button:hover, .home-foot button:focus-visible, .home-foot .tools a:hover, .home-foot .tools a:focus-visible { color: var(--accent); }
.home-foot button[aria-busy] { opacity: .45; cursor: progress; }
.nojs { position: fixed; bottom: 80px; left: 40px; list-style: none; padding: 0; font-family: var(--menu); }

@media (max-width: 1100px) {
  .home-shop { right: 40px; }
  .home-foot { left: 40px; right: 40px; }
}
@media (max-width: 768px) {
  body.home .side { padding: 18px 20px; }
  body.home .logo { font-size: 22px; line-height: 24px; }
  .home-shop { top: 22px; right: 20px; }
  /* home.js sets the piece's top and the line's top so the gaps above and below the piece are equal */
  .home-foot { left: 20px; right: 20px; bottom: auto; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
  .home-foot .hint { font-size: 15px; }
  /* three buttons on one row, each name on one line */
  .home-foot .tools { font-size: 10.5px; letter-spacing: .08em; gap: 6px 14px; flex-wrap: wrap; justify-content: center; }
  .home-foot .tools > * { white-space: nowrap; }
  .door .lbl { font-size: 11px; padding: 5px 7px; letter-spacing: .12em; }
}
