/* Shared colors and navigation for PIE BAKERY. */
.bakery {
  --muted: #71594e;
  --lab-paper: #fffdf6;
  --lab-rail: #fff4e7;
  --lab-line: #e9ccbc;
  --lab-edge: #bd8e7c;
  --lab-shadow: #eac5bb;
  --lab-berry: #a73d56;
  --lab-pink: #fce4e9;
  --lab-butter: #fff1c9;
  --lab-matcha: #e7efd6;
  --lab-lilac: #f0e6f7;
  --lab-blue: #e4eff5;
  --lab-hero: linear-gradient(108deg, #ffedec, #fff2d6);
  --lab-awning-pink: #efacb8;
  --lab-awning-cream: #fae0d0;
  background-color: #fff1e8;
  background-image: radial-gradient(#efd6cc 0.75px, transparent 1px);
}

html[data-theme="dark"] .bakery {
  --muted: #cdb39b;
  --lab-paper: #2e221c;
  --lab-rail: #382820;
  --lab-line: #573e35;
  --lab-edge: #8a6356;
  --lab-shadow: #1e140f;
  --lab-berry: #f8b2c3;
  --lab-pink: #53303d;
  --lab-butter: #51402b;
  --lab-matcha: #34402c;
  --lab-lilac: #44334f;
  --lab-blue: #293e48;
  --lab-hero: linear-gradient(108deg, #4b2d39, #4a3524);
  --lab-awning-pink: #8a4758;
  --lab-awning-cream: #694c38;
  background-color: #271b16;
  background-image: radial-gradient(#463027 0.75px, transparent 1px);
}

.bakery .topbar {
  padding-top: 8px;
  background: var(--lab-paper);
  border-bottom: 1px solid var(--lab-edge);
}

.bakery .topbar::after {
  top: 0;
  margin: 0;
  height: 9px;
  background:
    radial-gradient(ellipse at 12px 0, var(--lab-awning-pink) 0 11px, transparent 11.5px) 0 0 / 48px 9px repeat-x,
    radial-gradient(ellipse at 36px 0, var(--lab-awning-cream) 0 11px, transparent 11.5px) 0 0 / 48px 9px repeat-x;
  filter: none;
}

.bakery .brand-icon {
  background: var(--lab-pink);
  border: 1px solid var(--lab-edge);
  box-shadow: 2px 2px 0 var(--lab-shadow);
}

.bakery .brand-icon::after {
  content: "";
  width: 24px;
  height: 17px;
  background: var(--sprite-pie) center / contain no-repeat;
  image-rendering: pixelated;
}

.bakery .site-tabs .active {
  background: var(--lab-pink);
  border: 1px solid var(--lab-line);
  box-shadow: none;
}

.bakery .site-tabs .active { color: var(--lab-berry); }

.bakery .button.primary {
  color: #fffdf9;
  background: #a73d56;
  border-color: #792d41;
  box-shadow: 2px 3px 0 #792d41;
}

.bakery .button.primary:hover { background: #93324a; }
.bakery .button.active { background: var(--lab-matcha); }

@media (any-hover: hover) and (any-pointer: fine) {
  .bakery {
    cursor: url("/assets/pie-cursor-arrow.png") 2 2, auto;
  }

  .bakery :is(a[href], button:enabled, summary, select:enabled, input:enabled:is([type="button"], [type="submit"], [type="reset"], [type="checkbox"], [type="radio"], [type="file"])) {
    cursor: url("/assets/pie-cursor-hand.png") 8 2, pointer;
  }

  .bakery :is(textarea, input:not([type]), input:is([type="text"], [type="search"], [type="number"], [type="email"], [type="password"], [type="tel"], [type="url"]), [contenteditable]:not([contenteditable="false"])) {
    cursor: text;
  }
}

.cursor-sparkles {
  position: fixed;
  inset: 0;
  z-index: 25;
  overflow: hidden;
  pointer-events: none;
}

.cursor-star {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--star-size);
  height: var(--star-size);
  background: #ca8a38;
  clip-path: polygon(
    42% 0, 58% 0, 58% 25%, 74% 25%, 74% 42%, 100% 42%, 100% 58%,
    74% 58%, 74% 74%, 58% 74%, 58% 100%, 42% 100%, 42% 74%,
    26% 74%, 26% 58%, 0 58%, 0 42%, 26% 42%, 26% 25%, 42% 25%
  );
  opacity: 0;
  animation: cursor-star-twinkle 440ms ease-out both;
}

.cursor-star::after {
  content: "";
  position: absolute;
  inset: 34%;
  background: #fff4ce;
}

.cursor-star[data-tone="pink"] { background: #cf6482; }
.cursor-star[data-tone="pink"]::after { background: #ffe4ed; }
html[data-theme="dark"] .cursor-star { background: #ffd36e; }
html[data-theme="dark"] .cursor-star[data-tone="pink"] { background: #ff9ebc; }

@keyframes cursor-star-twinkle {
  0% { opacity: 0; transform: translate3d(var(--star-x), var(--star-y), 0) scale(0.45); }
  22% { opacity: 1; transform: translate3d(var(--star-x), var(--star-y), 0) scale(1); }
  100% {
    opacity: 0;
    transform: translate3d(calc(var(--star-x) + var(--star-dx)), calc(var(--star-y) + var(--star-dy)), 0) scale(0.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-sparkles { display: none; }
}
