[hidden] { display: none !important; }
body { overflow: hidden; }
body main { min-height: 0 !important; }
#carpet { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#carpet:focus-visible { outline: 2px solid var(--accent); outline-offset: -7px; }
#carpet.grabbing { cursor: grabbing !important; }
header { pointer-events: none; }
header a, header button { pointer-events: auto; }
footer { position: fixed; inset: auto 4.5vw 30px; margin: 0; padding: 0; border: 0; display: flex; justify-content: flex-end; pointer-events: none; }
.controls { display: flex; padding: 5px; background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 3px 14px #0000000c; pointer-events: auto; }
.controls button { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-size: 12px; padding: 10px 12px; cursor: pointer; }
.controls button:hover { background: var(--rule); }
.controls svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
#fallback { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 340px; font-size: 16px; line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 760px) { footer { inset: auto 7vw max(22px, env(safe-area-inset-bottom)); } }

.landing-copyright { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.home-page footer { justify-content: flex-start; }
@media (max-width: 600px) { .landing-copyright { font-size: 10px; } }

#carpet:not([data-ready="true"]) { visibility: hidden; }
.controls button:disabled { opacity: .45; cursor: default; }

.grip-feedback{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:4;overflow:visible;color:var(--accent)}
.grip-mark{opacity:0;transition:opacity 360ms ease-out}
.grip-mark.is-active{opacity:1}
.grip-ring,.grip-stitches,.grip-thread{fill:none;stroke:currentColor;stroke-width:1;vector-effect:non-scaling-stroke}
.grip-ring{stroke-opacity:.78}
.grip-stitches{stroke-opacity:.48;stroke-linecap:round}
.grip-thread{stroke-opacity:.28;stroke-dasharray:2 4;stroke-linecap:round}
.grip-tip{fill:currentColor;fill-opacity:.65}
