/* Bazaar Video bento composition — Figma 2049:1934 (1920×1080). Same shell as
   the Bazaar DS bento (bazaar-design-system/bento): a 1920×1080 canvas scaled
   to fit, a host-applied blur while it loads, and a phone card whose
   hover-grow transitions are armed only once the composition has settled. */

* {
  box-sizing: border-box;
}

:root {
  --canvas-width: 1920;
  --canvas-height: 1080;
  /* Figma: cards are #F5F5F5 with a 1px inside stroke of black at 8%, r48. */
  --card: #f5f5f5;
  --card-line: rgba(0, 0, 0, 0.08);
  --card-radius: 48px;
  --touch-cursor: url("data:image/svg+xml;utf8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Ccircle%20cx='16'%20cy='16'%20r='13.25'%20fill='black'%20fill-opacity='.14'%20stroke='black'%20stroke-opacity='.3'%20stroke-width='1.5'/%3E%3C/svg%3E") 16 16, default;
}

html,
body {
  width: 100%;
  min-width: 100%;
  min-height: 100%;
  margin: 0;
}

/* Transparent between the cards so the host page's ground shows through. */
body {
  display: grid;
  min-height: 100vh;
  overflow-x: hidden;
  place-items: center;
  background: transparent;
}

.composition-frame {
  position: relative;
  width: min(100vw, 1920px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: transparent;
  container-type: inline-size;
}

.composition-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  transform: scale(var(--canvas-scale, 1));
  transform-origin: left top;
  /* A 1px hairline on screen regardless of the canvas scale (see the DS bento
     for the device-pixel snapping caveat). */
  --card-hairline: calc(1px / var(--canvas-scale, 1));
}

/* ── Loading state ─────────────────────────────────────────────────────────
   Nothing here hides or blurs while it loads: the host page blurs the whole
   frame from outside (BentoComposition.jsx), easing it off as script.js reports
   progress, and this document renders at full strength underneath, so every
   card is decoded and painted before the last step to sharp. The
   phone card's hover-grow transitions stay unarmed until `.is-settled`. */

/* ── Shared card look ─────────────────────────────────────────────────────── */

/* The hairline is an inset shadow, not a border: a border would join the
   padding box and shift every 33px inset by one screen pixel (which is what
   put the phone 1.8px off-centre and its expanded bottom gap at 31.5). */
.phone-card,
.player-panel,
.cw-panel__surface {
  border-radius: var(--card-radius);
  background: var(--card);
  box-shadow: inset 0 0 0 var(--card-hairline) var(--card-line);
}

.component-frame {
  display: block;
  border: 0;
  background: transparent;
}

/* ── Phone card (Figma 2049:1935 — 559×942 at 134,69; phone 493×994.48 at 33,33)
   The phone is taller than its card and clipped at the bottom (as in Figma).
   Hover grows the card by the DS bento's exact amounts (36.48 up, 72.96
   taller) and lifts the phone so its bottom lands 33px above the card's edge,
   revealing the lower screen. */
.phone-card {
  position: absolute;
  z-index: 2;
  top: 69px;
  left: 134px;
  width: 559px;
  height: 942px;
  overflow: hidden;
  will-change: top, height;
  cursor: var(--touch-cursor);
}

.composition-canvas.is-settled .phone-card {
  transition:
    top 680ms cubic-bezier(0.22, 1, 0.36, 1),
    height 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.composition-canvas.is-settled .phone-mock-wrap {
  transition: transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.phone-card:hover,
.phone-card:focus-within {
  z-index: 6;
  top: 32.52px;
  height: 1014.96px;
}

.phone-mock-wrap {
  position: absolute;
  top: 33px;
  left: 50%; /* centred like the DS wrap: (559 − 493) / 2 = 33 each side */
  width: 493px;
  height: 994.48px;
  transform: translateX(-50%);
  will-change: transform;
}

/* Lift = 33 + 994.48 + 33 − 1014.96: with the card grown, the phone's bottom
   edge sits exactly 33px above the card's bottom — the same padding as the
   sides and top at rest — while only its top bezel (12.5px) leaves the card. */
.phone-card:hover .phone-mock-wrap,
.phone-card:focus-within .phone-mock-wrap {
  transform: translate(-50%, -45.52px);
}

.phone-mock-wrap .component-frame {
  width: 493px;
  height: 994.48px;
}

/* ── Player card (Figma 2049:3205 — 1060.48×559 at 725,69.25; player 994.48×493 at 33,33) */
.component-panel {
  position: absolute;
  z-index: 3;
}

.player-panel {
  top: 69.25px;
  left: 725px;
  width: 1060.48px;
  height: 559px;
  overflow: hidden;
}

.player-panel .component-frame {
  position: absolute;
  top: 33px;
  left: 33px;
  width: 994.48px;
  height: 493px;
}

/* ── Continue Watching card (Figma 2049:3302 — 1061×350.49 at 725,660.25; row 995×284.49 at 33,33)
   The section is NOT the card: it runs from the card's top edge to the bottom
   of the canvas with overflow visible, the card fill is a child, and the
   iframe covers the whole section. The row's overflow menu can therefore
   draw past the card's bottom edge (the iframe's document is transparent). */
.cw-panel {
  top: 660.25px;
  left: 725px;
  width: 1061px;
  height: 419.75px; /* to the canvas bottom */
  overflow: visible;
  z-index: 5; /* above the player card so an open menu is never under it */
}

.cw-panel__surface {
  position: absolute;
  top: 0;
  left: 0;
  width: 1061px;
  height: 350.49px;
}

.cw-panel .component-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

@media (max-aspect-ratio: 16 / 9) {
  body {
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* The hover grow still happens, just without the travel. */
  .composition-canvas.is-settled .phone-card,
  .composition-canvas.is-settled .phone-mock-wrap {
    transition: none;
  }
}
