/* ARSWORD /portofolio/: the showroom (the live sites on curved screens, from showroom.js) and a detail sheet per
   project (a <dialog>, from portofolio.js). Without WebGL the showroom is a plain grid of posters. */

/* showroom, static: a grid of the posters (the page title is for screen readers only) */
.sr-head { padding-top: clamp(24px, 3vw, 48px); }
.sr-list {
  list-style: none; margin-top: 0; padding: 0 0 var(--block);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 3.4vw, 52px) clamp(16px, 1.8vw, 28px);
}
.sr-list a { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; border-radius: var(--r-lg); background: var(--sunken); }
.sr-list a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); }
.sr-list img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.sr-list a:hover img { transform: scale(1.02); }
.sr-list h2 { margin-top: 16px; font-size: var(--fs-xl); font-weight: 600; line-height: 1.25; letter-spacing: -.018em; }
.sr-list p { margin-top: 6px; max-width: 60ch; font-size: var(--fs-md); line-height: 1.5; color: var(--ink-3); text-wrap: pretty; }

/* showroom, 3D (html.sr-app, set before the first paint by the page's head script when the showroom should run and
   taken away by showroom.js when it cannot; showroom.js adds .is-3d): the showroom is the whole page. It fills the screen
   under the masthead, the canvas behind and the counter, the site in front and the arrows over it; nothing
   scrolls, and the closing section and the footer step aside (the masthead keeps the menu and WhatsApp) */
html.sr-app, html.sr-app body { overflow: hidden; }
html.sr-app .showroom ~ section, html.sr-app .colophon { display: none; }
html.sr-app .sr-stage { position: relative; height: calc(100svh - var(--topbar)); overflow: clip; }
html.sr-app .sr-list { display: none; }
html:not(.sr-app) .sr-ui { display: none; } /* the overlay the page ships belongs to the 3D view only */
html.sr-app .sr-head { position: absolute; padding: 0; } /* keeps the (screen-reader) page title, takes no room */
.sr-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 1.2s var(--ease);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.sr-canvas.is-on { opacity: 1; }
.sr-canvas.is-hot { cursor: pointer; }
.sr-canvas.is-drag { cursor: grabbing; }
.sr-ui {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: end; align-items: end; gap: 12px 32px;
  padding-bottom: clamp(20px, 4.5vh, 48px);
}
.sr-ui a, .sr-ui button { pointer-events: auto; }
.sr-count { position: absolute; top: clamp(22px, 4vh, 44px); right: 0; font-size: var(--fs-md); font-variant-numeric: tabular-nums; color: var(--ink-3); }
.sr-count b { font-weight: 600; color: var(--ink); }
.sr-info { min-width: 0; }
.sr-name { font-size: var(--fs-figure); font-weight: 600; line-height: 1.05; letter-spacing: -.035em; }
.sr-desc { margin-top: 10px; max-width: 58ch; font-size: var(--fs-md); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.sr-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; }
.sr-nav { display: flex; gap: 8px; }
/* the arrows are not drawn (scroll, drag, swipe and the arrow keys turn the ring); they stay for keyboards and
   screen readers and appear only while one of them has focus */
.sr-nav:not(:focus-within) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sr-nav .icon-btn { background: var(--canvas); }
.sr-nav .icon-btn[aria-disabled="true"] { color: var(--line-strong); border-color: var(--line); cursor: default; }

/* project detail: a sheet over the showroom. The words stay on the left, the recording and the captures
   scroll on the right; on phones the sheet fills the screen and scrolls as one column */
