/* Tablet trim and the sidebar drawn on its screen.
   Sizes are in screen pixels of the docked device; --k (1 / docked scale) turns
   them into the 1920x1080 stage space and is set once per layout. --e (0..1) is
   how far the device has docked and only drives opacity, so nothing here is
   repainted during the dock animation (that is what made phones stutter). The
   frame itself keeps clipping with a plain rectangle (see site.css); the bezel
   ring covers its corners. */

.device-trim { position: absolute; inset: 0; pointer-events: none; --e: 0; --k: 1; }

/* Metal body: anodised space-grey aluminium with a bright chamfer line. */
.device-body {
  position: absolute; z-index: -1; opacity: var(--e);
  inset: calc(-1 * (17px + 5.4px) * var(--k));
  border-radius: calc((14px + 17px + 5.4px) * var(--k));
  background:
    linear-gradient(148deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 24%, rgba(255, 255, 255, 0) 58%, rgba(255, 255, 255, .22) 100%),
    linear-gradient(90deg, #aab0b9 0%, #dde1e6 9%, #9ba2ac 32%, #cfd3d9 58%, #8d949f 84%, #b4bac2 100%);
  box-shadow:
    inset 0 0 0 calc(.9px * var(--k)) rgba(255, 255, 255, .6),
    inset 0 calc(1.6px * var(--k)) 0 rgba(255, 255, 255, .5),
    inset 0 calc(-1.4px * var(--k)) 0 rgba(0, 0, 0, .28),
    0 calc(1.5px * var(--k)) calc(3px * var(--k)) rgba(0, 0, 0, .4);
}
/* Power button (top edge) and volume rocker (right edge). */
.device-body::before, .device-body::after {
  content: ""; position: absolute;
  background: linear-gradient(180deg, #d4d8de, #9ba2ac 60%, #7c838e);
}
.device-body::before {
  top: calc(-2.6px * var(--k)); right: 13%;
  width: 6.5%; height: calc(3px * var(--k));
  border-radius: calc(2px * var(--k)) calc(2px * var(--k)) 0 0;
  background: linear-gradient(90deg, #d4d8de, #9ba2ac 60%, #7c838e);
}
.device-body::after {
  right: calc(-2.6px * var(--k)); top: 15%;
  width: calc(3px * var(--k)); height: 24%;
  border-radius: 0 calc(2px * var(--k)) calc(2px * var(--k)) 0;
  background:
    linear-gradient(180deg, #9ba2ac 0 44%, transparent 44% 56%, #9ba2ac 56% 100%),
    linear-gradient(90deg, #7c838e, #d4d8de);
}

/* Glass bezel: a black ring around the screen, with a darker rim and a soft
   shadow where the cover glass meets the panel. */
.device-bezel {
  position: absolute; z-index: 1; inset: 0; opacity: var(--e);
  border-radius: calc(14px * var(--k));
  box-shadow:
    inset 0 0 0 calc(1px * var(--k)) rgba(0, 0, 0, .75),
    inset 0 0 calc(22px * var(--k)) rgba(0, 0, 0, .32),
    0 0 0 calc(17px * var(--k)) #06080b,
    0 0 0 calc(17.9px * var(--k)) #232830;
}

/* Reflection of a window on the cover glass. */
.device-glare {
  position: absolute; z-index: 2; inset: 0;
  border-radius: calc(14px * var(--k));
  opacity: calc(var(--e) * .9);
  background:
    linear-gradient(116deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .05) 24%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(116deg, rgba(255, 255, 255, 0) 52%, rgba(255, 255, 255, .045) 58%, rgba(255, 255, 255, 0) 64%);
}

/* ---------- sidebar on the tablet screen ---------- */
.dev-sidebar {
  position: absolute; z-index: 5; left: 0; top: 0; bottom: 0; width: 440px;
  display: flex; flex-direction: column;
  padding: 48px 30px 38px;
  color: #fff; font-family: var(--sans);
  background: linear-gradient(180deg, #1b3a63 0%, #152f52 100%);
  border-right: 2px solid rgba(255, 255, 255, .07);
  opacity: 0; transform: translateX(-28px); pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
/* It appears only once the device has finished docking (body.doc). */
body.doc .dev-sidebar {
  opacity: 1; transform: none;
  transition: opacity .55s ease .12s, transform .7s var(--ease) .12s;
}
.dev-brand { display: flex; align-items: center; gap: 16px; padding: 0 6px 38px; border-bottom: 2px solid rgba(255, 255, 255, .09); }
.dev-brand .brand-logo { --logo-h: 112px; }
.dev-nav { position: relative; flex: 1; display: flex; flex-direction: column; gap: 8px; margin-top: 34px; }
.dev-item {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 18px; flex: none;
  height: 104px; padding: 0 22px; border-radius: 20px;
  font-size: 33px; font-weight: 600; line-height: 1.15;
  color: rgba(255, 255, 255, .76);
  transition: color .3s ease;
}
.dev-item svg { width: 42px; height: 42px; flex: none; stroke: currentColor; stroke-width: 1.7; }
.dev-item.is-on { color: #fff; }
.dev-indicator {
  position: absolute; z-index: 0; left: 0; right: 0; top: 0;
  height: var(--ind-h, 104px); transform: translateY(var(--ind-y, 0px));
  border-radius: 20px;
  background: rgba(255, 255, 255, .14); border: 2px solid rgba(255, 255, 255, .16);
  transition: transform .42s var(--ease), height .42s var(--ease);
}
