/* ==========================================================================
   Pikett · division demo "div-apps" (divisions/apps.html hero stage)
   The phone and its live screen are WebGL (js/scenes/div-apps.js); this file
   styles the canvas layer, the "Face front" reset and a soft studio glow.
   ========================================================================== */

/* a warm key light behind the phone, so the chrome and the glass have something to sit in */
.scene[data-scene="div-apps"]::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  left: 50%; top: 46%; width: min(92%, 640px); aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 22%, transparent), color-mix(in srgb, var(--c) 6%, transparent) 55%, transparent 74%);
}
/* the studio floor the phone floats over */
.scene[data-scene="div-apps"]::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  left: 50%; top: var(--ademo-floor, 86%); width: min(78%, 560px); height: 22%; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(243, 242, 238, .06), rgba(243, 242, 238, .02) 55%, transparent 100%);
}
.scene.is-fallback[data-scene="div-apps"]::before, .scene.is-fallback[data-scene="div-apps"]::after { display: none; }

.ademo__gl { z-index: 1; cursor: grab; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }

/* reset: top right, clear of the stage's hint line at the bottom */
.ademo__front {
  position: absolute; z-index: 3; top: 16px; right: 16px;
  display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 16px 0 13px; border-radius: 99px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
  color: var(--fg); background: rgba(18, 18, 22, .66);
  -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 10px 30px -14px rgba(0, 0, 0, .8);
  transition: opacity .35s var(--ease), transform .55s var(--ease), background-color .3s, color .3s, box-shadow .3s, visibility 0s 0s;
}
.ademo__front svg { width: 16px; height: 16px; flex: none; color: var(--c); transition: transform .6s var(--ease); }
.ademo__front:hover { background: var(--c); color: #0A0A0C; box-shadow: inset 0 0 0 1px transparent, 0 14px 34px -14px var(--c); }
.ademo__front:hover svg { color: #0A0A0C; transform: rotateY(180deg); }
.ademo__front:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ademo__front.is-hidden {
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.96); pointer-events: none;
  transition: opacity .3s var(--ease), transform .45s var(--ease), visibility 0s .45s;
}
@media (max-width: 560px) {
  .ademo__front { top: 12px; right: 12px; height: 34px; padding: 0 13px 0 11px; font-size: 10.5px; gap: 7px; }
  .ademo__front svg { width: 14px; height: 14px; }
}
@media (hover: none) {
  .ademo__front:hover { background: rgba(18, 18, 22, .66); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2), 0 10px 30px -14px rgba(0, 0, 0, .8); }
  .ademo__front:hover svg { color: var(--c); transform: none; }
}

/* no WebGL: the same app, flat, in a CSS phone (js builds .ademo__flat instead of the canvas) */
.ademo__flat { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; }
.ademo__device {
  position: relative; height: 80%; max-width: 86%; aspect-ratio: 78 / 160; transform: translateY(-3%);
  border-radius: 16.5% / 8%; background: #050506;
  box-shadow:
    inset 0 0 0 1.5px rgba(243, 242, 238, .6), inset 0 0 0 3.5px #1C1C22,
    0 0 0 1px rgba(243, 242, 238, .14),
    0 50px 90px -40px rgba(0, 0, 0, .9), 0 30px 90px -40px color-mix(in srgb, var(--c) 55%, transparent);
}
.scene .ademo__device canvas.ademo__screen {
  position: absolute !important; inset: auto !important; left: 3.72%; top: 1.81%;
  width: 92.56% !important; height: 96.38% !important; border-radius: 14% / 6.8%;
  touch-action: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
/* nothing to spin in the flat version, so the stage's spin hint steps aside */
.dhero__stage:has(.ademo__flat) .dhero__hint { display: none; }
/* if the 3D scene fails for any other reason, centre the page's own fallback line */
.scene[data-scene="div-apps"].is-fallback .scene__fallback { display: grid; place-items: center; }
