:root {
  --paper: #f8f3e9;
  --ink: #2f2923;
  --muted: #7f7163;
  --gold: #b98d4c;
  --soft: #fffaf1;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: linear-gradient(135deg, #fbf7ef, var(--paper) 55%, #f1e6d6);
  min-height: 100vh;
  position: relative;
}
body.theme-churchyard { background: #f3ecdf url("/static/img/themes/churchyard-front.jpg") center top / cover fixed; }
body.theme-ivory { background: #f8f3e9 url("/static/img/themes/ivory.jpg") center top / cover fixed; }
body.theme-navy { background: #1c2a3a url("/static/img/themes/navy.jpg") center top / cover fixed; }
body.theme-garden { background: #eef3e8 url("/static/img/themes/garden.jpg") center top / cover fixed; }
body.theme-celtic { background: #ece7dc url("/static/img/themes/celtic.jpg") center top / cover fixed; }
body.theme-linen { background: #f6f4ef url("/static/img/themes/linen.jpg") center top / cover fixed; }
body.studio-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(248, 243, 233, .78);
  pointer-events: none;
  z-index: 0;
}
body.studio-page.theme-navy::before { background: rgba(20, 28, 40, .55); }
body.studio-page.theme-navy { color: #f4efe4; }
.site-head, .site-foot, main { position: relative; z-index: 1; width: min(960px, calc(100% - 32px)); margin: 0 auto; }
body.studio-page .site-head,
body.studio-page .site-foot,
body.studio-page main { width: min(1180px, calc(100% - 32px)); }
.site-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.2rem 0;
}
.mark { font-weight: 700; letter-spacing: .04em; text-decoration: none; color: var(--ink); }
nav a { margin-left: 1rem; color: var(--muted); text-decoration: none; }
.hold {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 3rem 0 4rem;
}
.hold h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: .3rem 0 .6rem; }
.hold .lede { margin: 0 auto 1.2rem; }
nav a.quiet { font-size: .85rem; opacity: .55; }
.hero { padding: 2.5rem 0 1rem; }
h1 { font-weight: 500; letter-spacing: .02em; }
.lede { color: var(--muted); max-width: 38rem; line-height: 1.5; }
.kicker { letter-spacing: .14em; text-transform: uppercase; font-size: .78rem; color: var(--gold); }
.btn {
  display: inline-block; background: #25384f; color: #fffaf1; text-decoration: none;
  border: 0; border-radius: 999px; padding: .55rem 1.1rem; font: inherit; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--gold); }
.theme-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; margin: 2rem 0; }
.theme-card, .theme-opt {
  border: 1px solid rgba(185,141,76,.45); border-radius: 16px; padding: 1rem; background: var(--soft);
}
.theme-navy { background: #25384f; color: #f8f3e9; }
.theme-garden { background: #eef3e8; }
.theme-celtic { background: #ece7dc; }
.theme-churchyard { background: #f3ecdf url("/static/img/themes/churchyard-front.jpg") right 10px center / 34% auto no-repeat; }
.theme-opt.theme-churchyard { padding-right: 7.5rem; }
.form { display: grid; gap: 1.2rem; padding-bottom: 3rem; }
.form.narrow { max-width: 22rem; }
fieldset { border: 1px solid rgba(185,141,76,.35); border-radius: 16px; padding: 1rem 1.1rem 1.2rem; }
legend { padding: 0 .4rem; color: var(--gold); }
label { display: grid; gap: .3rem; margin: .55rem 0; font-size: .95rem; }
input, textarea, select { font: inherit; padding: .45rem .55rem; border: 1px solid #d9cbb8; border-radius: 8px; background: #fff; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.hymn-list { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .8rem; margin: .4rem 0 1rem; }
.check { display: flex; gap: .4rem; align-items: center; font-size: .92rem; }
.theme-pick { display: grid; gap: .5rem; }
.theme-opt { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; align-items: start; cursor: pointer; }
.theme-opt span { grid-column: 2; color: var(--muted); font-size: .88rem; }
.preview-frame { width: 100%; height: 820px; border: 1px solid #d9cbb8; border-radius: 12px; background: #fff; }
.orders { width: 100%; border-collapse: collapse; }
.orders td, .orders th { text-align: left; padding: .45rem 0; border-bottom: 1px solid #eadfcf; }
.flash { background: #fff; border-left: 3px solid var(--gold); padding: .5rem .8rem; }
.site-foot { padding: 2rem 0 3rem; color: var(--muted); font-size: .88rem; }
.help { color: var(--muted); margin: .2rem 0; }
.status-row { display: flex; gap: .5rem; margin-top: 1rem; }
.card-panel {
  background: #fffaf1; border: 1px solid #eadfcf; border-radius: 14px;
  padding: 1rem 1.1rem; margin: 1rem 0;
}
.api-modal {
  border: 1px solid #eadfcf; border-radius: 16px; padding: 1.2rem 1.3rem;
  max-width: 24rem; width: calc(100% - 2rem); background: #fffaf1;
}
.api-modal::backdrop { background: rgba(40, 24, 8, .4); }
@media (max-width: 700px) {
  .grid-2, .hymn-list { grid-template-columns: 1fr; }
}
