/* ==========================================================================
   Device frames (shared)  ·  classes prefixed dvc-
   --------------------------------------------------------------------------
   Pure CSS phone, tablet, laptop and browser-window frames for product
   screenshots and clips. Every frame scales fluidly with its own width
   (bezels, corners and chrome are sized in container units), so set the
   width and the rest follows.

   Markup (the frame element is usually a <figure> or <div>):

     <div class="dvc dvc-phone">
         <div class="dvc-screen">
             <img src="..." width="824" height="1830" alt="..." loading="lazy" decoding="async">
         </div>
     </div>

     <div class="dvc dvc-browser" data-url="tradeyoke.com">   (data-url is optional)
         <div class="dvc-screen"><img ...></div>
     </div>

     <div class="dvc dvc-laptop"><div class="dvc-screen"><video muted playsinline preload="none" poster="..."></video></div></div>
     <div class="dvc dvc-tablet"><div class="dvc-screen"><img ...></div></div>

   Custom properties (set on the frame element, inline or in a page stylesheet):
     --dvc-w      frame width            default: phone 280px, tablet 520px, laptop/browser 100%
     --dvc-ratio  screen aspect ratio    default: phone 9/19.5, tablet 4/3, laptop 16/10, browser 16/10
     --dvc-fit    object-fit of media    default: cover
     --dvc-pos    object-position        default: top center (shows the top of tall captures)
     --dvc-body   frame / bezel colour   default: graphite
     --dvc-shadow outer shadow           default: soft drop shadow; set to none to remove

   Modifiers: .dvc-tablet.dvc-landscape (ratio 4/3 landscape is the default,
   use --dvc-ratio: 3/4 for portrait), .dvc-flat (no reflection), .dvc-light
   (silver body for dark backgrounds).

   The frame never exceeds its container (max-width: 100%). The screen keeps
   its aspect ratio, so the frame reserves its height before the image loads
   (no layout shift). Browsers without container query units fall back to
   fixed pixel bezels.
   ========================================================================== */

.dvc {
    --dvc-fit: cover;
    --dvc-pos: top center;
    --dvc-body: #1d2127;
    --dvc-edge: #4a515c;
    --dvc-shadow: 0 2.2rem 3.2rem -1.6rem rgba(8, 14, 24, 0.45), 0 0.8rem 1.6rem -0.8rem rgba(8, 14, 24, 0.3);
    container-type: inline-size;
    position: relative;
    display: block;
    box-sizing: border-box;
    width: var(--dvc-w, 100%);
    max-width: 100%;
    margin: 0;
}

.dvc *,
.dvc *::before,
.dvc *::after { box-sizing: border-box; }

.dvc-screen {
    position: relative;
    overflow: hidden;
    aspect-ratio: var(--dvc-ratio, 16 / 10);
    background: #0b0d10;
    isolation: isolate;
}

.dvc-screen > img,
.dvc-screen > video,
.dvc-screen > picture,
.dvc-screen > picture > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: var(--dvc-fit);
    object-position: var(--dvc-pos);
    border: 0;
}

/* Glass: a soft diagonal reflection over the screen. Never blocks clicks. */
.dvc-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(118deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 26%, rgba(255, 255, 255, 0) 42%);
}

.dvc-flat .dvc-screen::after { display: none; }

/* --------------------------------------------------------------------------
   Phone
   -------------------------------------------------------------------------- */
