/* Showcases (js/fx/showcase.js): what the Frame shows on a major world's signboard instead of the 3D slab.
   They live in a layer inside the Frame's box (.frame__shows, a size container: every length below is a share of
   that box, cqw / cqh), one .show per world, only the one of the world that has the page is on (a timed fade).
   Device frames (.dv-phone, .dv-laptop) are plain CSS, the same for every project, with no maker's mark.
   Devices are placed with physical offsets (left / top), so a composition is the same in both page directions;
   the recreated app screens inside keep their own direction. */
.frame__shows { position: absolute; inset: 0; pointer-events: none; container-type: size; }
.show { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; visibility: hidden; transition: opacity 0.22s linear, visibility 0s 0.22s; }
.show.is-on { opacity: 1; visibility: visible; transition: opacity 0.3s linear, visibility 0s; }
.show__in { position: relative; flex: none; }
/* While a showcase is on, the slab under it fades out, and is then taken out altogether (.is-solo, set once the
   fade is over), so the renderer stops drawing it. */
.frame__stage, .frame__fallback { transition: opacity 0.25s linear; }
.frame.has-show .frame__stage, .frame.has-show .frame__fallback { opacity: 0; }
.frame.is-solo .frame__stage, .frame.is-solo .frame__fallback { display: none; }

/* ---- A phone. --w is its width; proportions are the worlds' own device (css/world.css .w-device--phone), which
   the recreated screens were drawn for. --u is 1/390 of the screen, the unit of the app UIs. */
