:root {
  --paper:       #f6f1e6;
  --surface:     #fbf8f1;
  --ink:         #23201b;
  --ink-soft:    #4a443c;
  --muted:       #8a8173;
  --line:        #e4ddcd;
  --line-strong: #d6ccb8;
  --accent:      #1f6f5c;
  --accent-deep: #174f43;
  --gold:        #b1853c;
  --danger:      #a23b2d;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --radius: 12px;
  --maxw: 1080px;
  --shadow: 0 1px 2px rgba(35,32,27,.05), 0 8px 28px rgba(35,32,27,.06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent-deep); text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
a:hover { color: var(--accent); }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: .9em;
  background: rgba(31,111,92,.08);
  color: var(--accent-deep);
  padding: .1em .35em;
  border-radius: 5px;
}

/* ---- chrome ---- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(140%) blur(8px);
}
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; display: block; }
.brand-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; letter-spacing: .01em; }
.site-nav { display: flex; align-items: center; gap: 1.25rem; font-size: .95rem; }
.site-nav a { text-decoration: none; color: var(--ink-soft); }
.site-nav a:hover { color: var(--accent); }

.site-footer {
  margin-top: auto;
  padding: 2rem clamp(1rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .88rem;
  display: flex; gap: .5rem; align-items: center;
}
.site-footer .dot { opacity: .5; }

/* ---- layout ---- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1rem, 4vw, 2.5rem); flex: 1; }
.narrow { max-width: 720px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.opt { color: var(--muted); font-weight: 400; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; letter-spacing: -.01em; font-weight: 600; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: .98rem; font-weight: 550;
  padding: .62rem 1.25rem; border-radius: 999px;
  background: var(--accent); color: #fbf8f1; border: 1px solid var(--accent);
  text-decoration: none; cursor: pointer; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--accent-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .4rem .9rem; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--accent-deep); border-color: var(--line-strong); }
.btn-ghost:hover { background: rgba(31,111,92,.07); color: var(--accent-deep); }

/* ---- landing ---- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; color: var(--gold); font-weight: 600; margin: 0 0 .8rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0 0 1rem; }
.lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 38ch; }
.hero-actions { display: flex; gap: .8rem; margin-top: 1.8rem; flex-wrap: wrap; }
.hero-art img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); display: block; }

.how { margin-top: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--line); padding-top: 2rem; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.steps li { color: var(--ink-soft); }
.step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line-strong);
  font-family: var(--serif); color: var(--accent-deep); margin-right: .5rem;
}

/* ---- forms / auth ---- */
.auth-card { max-width: 440px; margin: 1rem auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.auth-card h1 { margin: 0 0 .4rem; font-size: 1.8rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.4rem; }
.stack label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; color: var(--ink-soft); font-weight: 550; }
input, textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: 9px; padding: .65rem .8rem;
  width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,111,92,.15); }
