:root {
  --violet: #5a0fb8;
  --panel: #3d0f80;
  --accent: #5a0fb8;
  --bg: #fdf1e8;
  --surface: #fbe3d3;
  --text: #2d1a45;
  --muted: #66507a;
  --link: #5a0fb8;
  --on-panel: #fdf1e8;
  --on-accent: #ffffff;
  --error: #a63a00;
  color-scheme: light;
  --font-display: "Young Serif", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pop: #e8458b;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --violet: #c1a6ff;
    --panel: #12081f;
    --accent: #b9a0f5;
    --bg: #1a0d2e;
    --surface: #27163f;
    --text: #f2e9fb;
    --muted: #bdaed2;
    --link: #c9b3ff;
    --on-panel: #f3eefc;
    --on-accent: #1f1830;
    --error: #ffa07a;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --violet: #c1a6ff;
  --panel: #12081f;
  --accent: #b9a0f5;
  --bg: #1a0d2e;
  --surface: #27163f;
  --text: #f2e9fb;
  --muted: #bdaed2;
  --link: #c9b3ff;
  --on-panel: #f3eefc;
  --on-accent: #1f1830;
  --error: #ffa07a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; }
a { color: var(--link); }
code { font-family: var(--font-mono); }

main { max-width: 64rem; margin: 0 auto; padding: 2rem 1rem; }

.site-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem;
  padding: 1rem; background: var(--panel); color: var(--on-panel);
}
.site-header a { color: var(--on-panel); text-decoration: none; }
.site-header .brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.08em; text-transform: uppercase; }
.brand-logo { width: auto; height: 4.5rem; display: block; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 1rem; flex: 1; }
.site-header nav a:hover, .site-header nav a:focus-visible { text-decoration: underline; }

.site-footer {
  padding: 2rem 1rem; background: var(--panel); color: var(--on-panel); text-align: center;
}
.site-footer a { color: var(--on-panel); }
.site-footer .motto { font-family: var(--font-display); font-size: 1.25rem; }

.site-footer .footer-login { font-size: 0.85rem; opacity: 0.85; }
.logout-form { display: inline; margin-left: 1rem; }
.link-button {
  background: none; border: 0; padding: 0; font: inherit; color: inherit;
  text-decoration: underline; cursor: pointer;
}

.auth-card {
  max-width: 26rem; margin: 0 auto; padding: 1.5rem;
  background: var(--surface); border-radius: 0.75rem;
}
.auth-card form p { margin: 0 0 1rem; }
.auth-card label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.auth-card input[type="text"], .auth-card input[type="password"], .auth-card input[type="email"] {
  width: 100%; padding: 0.7rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--muted); border-radius: 0.4rem;
}
.auth-card button {
  width: 100%; padding: 0.75rem; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--on-accent); border: 0; border-radius: 999px;
}
.auth-card .errorlist { color: var(--error); padding-left: 1rem; margin: 0 0 0.5rem; }
.auth-card .helptext { color: var(--muted); font-size: 0.85rem; }

.filter-links { display: flex; gap: 1rem; }
.filter-links a[aria-current="page"] { font-weight: 600; text-decoration: none; color: var(--text); }
.empty { color: var(--muted); }

