/* ---------------------------------------------------------------------------
 * The stage — the same object the extension draws on a tab, running for real on
 * this page. Every frame is a live same-origin iframe at a true device width,
 * so the layouts inside are not screenshots: they reflow, they scroll, and the
 * CSS read-out is measured from the document.
 *
 * The body, the bezel, the status bar and the cutouts are lifted from
 * public/content.js rather than re-invented, down to the numbers: bezel 14,
 * body radius 52, screen radius 38, island 116x30 at top 12, notch 30 tall
 * hanging off the edge, punch-hole 13px centred in the bar. If those change in
 * the extension they have to change here too, or the site stops showing the
 * product it is selling.
 * ------------------------------------------------------------------------- */

.stage {
  position: relative;
}

.row {
  display: flex;
  align-items: flex-end; /* devices differ in height; align the bottoms */
  justify-content: center;
  gap: var(--gap, 34px);
}

/* --bez is the bezel, so the glass ends up exactly the device's width. Padding
 * drawn inwards would hand a 412px phone a 384px viewport and the breakpoint
 * this whole page exists to show would never fire. */
.screen {
  --bez: 14;
  position: relative;
  flex: none;
  width: calc((var(--w) + var(--bez) * 2) * 1px * var(--s));
  height: calc((var(--h) + var(--bez) * 2) * 1px * var(--s));
}

.phone {
  position: absolute;
  top: 0;
  left: 0;
  width: calc((var(--w) + var(--bez) * 2) * 1px);
  height: calc((var(--h) + var(--bez) * 2) * 1px);
  padding: calc(var(--bez) * 1px);
  border-radius: 52px;
  transform: scale(var(--s));
  transform-origin: top left;
  background: linear-gradient(158deg, #35322e 0%, #171614 46%, #0f0e0d 100%);
  /* one light source: a lip on the top edge, a tight shadow below it */
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 16px 28px -16px rgba(0, 0, 0, 0.9);
}

/* the side keys, on the body rather than on the glass */
.phone .key {
  position: absolute;
  width: 2px;
  background: #2b2825;
  border-radius: 2px;
}

.glass {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 38px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

/* The status bar is drawn inside the screen, above the page, and takes its
 * colours from the page itself, so it reads as part of the device rather than
 * as a sticker. Cutouts sit on top of it, which is where they sit on the real
 * thing. */
.statusbar {
  position: relative;
  z-index: 2;
  flex: none;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 600 13px/1 -apple-system, system-ui, "Segoe UI", sans-serif;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
}
.statusbar .sb-time {
  font-variant-numeric: tabular-nums;
}
.statusbar .sb-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}
.statusbar svg {
  display: block;
  fill: currentColor;
}

.island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  border-radius: 18px;
  z-index: 3;
  box-shadow: inset 0 0 1px 1px rgba(255, 255, 255, 0.08);
}
.notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  border-radius: 0 0 18px 18px;
  z-index: 3;
}
.home {
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  z-index: 3;
}

.pane {
  flex: 1;
  width: 100%;
  border: 0;
  display: block;
  background: #fff;
}

/* Caption under the frame. Two roles, two treatments: the model is a name and
 * is set in the text face; the size is data and is set in the mono. */
.tag {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}
.tag b {
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.tag span {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  color: var(--text-faint);
}
.screen.lead .tag b {
  color: var(--text);
}

/* ---- the inspector caliper ------------------------------------------------
 * Giallo is what the panel is reporting, exactly as in the product, and nothing
 * is ever injected into the document being read.
 * ------------------------------------------------------------------------ */
.ins {
  position: absolute;
  pointer-events: none;
  z-index: 8;
  outline: 1px solid var(--accent);
  background: rgba(255, 212, 0, 0.1);
  opacity: 0;
  transition: opacity 0.12s ease;
}
.ins.on {
  opacity: 1;
}
.ins i {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--accent);
}
.ins i:nth-child(1) { top: -2px; left: -2px; }
.ins i:nth-child(2) { top: -2px; right: -2px; }
.ins i:nth-child(3) { bottom: -2px; left: -2px; }
.ins i:nth-child(4) { bottom: -2px; right: -2px; }

.readout {
  position: absolute;
  z-index: 9;
  min-width: 210px;
  padding: 12px 14px 13px;
  --cut: 10px;
  --blade-fill: #100f0e;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.readout.on {
  opacity: 1;
}
.readout .sel {
  color: var(--accent);
  margin-bottom: 6px;
  display: block;
}
.readout dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
}
.readout dt {
  color: #b8b2a6;
}
.readout dd {
  margin: 0;
  color: #e8a33d;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