input::placeholder, textarea::placeholder { color: #b3aa99; }
.form-error { background: rgba(162,59,45,.08); border: 1px solid rgba(162,59,45,.25); color: var(--danger); padding: .6rem .8rem; border-radius: 9px; font-size: .9rem; margin: 0; }

/* ---- dashboard ---- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.dash-head h1 { margin: 0 0 .2rem; font-size: 2rem; }
.post-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.post-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem .25rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.post-row-title { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.post-row-title:hover { color: var(--accent); }
.post-row-meta { margin: .3rem 0 0; font-size: .85rem; }
.post-row-actions { display: flex; align-items: center; gap: 1rem; font-size: .9rem; }
.post-row-actions form { margin: 0; }
.tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; }
.tag-live { background: rgba(31,111,92,.12); color: var(--accent-deep); }
.tag-draft { background: rgba(177,133,60,.15); color: var(--gold); }
.link-danger { background: none; border: none; color: var(--danger); cursor: pointer; font: inherit; padding: 0; }
.link-danger:hover { text-decoration: underline; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); }
.empty .btn { margin-top: 1rem; }
.big-mark { font-size: 3rem; color: var(--gold); margin: 0 0 .5rem; }

/* ---- editor ---- */
.editor { max-width: 760px; margin: 0 auto; }
.editor-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.editor-head h1 { margin: 0; font-size: 1.6rem; }
.editor-head a { text-decoration: none; font-size: .9rem; }
.title-input { font-family: var(--serif); font-size: 1.8rem; font-weight: 600; padding: .5rem .6rem; background: transparent; border: none; border-bottom: 1px solid var(--line-strong); border-radius: 0; }
.title-input:focus { box-shadow: none; border-bottom-color: var(--accent); }
.body-input { font-family: var(--serif); font-size: 1.08rem; line-height: 1.7; resize: vertical; min-height: 320px; background: var(--surface); }
.editor-actions { display: flex; gap: .8rem; }

/* ---- blog (subdomain) ---- */
.blog-masthead { text-align: center; padding: clamp(2.5rem, 6vw, 4rem) 1rem 1.5rem; border-bottom: 1px solid var(--line); }
.blog-author { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.blog-bio { color: var(--muted); max-width: 50ch; margin: .6rem auto 0; }

.entries { list-style: none; padding: 0; margin: 0; }
.entry { padding: 2.2rem 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: none; }
.entry-date { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin: 0 0 .5rem; }
.entry-title { font-size: 1.7rem; margin: 0 0 .6rem; }
.entry-title a { color: var(--ink); text-decoration: none; }
.entry-title a:hover { color: var(--accent); }
.entry-excerpt { color: var(--ink-soft); margin: 0 0 .8rem; }
.entry-more { font-size: .9rem; text-decoration: none; font-weight: 550; }

.article { max-width: 680px; margin: 0 auto; }
.article-head { text-align: center; padding: clamp(2rem, 5vw, 3rem) 0 1.5rem; }
.article-title { font-size: clamp(2rem, 5vw, 2.8rem); margin: .3rem 0 0; }
.article-back { text-align: center; margin-top: 2.5rem; }
.article-back a { text-decoration: none; color: var(--muted); }
.article-back a:hover { color: var(--accent); }

/* ---- prose ---- */
.prose { font-family: var(--serif); font-size: 1.16rem; line-height: 1.75; color: var(--ink); }
.prose p { margin: 0 0 1.2rem; }
.prose h2 { font-size: 1.6rem; margin: 2rem 0 .8rem; }
.prose h3 { font-size: 1.3rem; margin: 1.6rem 0 .6rem; }
.prose h4 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }
.prose ul { padding-left: 1.3rem; margin: 0 0 1.2rem; }
.prose li { margin: .3rem 0; }
.prose a { color: var(--accent-deep); }
.prose blockquote { margin: 1.4rem 0; padding: .2rem 0 .2rem 1.2rem; border-left: 3px solid var(--gold); color: var(--ink-soft); font-style: italic; }
.prose code { font-size: .92em; }

/* ---- blog themes (public pages only) ---- */
body.theme-flourish { /* house style — defaults from :root */ }

body.theme-noir {
  --paper: #1a1714; --surface: #221d19; --ink: #ece4d6; --ink-soft: #c5bba9;
  --muted: #8f8473; --line: #332c25; --line-strong: #473d33;
  --accent: #c8a44d; --accent-deep: #dcbb67; --gold: #c8a44d;
}
body.theme-manuscript {
  --paper: #ffffff; --surface: #faf8f5; --ink: #1a1a1a; --ink-soft: #444444;
  --muted: #8a8a8a; --line: #ececec; --line-strong: #dcdcdc;
  --accent: #9b2226; --accent-deep: #7a1a1d; --gold: #9b2226;
  --serif: Georgia, "Times New Roman", Times, serif;
}
body.theme-garden {
  --paper: #eef2e9; --surface: #f6f8f2; --ink: #2c3a2e; --ink-soft: #4a5b4c;
  --muted: #7d8a7d; --line: #dde4d6; --line-strong: #cbd6c2;
  --accent: #4f8a4f; --accent-deep: #3c6e3c; --gold: #9aa15a;
}
body.theme-typewriter {
  --paper: #fafafa; --surface: #f2f2f2; --ink: #111111; --ink-soft: #333333;
  --muted: #888888; --line: #e2e2e2; --line-strong: #cfcfcf;
  --accent: #222222; --accent-deep: #000000; --gold: #666666;
  --serif: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

/* ---- settings page ---- */
.field-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin: 0; background: var(--surface); }
.field-group + .field-group { margin-top: 1.2rem; }
.field-group legend { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; padding: 0 .4rem; }
.field-group label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; color: var(--ink-soft); font-weight: 550; }
.field-group label + label { margin-top: .9rem; }
.row-label { max-width: 360px; }
.form-ok { background: rgba(31,111,92,.1); border: 1px solid rgba(31,111,92,.3); color: var(--accent-deep); padding: .6rem .8rem; border-radius: 9px; font-size: .9rem; }
.dash-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.theme-card { position: relative; display: block !important; border: 1px solid var(--line-strong); border-radius: 10px; padding: .8rem; cursor: pointer; background: var(--paper); transition: border-color .15s, box-shadow .15s; }
.theme-card:hover { border-color: var(--accent); }
.theme-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31,111,92,.2); }
.theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-swatch { display: flex; height: 34px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); }
.theme-swatch i { flex: 1; }
.theme-name { display: block; font-family: var(--serif); font-weight: 600; color: var(--ink); margin-top: .5rem; }
.theme-blurb { display: block; font-size: .78rem; color: var(--muted); font-weight: 400; line-height: 1.35; margin-top: .1rem; }

