/* ============ Desk scene — first "Powerful" card ============
   A self-running demo over the card's blue wallpaper: the tile shrinks into a
   Dock, a cursor clicks it, the folder pops open above. desk-scene.js drives
   every frame; this file only holds the look.

   Sizes are TinyFolder points multiplied by --s (px per point, set by JS from
   the card size). The folder follows the app's own rules (TinyFolder One,
   src/helpers/popup-layout.ts + src/tokens/glass.js): Tiles view at tight
   density – 92 pt cards, 6 pt gaps, 8 pt frame, 22 pt folder corners, 14 pt
   card corners, 39 pt icons, 12 pt semibold labels; dark glass. The Dock is
   the Figma desktop (Filkov's Deck, node 84:99). */

[data-desk-scene] { position: relative; }

/* two layers: the Dock sits under the flying tile, the folder and the cursor
   above it (.ccard__tilewrap is z-index 2) */
.dsc {
  position: absolute; inset: 0;
  pointer-events: none;
  --s: 1;
}
.dsc--under { z-index: 1; }
.dsc--over  { z-index: 3; }
.dsc > * { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
/* .ccard__media img (styles.css) stretches every picture in the card to cover
   it – the scene's own pictures opt out with a stronger selector */
.dsc img { object-fit: contain; }

/* ---- Dock ---- */
.dsc__dock {
  height: calc(var(--s) * 59.17px);
  border-radius: calc(var(--s) * 15.2px);
  background: rgba(255, 255, 255, .2);
  box-shadow: inset 0 0 0 calc(var(--s) * .32px) rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(calc(var(--s) * 15.8px));
  backdrop-filter: blur(calc(var(--s) * 15.8px));
  opacity: 0;
}
.dsc .dsc__ico {
  position: absolute; left: 0; top: 0;
  width: calc(var(--s) * 48.2px); height: calc(var(--s) * 48.2px);
  display: block;
  filter: drop-shadow(0 calc(var(--s) * .9px) calc(var(--s) * .9px) rgba(0, 0, 0, .18));
}
.dsc__dot {
  position: absolute; left: 0; top: 0;
  width: calc(var(--s) * 1.78px); height: calc(var(--s) * 1.78px);
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
  opacity: 0;
}

/* ---- Folder (popup) ---- */
.dsc__pop {
  box-sizing: border-box;
  width: calc(var(--s) * 402px); height: calc(var(--s) * 206px);
  padding: calc(var(--s) * 8px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: calc(var(--s) * 6px);
  border-radius: calc(var(--s) * 22px);
  /* GLASS.dark fill + the folder's blue tint, over a blurred wallpaper */
  background-color: rgba(30, 30, 32, .26);
  background-image: linear-gradient(rgba(40, 112, 238, .12), rgba(37, 104, 221, .12));
  -webkit-backdrop-filter: blur(calc(var(--s) * 24px)) saturate(110%) brightness(1.06);
  backdrop-filter: blur(calc(var(--s) * 24px)) saturate(110%) brightness(1.06);
  box-shadow:
    inset 0 calc(var(--s) * 1px) 0 rgba(255, 255, 255, .52),
    inset 0 calc(var(--s) * -14px) calc(var(--s) * 22px) calc(var(--s) * -18px) rgba(0, 0, 0, .34),
    0 calc(var(--s) * 28px) calc(var(--s) * 64px) rgba(0, 0, 20, .26),
    0 calc(var(--s) * 6px) calc(var(--s) * 16px) rgba(0, 0, 20, .16);
  opacity: 0; visibility: hidden;
}
/* the liquid-glass rim: brighter on the lit top-left, fading round the sides */
.dsc__pop::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: calc(var(--s) * 1px);
  background: linear-gradient(160deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .06) 38%, rgba(255, 255, 255, .03) 62%, rgba(255, 255, 255, .22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
.dsc__card {
  position: relative; box-sizing: border-box; min-width: 0;
  padding: calc(var(--s) * 10px);
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  border-radius: calc(var(--s) * 14px);
  background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 calc(var(--s) * .5px) rgba(255, 255, 255, .11);
}
/* the app draws a full-bleed icon 1.22x its 32 pt box, centred on it */
.dsc .dsc__card img {
  display: block; flex: none;
  width: calc(var(--s) * 39px); height: calc(var(--s) * 39px);
  margin: calc(var(--s) * -3.5px);
}
.dsc__card span {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere; width: 100%;
  font: 600 calc(var(--s) * 12px) / 1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

/* ---- Cursor ---- */
.dsc__cursor {
  width: calc(var(--s) * 14px); height: calc(var(--s) * 20px);
  overflow: visible;
  transform-origin: 0 0;
  filter: drop-shadow(0 calc(var(--s) * .6px) calc(var(--s) * 1.2px) rgba(0, 0, 0, .35));
  opacity: 0;
}
