/* Interactive simulators. Sizes in em so presenter mode can scale by raising font-size. Tokens come from main.css. */
.sim{font-size:15px;line-height:1.5;max-width:34em;margin:1.4em 0;padding:.8em;border:1px solid var(--line);background:var(--surface);color:var(--ink)}
.sim-stage{position:relative;aspect-ratio:16/10;overflow:hidden;background:var(--surface-raised)}
.sim-img{display:block;width:100%;height:100%;object-fit:cover;user-select:none}
.sim-overlay{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated;mix-blend-mode:overlay;pointer-events:none}
.sim-svg{position:absolute}
.sim-canvas{display:block;width:100%;height:auto;background:var(--surface-raised)}
.sim-canvas.digital{image-rendering:pixelated}
.sim-zoom{aspect-ratio:16/10}
.sim-control{display:grid;grid-template-columns:1fr auto;align-items:center;gap:.2em .8em;margin-top:.8em}
.sim-control>.sim-seg,.sim-control>input{grid-column:1/-1}
.sim-label{font-weight:500;font-size:.9em}
.sim-value{font-family:var(--font-mono);font-weight:500;color:var(--accent-ink);font-size:.9em}
.sim input[type=range]{width:100%;min-height:2.75em;margin:0;accent-color:var(--accent-ink)}
.sim-seg{display:flex;flex-wrap:wrap;gap:.4em}
.sim-btn{min-height:2.75em;padding:.35em .9em;border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:transparent;color:inherit;font-weight:500;cursor:pointer}
.sim-btn:hover{background:var(--surface-raised)}
/* current option: lime border, never a lime fill */
.sim-btn[aria-pressed=true]{border-color:var(--accent-ink);box-shadow:inset 0 0 0 1px var(--accent-ink)}
.sim-play{margin-top:.6em}
.sim-caption{margin:.8em 0 0;min-height:3em;font-size:.95em}
.sim-error{margin:0;color:var(--danger);font-size:.9em}
@media (max-width:420px){.sim{padding:.6em}.sim-btn{padding:.35em .7em}}
@media (prefers-reduced-motion:reduce){.sim *{transition:none!important}}
/* presenter mode: scale the whole component */
.presenter-page .sim{font-size:clamp(15px,2.3vh,26px);max-width:min(100%,30em);background:var(--surface-raised)}
.presenter-page .sim-btn:hover{background:var(--surface)}
.presenter-page .presenter-prose .sim .sim-img{width:100%;height:100%;max-width:none;max-height:none;margin:0;object-fit:cover}
/* layered sims: bg + hole + subject cutout stacked at identical size; scale keeps blurred edges off-screen */
.sim-layered{aspect-ratio:3/2}
.sim-layer{position:absolute;inset:0;transform:scale(1.08)}
.sim-layer[hidden]{display:none!important}
.sim-hole{-webkit-mask-image:linear-gradient(#000,#000),var(--cut);-webkit-mask-composite:xor;mask-image:linear-gradient(#000,#000),var(--cut);mask-composite:exclude;-webkit-mask-size:100% 100%;mask-size:100% 100%}
.sim-tap{cursor:crosshair;touch-action:manipulation}
/* the focus box imitates a phone camera's own UI, so it keeps camera yellow rather than the brand accent */
.sim-focusbox{position:absolute;width:3.4em;height:3.4em;transform:translate(-50%,-50%);border:2px solid #ffd60a;pointer-events:none}
.sim-focusbox[hidden]{display:none}
.sim-credit{margin:.3em 0 0;font-size:.7em;color:var(--ink-muted)}
.sim-credit a{color:inherit}
.chapter-prose .sim .sim-img{width:100%;height:100%;max-width:none;max-height:none;margin:0;border:0}
