.yy-case-arm { opacity: 0; transform-origin: 119px 112px; transform: rotate(-102deg); }
.yy-case-cover { transform-origin: 0 0; transform: rotate(5deg) scale(.04); }
#studio[data-case-act] .character-side { --patrol-play: paused; }
#studio[data-case-act] .yy-facing { animation: none; transform: none; }
#studio[data-case-act] .speech { visibility: hidden; }
#studio[data-case-act] :is(.yy-leg, .yy-bounce, .yy-arm-near, .yy-sprout) { animation: none; }
#studio[data-case-act]:not([data-case-act="pose"]) :is(.yy-arm-far, .yy-smile) { opacity: 0; }
#studio[data-case-act]:not([data-case-act="pose"]) .yy-open-mouth { opacity: 1; transform: scale(.67,.62); }
#studio[data-case-act="reach"] .yy-case-arm { opacity: 1; transform: rotate(0); transition: transform .24s ease-out; }
#studio:is([data-case-act="pull"],[data-case-act="offer"]) .yy-case-arm {
  opacity: 1; transform: rotate(98deg); transition: transform .48s cubic-bezier(.4,.02,.25,1.12);
}
#studio:is([data-case-act="pull"],[data-case-act="offer"]) .yy-case-cover {
  transform: rotate(-104deg) scale(1); transition: transform .48s cubic-bezier(.35,.02,.25,1.06);
}
#studio[data-case-act="offer"] .yy-case-cover { visibility: hidden; }
#studio[data-case-act] .yy-pupil { transform: translate(2px,2.2px); }

