/*
 * Device frames — shared by the showroom site and the video compositions.
 * Each frame scales with its own width; set `width` on the .device element.
 * .device is the size container; .frame draws the bezel in container units.
 *
 *   <div class="device tv"><div class="frame"><div class="screen"><img …></div></div></div>
 *   <div class="device phone"><div class="frame"><div class="screen"><img …></div></div></div>
 *   <div class="device browser"><div class="frame"><div class="bar"><i></i><i></i><i></i><span>example.com</span></div><div class="screen"><img …></div></div></div>
 *
 * A .screen may hold several <img>; the one with .is-active is shown.
 */

.device {
  position: relative;
  container-type: inline-size;
  isolation: isolate;
}
.device .frame { position: relative; }

.device .screen {
  position: relative;
  overflow: hidden;
  background: #000;
}

.device .screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: opacity 0.9s ease;
}

.device .screen:has(> img + img) > img:not(.is-active) { opacity: 0; }

/* Glass glare shared by every frame. */
.device .screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 38%);
  z-index: 2;
}

/* ---------- TV ---------- */
.device.tv > .frame {
  padding: 1.1cqi;
  border-radius: 1.4cqi;
  background: linear-gradient(180deg, #1b1d22, #0b0c0f);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    0 3cqi 7cqi -2cqi rgba(0, 0, 0, 0.75);
}
.device.tv .screen {
  aspect-ratio: 16 / 9;
  border-radius: 0.5cqi;
}
.device.tv.has-stand > .frame::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3.2cqi;
  width: 18cqi;
  height: 3.2cqi;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #16171b, #0b0c0f);
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  z-index: -1;
}

/* ---------- Phone ---------- */
.device.phone > .frame {
  padding: 3.2cqi;
  border-radius: 15cqi;
  background: linear-gradient(160deg, #2a2c31, #0c0d10 55%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 0 0 1.6cqi #050506,
    0 6cqi 14cqi -4cqi rgba(0, 0, 0, 0.8);
}
.device.phone .screen {
  aspect-ratio: 1080 / 2400;
  border-radius: 12cqi;
}
/* Camera pill — sits in the empty centre of the Android status bar. */
.device.phone .screen::before {
  content: "";
  position: absolute;
  top: 2.6cqi;
  left: 50%;
  width: 7cqi;
  height: 7cqi;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #050506;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 3;
}

/* ---------- Browser ---------- */
.device.browser > .frame {
  border-radius: 1.2cqi;
  overflow: hidden;
  background: #15171c;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 3cqi 7cqi -2cqi rgba(0, 0, 0, 0.75);
}
.device.browser .bar {
  display: flex;
  align-items: center;
  gap: 0.7cqi;
  height: 3.4cqi;
  padding: 0 1.4cqi;
  background: #1d2026;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.device.browser .bar i {
  width: 1cqi;
  height: 1cqi;
  border-radius: 50%;
  background: #3a3e47;
}
.device.browser .bar span {
  margin: 0 auto;
  min-width: 30%;
  padding: 0.45cqi 2cqi;
  border-radius: 99px;
  background: #121419;
  color: #9ba1ae;
  font: 500 1.25cqi/1 "Inter", system-ui, sans-serif;
  text-align: center;
  white-space: nowrap;
}
.device.browser .screen { aspect-ratio: 16 / 9; }
