/* Device Frame — iPhone 15 Pro (to-scale CSS mockup)
 * Usage: Wrap mobile UI in <div class="device-frame"><div class="device-screen">...</div></div>
 * On desktop: shows a realistic phone bezel with scrollable content
 * On mobile (<768px): frame disappears, raw UI fills the viewport
 *
 * iPhone 15 Pro viewport: 393 × 852 CSS px
 * Device shell adds bezel, dynamic island, side buttons
 */

:root {
  --device-width: 393px;
  --device-height: 852px;
  --device-bezel: 12px;
  --device-radius-outer: 54px;
  --device-radius-inner: 46px;
  --device-shell-color: #1a1a1e;
  --device-bezel-border: #2a2a2e;
  --device-bg: #0a0a0f;
}

/* Container — centers the phone on a dark "desk" */
.device-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
  background: #050508;
  /* Subtle radial vignette */
  background: radial-gradient(ellipse at center, #0c0c12 0%, #050508 70%);
}

/* The phone shell */
.device-frame {
  position: relative;
  width: calc(var(--device-width) + var(--device-bezel) * 2);
  height: calc(var(--device-height) + var(--device-bezel) * 2);
  background: var(--device-shell-color);
  border-radius: var(--device-radius-outer);
  border: 2px solid var(--device-bezel-border);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 20px 60px rgba(0,0,0,0.6),
    0 2px 8px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.04);
  flex-shrink: 0;
}

/* Side button: power (right side) */
.device-frame::before {
  content: '';
  position: absolute;
  right: -4px;
  top: 180px;
  width: 4px;
  height: 80px;
  background: var(--device-bezel-border);
  border-radius: 0 3px 3px 0;
}

/* Side button: volume (left side) — uses a pseudo + sibling trick */
.device-frame::after {
  content: '';
  position: absolute;
  left: -4px;
  top: 160px;
  width: 4px;
  height: 36px;
  background: var(--device-bezel-border);
  border-radius: 3px 0 0 3px;
  box-shadow: 0 54px 0 var(--device-bezel-border), 0 100px 0 var(--device-bezel-border);
  /* volume up, volume down, mute toggle */
}

/* Dynamic Island */
.device-island {
  position: absolute;
  top: calc(var(--device-bezel) + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 36px;
  background: #000;
  border-radius: 20px;
  z-index: 10;
  /* Subtle border to catch the light */
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
}

/* The screen area — clips and scrolls */
.device-screen {
  position: absolute;
  top: var(--device-bezel);
  left: var(--device-bezel);
  width: var(--device-width);
  height: var(--device-height);
  border-radius: var(--device-radius-inner);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--device-bg);
  /* Smooth momentum scrolling */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.device-screen::-webkit-scrollbar {
  display: none;
}

/* Status bar — time, signal, battery */
.device-statusbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px 0;
  height: 54px;
  font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #e4e4e7;
  background: inherit;
}

.device-statusbar-left {
  width: 60px;
}

.device-statusbar-center {
  /* Space for dynamic island */
  width: 126px;
}

.device-statusbar-right {
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

/* Battery icon */
.device-battery {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.device-battery-body {
  width: 25px;
  height: 12px;
  border: 1.5px solid #e4e4e7;
  border-radius: 3px;
  padding: 1.5px;
  position: relative;
}

.device-battery-body::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 5px;
  background: #e4e4e7;
  border-radius: 0 2px 2px 0;
}

.device-battery-fill {
  width: 75%;
  height: 100%;
  background: #e4e4e7;
  border-radius: 1.5px;
}

/* Signal bars */
.device-signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 12px;
}

.device-signal-bar {
  width: 3px;
  background: #e4e4e7;
  border-radius: 1px;
}

/* Home indicator bar at bottom */
.device-home-indicator {
  position: absolute;
  bottom: calc(var(--device-bezel) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: rgba(228, 228, 231, 0.3);
  border-radius: 3px;
  z-index: 10;
}

/* Label below the phone */
.device-label {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 11px;
  color: #52525b;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ── Responsive: on actual mobile, ditch the frame ── */
@media (max-width: 767px) {
  .device-stage {
    padding: 0;
    min-height: 0;
    background: var(--device-bg);
  }

  .device-frame {
    width: 100%;
    height: auto;
    min-height: 100dvh;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .device-frame::before,
  .device-frame::after {
    display: none;
  }

  .device-island,
  .device-statusbar,
  .device-home-indicator,
  .device-label {
    display: none;
  }

  .device-screen {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    border-radius: 0;
    overflow: visible;
  }
}
