/* Synkloft: shared components for the gallery, the creator app and the home page.
   Colours, fonts, radii and shadows come from tokens.css (generated from brand/brand.json). */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--body-size)/var(--body-line) var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-heading); font-weight: var(--weight-title); letter-spacing: -.015em; margin: 0 0 .4em; }
h3 { font-weight: var(--weight-card); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px;
  border-radius: var(--radius-button); border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-decoration: none; color: var(--text); font-weight: 500; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; }

.field { display: grid; gap: 6px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; padding: 11px 13px; border-radius: var(--radius-input); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 16px; }
.error-box, .warn-box, .info-box, .ok-box { padding: 12px 14px; border-radius: 8px; margin: 0 0 14px; }
.error-box { background: var(--danger-soft); color: var(--danger); }
.warn-box { background: var(--warn-soft); color: var(--warn); }
.info-box { background: var(--accent-soft); color: var(--accent); }
.ok-box { background: var(--ok-soft); color: var(--ok); }
.chip { display: inline-block; font-size: var(--caption-size); padding: 2px 8px; border-radius: var(--radius-badge); background: var(--surface-2); color: var(--muted); font-weight: 600; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 18px; box-shadow: var(--shadow); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: var(--radius-button); z-index: 100; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }
.foot-brand { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 16px; }
.foot-brand a { color: inherit; }

.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--radius-card); padding: 22px; width: min(460px, 100%); box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }

/* brand marks */
.wordmark { display: inline-flex; align-items: center; text-decoration: none; }
.wordmark img { height: 28px; width: auto; display: block; }
.wordmark .light { display: block; } .wordmark .dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wordmark .light { display: none; } :root:not([data-theme="light"]) .wordmark .dark { display: block; } }
:root[data-theme="dark"] .wordmark .light { display: none; } :root[data-theme="dark"] .wordmark .dark { display: block; }
.powered { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); text-decoration: none; font-size: var(--small-size); }
.powered img { height: 16px; width: auto; opacity: .8; }
