/* iPhone-style frame used on the homepage and case studies. Load this BEFORE
   site.css so Tailwind utilities (absolute, w-*) can override it.
   Proportions follow a real 1290 x 2796 screen, so screenshots fit exactly.
   Everything scales with the frame's width. */

.phone {
    position: relative;
    padding: 0;
    background: #050505;
    border-radius: 15.5% / 7.4%;
    box-shadow:
        0 0 0 1.5px #2e2e33,
        0 0 0 3px #141416,
        0 0 0 3.5px rgba(255, 255, 255, .14),
        0 40px 90px -30px rgba(0, 0, 0, .85),
        0 30px 90px -40px rgba(255, 107, 0, .35);
}

/* Side buttons */
.phone::before,
.phone::after {
    content: '';
    position: absolute;
    width: 3px;
    background: linear-gradient(90deg, #1b1b1e, #3a3a40);
}

.phone::before {
    right: -6px;
    top: 26%;
    height: 12%;
    border-radius: 0 3px 3px 0;
}

.phone::after {
    left: -6px;
    top: 20%;
    height: 7%;
    border-radius: 3px 0 0 3px;
}

/* Slimmer bezel for small phones (under ~220px wide), e.g. homepage cards */
.phone.phone-sm {
    box-shadow:
        0 0 0 1px #2e2e33,
        0 0 0 1.5px rgba(255, 255, 255, .12),
        0 30px 70px -25px rgba(0, 0, 0, .85),
        0 20px 70px -30px rgba(255, 107, 0, .35);
}

.phone.phone-sm::before,
.phone.phone-sm::after {
    width: 2px;
}

.phone.phone-sm::before { right: -3.5px; }
.phone.phone-sm::after { left: -3.5px; }

.phone-sm .phone-screen { margin: 2.4%; border-radius: 13.6% / 6.3%; }

/* The bezel is a margin on the screen, not padding on the frame: percentage
   padding is measured against the frame's parent, which breaks the bezel
   whenever the phone is absolutely positioned inside a wider box. */
.phone-screen {
    position: relative;
    margin: 3.4%;
    overflow: hidden;
    aspect-ratio: 1290 / 2796;
    border-radius: 13.1% / 6.1%;
    background: #fff;
}

.phone-screen > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity .6s ease, transform .8s cubic-bezier(.16, 1, .3, 1);
}

.phone-screen > img.on {
    opacity: 1;
    transform: none;
}

/* Dynamic Island, for screens built in HTML rather than screenshots */
.phone-island {
    position: absolute;
    top: 1.3%;
    left: 50%;
    transform: translateX(-50%);
    width: 31%;
    height: 3.6%;
    border-radius: 999px;
    background: #000;
    z-index: 5;
}

@media (prefers-reduced-motion: reduce) {
    .phone-screen > img { transition: none; }
}
