/* A geometric portrait as a direct-manipulation interface. */
#welcome .face-world{position:relative;align-self:center;height:clamp(340px,48svh,510px);min-height:0;margin:0 -20px}
.face-stage{position:relative;width:100%;height:100%;min-height:280px;touch-action:pan-y;cursor:default;container-type:size;outline:none;user-select:none;-webkit-tap-highlight-color:transparent}
.face-stage:focus-visible:after{content:'';position:absolute;left:47%;bottom:5%;width:6%;height:1px;background:#a2c3d7}
.face-canvas,.face-preview{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.face-preview{object-fit:contain;opacity:var(--face-preview-opacity,1);transform:var(--face-preview-transform,none)}.face-canvas{opacity:0}.face-ready .face-canvas{opacity:1}.face-ready .face-preview{opacity:0}
.face-preview-light{display:block}.face-preview-dark{display:none}html[data-theme=dark] .face-preview-dark{display:block}html[data-theme=dark] .face-preview-light{display:none}

@media(min-width:761px) and (max-height:800px){#welcome .face-world{height:clamp(310px,44svh,400px)}}
@media(max-width:760px){#welcome .face-world{height:360px;margin:0 0 12px}}
@media print{.face-canvas{display:none}.face-ready .face-preview{opacity:1}}
/* Page-space particles share the welcome's stacking context and never take input. */
#welcome .face-dust{position:absolute;inset:0;width:100%;height:100%;z-index:2;pointer-events:none}
#welcome .welcome-field{opacity:1;visibility:visible;transition:none}
#welcome.face-dispersed .welcome-field{opacity:1}
@media(prefers-reduced-motion:reduce){#welcome .welcome-field{transition:none}}
@media print{.face-dust{display:none}}
/* A framed study, with one visible thought to follow. */
.face-halo{position:absolute;z-index:0;left:50%;top:48%;width:var(--face-frame-size,min(94%,470px));aspect-ratio:1;transform:translate(-50%,-50%);border:1px solid #90b3ca55;border-radius:50%;background:radial-gradient(circle at 36% 28%,#f0f7fbbf,#d2e7f180 65%,#bad7e638);box-shadow:inset 0 0 65px #f1f9fc40;pointer-events:none;transition:opacity 1.8s;animation:none}
.face-halo:after{content:'';position:absolute;inset:17px;border:1px solid #a2c1d238;border-radius:50%}
html[data-theme=dark] .face-halo{background:radial-gradient(circle at 36% 28%,#2d465ed9,#20384b99 65%,#172d3c55);border-color:#87b3cc38;box-shadow:inset 0 0 65px #6b9db40a}
.face-canvas,.face-preview{z-index:1}
/* A small logic network: native buttons, visible links, no dragging or hidden gestures. */
#welcome .face-world{margin-bottom:82px}
.face-thought-network{position:absolute;z-index:2;left:50%;top:48%;width:var(--face-frame-size,420px);height:var(--face-frame-size,420px);transform:translate(-50%,-50%);overflow:visible;pointer-events:none;color:#648fa9}
html[data-theme=dark] .face-thought-network{color:#afd4e5}
.face-thought-network path{fill:none;stroke:currentColor;stroke-width:.7px;vector-effect:non-scaling-stroke}
.face-thought-node{position:absolute;z-index:4;transform:translate(-50%,-50%);width:44px;height:44px;padding:0;border:0;background:none;border-radius:50%;cursor:pointer;color:#6d9bb5}
.face-thought-node span{position:relative;display:block;width:17px;height:17px;margin:auto;border:1px solid #80abc398;border-radius:50%;background:#dfedf6;transition:box-shadow .18s,border-color .18s}
.face-thought-node span:after{content:'';position:absolute;inset:4px;border-radius:50%;background:#5d91ac;opacity:var(--thought-light,0)}
.face-thought-node.is-on span{border-color:#72a9c7;box-shadow:0 0 12px #71b9df38}
.face-thought-node.is-affected span{box-shadow:0 0 0 5px #80abc32b;outline:1px dashed #80abc375;outline-offset:5px}
.face-thought-node:focus-visible{outline:1px solid #80abc3;outline-offset:0}
html[data-theme=dark] .face-thought-node span{background:#20394d;border-color:#91bbcf7d}
html[data-theme=dark] .face-thought-node span:after{background:#c1e4f2}
html[data-theme=dark] .face-thought-node.is-on span{border-color:#b3d9e9;box-shadow:0 0 14px #a1d8f244}
.face-thought-caption{position:absolute;z-index:4;left:50%;top:100%;transform:translateX(-50%);width:max-content;max-width:100%;padding-top:8px;text-align:center;color:#64899e}
.face-thought-caption p{margin:0 0 4px;font-size:12px;line-height:1.4}
.face-thought-caption>span{display:block;font-size:10px;line-height:1.5}
.face-thought-actions{display:flex;justify-content:center;gap:15px;margin-top:2px}
.face-thought-actions button{min-height:44px;padding:0 6px;background:none;border:0;font:inherit;font-size:10px;color:inherit;cursor:pointer;text-decoration:underline;text-decoration-color:#80abc344;text-underline-offset:4px}
.face-thought-actions button:disabled{opacity:.3;cursor:default}
html[data-theme=dark] .face-thought-caption{color:#a3c4d6}
.face-thought-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.face-solved .face-halo{opacity:.40;transform:translate(-50%,-50%)}
.face-solved .face-thought-network{opacity:0;transition:opacity 1.2s}
.face-thought-node[hidden],.face-thought-caption[hidden]{display:none}
.face-thought-network,.face-thought-node,.face-thought-caption{visibility:hidden}
.face-thought-ready .face-thought-network,.face-thought-ready .face-thought-node,.face-thought-ready .face-thought-caption{visibility:visible}

@media(prefers-reduced-motion:reduce){.face-halo,.face-thought-node span,.face-thought-network{transition:none!important}}
@media print{.face-thought-network,.face-thought-node,.face-thought-caption{display:none}}

/* The halo fits its stage before JavaScript measures anything; it never flies in. */
@supports(width:1cqw){.face-halo{width:min(94cqw,96cqh,470px)}}

.face-solved .face-thought-caption>p,.face-solved .face-thought-caption>span,.face-solved #face-thought-undo{display:none}

/* Re-form: let material gather before the thought points quietly reappear. */
.face-thought-caption>p{transition:opacity .55s ease}.face-assembling .face-thought-caption>p{opacity:0}.face-assembling .face-thought-node{pointer-events:none}.face-assembling .face-halo{opacity:.65}
@media(prefers-reduced-motion:reduce){.face-thought-caption>p{transition:none}}

/* Reserve the caption line so Re-form does not jump when its title returns. */
.face-solved .face-thought-caption>p{display:block;visibility:hidden;opacity:0}

/* Match the wider editorial columns without stretching the portrait canvas. */
@media(min-width:1600px){
 #welcome .face-world{height:clamp(510px,min(27vw,50svh),600px)}
}
@supports(width:1cqw){
 .face-halo{width:min(94cqw,96cqh,clamp(470px,calc(100cqw - 290px),700px))}
}
@media(min-width:1600px) and (max-height:900px){
 #welcome .face-world{height:clamp(420px,52svh,510px)}
}