.pd {
  --pad: clamp(28px, 4vw, 72px);
  width: min(100% - 2 * clamp(8px, 1.6vw, 24px), 1680px); height: calc(100svh - 2 * clamp(8px, 1.6vw, 24px));
  max-width: none; max-height: none; margin: auto; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--canvas); color: var(--ink);
  overflow: hidden; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(32px) scale(.99);
  transition: opacity .45s var(--ease), transform .7s var(--ease), overlay .7s allow-discrete, display .7s allow-discrete;
}
.pd[open] { opacity: 1; transform: none; }
@starting-style { .pd[open] { opacity: 0; transform: translateY(32px) scale(.99); } }
.pd::backdrop { background: rgb(0 0 0 / 0); transition: background .45s var(--ease), overlay .45s allow-discrete, display .45s allow-discrete; }
.pd[open]::backdrop { background: rgb(0 0 0 / .55); }
@starting-style { .pd[open]::backdrop { background: rgb(0 0 0 / 0); } }
.pd-close {
  position: absolute; top: clamp(14px, 2vw, 24px); right: clamp(14px, 2vw, 24px); z-index: 3;
  width: 48px; height: 48px; background: var(--inverse); border-color: var(--inverse); color: var(--on-inverse);
}
.pd-close:hover { background: var(--inverse-hover); border-color: var(--inverse-hover); }
.pd-item { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); height: 100%; }
.pd-text { display: flex; flex-direction: column; align-items: flex-start; min-height: 0; padding: var(--pad); overflow-y: auto; }
.pd-count { font-size: var(--fs-md); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pd-count b { font-weight: 600; color: var(--ink); }
.pd-title { margin-top: clamp(16px, 2vw, 28px); font-size: clamp(2.5rem, 1.4rem + 3.4vw, 5rem); font-weight: 600; line-height: .98; letter-spacing: -.045em; text-wrap: balance; }
.pd-desc { margin-top: clamp(18px, 2vw, 28px); max-width: 44ch; font-size: var(--fs-lg); line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.pd-facts { width: 100%; max-width: 460px; margin: clamp(24px, 2.6vw, 36px) 0 0; border-top: 1px solid var(--line); }
.pd-facts > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-md); }
.pd-facts dt { color: var(--ink-3); }
.pd-facts dd { margin: 0; overflow-wrap: anywhere; }
.pd-text .cta { margin-top: clamp(24px, 2.6vw, 36px); }
.pd-media {
  display: grid; align-content: start; gap: clamp(28px, 3vw, 44px); min-height: 0;
  padding: var(--pad) clamp(76px, 7vw, 112px) var(--pad) 0; overflow-y: auto; overscroll-behavior: contain;
}
.pd-fig { margin: 0; }
.pd-frame { position: relative; overflow: hidden; border-radius: var(--r-md); background: var(--sunken); }
.pd-frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.pd-frame img, .pd-frame video { display: block; width: 100%; height: auto; }
.pd-frame video { aspect-ratio: 1280 / 630; object-fit: cover; }
.pd-fig figcaption { margin-top: 10px; font-size: var(--fs-sm); color: var(--ink-3); }
.pd-devices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); align-items: start; }
.pd-next {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 28px 0 4px; border: 0; border-top: 1px solid var(--line); background: none;
  color: var(--ink-3); font-size: var(--fs-md); text-align: left;
}
.pd-next b { margin-right: auto; font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -.025em; color: var(--ink); }
.pd-next .ico { width: 28px; height: 28px; color: var(--ink); transition: transform .3s var(--ease); }
.pd-next:hover .ico { transform: translateX(6px); }

