/* =====================================================================
   SugarPlumJelly Miami — v7 additions
   (two-way scroll reveals, the cookie turning into its inside,
   the chalkboard Instagram section)
   ===================================================================== */

/* ---------- Scroll reveals work both ways; leaving is quicker than arriving ---------- */
.js .reveal:not(.is-in) { transition-duration: 450ms; transition-delay: 0ms; transition-timing-function: cubic-bezier(.4, 0, 1, 1); }

/* ---------- Cookie menu: the cookie turns into its inside ---------- */
.treat { container-type: inline-size; }
.treat .fm-inside {
  inset: 9%; right: 9%; bottom: 9%; width: auto; aspect-ratio: auto; border-radius: 50%;
  box-shadow: 0 0 0 5px var(--surface), var(--shadow-md);
  opacity: 0; transform: scale(.78) rotate(-14deg); transform-origin: 50% 50%;
  transition: transform 520ms var(--ease-spring), opacity 260ms ease; transition-delay: 0ms;
}
.treat .fm-cookie { transition: transform 520ms var(--ease-spring), opacity 300ms ease, filter 500ms; }
.treat .fm:hover .fm-cookie, .treat.show-inside .fm-cookie { transform: rotate(calc(var(--tilt) + 22deg)) scale(1.1); opacity: 0; }
.treat .fm:hover .fm-inside, .treat.show-inside .fm-inside { opacity: 1; transform: none; transition-delay: 60ms; }
.treat .fm:hover .fm-halo, .treat.show-inside .fm-halo { transform: scale(1.04); }
@media (hover: none) {
  /* a tap on the picture opens the cookie page, so a lingering :hover must not swap it */
  .treat:not(.show-inside) .fm:hover .fm-cookie { transform: rotate(var(--tilt)); opacity: 1; }
  .treat:not(.show-inside) .fm:hover .fm-inside { opacity: 0; transform: scale(.78) rotate(-14deg); }
}

.inside-btn {
  --size: min(100cqw, 220px);
  position: absolute; z-index: 3; top: calc(var(--size) - 42px); right: calc(50cqw - var(--size) / 2 - 2px);
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px 0 9px; border: 0; border-radius: 999px;
  background: var(--surface); color: var(--grape); font: 600 .78rem/1 var(--font-body, inherit); letter-spacing: .01em;
  box-shadow: 0 0 0 1px rgba(143, 118, 169, .25), 0 6px 14px -6px rgba(60, 28, 50, .35);
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background 200ms ease, color 200ms ease, transform 160ms ease, opacity 200ms ease;
}
.inside-btn::before { /* 44px touch target around the small pill */ content: ""; position: absolute; inset: -5px -4px; }
.inside-btn svg { width: 18px; height: 18px; flex: none; transition: transform 400ms var(--ease-spring); }
.inside-btn:active { transform: scale(.94); }
.inside-btn[aria-pressed="true"] { background: var(--grape); color: var(--on-accent, #fff); }
.inside-btn[aria-pressed="true"] svg { transform: rotate(-30deg); }
.inside-btn:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; }
/* with a mouse the hover does the work; the button only shows for keyboard focus */
@media (hover: hover) and (pointer: fine) {
  .inside-btn { opacity: 0; pointer-events: none; }
  .inside-btn:focus-visible { opacity: 1; pointer-events: auto; }
}
@media (max-width: 760px) { .inside-btn { --size: min(100cqw, 170px); top: calc(var(--size) - 36px); height: 32px; } }
[data-theme="dark"] .inside-btn { background: #2A2036; color: var(--silver); box-shadow: 0 0 0 1px rgba(193, 181, 201, .35), 0 6px 16px -6px rgba(0, 0, 0, .7); }
[data-theme="dark"] .inside-btn[aria-pressed="true"] { background: var(--silver); color: #211A2B; }
@media (prefers-reduced-motion: reduce) {
  .treat .fm-inside { transform: none; transition: opacity 200ms; }
  .treat .fm:hover .fm-cookie, .treat.show-inside .fm-cookie { transform: rotate(var(--tilt)); }
}

/* ---------- Instagram: the v6 framed photo, a little larger and tilted slightly to the right ---------- */
.insta-art { max-width: 520px; }
.ia-photo { width: 70%; transform: translate(-50%, calc(-50% + var(--p) * -20px)) rotate(8deg); }
.insta-art:hover .ia-photo { transform: translate(-50%, calc(-51% + var(--p) * -20px)) rotate(5deg) scale(1.02); }
@media (max-width: 860px) {
  .insta-art { max-width: 380px; margin-block: 24px 6px; }
  .ia-photo { width: 58%; }
}
