/* Tiles, the portfolio mark (assets/brand/tiles-mark.svg).
   A square, two quarter circles and the green circle: a small modular system.
   Pieces sit on a 64-unit grid where 1em = 1 unit, so the same rules work at
   any size. Set --mark-size on .brand-mark to resize it.

   Markup, inside the home link:
   <span class="brand-mark" aria-hidden="true"><i></i><i></i><i></i><i></i></span>

   On hover or keyboard focus of the link, the pieces reshape: the square
   rounds into the green circle, the circle becomes a quarter, and the
   quarters turn. Adding .is-playing to the link plays the same move. */
.brand-mark {
  --mark-size: 24px;
  position: relative;
  display: block;
  flex-shrink: 0;
  width: var(--mark-size);
  height: var(--mark-size);
  font-size: calc(var(--mark-size) / 64);
}
.brand-mark i {
  position: absolute;
  display: block;
  width: 22em;
  height: 22em;
  background: var(--ink);
  transition:
    border-radius 0.6s cubic-bezier(0.65, 0, 0.35, 1) var(--d, 0s),
    background-color 0.45s ease var(--d, 0s);
}
.brand-mark i:nth-child(1) { left: 8em; top: 8em; border-radius: 2em; }
.brand-mark i:nth-child(2) { left: 34em; top: 8em; border-radius: 0 22em 0 0; --d: 0.05s; }
.brand-mark i:nth-child(3) { left: 34em; top: 34em; border-radius: 11em; background: var(--accent-bright); --d: 0.1s; }
.brand-mark i:nth-child(4) { left: 8em; top: 34em; border-radius: 0 0 0 22em; --d: 0.15s; }

:is(:hover, :focus-visible, .is-playing) > .brand-mark i:nth-child(1) { border-radius: 11em; background: var(--accent-bright); }
:is(:hover, :focus-visible, .is-playing) > .brand-mark i:nth-child(2) { border-radius: 2em; }
:is(:hover, :focus-visible, .is-playing) > .brand-mark i:nth-child(3) { border-radius: 0 0 22em 0; background: var(--ink); }
:is(:hover, :focus-visible, .is-playing) > .brand-mark i:nth-child(4) { border-radius: 22em 0 0 0; }

@media (max-width: 640px) {
  .brand-mark { --mark-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-mark i { transition-duration: 0.01s; transition-delay: 0s; }
}