/* ---- images: posts, media, avatar, banner ---- */
.post-img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 1.4rem 0; }
.prose .post-img { box-shadow: var(--shadow); }

.upload-bar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.5rem; }
.upload-bar input[type=file] { width: auto; flex: 1 1 240px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.media-item { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.media-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.media-item figcaption { padding: .55rem; display: flex; flex-direction: column; gap: .4rem; }
.copy-src { font-family: ui-monospace, Menlo, monospace; font-size: .72rem; padding: .35rem .45rem; }
.media-item figcaption form { margin: 0; align-self: flex-end; }

.img-field { display: flex; gap: 1rem; align-items: flex-start; }
.img-field + .img-field { margin-top: 1rem; }
.img-field > div { flex: 1; }
.inline-check { flex-direction: row !important; align-items: center; gap: .4rem; font-weight: 400; margin-top: .5rem; }
.inline-check input { width: auto; }
.avatar-preview { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-strong); }
.header-preview { width: 120px; height: 56px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line-strong); }

.blog-banner { width: 100%; max-height: 280px; overflow: hidden; border-bottom: 1px solid var(--line); }
.blog-banner img { width: 100%; height: 100%; max-height: 280px; object-fit: cover; display: block; }
.blog-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--paper); box-shadow: 0 0 0 1px var(--line-strong); display: block; margin: 0 auto .8rem; }
.blog-banner + .blog-masthead .blog-avatar { margin-top: -54px; position: relative; }

/* ---- responsive ---- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .steps { grid-template-columns: 1fr; gap: 1rem; }
  .dash-head { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- report form: captcha + nav button contrast fix ---- */
.stack input[readonly] { background: var(--paper); color: var(--muted); cursor: not-allowed; }
.captcha { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border: 1px solid var(--line-strong); border-radius: 10px; padding: .7rem .9rem; background: var(--surface); }
.captcha .cleft { display: flex; align-items: center; gap: .7rem; font-size: .95rem; color: var(--ink-soft); }
.capbox { width: 26px; height: 26px; border: 2px solid var(--line-strong); border-radius: 6px;
  display: grid; place-items: center; cursor: pointer; background: #fff; flex: none; }
.capbox.ok { background: var(--accent); border-color: var(--accent); }
.capbox.ok::after { content: "\2713"; color: #fff; font-weight: 700; }
.capbox .spin { width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite; }
.capbrand { font-size: .72rem; color: var(--muted); text-align: right; line-height: 1.15; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
/* the nav CTA inherited ".site-nav a" grey text over the green button — force light */
.site-nav a.btn, .site-nav a.btn:hover { color: #fff; }

/* ---- admin: reports list ---- */
.report-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.4rem; }
.report-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; box-shadow: var(--shadow); }
.report-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.report-head a { font-weight: 700; word-break: break-all; }
.report-head time { font-size: .82rem; white-space: nowrap; }
.report-from { font-size: .85rem; margin: .3rem 0 .6rem; word-break: break-word; }
.report-body { margin: 0; white-space: pre-wrap; line-height: 1.55; }
