:root {
  --bg: #f6f7fb;
  --bg-soft: #eef1f7;
  --bg-card: #ffffff;
  --line: #dde2ec;
  --text: #151a24;
  --muted: #5a6474;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, .10);
  --danger: #d92d20;
  --ok: #15803d;
  --warn: #b45309;
  --shadow: 0 1px 2px rgba(21, 26, 36, .06), 0 8px 24px rgba(21, 26, 36, .05);
  --radius: 14px;
  --maxw: 780px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -200px, #e8edfa, var(--bg));
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; }

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 247, 251, .84);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.site-nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.site-nav a { color: var(--muted); }
.site-nav a:hover { color: var(--text); text-decoration: none; }

.site-main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 32px 20px 64px; }
.site-footer {
  display: flex; justify-content: space-between; gap: 12px;
  max-width: var(--maxw); width: 100%; margin: 0 auto; padding: 20px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 13px;
}

.btn {
  display: inline-block; padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: #ffffff; font-weight: 600; cursor: pointer; font-size: 15px;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-white { background: #ffffff; border-color: var(--line); color: var(--text); }
.btn-white:hover { filter: brightness(0.95); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-small { padding: 7px 14px; font-size: 14px; }
.btn.full { width: 100%; }
.link-button { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.link-button:hover { color: var(--text); }
.link-button.danger:hover { color: var(--danger); }
.inline-form { display: inline; }

.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none; }

.hero { padding: 48px 0 24px; }
.hero.narrow { max-width: 620px; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; color: var(--accent); margin: 0 0 12px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); margin: 0 0 16px; }
.lede { color: var(--muted); font-size: 18px; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.stats { display: flex; flex-wrap: wrap; gap: 32px; margin: 42px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); }
.stats dt { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-size: 20px; font-weight: 600; }

.feature-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 48px; }
.feature-grid article { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.feature-grid h3 { margin: 0 0 8px; font-size: 16px; }
.feature-grid p { margin: 0; color: var(--muted); font-size: 14px; }

.wall-head { margin-bottom: 24px; }
.wall-head h1 { margin: 0 0 4px; }
.post-stream { display: flex; flex-direction: column; gap: 28px; }
.post-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.post-card h2 { margin: 0 0 6px; font-size: 24px; }
.post-meta { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.post-summary { margin: 0 0 16px; color: var(--muted); font-size: 17px; }
.post-body { margin-bottom: 18px; }

.rich-text img { max-width: 100%; height: auto; border-radius: 8px; }
.rich-text blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--muted); }
.rich-text pre { background: var(--bg-soft); border: 1px solid var(--line); padding: 14px; border-radius: 10px; overflow-x: auto; }
.rich-text code { background: var(--bg-soft); padding: 2px 6px; border-radius: 5px; font-size: .92em; }
.rich-text table { width: 100%; border-collapse: collapse; }
.rich-text th, .rich-text td { border: 1px solid var(--line); padding: 8px; text-align: left; }

.asset { margin: 18px 0 0; }
.asset figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }
.protected-media { width: 100%; display: block; border-radius: 10px; background: #000; outline: none; }
.asset-audio .protected-media { border-radius: 999px; background: var(--bg-soft); }
.no-select .post-body, .no-select .post-card h2 { -webkit-user-select: none; user-select: none; }

#wall-sentinel { height: 60px; display: flex; align-items: center; justify-content: center; margin-top: 24px; }
#wall-sentinel .loading-label { color: var(--muted); font-size: 14px; opacity: 0; transition: opacity .2s; }
#wall-sentinel.busy .loading-label { opacity: 1; }

.temp-banner {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline;
  padding: 12px 16px; margin-bottom: 24px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid rgba(37, 99, 235, .28); font-size: 14px;
}
.cta-card { margin-top: 32px; padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }

.auth-card { max-width: 420px; margin: 40px auto; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.auth-card.wide { max-width: 620px; }
.auth-card h1 { margin: 0 0 20px; font-size: 26px; }
.auth-card p { font-size: 14px; }
.auth-card ul { padding-left: 18px; color: var(--muted); font-size: 13px; }
.auth-card label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.sm-input, .auth-card input[type=text], .auth-card input[type=password], .auth-card input[type=email] {
  width: 100%; padding: 11px 13px; margin-bottom: 6px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font: inherit;
}
.sm-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.helptext { display: block; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.form-error, .errorlist { color: var(--danger); font-size: 14px; list-style: none; padding: 0; }

.detail-list { margin: 0 0 24px; }
.detail-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 14px; }
.detail-list dd { margin: 0; font-weight: 500; }

.messages { list-style: none; max-width: var(--maxw); margin: 16px auto 0; padding: 0 20px; }
.message { padding: 11px 15px; border-radius: 10px; margin-bottom: 8px; font-size: 14px; background: var(--bg-soft); border: 1px solid var(--line); }
.message.success { border-color: rgba(21, 128, 61, .45); }
.message.error { border-color: rgba(217, 45, 32, .45); }

@media (max-width: 560px) {
  .site-header { padding: 12px 16px; }
  .site-nav { gap: 12px; font-size: 13px; }
  .post-card { padding: 18px; box-shadow: var(--shadow); }
}
