/* cast.css: step 01's scenes (js/cast.js). The frame is the stage's 16:9; everything inside is placed in frame percent. */
.cast {
  position: relative;
}
.cs-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  border-radius: var(--stage-radius, 12px);
  overflow: hidden;
  isolation: isolate;
}
.cs-frame > img,
.cs-clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cs-clip {
  z-index: 3;
}
.cs-art {
  position: absolute;
  transform-origin: 0 0;
  z-index: 2;
}
.cs-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.cs-checker {
  position: absolute;
  z-index: 1;
  border-radius: 14px;
  background: repeating-conic-gradient(#e4e1e8 0 25%, #ffffff 0 50%) 0 0 / 22px 22px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* a · one move: the drawing is a card on the panel until the place comes up around it */
.cs-a .cs-paper {
  border-radius: 4%;
  box-shadow:
    0 30px 60px -24px rgba(31, 22, 40, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* b · three frames */
.cs-b {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1.7778fr);
  align-items: start;
  gap: 0 8px;
}
.cs-tile {
  margin: 0;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
  opacity: 0.5;
}
.cs-tile.on,
.cs-tile.done {
  opacity: 1;
}
.cs-tile.on .cs-tbox {
  box-shadow:
    0 0 0 3px var(--surface, #fff),
    0 0 0 5.5px var(--ring, var(--accent, #d9434f)),
    0 18px 36px -18px rgba(0, 0, 0, 0.45);
}
.cs-tbox {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #fcead4;
  transition: box-shadow 0.3s ease;
}
.cs-sq .cs-tbox {
  aspect-ratio: 1;
}
.cs-wide .cs-tbox {
  aspect-ratio: 16 / 9;
}
.cs-tbox img,
.cs-tbox video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cs-check .cs-tbox {
  background: repeating-conic-gradient(#e4e1e8 0 25%, #ffffff 0 50%) 0 0 / 16px 16px;
}
.cs-tile figcaption {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font:
    600 13px/1.25 'DC Instrument',
    system-ui,
    sans-serif;
  color: var(--surface-ink, #1d1720);
}
.cs-tile figcaption b {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10.5px;
  background: var(--surface-ink, #1d1720);
  color: var(--surface, #fff);
}
.cs-arrow {
  align-self: center;
  margin-top: -24px;
  height: 2px;
  background: color-mix(in srgb, var(--surface-ink, #1d1720) 35%, transparent);
  position: relative;
}
.cs-arrow::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -4px;
  border: 5px solid transparent;
  border-left: 7px solid color-mix(in srgb, var(--surface-ink, #1d1720) 35%, transparent);
  border-right: 0;
}
@media (max-width: 639px) {
  .cs-b {
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
    gap: 14px 8px;
  }
  .cs-b > .cs-arrow:nth-of-type(2) {
    display: none;
  }
  .cs-wide {
    grid-column: 1 / -1;
  }
}

/* c · before/after: the drawing on its paper over the stage, cut where the handle is */
.cs-c {
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.cs-before {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #fcead4;
}
.cs-bleed {
  -webkit-mask-image: linear-gradient(to right, #000 78%, transparent 98%);
  mask-image: linear-gradient(to right, #000 78%, transparent 98%);
}
.cs-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  width: 0;
}
.cs-handle::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1.5px;
  width: 3px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.12),
    0 0 18px rgba(0, 0, 0, 0.25);
}
.cs-handle i {
  position: absolute;
  top: 50%;
  left: -19px;
  width: 38px;
  height: 38px;
  margin-top: -19px;
  border-radius: 50%;
  background: #fff;
  color: #2a1f33;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.5);
}
.cs-handle svg {
  width: 22px;
  height: 22px;
}
.cs-handle:focus-visible i {
  outline: 2px solid var(--ring, #d9434f);
  outline-offset: 3px;
}
.cs-chip {
  position: absolute;
  top: 4%;
  z-index: 5;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(251, 244, 234, 0.95);
  color: #2a1f33;
  font:
    600 13px/1 'DC Instrument',
    system-ui,
    sans-serif;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.cs-chip-l {
  left: 3%;
}
.cs-chip-r {
  right: 3%;
}

/* d · the cast sheet beside the stage */
.cs-d {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 2fr);
  gap: 14px;
  align-items: stretch;
}
.cs-sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: 22px;
  background: #fff;
  color: #000;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 18px 40px rgba(31, 22, 40, 0.1);
  font-family: -apple-system, 'SF Pro Text', Roboto, 'Segoe UI', system-ui, sans-serif;
}
.cs-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: repeating-conic-gradient(#e9e7ec 0 25%, #f7f6f8 0 50%) 0 0 / 14px 14px;
}
.cs-slot.framed {
  background: #f2f2f7;
}
.cs-pics {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}
.cs-pics img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cs-status {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 5px 9px 5px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
}
.cs-status svg {
  width: 14px;
  height: 14px;
}
.cs-fields {
  display: grid;
  gap: 10px;
}
.cs-field {
  display: grid;
  gap: 4px;
}
.cs-label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(69, 54, 83, 0.6);
}
.cs-value {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  background: #f2f2f7;
  font-size: 16px;
  line-height: 21px;
}
.cs-caret {
  display: inline-block;
  width: 2px;
  height: 19px;
  margin-left: 1px;
  background: #d9434f;
}
.cs-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 3px 2px;
}
.cs-swatches i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c);
  transition: box-shadow 0.25s ease;
}
.cs-swatches i.on {
  box-shadow:
    0 0 0 2.5px #fff,
    0 0 0 4.5px var(--c);
}
.cs-dstage {
  align-self: center;
}
@media (max-width: 639px) {
  .cs-d {
    grid-template-columns: minmax(0, 1fr);
  }
  .cs-sheet {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: start;
  }
  .cs-swatches {
    flex-wrap: nowrap;
    gap: 6px;
  }
  .cs-swatches i {
    width: 20px;
    height: 20px;
    flex: none;
  }
}
@media (max-width: 359.98px) {
  .cs-swatches {
    flex-wrap: wrap;
  }
}
@media (min-width: 640px) and (max-width: 899.98px) {
  .cs-d {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr);
  }
}