.work-grid {
  list-style: none; margin: 1rem 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
@media (min-width: 40rem) { .work-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 60rem) { .work-grid { grid-template-columns: repeat(4, 1fr); } }
.work-card a { display: block; text-decoration: none; color: var(--text); }
.work-card img, .work-card-empty {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  background: var(--surface); border-radius: 0.5rem;
}
.work-card-title { display: block; font-weight: 600; margin-top: 0.4rem; }
.work-card-meta { margin: 0; color: var(--muted); font-size: 0.9rem; }

.work-photos img, .artist-photo { max-width: 100%; height: auto; border-radius: 0.5rem; display: block; margin-bottom: 1rem; }
.work-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; }
.work-facts dt { font-weight: 600; }
.work-facts dd { margin: 0; }
.how-to-order, .commission-info { background: var(--surface); padding: 1rem; border-radius: 0.5rem; }
.artist-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; overflow-wrap: anywhere; }
.new-count { background: var(--accent); color: var(--on-accent); padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.button {
  display: inline-block; background: var(--accent); color: var(--on-accent);
  padding: 0.5rem 1.1rem; border-radius: 999px; font-weight: 600; text-decoration: none;
}

/* Studio */
.studio-messages { list-style: none; padding: 0.5rem 1rem; background: var(--surface); border-radius: 0.5rem; }
.studio-actions { display: flex; gap: 1rem; align-items: center; }
.studio-list { list-style: none; padding: 0; display: grid; gap: 1rem; }
.studio-item { display: flex; gap: 1rem; background: var(--surface); padding: 0.75rem; border-radius: 0.5rem; }
.studio-item img { width: 5rem; height: 5rem; object-fit: cover; border-radius: 0.4rem; }
.badges { margin: 0.25rem 0; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.badge { background: var(--panel); color: var(--on-panel); padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.85rem; }
.muted { color: var(--muted); margin-left: 0.5rem; }
.studio-form { padding-bottom: 5rem; max-width: 40rem; }
.studio-form .field { margin: 0 0 1rem; }
.field-website { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.studio-form .field[hidden] { display: none; }
.studio-form label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.studio-form input[type="text"], .studio-form input[type="number"], .studio-form input[type="url"],
.studio-form input[type="file"], .studio-form select, .studio-form textarea {
  width: 100%; min-height: 3rem; padding: 0.6rem; font: inherit;
  border: 2px solid var(--muted); border-radius: 0.5rem; background: var(--bg); color: var(--text);
}
.copy-box { display: block; width: 100%; min-height: 7rem; padding: 0.6rem; font: inherit; border: 2px solid var(--muted); border-radius: 0.5rem; background: var(--bg); color: var(--text); }
.studio-form input[type="checkbox"] { width: 1.5rem; height: 1.5rem; vertical-align: middle; }
.studio-form .errorlist { color: var(--error); padding-left: 1rem; margin: 0.25rem 0 0; font-weight: 600; }
.studio-form .helptext { color: var(--muted); font-size: 0.85rem; }
.current-photos { border: 1px solid var(--muted); border-radius: 0.5rem; margin-bottom: 1rem; }
.current-photo { display: inline-block; margin: 0.25rem 0.75rem 0.5rem 0; font-weight: 400; }
.current-photo img { width: 5rem; height: 5rem; object-fit: cover; display: block; border-radius: 0.4rem; }
.save-bar {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 0.75rem 1rem;
  background: var(--surface); border-top: 1px solid var(--muted); z-index: 10;
}
.save-bar .button { width: 100%; min-height: 3rem; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
/* The fixed bar sits over the bottom of the page on phones; leave room so the footer stays reachable. */
body:has(.save-bar) .site-footer { padding-bottom: 6rem; }
@media (min-width: 40rem) {
  body:has(.save-bar) .site-footer { padding-bottom: 2rem; }
  .save-bar { position: static; padding: 0; background: none; border: 0; }
  .save-bar .button { width: auto; }
  .studio-form { padding-bottom: 0; }
}

/* Pages */
.hero { padding: 1.5rem 0 0.5rem; }
.hero h1 { font-size: clamp(2.25rem, 9vw, 4.5rem); color: var(--violet); margin: 0 0 1rem; }
.name-line { font-size: 1.15rem; margin: 0 0 0.5rem; }
.stitch { border: 0; border-top: 3px dashed var(--pop); margin: 2rem 0; }
.doors { display: grid; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 40rem) { .doors { grid-template-columns: 1fr 1fr; } }
.door { background: var(--surface); padding: 1.25rem; border-radius: 0.75rem; }
.door h2 { margin-top: 0; }
.cards { display: grid; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 40rem) { .cards { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); padding: 1.25rem; border-radius: 0.75rem; }
.card h3 { margin-top: 0; }
.link-band { background: var(--panel); color: var(--on-panel); padding: 1.25rem 1rem; border-radius: 0.75rem; font-size: 1.15rem; }
.link-band a { color: inherit; font-weight: 600; }
.order-strip { background: var(--surface); border-left: 4px solid var(--accent); padding: 0.75rem 1rem; border-radius: 0.5rem; }
.status {
  display: inline-block; background: var(--panel); color: var(--on-panel);
  padding: 0.05rem 0.6rem; border-radius: 999px; font-size: 0.85rem; margin: 0 0.4rem;
}
.notice { background: var(--surface); border-left: 4px solid var(--accent); padding: 1rem; border-radius: 0.5rem; }
.motto-quote { font-family: var(--font-display); font-size: 1.5rem; color: var(--violet); }
.values { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; }
.values li { background: var(--surface); padding: 0.25rem 0.9rem; border-radius: 999px; }
a:focus-visible, .button:focus-visible { outline: 3px solid var(--error); outline-offset: 2px; }
.site-header a:focus-visible, .site-footer a:focus-visible { outline-color: var(--accent); }
.error-summary { border: 2px solid var(--error); border-radius: 0.5rem; padding: 0.5rem 1rem; margin-bottom: 1rem; color: var(--error); background: var(--surface); }
.error-summary:focus { outline: 3px solid var(--error); outline-offset: 2px; }
.error-summary p { margin: 0.25rem 0; }
.error-summary ul { margin: 0 0 0.25rem; padding-left: 1.25rem; }
.needs-list li { margin-bottom: 0.75rem; }

/* Request review */
.filter-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.filter-form select { min-height: 2.5rem; }
.filter-form button { border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.request-photo { max-width: 100%; width: 20rem; height: auto; border-radius: 0.5rem; }

/* Brand look: peach and violet from the printed cards */
.hero { display: grid; gap: 1.5rem; align-items: center; padding: 1rem 0 0; }
@media (min-width: 48rem) { .hero { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.35fr); } }
.hero-logo { width: 9rem; height: auto; margin: 0 0 1rem; display: block; }
.kicker { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; color: var(--violet); margin: 0 0 0.5rem; font-size: 0.9rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; height: auto; display: block; }
.door { padding: 0; overflow: hidden; border: 2px solid var(--violet); background: var(--surface); }
.door img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.door-body { padding: 1rem 1.25rem 1.25rem; }
.door-body h2 { margin: 0 0 0.5rem; color: var(--violet); }
.pledge { text-align: center; font-family: var(--font-display); font-size: 1.25rem; color: var(--violet); margin: 2rem 0; }
.page-photo { width: 100%; height: auto; max-height: 26rem; object-fit: cover; border-radius: 1rem; border: 3px solid var(--violet); display: block; margin: 1rem 0 1.5rem; }
.story-logo { width: 12rem; height: auto; float: right; margin: 0 0 1rem 1.5rem; }
@media (max-width: 40rem) { .story-logo { float: none; margin: 0 auto 1rem; display: block; } }
.card, .work-card img, .how-to-order, .commission-info { border-radius: 1rem; }
h1, h2, h3 { color: var(--violet); }
.site-header h1, .site-footer h2 { color: inherit; }
@media (max-width: 40rem) { .site-header nav { flex-basis: 100%; } }

/* Photo sizing */
.work-detail { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 48rem) { .work-detail { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.work-photos { display: grid; gap: 0.75rem; }
.work-photos img { width: auto; max-width: 100%; height: auto; max-height: 34rem; border-radius: 1rem; margin: 0; }
.work-info h1 { margin-top: 0; }
.work-card img, .work-card-empty { aspect-ratio: 4 / 5; border-radius: 1rem; }
.hero-photo img { max-height: none; }
.hero-logo { width: 11rem; }
.page-photo { max-height: 22rem; }

/* front page: keep photos modest */
.hero-photo { max-width: none; justify-self: stretch; }
.hero-photo img { max-height: none; }
@media (min-width: 48rem) {
  .hero { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.35fr); gap: 0; }
  .hero-photo { margin: -1.5rem -1rem -1rem -2rem; }
}
.doors .door img { aspect-ratio: 16 / 9; max-height: 12rem; }

/* studio profile status */
.profile-status { margin: 0 0 1.5rem; }
.badge { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 1rem; font-size: 0.85rem; margin-right: 0.4rem; }
.badge-public { background: var(--violet); color: var(--bg, #1a0f2e); }
.badge-hidden { border: 2px solid var(--violet); }

/* front page logo sits on a circle in the headline colour */
.hero-photo { background: #3d0f80; border: 0.4rem solid #fff; border-radius: 50%; aspect-ratio: 1; }
.hero-photo { width: 90%; justify-self: end; }
@media (min-width: 48rem) { .hero-photo { margin-inline: 0 -0.5rem; } }

.back { margin: 0 0 1rem; }

/* front page: the artist-page link sits a bit lower than the story button */
.hero-actions a:not(.button) { display: inline-block; margin-top: 0.4rem; }
