/* A phone as hardware: a brushed titanium rim with its buttons, a black bezel, the screen, and a
   glass highlight that follows the pointer. Shared by both homepage views. Sizes come from the
   wrapper; tune with --r (corner radius), --rim and --bezel. device.js drives --rx/--ry (tilt)
   and --gx/--gy (where the highlight sits); with JavaScript off it simply stands straight. */
.device {
  --r: 30px; --rim: 3px; --bezel: 4px;
  position: relative; display: block; width: 100%; height: 100%; border-radius: var(--r); padding: var(--rim);
  background:
    linear-gradient(145deg, #b4b9c2 0%, #575b64 12%, #25272d 34%, #17181c 58%, #3a3d45 84%, #c3c8d1 100%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .38), inset 0 -1px 1px rgba(0, 0, 0, .5);
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
}
/* Buttons: action and volume on the left, side button on the right, all on the rim's edge. */
.device::before, .device::after { content: ""; position: absolute; width: 2px; border-radius: 2px; pointer-events: none; }
.device::before { left: -1.5px; top: 17%; height: 21%;
  background: linear-gradient(#5a5e67 0 18%, transparent 18% 32%, #5a5e67 32% 62%, transparent 62% 70%, #5a5e67 70% 100%); }
.device::after { right: -1.5px; top: 25%; height: 11%; background: linear-gradient(#6a6e77, #3d4048); }
.device .scr {
  position: absolute; inset: var(--rim); border-radius: calc(var(--r) - var(--rim)); overflow: hidden;
  background: #000; border: var(--bezel) solid #030304;
}
.device .scr video, .device .scr .layer video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block;
  border-radius: calc(var(--r) - var(--rim) - var(--bezel)); transition: opacity .28s ease;
}
.device .scr video.swap { opacity: 0; }
/* Glass: a soft highlight that slides as the phone turns, plus a fixed diagonal sheen. */
.device .glare {
  position: absolute; inset: var(--rim); border-radius: calc(var(--r) - var(--rim)); pointer-events: none;
  background:
    radial-gradient(80% 42% at var(--gx, 28%) var(--gy, 4%), rgba(255, 255, 255, .17), transparent 62%),
    linear-gradient(118deg, rgba(255, 255, 255, .08) 0 24%, transparent 44%);
  mix-blend-mode: screen;
}
@media (prefers-reduced-motion: reduce) { .device .scr video { transition: none; } }
