/* COVERUP Switch: one screen, preview on the left, settings on the right; stacks on a phone.
   COVERUP colours (owner, 2026-10-19): graphite and chalk, brass as the accent. Brass itself is too light for small text
   on chalk (2.8:1), so links and small text use a deeper brass (5.1:1); brass is kept for the header and highlights. */
:root {
  --graphite: #1d2329; --chalk: #f3f1ec; --brass: #b8892c;
  --bg: var(--chalk); --paper: #fbfaf7; --ink: var(--graphite); --muted: #5d646b; --rule: #ddd8ce;
  --accent: #85601a; --accent-ink: #ffffff; --warn: #a3401f;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--body); }
a { color: var(--accent); }
button, select, input { font: inherit; color: inherit; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px max(16px, env(safe-area-inset-left)); background: var(--graphite); color: var(--chalk); }
.wordmark { font: 700 15px/1 var(--display); letter-spacing: .18em; text-decoration: none; color: var(--ink); }
.brand { margin: 0; display: flex; align-items: center; gap: 10px; font: 400 22px/1 var(--body); }
.brand-mark { width: 36px; height: 36px; }
.brand-word { height: 23px; width: auto; }
.brand span { color: var(--brass); }
.title p { margin: 6px 0 0; color: #c9cdd1; font-size: 14px; }
.title .by { color: var(--brass); text-decoration: none; letter-spacing: .08em; font-size: 12px; text-transform: uppercase; margin-left: 6px; }
.badge { font-size: 12px; color: #c9cdd1; border: 1px solid #3a4148; border-radius: 3px; padding: 4px 8px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0; min-height: calc(100vh - 140px); }
.stage { position: sticky; top: 0; align-self: start; height: calc(100vh - 81px); min-height: 420px; background: linear-gradient(#f7f7f5, #e9e8e4); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.stage-tools { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.stage-tools button { background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; padding: 6px 10px; cursor: pointer; }
.stage-tools button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.no-webgl { position: absolute; inset: 40% 20px auto; text-align: center; color: var(--muted); }

.panel { background: var(--paper); border-left: 1px solid var(--rule); padding: 18px 18px 24px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
select { padding: 8px; border: 1px solid var(--rule); border-radius: 3px; background: #fff; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.hint.warn { color: var(--warn); }
.design-name { margin: 0; font-weight: 600; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--rule); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.safety { border-top: 1px solid var(--rule); padding-top: 12px; font-size: 13px; }
.safety p { margin: 0 0 8px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.downloads { display: flex; gap: 8px; flex-wrap: wrap; }
.downloads button { padding: 10px 14px; border-radius: 3px; border: 1px solid var(--ink); background: var(--paper); cursor: pointer; }
.downloads .primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.downloads .primary:hover { background: #2c343b; }
.swatch[aria-pressed="true"] { outline-color: var(--brass); }

.foot { padding: 14px max(16px, env(safe-area-inset-left)); color: var(--muted); font-size: 13px; border-top: 1px solid var(--rule); }
.foot p { margin: 0; }

@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .stage { position: relative; min-height: 360px; height: 58vh; }
  .panel { border-left: 0; border-top: 1px solid var(--rule); }
  .badge { margin-left: 0; }
}

/* measure your own */
.own[hidden] { display: none; }
.own { border: 1px solid var(--rule); border-radius: 3px; padding: 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.own legend { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 4px; }
.own-row { display: grid; grid-template-columns: 1fr 140px; align-items: center; gap: 8px; }
.own-row[hidden] { display: none; }
.own-row label { font-size: 14px; }
.own-row input, .own-row select { padding: 7px 8px; border: 1px solid var(--rule); border-radius: 3px; background: #fff; width: 100%; min-width: 0; }
.own-row select { grid-column: 2; }
@media (max-width: 420px) { .own-row { grid-template-columns: 1fr 110px; } }

/* header: guide, language, version */
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top-nav .badge { margin-left: 0; }
.text-button { background: none; border: 0; padding: 4px 2px; cursor: pointer; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.lang select { padding: 5px 6px; background: var(--graphite); color: var(--chalk); border: 1px solid #3a4148; border-radius: 3px; }
.top :focus-visible { outline-color: var(--brass); }
.link-button { align-self: flex-start; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* how to fit it */
.guide { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border: 1px solid var(--rule); border-radius: 4px; padding: 0; background: var(--paper); color: var(--ink); }
.guide::backdrop { background: rgba(20, 24, 29, .45); }
.guide-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; background: var(--paper); border-bottom: 1px solid var(--rule); }
.guide-head h2 { margin: 0; font: 700 22px/1.1 var(--display); letter-spacing: .03em; }
.steps { margin: 0; padding: 16px 18px 22px 44px; display: flex; flex-direction: column; gap: 16px; }
.steps li::marker { font-weight: 700; color: var(--accent); }
.steps h3 { margin: 0 0 4px; font-size: 16px; }
.steps p { margin: 0; max-width: 62ch; }
.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.photos img { width: 100%; height: auto; border-radius: 3px; display: block; }
.about-body { padding: 16px 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.about-body p { margin: 0; max-width: 66ch; }
