/* Problem section, production: the receipt-run loop fills the card; the text sits on its calm side.
   Desktop source (16:9): the left third is empty ink. Phone source (9:16): the top 40% is empty ink. Tablet source (3:4): the top 35%.
   The text column is sized from the video's cover geometry (card = size container), so it stays inside
   the calm area at any viewport. The scroll grow-in (.prob-pin / .prob-card / --pk) is untouched. */
#problem.problem-3d .prob-card{container-type:size;padding-block:0}   /* cq units then match the box the video covers */
#problem.problem-3d .hats-figure{display:none}
/* Match the delivered ink-matte posters and MP4s beneath transparent WebM edges. */
#problem.problem-3d .prob-card{background:#23201B}
#problem .p3d,#problem .p3d-toggle{display:none}
#problem.problem-3d .p3d{display:block;position:absolute;inset:0;z-index:0;pointer-events:none}
#problem .p3d :is(img,video){position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 50%;display:block}
#problem .p3d video{opacity:0;transition:opacity .4s var(--out)}
#problem .p3d.is-playing video{opacity:1}
                                                                                                                              
#problem .p3d picture{transition:opacity .4s var(--out)}
#problem .p3d.is-playing picture{opacity:0}
#problem.problem-3d .prob-card-inner{z-index:1;max-width:none;margin:0;align-self:center;justify-self:start;
  /* video width when it covers the card, its side crop, and the calm column inside it */
  --vw:max(100cqw,177.78cqh);--crop:calc((var(--vw) - 100cqw) / 2);
  --pad:clamp(24px,4.6cqw,96px);--col:calc(.335 * var(--vw) - var(--crop) - var(--pad) - 12px);
  width:calc(var(--col) + var(--pad));padding:0 0 0 var(--pad)}
#problem.problem-3d .hats-layout{display:block}
#problem.problem-3d .prob-line{font-size:clamp(26px,calc(var(--col) / 7.6),76px);max-width:none}
#problem.problem-3d .prob-sub{font-size:clamp(16px,calc(var(--col) / 22),24px);max-width:none;margin-top:clamp(14px,2.4cqh,28px)}
#problem.problem-3d .kicker{margin-bottom:clamp(12px,2.2cqh,22px)}
#problem .p3d-toggle{position:absolute;z-index:2;right:clamp(14px,2.4cqw,32px);top:clamp(10px,1.2cqh,20px);bottom:auto;
  align-items:center;gap:8px;min-height:44px;min-width:44px;padding:8px 14px 8px 12px;border:1px solid #6B5E50;border-radius:22px;
  background:#23201B;color:#FFF9F0;font:600 14px/1 var(--sans);cursor:pointer}
#problem.problem-3d.p3d-motion .p3d-toggle{display:inline-flex}
#problem .p3d-toggle:hover{background:#3A332C}
#problem .p3d-toggle:focus-visible{outline:3px solid var(--sun);outline-offset:3px}
#problem .p3d-toggle svg{width:14px;height:14px;fill:currentColor}
#problem .p3d-toggle .play-icon,#problem .p3d-toggle[aria-pressed="true"] .pause-icon{display:none}
#problem .p3d-toggle[aria-pressed="true"] .play-icon{display:block}
@media (max-aspect-ratio:1/1){
  /* phone source: calm band is the top 42% of the video height, less the vertical crop */
  #problem.problem-3d .prob-card{place-items:start stretch}
  #problem.problem-3d .prob-card-inner{align-self:start;justify-self:stretch;width:auto;
    --vh:max(100cqh,177.78cqw);--vcrop:calc((var(--vh) - 100cqh) / 2);--band:calc(.40 * var(--vh) - var(--vcrop));
    --pad:clamp(20px,5.4cqw,48px);padding:0 var(--pad);padding-top:max(24px,calc(var(--band) * .08))}
  #problem.problem-3d .prob-line{font-size:clamp(24px,min(8.2cqw,calc(var(--band) / 8.6)),52px)}
  #problem.problem-3d .prob-sub{font-size:clamp(15px,min(4.6cqw,calc(var(--band) / 18)),21px);margin-top:clamp(10px,1.6cqh,20px)}
  #problem.problem-3d .kicker{margin-bottom:clamp(8px,1.4cqh,16px)}
}
/* portrait tablets (3:5 to 1:1): their own 3:4 cut (problem-tablet.*) covers the card, road out to both edges.
   Its papers keep out of the top 35%; the text band is measured on the 3:4 cover height. */
@media (max-aspect-ratio:1/1) and (min-aspect-ratio:3/5){
  /* wider than 3:4 the cover crops height: take 3/4 of it from the empty top so his shoes and the road keep the bottom */
  #problem .p3d :is(img,video){object-position:50% 75%}
  #problem.problem-3d .prob-card-inner{--vh:max(100cqh,133.33cqw);--vcrop:calc((var(--vh) - 100cqh) * .75)}
}
/* reduced motion: the base CSS makes the card static; keep it the poster's containing block */
@media (prefers-reduced-motion:reduce){html #problem.problem-3d .prob-card{position:relative;height:max(540px,100svh)}}   /* explicit height: size containment reads height:auto as 0 */