.dvc-phone {
    --dvc-ratio: 9 / 19.5;
    width: var(--dvc-w, 280px);
    padding: 0;
    border-radius: 15% / 7%;
    background: linear-gradient(150deg, #3a4049 0%, var(--dvc-body) 30%, #0c0e11 100%);
    box-shadow: inset 0 0 0 2px var(--dvc-edge), inset 0 0 0 5px #0a0b0d, var(--dvc-shadow);
}

.dvc-phone > .dvc-screen {
    margin: 12px;
    margin: 4.4cqi;
    border-radius: 11.5% / 5.4%;
}

/* Camera island */
.dvc-phone::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: 7.2cqi;
    left: 50%;
    width: 29cqi;
    height: 8.4cqi;
    transform: translateX(-50%);
    border-radius: 999px;
    background: radial-gradient(circle at 78% 50%, #1b2a44 0 1.3cqi, #08090b 1.5cqi);
}

/* Side buttons */
.dvc-phone::after {
    content: "";
    position: absolute;
    top: 24%;
    right: -0.9cqi;
    width: 1.2cqi;
    height: 13%;
    border-radius: 0 0.6cqi 0.6cqi 0;
    background: linear-gradient(90deg, #15181c, #4a515c);
}

/* --------------------------------------------------------------------------
   Tablet (landscape by default)
   -------------------------------------------------------------------------- */
.dvc-tablet {
    --dvc-ratio: 4 / 3;
    width: var(--dvc-w, 520px);
    border-radius: 5.5% / 7.3%;
    background: linear-gradient(150deg, #3a4049 0%, var(--dvc-body) 30%, #0c0e11 100%);
    box-shadow: inset 0 0 0 2px var(--dvc-edge), inset 0 0 0 4px #0a0b0d, var(--dvc-shadow);
}

.dvc-tablet > .dvc-screen {
    margin: 14px;
    margin: 3.6cqi;
    border-radius: 2.4cqi;
}

.dvc-tablet::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 1.6cqi;
    width: 1.1cqi;
    height: 1.1cqi;
    transform: translateY(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #24324a, #050607 70%);
}

/* --------------------------------------------------------------------------
   Laptop (lid + base)
   -------------------------------------------------------------------------- */
.dvc-laptop {
    --dvc-ratio: 16 / 10;
    filter: drop-shadow(0 1.6rem 1.8rem rgba(8, 14, 24, 0.35));
}

.dvc-laptop > .dvc-screen {
    margin: 0 9% 0;
    border: 10px solid #0b0c0f;
    border-width: 1.7cqi 1.7cqi 2.4cqi;
    border-radius: 1.8cqi 1.8cqi 0.4cqi 0.4cqi;
    box-shadow: 0 0 0 1px var(--dvc-edge);
    background-clip: padding-box;
}

/* Webcam dot in the top bezel */
.dvc-laptop::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: 0.6cqi;
    left: 50%;
    width: 0.7cqi;
    height: 0.7cqi;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #1f2a3a;
}

/* Base with the thumb notch */
.dvc-laptop::after {
    content: "";
    display: block;
    height: 2.4cqi;
    min-height: 6px;
    border-radius: 0 0 2.2cqi 2.2cqi / 0 0 1.8cqi 1.8cqi;
    background:
        radial-gradient(ellipse 7.5cqi 1.1cqi at 50% 0, #2b3038 0 96%, transparent 100%),
        linear-gradient(180deg, #d9dde3 0%, #b4bac3 38%, #7d848f 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* --------------------------------------------------------------------------
   Browser window
   -------------------------------------------------------------------------- */
.dvc-browser {
    --dvc-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 10px;
    border-radius: 1.3cqi;
    background: #eef1f5;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12), var(--dvc-shadow);
}

/* Title bar with the three window controls */
.dvc-browser::before {
    content: "";
    display: block;
    height: 30px;
    height: 4.6cqi;
    min-height: 14px;
    background:
        radial-gradient(circle at 2.6cqi 50%, #ff5f57 0 0.62cqi, transparent 0.7cqi),
        radial-gradient(circle at 4.6cqi 50%, #febc2e 0 0.62cqi, transparent 0.7cqi),
        radial-gradient(circle at 6.6cqi 50%, #28c840 0 0.62cqi, transparent 0.7cqi),
        linear-gradient(180deg, #f6f7f9, #e7eaee);
    border-bottom: 1px solid #d5dae1;
}

/* Address bar; shows data-url when given */
.dvc-browser::after {
    content: attr(data-url);
    position: absolute;
    top: 0.85cqi;
    left: 50%;
    width: 46%;
    height: 2.9cqi;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px #dfe3e9;
    color: #4b5563;
    font: 500 1.45cqi/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.dvc-browser > .dvc-screen { background: #ffffff; }

/* --------------------------------------------------------------------------
   Variants
   -------------------------------------------------------------------------- */
.dvc-light.dvc-phone,
.dvc-light.dvc-tablet {
    --dvc-body: #c9ced6;
    --dvc-edge: #eef1f5;
    background: linear-gradient(150deg, #f2f4f7 0%, var(--dvc-body) 35%, #9aa1ab 100%);
}

@media (prefers-reduced-motion: no-preference) {
    .dvc-screen > img { transition: opacity 0.3s ease; }
}

/* --------------------------------------------------------------------------
   Options for dark pages (additive: nothing above changes)

   .dvc-dark      browser window with dark chrome (title bar, address pill)
   .dvc-tilt      the frame leans towards the pointer: a page script sets
                  --dvc-rx / --dvc-ry (degrees) on the frame; zero by default
   .dvc-glare     a soft highlight that follows the pointer across the glass:
                  set --dvc-gx / --dvc-gy (0% to 100%) and --dvc-glare (0..1)
   --dvc-tint     placeholder colour of the screen while its media loads
   Tilt and glare do nothing until a script sets the variables, and both are
   switched off for reduced motion.
   -------------------------------------------------------------------------- */
.dvc-screen { background-color: var(--dvc-tint, #0b0d10); }

.dvc-browser.dvc-dark {
    background: #10141d;
    box-shadow: 0 0 0 1px rgba(148, 197, 255, 0.16), var(--dvc-shadow);
}
.dvc-browser.dvc-dark::before {
    background:
        radial-gradient(circle at 2.6cqi 50%, #ff5f57 0 0.62cqi, transparent 0.7cqi),
        radial-gradient(circle at 4.6cqi 50%, #febc2e 0 0.62cqi, transparent 0.7cqi),
        radial-gradient(circle at 6.6cqi 50%, #28c840 0 0.62cqi, transparent 0.7cqi),
        linear-gradient(180deg, #1d2331, #161b26);
    border-bottom-color: rgba(255, 255, 255, 0.07);
}
.dvc-browser.dvc-dark::after {
    background: rgba(0, 0, 0, 0.32);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    color: #b8c4d4;
}

.dvc-tilt {
    --dvc-rx: 0deg;
    --dvc-ry: 0deg;
    transform: perspective(1400px) rotateX(var(--dvc-rx)) rotateY(var(--dvc-ry));
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(.2, .75, .25, 1);
    will-change: transform;
}

.dvc-glare > .dvc-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(60% 50% at var(--dvc-gx, 30%) var(--dvc-gy, 0%), rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 70%);
    opacity: var(--dvc-glare, 0);
    transition: opacity 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
    .dvc-tilt { transform: none; transition: none; }
    .dvc-glare > .dvc-screen::before { display: none; }
}
