# Pantry Pendulum — UI Component and State System

## Component Foundations

**[UI-FOUNDATION-1] Color.** Oat is the working ground; aubergine is ink/edge; tomato is primary action and error boundary; herb is confirmed state; butter is focus/highlight; flour is high-value text. Every role has a non-color cue. [VIS-COLOR-1]

**[UI-FOUNDATION-2] Typography.** Condensed slab identifies recipes and moments; humanist sans owns every actionable label, explanation, and setting. Minimum body is 15 logical pixels and text-scale modes are 100/115/130. [ART-TYPE-1]

**[UI-FOUNDATION-3] Spacing and target.** Four-pixel base grid, 8-pixel neighbor separation, 16-pixel screen gutter, and at least 44×44 for every action. [UX-TOUCH-2]

**[UI-FOUNDATION-4] Shape and depth.** Enamel controls use 14-pixel rounded corners, three-pixel aubergine borders, and a four-pixel lower lip. Cloth tickets use clipped corners and stitched inner edges. Depth explains press or layer ownership, never decoration alone. [UX-CONTROL-ACTION]

**[UI-FOUNDATION-5] Motion, focus, and ownership.** Press collapses only while contact remains active; release restores or activates. Butter focus halo plus one-pixel lift remains persistent for keyboard. Base component owns anatomy, variant owns role color, state owns interaction feedback, and instance owns label/icon/value. [UX-INPUT-1]

## Variants and Interaction States

**[UI-ACTION-1] `enamel-action`.** Visual variants are `tomato-primary`, `oat-secondary`, and `line-utility`; they never encode Normal/Highlighted/Pressed/Disabled. Normal has full lip; Highlighted adds butter halo and lift; Pressed collapses lip and moves face down; Disabled uses warm gray, dashed seam, readable copy, and no interaction. Each variant must render all four states in the HTML reference. [UX-CONTROL-ACTION]

**[UI-HANDLE-1] `tug-handle`.** `ready-handle` and `final-tug` are contextual variants. Ready, Acquired, Aiming, Resolving, and Disabled are interaction states. The hit region and force bound do not shrink between variants. First-contact preview appears only in Aiming; new acquisition is locked in Resolving. [UX-CONTROL-HANDLE]

## Non-Button Controls

**[UI-SWITCH-1] `cloth-switch`.** Render as a native checkbox with `role="switch"`. `standard` and `safety` are visual variants. Off and On are persistent values; Focused is navigation emphasis without value mutation; Disabled is noninteractive but retains its value word. Position, word, stitch, and color all expose the value. [UX-CONTROL-SWITCH]

## Input Mapping

**[UI-INPUT-1]** Touch directly targets and releases; mouse adds hover Highlighted parity; keyboard navigates all buttons/switches with Tab and group arrows then activates with Enter/Space; controller is explicitly not supported. The interactive reference demonstrates native focus, button activation, and switch changes; the later gameplay prototype alone may exercise drag physics. [UX-INPUT-1]

## Feedback Ownership

**[UI-FEEDBACK-1]** Visual belongs to the changed component/actor; motion belongs to the object that moves; audio belongs to confirmed action or arbitrated contact; haptic belongs only to committed gameplay outcome. Cancelled drags, hover, and generic navigation never claim completion. Reduced motion removes travel and squash while preserving state through tone, seam, outline, word, and static ring. [UX-FEEDBACK-1]

## Accessibility and Readiness

**[UI-READY-1]** Readiness requires: every token and component points to current GDD/product/UX refs; all button and non-button states exist; touch/mouse/keyboard/controller policy is explicit; visual/motion/audio/haptic ownership is explicit; 44×44, focus, type scale, high contrast, captions, symbols, and reduced motion are demonstrated; and all nine current screens appear with purpose, review states, primary input, and layout rule. [GDD-ACCEPT-2] [UX-ACCESS-1]

## Manifest Traceability

This UI system is bound to run `2026-09-pantry-pendulum-en-us` and concept `pantry-pendulum`. It covers `screen-onboarding`, `screen-cookbook`, `screen-gameplay`, `screen-pause`, `screen-success`, `screen-failure`, `screen-settings`, `screen-accessibility`, and `screen-legal`, including `state-fresh`, `state-active`, `state-paused`, `state-success`, `state-failure`, and `state-error`.

Implementation IDs are `mechanic-tug`, `mechanic-first-contact`, `mechanic-transform`, `mechanic-recipe-order`, `entity-mobile`, `entity-ingredients`, `entity-stations`, `entity-obstacles`, `environment-test-kitchen`, `environment-cookbook`, `enamel-action`, `cloth-switch`, `tug-handle`, and `recipe-rail`. Readiness IDs are `access-symbol-redundancy`, `access-scalable-type`, `access-high-contrast`, `access-reduced-motion`, `access-focus-targets`, `vfx-transform`, `vfx-scorch`, and `vfx-success`. Runtime networking remains offline-first under [PRD-NETWORK-1].
