/* A believable device frame -- graphite-metal body with a rim highlight,
   physical side buttons, a floating "dynamic island" camera cutout, and a
   faint glass sheen over the screen -- instead of a flat rounded rectangle. */
.phone-frame {
  width: 280px;
  max-width: 100%;
  height: 570px;
  background: linear-gradient(155deg, #38383d 0%, #17171a 42%, #000 100%);
  border-radius: 46px;
  padding: 10px;
  box-shadow:
    0 50px 90px -24px rgba(0, 0, 0, .45),
    0 10px 30px -12px rgba(0, 0, 0, .3);
  position: relative;
  flex: none;
  /* Subtle 3D tilt -- kept gentle (rather than a showroom-shot extreme
     angle) so the on-screen text stays easy to read. Needs `perspective`
     on the containing -visual block (parent/driver-experience.css) and
     `preserve-3d` here so .phone-frame-elevated's translateZ composes into
     this same tilted space instead of flattening back to 2D. */
  transform-style: preserve-3d;
  transform: rotateY(-9deg) rotateX(4deg);
  animation: phoneTilt 6.5s ease-in-out infinite;
}

/* Bakes the tilt into every keyframe -- animating `transform` on its own
   would otherwise overwrite the static rotate above with just translateY. */
@keyframes phoneTilt {
  0%, 100% { transform: rotateY(-9deg) rotateX(4deg) translateY(0); }
  50% { transform: rotateY(-9deg) rotateX(4deg) translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
  .phone-frame { animation: none; }
}

/* Thin metallic rim -- a light-to-dark ring traced just inside the body's
   own edge, via the "fill a box, then mask out its padding-box" trick. */
.phone-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(155deg, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, 0) 28%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, .18) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.phone-frame-btn {
  position: absolute;
  background: linear-gradient(90deg, #0a0a0c, #2c2c30);
  border-radius: 2px;
}
.phone-frame-btn--power { right: -3px; top: 148px; width: 3px; height: 68px; }
.phone-frame-btn--vol-up { left: -3px; top: 118px; width: 3px; height: 38px; }
.phone-frame-btn--vol-down { left: -3px; top: 168px; width: 3px; height: 38px; }

.phone-frame-island {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 86px;
  height: 26px;
  background: #000;
  border-radius: 20px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.phone-frame-camera {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4a5a6a, #0a0a0c 70%);
}

.phone-frame-screen {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 36px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Faint diagonal glass sheen -- sits above the screen content but below the
   statusbar/app content in paint order isn't needed since it's near-fully
   transparent; kept behind via DOM order + pointer-events:none either way. */
.phone-frame-glass {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .1) 0%, rgba(255, 255, 255, 0) 18%, rgba(255, 255, 255, 0) 82%, rgba(255, 255, 255, .05) 100%);
}

.phone-frame-statusbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.phone-frame-statusbar-icons {
  width: 46px;
  height: 10px;
  border-radius: 3px;
  background: currentColor;
  opacity: .18;
}

/* The "popping out of the screen" card -- a sibling of .phone-frame-screen
   (not a descendant), so its own overflow:hidden never clips it. translateZ
   pulls it toward the viewer along the phone's own tilted 3D axis (see
   .phone-frame's preserve-3d above), and the independent counter-rotation
   plus its own drop shadow sell it as a card lifted off the glass rather
   than UI painted flat on the screen. */
.phone-frame-elevated {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  width: calc(100% - 24px);
  transform: translate(-50%, -50%) translateZ(58px) rotate(-2deg);
  filter: drop-shadow(0 26px 32px rgba(0, 0, 0, .38));
}

@media (prefers-reduced-motion: reduce) {
  .phone-frame-elevated { filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .3)); }
}
