/* GRAPHICA Flow site — demo-tablet.css — v1.01
   The three example tablets in the world (scripts/demo-tablet.js): a graphite frame round a screen. The script sets
   the size, the place, the frame's width (--tablet-bezel), the corners (--tablet-radius) and the fade time
   (--screen-fade). The screen shows, from the bottom up: dark glass (the screen is off, so a tablet flying in never
   glares in the night), a picture of its finished dashboard (.is-seen, once it has loaded: .has-still), and the live
   demo (.is-live), which fades in over the picture and out again: the screen turns on when the river reaches it.
   Nobody can touch a demo: no pointer reaches it, so the wheel and the fingers go on moving the page. */

.demo-tablet {
  --tablet-edge: rgba(255, 255, 255, 0.1);
  --tablet-shine: rgba(255, 255, 255, 0.05);
  --tablet-shadow: rgba(0, 0, 0, 0.55);

  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box;
  padding: var(--tablet-bezel, 12px);
  border-radius: var(--tablet-radius, 24px);
  background: linear-gradient(150deg, #2a2826 0%, #161514 46%, #0e0d0c 100%);
  box-shadow:
    inset 0 0 0 1px var(--tablet-edge),
    inset 0 1px 0 var(--tablet-shine),
    0 30px 80px -20px var(--tablet-shadow);
  pointer-events: none;
}

.demo-tablet__screen {
  --glass-sheen: rgba(255, 255, 255, 0.035);

  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--tablet-radius, 24px) - var(--tablet-bezel, 12px));
  background: linear-gradient(118deg, transparent 38%, var(--glass-sheen) 50%, transparent 62%),
    linear-gradient(160deg, #18171a 0%, #0b0b0d 55%, #111013 100%);
}

.demo-tablet__still,
.demo-tablet__live {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--screen-fade, 0.5s) ease;
}

.demo-tablet__still {
  object-fit: cover;
}

.demo-tablet.is-seen.has-still .demo-tablet__still,
.demo-tablet.is-live .demo-tablet__live {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .demo-tablet__still,
  .demo-tablet__live {
    transition: none;
  }
}
