/* Six translucent glass surfaces. Blur stays on individual faces, never the
   preserve-3d solid: grouping effects on that parent would flatten the box. */
.persona-orbit {
  max-width: 1440px;
  --cube-width: clamp(220px, 19vw, 280px);
  --cube-size: var(--cube-width);
  --cube-height: calc(var(--cube-size) * .62);
  --cube-depth: calc(var(--cube-size) * .42);
  --persona-ratio: 16 / 9;
  isolation: isolate;
  perspective: 1100px;
  perspective-origin: 50% 40%;
}
.persona-slot[data-orbit-mode] .persona-stage {
  width: 100%;
  aspect-ratio: auto;
  height: var(--orbit-height);
  /* The lilac floor lives on the orbit; this layer contains only the figure. */
  background: transparent;
}
.persona-slot[data-orbit-mode] .persona-stage picture,
.persona-slot[data-orbit-mode] .persona-stage video {
  position: absolute;
  inset: 50% auto auto 50%;
  width: var(--media-size);
  height: var(--media-size);
  top: var(--figure-center-y);
  transform: translate(-50%, -50%);
}
/* Preserve the existing full square video and the desktop pillarboxed poster. */
.persona-slot[data-orbit-mode] .persona-stage picture { width: calc(var(--media-size) * 16 / 9); }
.persona-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--deep);
}
.persona-cubes-back { z-index: 1; }
.persona-cubes-front { z-index: 3; }
.persona-labels li {
  position: absolute;
  left: calc(50% + var(--cube-x, 0px));
  top: var(--cube-y);
  width: var(--cube-size);
  height: var(--cube-height);
  transform: translateX(-50%);
  opacity: var(--cube-opacity, 1);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  scroll-margin-block: calc(var(--header-h, 64px) + 24px) calc(var(--consent-h, 0px) + 96px);
  overflow-wrap: normal;
  hyphens: none;
}
.cube-counter {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  /* Local perspective affects the solid without changing the orbit radius. */
  perspective: 1100px;
  perspective-origin: 50% 40%;
  transform: scale(var(--cube-scale, 1));
  transform-origin: 50% 50%;
}
.cube-solid {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--cube-depth) * -.5)) rotateX(var(--cube-tilt-x, -8deg)) rotateY(var(--cube-rot-y, 12deg));
}
.cube-face {
  position: relative;
  display: flex;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 50%);
  border-radius: 3px;
  background: linear-gradient(135deg, rgb(255 255 255 / 38%), rgb(255 255 255 / 8%));
  background-color: color-mix(in srgb, var(--glass-tint, #e3e5f4) 22%, transparent);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 24%), inset 0 1px 0 rgb(255 255 255 / 62%);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  color: #1e2150;
}
/* One quiet diagonal reflection per plane; the ink sits above it. */
.cube-face::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(125deg, transparent 32%, rgb(255 255 255 / 18%) 44%, rgb(255 255 255 / 3%) 53%, transparent 64%);
  pointer-events: none;
}
:is(.persona-cubes-back, .persona-cubes-front) .cube-face {
  position: absolute;
  inset: 0 auto auto 0;
  width: var(--cube-size);
  height: var(--cube-height);
  backface-visibility: hidden;
}
.cube-plate {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
  padding: 3px;
  /* Pale glass preserves ink contrast when the orbit crosses dark clothing. */
  background: rgb(243 242 255 / 72%);
  color: #1e2150;
}
.cube-copy {
  display: block;
  flex: none;
  width: 100%;
  min-height: 0;
  max-height: 100%;
  direction: rtl;
  text-align: center;
  /* Approved long labels: smaller type that wraps inside the cube face. */
  font-size: 13px;
  line-height: 1.35;
  /* One weight per label: a ::first-line bold split sentences at the visual line break. */
  font-weight: 600;
  white-space: pre-line;
  text-wrap: balance;
  overflow-wrap: anywhere;
  hyphens: none;
}
.cube-face-front { --glass-tint: var(--shade-front, #f3f2ff); transform: translateZ(calc(var(--cube-depth) * .5)); }
.cube-face-back { --glass-tint: var(--shade-back, #d5d9ef); transform: rotateY(180deg) translateZ(calc(var(--cube-depth) * .5)); }
:is(.persona-cubes-back, .persona-cubes-front) :is(.cube-face-right, .cube-face-left) {
  left: calc((var(--cube-size) - var(--cube-depth)) * .5);
  width: var(--cube-depth);
  padding: 0;
}
.cube-face-right { --glass-tint: var(--shade-right, #d5d9ef); transform: rotateY(90deg) translateZ(calc(var(--cube-size) * .5)); }
.cube-face-left { --glass-tint: var(--shade-left, #e3e5f4); transform: rotateY(-90deg) translateZ(calc(var(--cube-size) * .5)); }
:is(.persona-cubes-back, .persona-cubes-front) :is(.cube-face-top, .cube-face-bottom) {
  top: calc((var(--cube-height) - var(--cube-depth)) * .5);
  height: var(--cube-depth);
  padding: 0;
}
.cube-face-top { --glass-tint: var(--shade-top, #f3f2ff); transform: rotateX(90deg) translateZ(calc(var(--cube-height) * .5)); }
.cube-face-bottom { --glass-tint: var(--shade-bottom, #b7bedc); transform: rotateX(-90deg) translateZ(calc(var(--cube-height) * .5)); }
.cube-shadow {
  position: absolute;
  left: 50%;
  top: calc(var(--cube-height) + 12px);
  width: 68%;
  height: 8px;
  border-radius: 50%;
  background: rgb(0 0 0 / 14%);
  filter: blur(5px);
  opacity: var(--cube-shadow-opacity, 1);
  transform: translate(-50%, -50%) scaleX(var(--cube-shadow-scale, 1));
}
@media (max-width: 720px), (max-height: 540px) {
  .persona-orbit { width: 100%; --cube-width: clamp(152px, 50vw, 160px); --persona-ratio: 1 / 1; }
  .persona-slot[data-orbit-mode] .persona-stage picture { width: var(--media-size); }
  .persona-labels li { font-size: 16px; }

}
/* Static mode returns one semantic print per card, in the source order. */
.persona-slot:not([data-orbit-mode]) .persona-labels,
:is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) .persona-labels {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-columns: repeat(3, var(--cube-size));
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
}
.persona-slot:not([data-orbit-mode]) .persona-labels li,
:is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) .persona-labels li {
  position: relative;
  inset: auto;
  width: var(--cube-size);
  height: auto;
  min-height: var(--cube-height);
  margin: 0;
  transform: none;
}
.persona-slot:not([data-orbit-mode]) .cube-face { height: 100%; white-space: pre-line; font-size: 16px; line-height: 1.5; }
:is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) { perspective: none; }
:is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) .persona-cubes-back,
:is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) .cube-shadow,
:is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) .cube-face[aria-hidden] { display: none; }
:is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) :is(.cube-counter, .cube-solid) { transform: none; perspective: none; }
:is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) .cube-face-front { position: relative; inset: auto; height: 100%; transform: none; }
/* The static figure retains its original frame and contain behavior. */
.motion-off .persona-slot[data-orbit-mode] .persona-stage { height: auto; aspect-ratio: var(--persona-ratio); }
.persona-orbit[data-cubes-static="true"] .persona-stage { height: auto; aspect-ratio: var(--persona-ratio); }
:is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) .persona-stage :is(picture, video) {
  inset: 0;
  width: 100%;
  height: 100%;
  transform: none;
}
@media (max-width: 720px) {
  .persona-slot:not([data-orbit-mode]) .persona-labels,
  :is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) .persona-labels { grid-template-columns: var(--cube-size); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .persona-orbit { perspective: none; }
  .persona-labels {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(3, var(--cube-size));
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
  }
  .persona-labels li { position: relative; inset: auto; width: var(--cube-size); height: auto; min-height: var(--cube-height); margin: 0; transform: none; }
  .persona-cubes-back, .cube-shadow, .persona-labels .cube-face[aria-hidden] { display: none; }
  .cube-counter, .cube-solid { transform: none; perspective: none; }
  .persona-labels .cube-face-front { position: relative; inset: auto; height: 100%; transform: none; }
  .persona-slot[data-orbit-mode] .persona-stage { height: auto; aspect-ratio: var(--persona-ratio); }
  .persona-slot[data-orbit-mode] .persona-stage picture,
  .persona-slot[data-orbit-mode] .persona-stage video { inset: 0; width: 100%; height: 100%; transform: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 720px) {
  .persona-labels { grid-template-columns: var(--cube-size); gap: 12px; }
}

/* Equal-height source plates remain readable when motion is disabled. */
:is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) :is(.cube-counter, .cube-solid),
.persona-slot:not([data-orbit-mode]) :is(.cube-counter, .cube-solid) { height: 100%; }
:is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) .cube-copy { flex: none; }
@media (prefers-reduced-motion: reduce) {
  .cube-counter, .cube-solid { height: 100%; }
  .cube-copy { flex: none; }
}

/* Browsers without either blur spelling receive the same flat static glass.
   JS also sets data-cubes-static so source order and media sizing agree. */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .persona-orbit { perspective: none; }
  .persona-labels {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(3, var(--cube-size));
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
  }
  .persona-labels li { position: relative; inset: auto; width: var(--cube-size); height: auto; min-height: var(--cube-height); margin: 0; transform: none; }
  .persona-cubes-back, .cube-shadow, .persona-labels .cube-face[aria-hidden] { display: none; }
  .cube-counter, .cube-solid { height: 100%; transform: none; perspective: none; }
  .persona-labels .cube-face-front { position: relative; inset: auto; height: 100%; transform: none; }
  .persona-slot[data-orbit-mode] .persona-stage { height: auto; aspect-ratio: var(--persona-ratio); }
  .persona-slot[data-orbit-mode] .persona-stage picture,
  .persona-slot[data-orbit-mode] .persona-stage video { inset: 0; width: 100%; height: 100%; transform: none; }
}

/* Preserve the existing flat stack on landscape phones when motion is off. */
@media (min-width: 721px) and (max-width: 900px) {
  .persona-slot:not([data-orbit-mode]) .persona-labels,
  :is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) .persona-labels { grid-template-columns: var(--cube-size); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) and (min-width: 721px) and (max-width: 900px) {
  .persona-labels { grid-template-columns: var(--cube-size); gap: 12px; }
}
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  @media (max-width: 900px) {
    .persona-labels { grid-template-columns: var(--cube-size); gap: 12px; }
  }
}

/* A phone that cannot fit approved copy at 12px keeps a semantic source list.
   Only the animated layers disappear; reduced motion keeps its flat fallback. */
.persona-orbit[data-cubes-hidden="true"]:not([data-cubes-static="true"]) :is(.persona-cubes-front, .persona-cubes-back) { display: none; }
.persona-orbit .persona-cubes-semantic { position: absolute; display: block; width: 1px; height: 1px; margin: -1px; }
.persona-orbit .persona-cubes-semantic li { position: static; width: auto; height: auto; transform: none; }
.persona-orbit[data-cubes-static="true"] .persona-cubes-semantic { display: none; }
/* Static cards grow with their copy, so the fitting constraint applies only in motion. */
:is(.motion-off .persona-orbit, .persona-orbit[data-cubes-static="true"]) .cube-copy { max-height: none; }
@media (prefers-reduced-motion: reduce) { .cube-copy { max-height: none; } }