.dv-phone { --bz: calc(var(--w) * 0.027); position: absolute; width: var(--w); height: calc(var(--w) * 2.1641); padding: var(--bz); border-radius: calc(var(--w) * 0.15); background: #0c0c0e;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14), 0 calc(var(--w) * 0.14) calc(var(--w) * 0.22) calc(var(--w) * -0.09) var(--sh, rgb(0 0 0 / 0.5)), 0 calc(var(--w) * 0.015) calc(var(--w) * 0.04) rgb(0 0 0 / 0.16); }
.dv-phone__screen { --u: calc((var(--w) - 2 * var(--bz)) / 390); position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: calc(var(--w) * 0.125); background: #f1f5f9; isolation: isolate; }
.dv-phone__island { position: absolute; z-index: 3; top: calc(var(--w) * 0.052); left: 36.5%; width: 27%; height: calc(var(--w) * 0.072); border-radius: 99px; background: #0c0c0e; }
.dv-ui { position: absolute; inset: 0; overflow: hidden; font-size: calc(16 * var(--u)); line-height: 1.4; }
/* The recreated screens are stills here. */
.show .pf-view, .show .px-view { transition: none; }
/* A capture of a site in a phone: a plain status strip in the site's own ground colour, the capture under it. */
.dv--dark .dv-phone__screen { padding-block-start: calc(var(--w) * 0.118); background: var(--site, #111); }
.dv-phone__screen > img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 0; }
/* On a dark ground the black body needs a lit edge. */
.show--duo .dv-phone, .show--duo .dv-laptop__lid { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.26), 0 0 0 1px rgb(0 0 0 / 0.5), 0 calc(var(--cw) * 0.05) calc(var(--cw) * 0.09) calc(var(--cw) * -0.03) rgb(0 0 0 / 0.75); }

/* ---- A laptop, seen from the front. --lw is the width of its lid. */
.dv-laptop { position: absolute; width: var(--lw); }
.dv-laptop__lid { position: relative; padding: calc(var(--lw) * 0.024) calc(var(--lw) * 0.018) calc(var(--lw) * 0.028); border-radius: calc(var(--lw) * 0.028) calc(var(--lw) * 0.028) calc(var(--lw) * 0.006) calc(var(--lw) * 0.006); background: #0c0c0e; }
.dv-laptop__cam { position: absolute; top: calc(var(--lw) * 0.009); left: 50%; width: calc(var(--lw) * 0.007); height: calc(var(--lw) * 0.007); margin-left: calc(var(--lw) * -0.0035); border-radius: 50%; background: #303038; }
.dv-laptop__screen { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: calc(var(--lw) * 0.005); background: #111; }
.dv-laptop__screen > img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 0; }
/* The deck, edge on: a little wider than the lid, a lit top edge, a thumb groove. */
.dv-laptop__base { position: relative; width: 115%; height: calc(var(--lw) * 0.026); margin-left: -7.5%; border-radius: calc(var(--lw) * 0.004) calc(var(--lw) * 0.004) calc(var(--lw) * 0.04) calc(var(--lw) * 0.04) / calc(var(--lw) * 0.004) calc(var(--lw) * 0.004) calc(var(--lw) * 0.022) calc(var(--lw) * 0.022);
  background: linear-gradient(to bottom, #e3e5e9, #b4b7bd 22%, #8a8d94 60%, #5c5f66); box-shadow: 0 calc(var(--lw) * 0.03) calc(var(--lw) * 0.05) calc(var(--lw) * -0.012) rgb(0 0 0 / 0.7); }
.dv-laptop__base::before { content: ''; position: absolute; top: 0; left: 43%; width: 14%; height: 34%; border-radius: 0 0 99px 99px; background: rgb(0 0 0 / 0.3); }

/* ---- Three phones (Pfandbox, Phonax): the front one larger, the two others behind it at its sides, each more
   than 80 % in view (a screen's first words are at its start edge, which is the covered one for one of the two). */
.show--trio .show__in { --pw: min(43cqw, 97cqh / 2.1641, 290px); width: calc(var(--pw) * 2.32); height: calc(var(--pw) * 2.1641); }
.show--trio .dv-phone { top: 50%; left: 50%; }
.show--trio .dv--mid { --w: var(--pw); z-index: 2; transform: translate(-50%, -50%); }
.show--trio .dv--a, .show--trio .dv--b { --w: calc(var(--pw) * 0.8); }
.show--trio .dv--a { transform: translate(calc(-50% - var(--pw) * 0.76), -50%); }
.show--trio .dv--b { transform: translate(calc(-50% + var(--pw) * 0.76), -50%); }
/* The two at the back stand a little into the ground's haze. */
.show--trio .dv--a .dv-phone__screen::after, .show--trio .dv--b .dv-phone__screen::after { content: ''; position: absolute; inset: 0; z-index: 9; background: var(--bg); opacity: 0.12; pointer-events: none; }
.show--pfandbox { --sh: rgb(18 54 32 / 0.46); }
.show--phonax { --sh: rgb(64 22 92 / 0.42); }
.show--phonax .dv-phone__screen { background: #f3f4f6; }

/* ---- A laptop and a phone (Iran Gate, CG Nation). --cw is the width of the pair. */
.show--duo .show__in { --cw: min(96cqw, 96cqh * 1.42, 680px); width: var(--cw); height: calc(var(--cw) * 0.662); }
.show--duo .dv-laptop { --lw: calc(var(--cw) * 0.78); top: 0; left: calc(var(--cw) * 0.068); }
.show--duo .dv-phone { --w: calc(var(--cw) * 0.25); top: calc(var(--cw) * 0.121); left: calc(var(--cw) * 0.75); z-index: 2; }
.show--flip .dv-laptop { left: calc(var(--cw) * 0.152); }
.show--flip .dv-phone { left: 0; }
.show--irangate { --site: #101114; }
.show--cgnation { --site: #232d37; }
/* CG Nation's phone is scrolled into the wall: no header under the status strip, so the strip is the page's own colour. */

/* ---- The medallion (Confidentech). --d is the lens. The Tara stands in front of its lower edge. */
.show--disc .show__in { --d: min(70cqw, 80cqh, 470px); width: calc(var(--d) * 1.22); height: calc(var(--d) * 1.13); }
.md { position: absolute; inset: 0; }
.md__halo { position: absolute; left: 50%; top: calc(var(--d) * 0.5); width: calc(var(--d) * 1.7); height: calc(var(--d) * 1.7); margin: calc(var(--d) * -0.85) 0 0 calc(var(--d) * -0.85); border-radius: 50%; background: radial-gradient(closest-side, rgb(86 112 255 / 0.2), rgb(241 135 121 / 0.07) 58%, transparent 74%); }
/* A dial of fine marks round the lens. */
.md__ring { position: absolute; left: 50%; top: calc(var(--d) * -0.06); width: calc(var(--d) * 1.12); height: calc(var(--d) * 1.12); margin-left: calc(var(--d) * -0.56); border-radius: 50%; background: repeating-conic-gradient(from -0.35deg, rgb(245 242 239 / 0.5) 0 0.7deg, transparent 0.7deg 6deg);
  -webkit-mask-image: radial-gradient(closest-side, transparent calc(100% - var(--d) * 0.022), #000 calc(100% - var(--d) * 0.022)); mask-image: radial-gradient(closest-side, transparent calc(100% - var(--d) * 0.022), #000 calc(100% - var(--d) * 0.022)); }
.md__lens { position: absolute; left: 50%; top: 0; width: var(--d); height: var(--d); margin-left: calc(var(--d) * -0.5); border-radius: 50%; overflow: hidden; background: #101116;
  box-shadow: 0 0 0 calc(var(--d) * 0.014) #0b0b0e, 0 0 0 calc(var(--d) * 0.018) rgb(255 255 255 / 0.3), 0 calc(var(--d) * 0.08) calc(var(--d) * 0.14) calc(var(--d) * -0.04) rgb(0 0 0 / 0.8); }
.md__lens img { position: absolute; left: -11%; top: -17%; width: 122%; height: 122%; max-width: none; object-fit: cover; }
.md__glass { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(90% 70% at 28% 4%, rgb(255 255 255 / 0.2), transparent 46%), radial-gradient(closest-side, transparent 66%, rgb(6 6 10 / 0.55)); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1); }
/* The car's own position on the map keeps sending a ring out, like the app's live dot. */
.md__glass::after { content: ''; position: absolute; left: 50%; top: 37.5%; width: 26%; height: 26%; margin: -13% 0 0 -13%; border-radius: 50%; box-shadow: inset 0 0 0 calc(var(--d) * 0.006) rgb(140 160 255 / 0.9); opacity: 0; }
.show.is-on .md__glass::after { animation: md-ping 2.8s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }
@keyframes md-ping { 0% { transform: scale(0.5); opacity: 0; } 12% { opacity: 0.9; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
.md__ground { position: absolute; left: 50%; top: calc(var(--d) * 0.97); width: calc(var(--d) * 0.9); height: calc(var(--d) * 0.14); margin-left: calc(var(--d) * -0.47); border-radius: 50%; background: radial-gradient(closest-side, rgb(0 0 0 / 0.6), transparent); }
.md__car { position: absolute; left: 50%; top: calc(var(--d) * 0.43); width: calc(var(--d) * 1.2); height: auto; max-width: none; margin-left: calc(var(--d) * -0.575); }

/* Phones: the showcase gets a little more room than the slab had (the signboard's copy starts at 54svh; see
   .stop::after in css/home.css, which keeps it there however long the copy is). */
@media (max-width: 899px) {
  /* From just under the top bar (60 px; the box starts at 8svh) to just above the copy. */
  .frame__shows { inset-block: max(-1.5svh, 60px - 8svh) -3.5svh; }
}
@media (min-width: 900px) {
  .frame__shows { inset: 9svh 1vw; }
}
@media (prefers-reduced-motion: reduce) {
  .show, .frame__stage, .frame__fallback { transition: none !important; }
  .show.is-on .md__glass::after { animation: none; }
}
