/* ---------- playground: every image floating in one space ---------- */
/* Images sit at different depths: far ones are small and pale and drift slowly,
   near ones are large and move faster, so dragging reads as moving through space. */
.pg-page { overflow: hidden; height: 100vh; height: 100dvh; background: #fafafa; }
.pg-stage { position: fixed; inset: 0; overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.pg-stage.is-dragging { cursor: grabbing; }
.pg-world { position: absolute; inset: 0; }

.pg-item { position: absolute; left: 0; top: 0; margin: 0; padding: 0; border: 0; background: #ececec; cursor: pointer; will-change: transform; transform-origin: center; }
.pg-item img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; pointer-events: none; -webkit-user-drag: none; }
.pg-item img.is-loaded { opacity: 1; }
.pg-item-in { display: block; width: 100%; height: 100%; overflow: hidden; transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s ease, opacity .5s ease; }
.pg-item:hover .pg-item-in, .pg-item:focus-visible .pg-item-in { transform: scale(1.06); box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.pg-item.is-dim .pg-item-in { opacity: .08; }
/* staged entrance: each image grows in from its own depth */
.pg-item .pg-item-in { animation: pg-pop .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--d, 0s); }
@keyframes pg-pop { from { opacity: 0; transform: scale(.6); } }

/* the title sits between the far and near layers */
.pg-title { position: absolute; left: 50%; top: 50%; z-index: 50; transform: translate(-50%, -50%); margin: 0; font-size: clamp(44px, 9vw, 150px); font-weight: 400; line-height: 1; letter-spacing: -0.045em; white-space: nowrap; pointer-events: none; color: #000; }
.pg-count { font-size: .26em; letter-spacing: 0; vertical-align: 2.3em; margin-left: .25em; }
.pg-hint { position: absolute; left: 50%; top: calc(50% + clamp(40px, 6vw, 96px)); transform: translateX(-50%); z-index: 50; margin: 0; font-size: 13px; color: #777; white-space: nowrap; pointer-events: none; transition: opacity .6s ease; }
.pg-stage.has-moved .pg-hint { opacity: 0; }

/* bottom dock, like the reference's "All Work / Discover" bar */
.pg-dock { position: fixed; left: 50%; bottom: 18px; z-index: 300; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; background: #111; border-radius: 4px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.pg-dock-btn { font: inherit; color: #fff; background: none; border: 0; padding: 8px 14px; border-radius: 3px; white-space: nowrap; cursor: pointer; }
.pg-dock-btn:hover, .pg-dock-btn[aria-expanded="true"] { background: #2a2a2a; }
.pg-dock-btn--dark { background: #fff; color: #000; }
.pg-dock-btn--dark:hover { background: #ddd; }
.pg-menu { position: absolute; left: 0; bottom: calc(100% + 6px); min-width: 100%; max-height: 60vh; overflow-y: auto; padding: 4px; background: #111; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.pg-menu button { display: flex; justify-content: space-between; gap: 18px; width: 100%; font: inherit; color: #fff; background: none; border: 0; padding: 8px 12px; border-radius: 3px; text-align: left; white-space: nowrap; cursor: pointer; }
.pg-menu button:hover { background: #2a2a2a; }
.pg-menu button.is-on { background: #fff; color: #000; }
.pg-menu sup { opacity: .5; font-size: .8em; vertical-align: 0; }

.pg-tag { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; padding: 5px 9px 6px; background: #000; color: #fff; font-size: 12px; line-height: 1; white-space: nowrap; opacity: 0; transition: opacity .15s ease; }
.pg-tag.is-on { opacity: 1; }

/* ---------- detail: big image on the left, the project on the right ---------- */
.pg-detail { position: fixed; inset: 0; z-index: 400; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); background: rgba(250,250,250,0); transition: background .5s ease; }
.pg-detail[hidden] { display: none; }
.pg-detail.is-open { background: rgba(250,250,250,1); }
.pg-detail-media { position: relative; display: grid; place-items: center; padding: 70px clamp(16px, 3vw, 48px) 40px; min-height: 0; }
.pg-detail-img { width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); object-fit: contain; opacity: 0; transition: opacity .35s ease; }
.pg-detail-img.is-on { opacity: 1; }
.pg-detail-info { display: flex; flex-direction: column; gap: 14px; padding: 76px clamp(18px, 3vw, 48px) 32px 0; overflow-y: auto; font-size: 15px; line-height: 1.5; opacity: 0; transform: translateX(24px); transition: opacity .5s ease .15s, transform .6s cubic-bezier(.2,.7,.2,1) .15s; }
.pg-detail.is-open .pg-detail-info { opacity: 1; transform: none; }
.pg-detail-n { margin: 0; font-size: 13px; color: #777; }
.pg-detail-title { margin: 0; font-size: clamp(28px, 3vw, 46px); line-height: 1.05; letter-spacing: -0.02em; font-weight: 400; }
.pg-detail-kind { margin: 0; font-size: 14px; color: #555; }
.pg-detail-text { display: grid; gap: .8em; max-width: 34em; color: #222; }
.pg-detail-text p { margin: 0; }
.pg-detail-strip { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0 6px; scrollbar-width: thin; }
.pg-detail-strip button { flex: none; width: 52px; height: 52px; padding: 0; border: 0; background: #e5e5e5; cursor: pointer; opacity: .45; transition: opacity .2s ease; outline-offset: 1px; }
.pg-detail-strip button:hover { opacity: .8; }
.pg-detail-strip button.is-on { opacity: 1; outline: 1px solid #000; }
.pg-detail-strip img { width: 100%; height: 100%; object-fit: cover; }
.pg-detail-nav { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 8px; }
.pg-detail-nav button { font: inherit; font-size: 16px; width: 40px; height: 36px; border: 1px solid #000; background: none; border-radius: 99px; cursor: pointer; }
.pg-detail-nav button:hover { background: #000; color: #fff; }
.pg-detail-link { margin-left: auto; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.pg-detail-close { position: fixed; top: 10px; right: 14px; z-index: 2; font: inherit; font-size: 30px; line-height: 1; padding: 6px 10px; border: 0; background: none; cursor: pointer; }
/* the image that flies from the wall into place */
.pg-fly { position: fixed; z-index: 450; margin: 0; object-fit: cover; pointer-events: none; transition: all .65s cubic-bezier(.65,0,.2,1); }

@media (max-width: 760px) {
  .pg-detail { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; overflow-y: auto; }
  .pg-detail-media { padding: 56px 8px 8px; }
  .pg-detail-img { max-height: 58vh; max-height: 58dvh; }
  .pg-detail-info { padding: 8px 16px 90px; overflow: visible; transform: translateY(16px); }
  .pg-detail-close { top: 6px; right: 4px; }
  .pg-hint { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .pg-item .pg-item-in { animation: none; }
  .pg-fly { transition: none; }
}

/* rounded, to match the home tiles */
.pg-item, .pg-item-in { border-radius: 10px; }
.pg-fly, .pg-detail-img { border-radius: 14px; }
.pg-dock { border-radius: 99px; padding: 5px; }
.pg-dock-btn { border-radius: 99px; padding: 8px 16px; }
.pg-menu { border-radius: 16px; padding: 6px; }
.pg-menu button { border-radius: 99px; }
.pg-tag { border-radius: 99px; padding: 5px 10px 6px; }
.pg-detail-n, .pg-detail-kind { align-self: flex-start; padding: 4px 11px 5px; border-radius: 99px; background: #fff; border: 1px solid #e2e2e2; }
.pg-detail-strip button { border-radius: 8px; overflow: hidden; }
.pg-detail-close { top: 12px; right: 12px; width: 40px; height: 40px; padding: 0; border-radius: 50%; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.1); font-size: 24px !important; display: grid; place-items: center; }

/* no big title: the hint sits in the middle on its own */
.pg-hint { top: 50%; transform: translate(-50%, -50%); z-index: 1; }
.pg-stage { z-index: 0; }

/* the logo moves from the top into the middle of the space, large, behind the floating images */
.pg-page .nav-mid { display: none; }
.pg-logo { position: absolute; left: 50%; top: 50%; z-index: 0; width: min(62vw, 980px); height: auto; transform: translate(-50%, -50%); filter: brightness(0); opacity: .92; pointer-events: none; user-select: none; animation: pg-logo-in 1.4s cubic-bezier(.2,.7,.2,1) both; }
@keyframes pg-logo-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.92); } }
.pg-world { z-index: 1; }
.pg-hint { top: calc(50% + min(16vw, 250px)); z-index: 2; }
@media (max-width: 640px) { .pg-logo { width: 84vw; } .pg-hint { top: calc(50% + 22vw); } }