/* phone and tablet frames inside the sheet */
.mat {
  display: grid; place-items: center; padding: clamp(24px, 2.6vw, 38px) 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.device {
  width: 54%; overflow: hidden; padding: 8px; border: 1px solid var(--line); border-radius: 22px;
  background: var(--canvas); box-shadow: var(--shot-shadow);
}
.device img { display: block; width: 100%; height: auto; border-radius: var(--r-md); }
.device.tablet { width: 76%; padding: 8px; border-radius: var(--r-lg); }
.device.tablet img { border-radius: var(--r-row); }

/* the sheet's motion (portofolio.js, same-document view transitions). Opening, the screen in front (or the poster
   in the plain list) becomes the sheet's recording while the showroom steps back behind it; closing, the reverse;
   "Proyek berikutnya" turns the sheet like a page. The sheet's own fade stands down meanwhile, and its words rise in
   after the picture (.is-entering, also where a browser has no view transitions) */
html.pd-vt .pd, html.pd-vt .pd::backdrop { transition: none; }
.pd-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
::view-transition-group(pd-shot) { animation-duration: .9s; animation-timing-function: var(--ease); border-radius: var(--r-md); overflow: clip; }
::view-transition-old(pd-shot), ::view-transition-new(pd-shot) { height: 100%; object-fit: cover; animation-duration: .5s; }
html.pd-vt-open::view-transition-old(root) { animation: pd-recede .7s var(--ease) both; }
html.pd-vt-open::view-transition-new(root) { animation: pd-arrive .45s var(--ease) both; }
html.pd-vt-close::view-transition-old(root) { animation: pd-leave .45s cubic-bezier(.4, 0, 1, 1) both; }
html.pd-vt-close::view-transition-new(root) { animation: pd-return .9s var(--ease) both; }
::view-transition-group(pd-panel) { animation-duration: .75s; border-radius: var(--r-lg); overflow: clip; }
::view-transition-old(pd-panel), ::view-transition-new(pd-panel) { mix-blend-mode: normal; } /* two dark pages: no added light */
html.pd-vt-swap::view-transition-old(pd-panel) { animation: pd-turn-out .45s cubic-bezier(.4, 0, 1, 1) both; }
html.pd-vt-swap::view-transition-new(pd-panel) { animation: pd-turn-in .75s .06s var(--ease) both; }
@keyframes pd-recede { to { opacity: 0; transform: scale(.94); filter: blur(4px); } }
@keyframes pd-arrive { from { opacity: 0; } }
@keyframes pd-leave { to { opacity: 0; transform: translateY(20px) scale(.985); } }
@keyframes pd-return { from { opacity: 0; transform: scale(.94); filter: blur(4px); } }
@keyframes pd-turn-out { to { opacity: 0; transform: translateX(-7%); } }
@keyframes pd-turn-in { from { opacity: 0; transform: translateX(7%); } }
@keyframes pd-rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes pd-pop { from { opacity: 0; transform: scale(.7); } }
.pd.is-entering .pd-text > * { animation: pd-rise .9s var(--ease) both; }
.pd.is-entering .pd-text > :nth-child(1) { animation-delay: .14s; }
.pd.is-entering .pd-text > :nth-child(2) { animation-delay: .2s; }
.pd.is-entering .pd-text > :nth-child(3) { animation-delay: .26s; }
.pd.is-entering .pd-text > :nth-child(4) { animation-delay: .32s; }
.pd.is-entering .pd-text > :nth-child(5) { animation-delay: .38s; }
.pd.is-entering .pd-rec figcaption { animation: pd-rise .8s .42s var(--ease) both; }
.pd.is-entering .pd-media > :not(.pd-rec) { animation: pd-rise 1s .42s var(--ease) both; }
.pd.is-entering .pd-close { animation: pd-pop .6s .3s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { .pd.is-entering, .pd.is-entering * { animation: none !important; } }

.pf-close { display: flex; align-items: end; justify-content: space-between; gap: 28px 48px; flex-wrap: wrap; }
.pf-close-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 899.98px) {
  .pd { width: 100%; height: 100svh; border: 0; border-radius: 0; }
  /* one column that scrolls as a whole and opens on the recording (the picture the showroom's screen becomes),
     then the words, then the other pictures: the media box steps aside so its recording can lead */
  .pd-item { display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
  .pd-item > *, .pd-media > * { flex-shrink: 0; }
  .pd-media { display: contents; }
  .pd-rec { order: -1; margin: 72px var(--gutter) 0; }
  .pd-text { overflow: visible; padding: 28px var(--gutter) 8px; }
  .pd-media > :not(.pd-rec) { margin: 32px var(--gutter) 0; }
  .pd-media > :last-child { margin-bottom: 40px; }
  .pd-close { top: 12px; right: 12px; }
}
@media (max-width: 599.98px) {
  .sr-list { grid-template-columns: minmax(0, 1fr); }
  .sr-count { position: static; grid-column: 1 / -1; }
  .sr-ui { gap: 10px 16px; }
  .pd-devices { gap: 12px; }
  .pf-close-actions .cta { flex: 1 1 100%; }
}
