:root {
  --bg: #faf7f2;
  --fg: #26221c;
  --muted: #7a7266;
  --accent: #c2571f;
  --accent-fg: #ffffff;
  --border: #e3dcd0;
  --frame-bg: #fffdf9;
  --danger: #b3261e;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120f;
    --fg: #ece7de;
    --muted: #9a917f;
    --accent: #e8813f;
    --accent-fg: #1a1204;
    --border: #2e2a23;
    --frame-bg: #1b1813;
    --danger: #ff8a80;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}
nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
nav .spacer { flex: 1; }
nav a { color: var(--fg); text-decoration: none; font-weight: 500; }
nav a:hover { color: var(--accent); }
nav a.brand { font-family: var(--mono); font-weight: 700; letter-spacing: 0.02em; }
nav .muted { color: var(--muted); font-size: 0.9rem; }
main { max-width: 46rem; margin: 2rem auto; padding: 0 1.5rem; }
h1 { font-size: 1.6rem; margin-bottom: 0.25rem; }
h2 { font-size: 1.1rem; margin-top: 2.5rem; }
a { color: var(--accent); }
p.tagline { color: var(--muted); max-width: 34rem; }
.hero, .share { text-align: center; }
.hero .tagline { margin: 0.5rem auto 1.5rem; }
.art-frame {
  background: var(--frame-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  margin: 1rem 0;
  overflow-x: auto;
}
.hero .art-frame, .share .art-frame { display: inline-block; min-width: min(100%, 30rem); }
pre.art {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.25;
  text-align: left;
  display: inline-block;
}
.art-error p { color: var(--danger); margin: 0; font-size: 0.9rem; }
a.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-fg);
  text-decoration: none;
  font-weight: 600;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
}
a.cta:hover { filter: brightness(1.08); color: var(--accent-fg); }
button {
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button.subtle { background: transparent; color: var(--muted); border-color: var(--border); font-weight: 500; }
button.subtle:hover { color: var(--danger); border-color: var(--danger); filter: none; }
form.inline { display: inline; }
textarea, input[type="text"] {
  font: inherit;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--frame-bg);
  color: var(--fg);
}
textarea:focus, input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.studio-form { display: grid; gap: 0.9rem; }
.studio-form button { justify-self: start; }
.pickers { display: flex; gap: 1.5rem; flex-wrap: wrap; }
fieldset {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}
legend {
  float: left;
  padding: 0 0.6rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
label.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}
label.chip:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}
label.chip input { position: absolute; opacity: 0; pointer-events: none; }
ul.creations { list-style: none; padding: 0; }
ul.creations li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
ul.creations li a {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
ul.creations li a:hover { text-decoration: underline; }
ul.creations .meta { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.share .meta { color: var(--muted); font-size: 0.85rem; }
.share-link {
  display: block;
  max-width: 30rem;
  margin: 1rem auto 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
}
.share-link input { font-family: var(--mono); font-size: 0.85rem; }
.share-link .share-row { display: flex; gap: 0.5rem; margin-top: 0.25rem; }
.share-link .share-row input { flex: 1; min-width: 0; }
.share-link .share-row button { flex-shrink: 0; }
/* Public share page: a bare greeting card. */
body.card-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.card { max-width: 100%; text-align: center; }
.card pre.art {
  background: var(--frame-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem 2rem;
  max-width: 100%;
  overflow-x: auto;
}
.card .owner-tools { margin-top: 1.5rem; }
