/* The four touches of fx.js. Every rule hangs on a class that fx.js puts on <html> when its
   switch is on (fx-light, fx-depth, fx-assemble), so a switch that is off leaves nothing here
   in force. --fx-glow is the design's own colour (setGlow). */

/* ---------- light: glass, a glow under the finger, a ripple on each tap ---------- */
.fx-light .bar-main, .fx-light .bar-end {
  background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: 0 14px 34px -18px rgba(60, 10, 34, .55), inset 0 0 0 1px rgba(255, 255, 255, .75), inset 0 1px 0 #fff;
}
.fx-light .look-name {
  background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
  box-shadow: 0 12px 26px -14px rgba(60, 10, 34, .6), inset 0 0 0 1px rgba(255, 255, 255, .75);
}
.fx-light .dock {
  background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: 0 18px 44px -18px rgba(60, 10, 34, .55), inset 0 0 0 1px rgba(255, 255, 255, .75), inset 0 1px 0 #fff;
}
.fx-light .sheet, .fx-light .tray.is-open, .fx-light .pop, .fx-light .type-bar, .fx-light .edit-hint {
  background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
}
/* The dial sits over the chapter it dresses: milkier than the bars, so its name reads over any picture. */
.fx-light .dial {
  background: rgba(255, 255, 255, .7); -webkit-backdrop-filter: blur(22px) saturate(1.7); backdrop-filter: blur(22px) saturate(1.7);
  box-shadow: 0 26px 60px -22px rgba(60, 10, 34, .55), inset 0 0 0 1px rgba(255, 255, 255, .8), inset 0 -1.5px 0 #fff;
}
.fx-light .dial-arrow { background: rgba(60, 10, 34, .08); }
/* Messages: dark glass, so their words stay white over anything. */
.fx-light .toast {
  background: rgba(60, 10, 34, .7); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .14);
}
/* A dialog itself stays solid, because it is read; the page behind it goes out of focus. */
.fx-light .dlg::backdrop { background: rgba(50, 8, 28, .34); -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3); }
.fx-sheen {
  position: fixed; inset: 0; z-index: 38; pointer-events: none; opacity: 0; transition: opacity .6s ease;
  background: radial-gradient(230px circle at var(--lx, 50%) var(--ly, 50%), color-mix(in srgb, var(--fx-glow, #ff9fb8) 24%, transparent), transparent 70%);
}
.fx-sheen.on { opacity: 1; }
.fx-ripple {
  position: fixed; z-index: 96; width: 16px; height: 16px; margin: -8px; border-radius: 50%; pointer-events: none;
  border: 2px solid color-mix(in srgb, var(--fx-glow, #ff9fb8) 65%, #fff); animation: fx-ripple .6s ease-out forwards;
}
@keyframes fx-ripple { to { transform: scale(7); opacity: 0; } }

/* ---------- depth: pictures and cards shift with the tilt of the phone, or the mouse ---------- */
/* `translate` adds to each frame's own transform (its tilt, its place in a collage). */
.fx-depth .is-view .frame, .fx-depth .is-live .frame, .fx-depth .stage .snap, .fx-depth .stage .sheet, .fx-depth .stage .fr {
  translate: calc(var(--tx, 0) * var(--dz, 7px)) calc(var(--ty, 0) * var(--dz, 7px));
}
.fx-depth .is-view .hero-photo, .fx-depth .is-live .hero-photo { --dz: 12px; }
.fx-depth .is-view .reason, .fx-depth .is-live .reason, .fx-depth .is-view .voucher, .fx-depth .is-live .voucher,
.fx-depth .is-view .letter, .fx-depth .is-live .letter, .fx-depth .stage .flips {
  translate: calc(var(--tx, 0) * -4px) calc(var(--ty, 0) * -4px);
}

/* ---------- assemble: a new site settles into place; a picture arriving is swept by light ---------- */
.fx-sweep {
  position: fixed; inset-inline: 0; top: 0; z-index: 64; height: 42vh; pointer-events: none;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--fx-glow, #ff9fb8) 34%, transparent) 72%, rgba(255, 255, 255, .95) 98%, transparent);
  animation: fx-sweep 1.7s cubic-bezier(.45, 0, .2, 1) both;
}
@keyframes fx-sweep { from { transform: translateY(-44vh); } to { transform: translateY(112vh); } }
.fx-settle { animation: fx-settle .9s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--fx-i, 0) * 130ms + 260ms); }
@keyframes fx-settle { from { opacity: 0; transform: translateY(44px) scale(.97); filter: blur(8px); } }
.fx-assemble .frame.is-uploading::after {
  top: 0; left: 0; width: 100%; height: 100%; margin: 0; border: 0; border-radius: inherit; z-index: 2;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .8) 50%, transparent 70%); background-size: 260% 100%;
  animation: fx-scan 1.1s linear infinite;
}
@keyframes fx-scan { from { background-position: 130% 0; } to { background-position: -130% 0; } }

@media (prefers-reduced-motion: reduce) {
  .fx-sweep, .fx-settle, .fx-ripple { animation: none !important; }
  .fx-sheen { display: none; }
}