html:has(.case-dialog[open]) { overflow: hidden; }
.case-dialog {
  position: fixed; inset: 0; margin: 0; width: 100%; height: 100dvh; max-width: none; max-height: none;
  border: 0; padding: 52px clamp(12px,4vw,54px) 40px; background: transparent; overflow: hidden;
}
.case-dialog[open] { display: grid; place-items: center; animation: none; }
.case-dialog::backdrop { background: rgb(36 34 38 / 0%); backdrop-filter: none; transition: background .46s, backdrop-filter .46s; }
.case-dialog:is([data-scene="fly"],[data-scene="unfold"],[data-scene="read"])::backdrop {
  background: rgb(36 34 38 / 56%); backdrop-filter: blur(3px);
}
.album-dismiss {
  position: absolute; inset: max(12px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) auto auto;
  z-index: 8; width: 40px; height: 40px; border-radius: 50%; background: var(--paper); border: 1.6px solid var(--ink);
  box-shadow: 1.5px 2px 0 var(--ink);
}
.album-dismiss:hover:not(:disabled) { background: #ebe1fa; }
.case-album {
  --leaf: #fffcf1; --jacket: #a9ca74;
  position: relative; display: flex; width: min(890px,100%); max-height: 100%; min-height: 0;
  padding: 4px 5px 7px; background: var(--jacket); border: 2px solid var(--ink); border-radius: 9px 13px 13px 8px;
  box-shadow: 2px 4px 0 #313228, 3px 12px 28px #211d2547;
}
.case-dialog:is([data-scene="take"],[data-scene="fly"]) .case-album { visibility: hidden; pointer-events: none; }
.album-paper {
  position: relative; display: grid; grid-template-rows: auto minmax(0,1fr) auto; min-width: 0; min-height: 0; width: 100%;
  border: 1.4px solid #565843; border-radius: 5px 9px 7px 5px; background: var(--leaf) url("grain.svg");
  box-shadow: 0 2px 0 #eee4cb, 0 3px 0 #77745d;
}
.album-paper::after {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 24px; transform: translateX(-50%); pointer-events: none;
  background: linear-gradient(90deg,transparent,#524b3410 43%,#74684b3f 49%,#fffaf1 55%,transparent);
}
.album-header,.album-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-inline: clamp(17px,2.6vw,34px); }
.album-header { min-height: 68px; border-bottom: 1px solid #d7d1bb; }
.album-header h2 { display: inline-flex; align-items: center; gap: 9px; font-size: 20px; margin: 0; letter-spacing: -.035em; }
.album-header h2 .icon { width: 23px; height: 23px; transform: rotate(-6deg); }
.album-tabs { display: flex; gap: 4px; align-items: center; }
.album-tabs button {
  min-height: 38px; padding: 4px 13px; border: 1.4px solid transparent; border-radius: 5px 9px 5px 5px;
  background: transparent; color: #57594d; font-size: 14px; font-weight: 650;
}
.album-tabs button:hover { background: #ede9db; }
.album-tabs button[aria-pressed="true"] { background: #dfd0f5; color: #352c42; border-color: #51465c; box-shadow: 1px 2px 0 #51465c; transform: rotate(-2deg); }
.album-spreads { position: relative; display: grid; grid-template-columns: minmax(0,1fr); min-height: 0; overflow: auto; overscroll-behavior: contain; }
.case-spread { display: grid; grid-area: 1/1; grid-template-columns: repeat(2,minmax(0,1fr)); }
.case-spread[hidden] { display: none; }
.case-plate,.case-story { position: relative; min-width: 0; background: var(--leaf) url("grain.svg"); }
.case-plate { margin: 0; padding: 25px clamp(18px,2.35vw,33px) 17px; display: flex; flex-direction: column; justify-content: center; }
.case-visual { width: 100%; aspect-ratio: 56 / 46; position: relative; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #535347; }
.shop-proof { background: #a7bca4; }
.shop-proof img { display: block; width: 100%; height: 100%; object-fit: contain; }
.case-plate figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 32px; font-size: 12px; color: #626353; }
.case-plate figcaption [lang="en"] { font: 10px/1.4 var(--mono); }
.case-story { display: flex; flex-direction: column; justify-content: center; padding: 24px clamp(22px,3.05vw,43px) 30px; }
.case-kind { align-self: flex-start; font-size: 13px; font-weight: 600; color: #635b6b; }
.case-story h3 { margin: 10px 0 14px; font-size: clamp(34px,3.05vw,46px); line-height: 1.14; letter-spacing: -.07em; }
.case-story p,.case-story dd { margin: 0; font-size: 15px; line-height: 1.85; color: #47493f; }
.case-story dl { margin: 23px 0 0; border-top: 1px dashed #c2bca6; padding: 15px 0 0; }
.case-story dt { font-size: 12px; font-weight: 750; margin-bottom: 4px; }
.case-story dd { font-size: 14px; }
.album-footer { min-height: 61px; border-top: 1px solid #d7d1bb; }
.sample-note { padding: 3px 7px; border: 1px solid #8b8b71; border-radius: 3px; color: #66664f; transform: rotate(-3deg); font-size: 12px; }
.album-pager { display: flex; align-items: center; gap: 13px; }
.album-pager button {
  display: grid; place-items: center; width: 38px; height: 38px; border: 1.4px solid #575646; border-radius: 50%; background: #f9f6e8;
}
.album-pager button:hover:enabled { background: var(--lime); }
.album-pager button:disabled { opacity: .32; }
.album-pager .icon { width: 17px; height: 17px; }
#case-prev .icon { transform: rotate(180deg); }
#case-folio { font: 12px/1 var(--mono); }
.film-proof { display: flex; flex-direction: column; justify-content: space-between; background: #172321; }
.film-proof video { width: 100%; min-height: 0; flex: 1; object-fit: contain; background: #060d0e; }
.film-edge { display: flex; justify-content: space-between; padding: 9px 12px; gap: 10px; }
.film-edge i { width: 15px; height: 5px; border-radius: 2px; background: #d2d5bc; }
.zine-proof { display: grid; place-items: center; background: #c6bba6 url("grain.svg"); container-type: inline-size; }
.zine-proof::before,.zine-print { grid-area: 1/1; position: relative; width: 65%; height: 87%; background: #fff1d9; border: 1px solid #817967; }
.zine-proof::before { content: ""; background: #ebd9bc; transform: rotate(5deg); box-shadow: 2px 3px 4px #3e382431; }
.zine-print { overflow: hidden; transform: rotate(-4deg); box-shadow: 2px 4px 5px #3e382433; }
.zine-print img { position: absolute; left: 0; bottom: 0; width: 100%; height: 64%; object-fit: cover; object-position: 72% center; }
.zine-front { position: absolute; inset: 0; padding: 4.2% 6%; color: #332d22; }
.zine-front small { display: block; font: 600 clamp(8px,2.4cqw,10px)/1 var(--mono); }
.zine-front strong { display: block; margin-top: .14em; font: 750 clamp(23px,8cqw,35px)/1.04 "Songti SC",SimSun,serif; letter-spacing: -.04em; }
.zine-front span { position: absolute; left: 6%; bottom: 6%; padding: 4px 6px; background: #ffefd7; font-size: clamp(8px,2.8cqw,12px); }
.zine-proof[data-leaf="inside"] .zine-print img { top: 0; bottom: auto; height: 38%; object-position: center 55%; }
.zine-inside { position: absolute; inset: 38% 0 0; padding: 4.5% 6%; font-family: "Songti SC",SimSun,serif; color: #332b21; }
.zine-inside strong { font-size: clamp(17px,4.7cqw,22px); }
.zine-inside p { font-size: clamp(11px,3.15cqw,14px); line-height: 1.55; margin: .4em 0 0; }
.zine-switch { display: flex; gap: 2px; }
.zine-switch button { padding: 5px 8px; color: #5a5b4c; font-size: 12px; text-underline-offset: 3px; }
.zine-switch button[aria-pressed="true"] { color: #45315f; text-decoration: underline; text-decoration-thickness: 2px; }
.album-cover,.case-flight { pointer-events: none; visibility: hidden; }
.album-cover { position: absolute; inset: -2px -2px -2px auto; width: calc(50% + 2px); height: calc(100% + 4px); transform-origin: left center; }
.case-flight { position: fixed; z-index: 5; transform-origin: center; }
.case-dialog[data-scene="fly"] .case-flight { visibility: visible; }
.case-dialog[data-scene="unfold"] .album-cover { visibility: visible; animation: open-jacket .58s cubic-bezier(.37,.08,.26,.96) both; }
.case-dialog[data-scene="unfold"] .album-paper { animation: expose-pages .58s ease-out both; }
@keyframes open-jacket { 0% { transform: perspective(1000px) rotateY(0); } 72% { opacity: 1; } 100% { transform: perspective(1000px) rotateY(-176deg); opacity: 0; } }
@keyframes expose-pages { from { clip-path: inset(0 0 0 50%); } to { clip-path: inset(0); } }

@media(max-width:680px) {
  .case-dialog { padding: max(55px,calc(env(safe-area-inset-top) + 48px)) 11px max(15px,env(safe-area-inset-bottom)); }
  .case-album { width: min(430px,100%); }
  .album-header,.album-footer { padding-inline: 15px; }
  .album-header { min-height: 53px; gap: 4px; }
  .album-header h2 { font-size: 17px; gap: 5px; }
  .album-header h2 .icon { width: 18px; height: 18px; }
  .album-tabs { gap: 1px; }
  .album-tabs button { min-height: 32px; font-size: 12px; padding-inline: 8px; }
  .album-paper::after { display: none; }
  .case-spread { grid-template-columns: minmax(0,1fr); align-content: start; }
  .case-plate { padding: 13px 15px 0; }
  .case-visual { aspect-ratio: auto; height: clamp(172px,30dvh,270px); }
  .case-story { padding: 11px 17px 18px; }
  .case-story h3 { font-size: 28px; margin: 5px 0 8px; }
  .case-story p,.case-story dd { font-size: 14px; line-height: 1.68; }
  .case-story dl { margin-top: 12px; padding-top: 9px; }
  .case-kind,.case-story dt { font-size: 12px; }
  .album-footer { min-height: 50px; }
  .album-cover { width: calc(100% + 4px); }
  .zine-print,.zine-proof::before { width: min(65%,185px); }
  .album-dismiss { width: 36px; height: 36px; inset: max(9px,env(safe-area-inset-top)) 11px auto auto; }
}
@media(max-height:540px) and (min-width:681px) {
  .case-dialog { padding-block: 12px; padding-inline: 62px; }
  .album-header,.album-footer { min-height: 46px; }
  .case-visual { max-height: 49dvh; }
  .case-plate { padding-block: 12px 5px; }
  .case-story { padding-block: 13px; }
  .case-story h3 { font-size: 27px; margin-block: 4px 8px; }
  .case-story dl { margin-top: 10px; padding-top: 6px; }
}
@media(max-width:680px) and (max-height:660px) {
  .zine-proof { min-height: 190px; }
  .zine-proof[data-leaf="inside"] .zine-print { width: min(76%,210px); }
  .zine-proof[data-leaf="inside"] .zine-print img { height: 29%; }
  .zine-inside { inset-block-start: 29%; padding: 3% 5%; }
}
@media(prefers-reduced-motion:reduce) { .case-dialog::backdrop { transition: none; } }
