@font-face{font-family:Thunder;src:url('../assets/thunder-regular.ttf') format('truetype');font-display:swap}
:root{--ink:#242526;--soft:#626364;--rule:#2b30322b;--accent:#a7fa50;--gutter:clamp(22px,3vw,60px);--axis:54%;color-scheme:light;color:var(--ink);background:#e7e7e5;font:14px/1.48 ui-monospace,'SFMono-Regular',Menlo,Consolas,monospace;-webkit-font-smoothing:antialiased}
*{box-sizing:border-box}
body,h1,h2,p{margin:0}
body{height:100vh;height:100dvh;display:grid;grid-template-rows:74px minmax(410px,1fr);background:radial-gradient(ellipse 56% 83% at var(--axis) 40%,#fdfdfb 7%,#f4f4f1aa 63%,transparent),linear-gradient(#e1e2e0,#efefec 72%,#e2e2df)}
body:before{content:"";inset:0;position:fixed;background:url('../assets/paper.png');opacity:.055;pointer-events:none;z-index:6}
button,a,input{font:inherit;color:inherit;background:none;padding:0;border:0;min-width:0;text-decoration:none;appearance:none}
button,a{cursor:pointer;touch-action:manipulation;display:flex;align-items:center;justify-content:center;gap:9px;min-height:40px;transition:color .18s,background .18s,border-color .18s,opacity .18s}
button:disabled{opacity:.45;cursor:wait}
:focus-visible{outline:2px solid #4f6a33;outline-offset:3px}
svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;flex:none}
header{display:flex;align-items:center;gap:24px;padding:0 var(--gutter);z-index:3}
header h1{font-size:14px;font-weight:500}
header h1:before{content:'/';color:#969793;margin-right:24px}
#back,#reset{color:#565852}
#back svg{margin-left:-4px;width:15px}
#reset{margin-left:auto}
.primary{background:var(--ink);color:white;border-radius:7px;padding:0 17px}
.primary:hover{background:#424443}
#back:hover,#reset:hover,.heading button:hover{color:#000;text-decoration:underline;text-underline-offset:4px}
main{min-height:0;position:relative}
#scene{position:absolute;inset:0;overflow:hidden;touch-action:none;user-select:none;outline-offset:-4px;cursor:grab}
#scene:active{cursor:grabbing}
#frame{position:absolute;inset:1% 0 0;pointer-events:none}
#actor,#floor{position:absolute;left:var(--axis)}
#actor{transform-origin:50% 96%;transform:translateX(-50%) rotate(var(--lean,0deg))}
#surface{display:block;width:100%;height:100%;animation:bob 4.8s ease-in-out infinite}
#floor{transform:translate(-50%,-50%);height:18px;background:radial-gradient(ellipse closest-side,#24232299,#4846444d 44%,transparent);animation:shade 4.8s ease-in-out infinite}
@keyframes bob{50%{transform:translateY(-3px)}}@keyframes shade{0%,100%{opacity:.53}50%{opacity:.32}}
#turntable{position:absolute;top:10px;right:var(--gutter);display:flex;gap:12px;align-items:center;font-size:13px;white-space:nowrap}
#turntable button{min-width:40px;border-radius:30px}
#turntable svg{width:23px;height:23px}
#turntable button:hover{background:#ffffff80}
#follow{padding:0 13px}
#follow i{width:8px;height:8px;border-radius:50%;background:#999}
#follow[aria-pressed=true] i{background:#72d728;box-shadow:0 0 0 3px #8beb3f40}






aside{position:absolute;top:0;bottom:2%;left:var(--gutter);display:flex;width:clamp(250px,21vw,330px);overflow-y:auto;scrollbar-width:thin;overscroll-behavior:contain}
#controls{width:100%;margin:auto 0;padding:12px 5px}
section{padding:22px 0;border-bottom:1px solid var(--rule)}
.heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
h2{font:400 34px/.96 Thunder,Impact,sans-serif;text-transform:uppercase;letter-spacing:.012em}
.heading button,.heading output{color:var(--soft);font-size:13px;min-height:28px;display:flex;align-items:center}
.switch{border-radius:7px;padding:3px;display:flex;background:#20262210}
.switch button{flex:1;min-height:35px;border-radius:5px;font-size:14px}
.switch button[aria-pressed=true]{background:white;box-shadow:0 1px 3px #14181114}
p{color:var(--soft);text-wrap:pretty}
#help{margin:14px 0;font-size:14px;min-height:2.96em}
#upload{background:#ffffff6b;border:1px dashed #81837e;border-radius:7px;width:100%;height:58px}
#upload:hover{background:white;border-color:#111}
#private{display:flex;align-items:center;justify-content:center;gap:7px;font-size:12px;margin-top:12px}
#private svg{width:13px;height:13px}
.swatches{display:flex;justify-content:space-between}
.swatches button{width:clamp(30px,2.55vw,40px);min-height:0;aspect-ratio:1;border-radius:100%;background:var(--swatch);box-shadow:inset 0 0 0 1px #0001;position:relative}
.swatches button:after{content:'';position:absolute;inset:-4px;border-radius:50%;border:1px solid transparent}
.swatches button:hover:after{border-color:#888}
.swatches button[aria-pressed=true]:after{border:1.5px solid var(--ink)}
#hint{padding-top:22px;font-size:13px}
.range{display:grid;align-items:center;grid-template-columns:64px minmax(56px,1fr) 42px;gap:8px;min-height:37px;font-size:13px}
.range output{text-align:right}
input[type=range]{height:28px;cursor:ew-resize;background:linear-gradient(to right,#252624 var(--v),#c8c9c6 var(--v)) center/100% 2px no-repeat}
input[type=range]::-webkit-slider-thumb{appearance:none;background:#282926;border-radius:50%;height:14px;width:14px}
input[type=range]::-moz-range-thumb{border:0;background:#282926;border-radius:50%;height:14px;width:14px}
#working,#notice,#drop{position:absolute;left:var(--axis);top:45%;transform:translate(-50%,-50%);padding:12px 18px;color:white;background:#202020e8;border-radius:8px;z-index:7;width:max-content;max-width:90%;font-size:14px}
#notice{position:fixed;top:auto;bottom:78px;max-width:min(430px,86vw);left:50%;transform:translateX(-50%)}
#notice a{color:var(--accent)}
#drop{inset:10px;transform:none;max-width:none;width:auto;display:grid;place-items:center;border:1px dashed var(--accent);pointer-events:none}
dialog{border:none;border-radius:12px;background:#f6f6f4;color:var(--ink);width:min(390px,94vw);padding:24px}
dialog::backdrop{background:#15161860;backdrop-filter:blur(5px)}
dialog>button{display:grid;text-align:left;border:1px solid var(--rule);padding:16px;border-radius:7px;gap:5px;width:100%;justify-content:stretch;margin-top:10px}
dialog>button:hover{background:white;border-color:var(--ink)}
dialog small{font-size:13px;color:var(--soft)}#close{width:32px}
[hidden]{display:none!important}
@media(max-width:1080px){:root{--axis:58%}}
@media(max-width:900px){:root{--axis:60%}aside{width:228px}}
@media(max-width:760px){
 :root{--axis:50%;--gutter:15px}
 body{grid-template-rows:54px minmax(0,1fr);min-height:465px}
 header{font-size:12px;gap:13px}header h1{display:none}#reset svg{display:none}.primary{padding:0 12px;min-height:35px}
 main{display:grid;grid-template-rows:minmax(255px,60%) minmax(0,1fr)}
 #scene,aside{position:relative;inset:auto;width:100%;min-height:0}
 #frame{top:4px}
 #turntable{bottom:0;right:50%;transform:translateX(50%);top:auto;gap:6px;font-size:12px}
 aside{background:#fafaf9c9;border-top:1px solid var(--rule);scroll-padding:8px}
 #controls{padding:0 20px max(15px,env(safe-area-inset-bottom));max-width:500px;margin:0 auto}
 section{padding:16px 0}.heading{margin-bottom:10px}h2{font-size:27px}#help{min-height:0;margin:10px 0;font-size:13px}
 #private{margin-top:9px}#upload{height:45px}.swatches button{width:35px}#hint{padding-top:14px}
 #working{max-width:80%}
}
@media(max-width:360px){header{gap:9px}#save svg{display:none}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

#expand{color:inherit;font:inherit;text-transform:inherit}
#expand svg{transition:transform .2s}
#expand[aria-expanded=true] svg{transform:rotate(180deg)}
#fit .heading{margin-bottom:0}
#sliders{padding-top:12px}
#wardrobe .heading:not(:first-child){padding-top:24px}
#shoes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:1px}
#shoes button{border-radius:6px;background:#ffffff7a;border:1px solid #20262216;overflow:hidden;min-height:0}
#shoes button:hover{background:#fff}
#shoes canvas{width:100%;height:auto;display:block}
#shoes button[aria-pressed=true]{background:#fff;outline:1.5px solid var(--ink);outline-offset:2px}
#controls{padding-inline:6px}
#wardrobe .heading{margin-bottom:13px}
#wardrobe h2,#fit h2{font-size:29px}
@media(min-width:761px) and (max-height:815px){
 section{padding-block:15px}
 .heading{margin-bottom:12px}
 #wardrobe .heading:not(:first-child){padding-top:18px}
 #wardrobe .heading{margin-bottom:10px}
 #upload{height:46px}
 #help{margin-block:10px}
 #hint{padding-top:14px}
}
@media(max-width:760px){
 #controls{padding-inline:20px}
 #wardrobe .heading:not(:first-child){padding-top:19px}
 #shoes{gap:13px}
}

/* The rulers and camera controls stay in viewport space while the stage moves. */
#scene{overflow:clip}
#frame{overflow:clip;padding-bottom:85px}
.dimension,#zoom,#turntable{cursor:default;font-variant-numeric:tabular-nums}
.dimension,#zoom{position:absolute;display:flex;align-items:center;font-size:13px}
.dimension{gap:14px}
.dimension label{color:#545653}
.dimension output{white-space:nowrap;font-weight:600}
.dimension input{margin:0;touch-action:none}
.stature{right:clamp(var(--gutter),calc(46vw - 37dvh),29vw);top:46%;transform:translateY(-50%);flex-direction:column;gap:3px;padding:12px}
.stature #height{writing-mode:vertical-lr;direction:rtl;width:38px;height:clamp(140px,38dvh,480px);margin-top:12px;cursor:ns-resize;background:linear-gradient(to top,#252624 var(--v),#bcbeba var(--v)) center/2px 100% no-repeat}
.mass{left:var(--axis);bottom:24px;transform:translateX(-50%);padding:5px 16px}
.mass #weight{width:clamp(130px,16vw,295px)}
#zoom{right:var(--gutter);bottom:24px;border-radius:8px;background:#ffffffab;box-shadow:0 1px 4px #181c1912}
#zoom button{width:38px;min-height:38px;border-radius:8px}
#zoom button:hover{background:#171a1610}
#zoom button:disabled{cursor:default}
#zoom #zoomValue{width:54px}
#zoom #fitView{border-left:1px solid var(--rule);border-radius:0 8px 8px 0}
#zoom svg{width:17px;height:17px}
#scene[data-zoomed] :is(.dimension,#turntable,#zoom){background:#f7f7f4f2;box-shadow:0 1px 6px #1518151a}
#scene[data-zoomed] :is(.dimension,#turntable){border-radius:24px}
@media(min-width:761px){
 #scene[data-zoomed] #frame{mask-image:linear-gradient(to right,transparent calc(var(--gutter) + clamp(250px,21vw,330px)),black calc(var(--gutter) + clamp(250px,21vw,330px) + 85px))}
}
@media(min-width:761px) and (max-width:1010px){
 #zoom{right:14px}
 .mass{gap:9px;padding-inline:8px}
 .mass #weight{width:116px}
 #turntable{gap:3px;font-size:12px}
}
@media(max-width:760px){
 #frame{padding-bottom:83px}
 .dimension,#zoom{font-size:12px}
 .stature{right:5px;top:calc(50% - 38px);padding:8px 5px}
 .stature #height{margin-top:6px;height:clamp(96px,23dvh,255px);width:40px}
 .mass{bottom:40px;gap:10px;padding:2px 12px}
 .mass #weight{width:clamp(115px,39vw,210px);height:34px}
 #zoom{right:auto;bottom:auto;left:11px;top:calc(50% - 38px);transform:translateY(-50%);flex-direction:column}
 #zoom #zoomValue{width:42px;min-height:28px;font-size:11px}
 #zoom #plus{order:-1}
 #zoom #fitView{border-left:0;border-top:1px solid var(--rule);width:100%;border-radius:0 0 8px 8px}
 .dimension input::-webkit-slider-thumb{width:17px;height:17px}
 .dimension input::-moz-range-thumb{width:17px;height:17px}
}
