/* ════════════════════════════════════════════════════════════════════════
 * MiracleFarms · Brand System v1
 * Drop-in CSS — append to your existing site.css (or import after it).
 *
 * Tokens use --mf-* prefix to avoid collisions. If you already use
 * --accent / --ink etc., the component classes below also work standalone.
 * ════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Tokens · color ─────────────────────────────────────────────────── */
  --mf-bg:           #faf7f0;     /* page bg, off-white */
  --mf-bg-soft:      #f1ead7;     /* card / row hover */
  --mf-bg-card:      #fffcf4;     /* card */
  --mf-ink:          #2c2a26;     /* primary text */
  --mf-ink-soft:     rgba(44,42,38,0.70);
  --mf-ink-faint:    rgba(44,42,38,0.45);
  --mf-ink-ghost:    rgba(44,42,38,0.28);
  --mf-rule:         rgba(44,42,38,0.14);
  --mf-rule-soft:    rgba(44,42,38,0.08);
  --mf-accent:       #3a5a40;     /* deep green — main mark, links */
  --mf-accent-soft:  #688f4e;     /* soft green — accent strokes, status pills */
  --mf-tag-bg:       rgba(104,143,78,0.12);
  --mf-warm:         #b08d3a;     /* amber — wip badges only */

  /* ── Tokens · type ──────────────────────────────────────────────────── */
  --mf-serif: "Source Serif 4","Source Serif Pro","Noto Serif SC","Source Han Serif SC",Georgia,"Songti SC",serif;
  --mf-sans:  "Inter",-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  --mf-mono:  "IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

/* ════════════════════════════════════════════════════════════════════════
 * Brand mark
 * ════════════════════════════════════════════════════════════════════════ */

.mf-mark { display: inline-block; vertical-align: middle; flex-shrink: 0; }

.mf-brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mf-serif); font-weight: 600;
  color: var(--mf-ink); letter-spacing: 0;
  text-decoration: none;
}
.mf-brand em { font-style: italic; font-weight: 400; }

/* ════════════════════════════════════════════════════════════════════════
 * Navbar
 * ════════════════════════════════════════════════════════════════════════ */

.mf-nav {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px;
  background: var(--mf-bg);
  border-bottom: 1px solid var(--mf-rule-soft);
  font-family: var(--mf-sans);
}
.mf-nav .mf-brand { font-size: 17px; }
.mf-nav .mf-nav-tag {
  font-family: var(--mf-mono); font-size: 10px; color: var(--mf-ink-faint);
  letter-spacing: 0.10em; text-transform: uppercase;
  padding-left: 12px; border-left: 1px solid var(--mf-rule);
}
.mf-nav .mf-nav-links {
  margin-left: auto;
  display: flex; gap: 18px;
  font-size: 13px;
}
.mf-nav .mf-nav-links a {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--mf-ink-soft); text-decoration: none;
  transition: color 0.15s;
}
.mf-nav .mf-nav-links a:hover { color: var(--mf-accent); }
.mf-nav .mf-nav-links svg { color: var(--mf-accent-soft); }
@media (max-width: 720px) {
  .mf-nav .mf-nav-tag,
  .mf-nav .mf-nav-links { display: none; }
}

/* ════════════════════════════════════════════════════════════════════════
 * Hero · Editorial cover (Hero C)
 * ════════════════════════════════════════════════════════════════════════ */

.mf-hero {
  background: var(--mf-bg);
  border-bottom: 1px solid var(--mf-rule-soft);
}
.mf-hero-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 56px 32px 40px;
}
.mf-hero .mf-hero-tag {
  font-family: var(--mf-mono); font-size: 11px;
  letter-spacing: 0.14em; color: var(--mf-ink-faint);
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 10px;
  padding-bottom: 18px;
}
.mf-hero .mf-hero-tag::before,
.mf-hero .mf-hero-tag::after {
  content: ""; height: 1px; background: var(--mf-rule); width: 24px;
}
.mf-hero .mf-hero-tag::after { width: 60px; }
.mf-hero .mf-hero-row {
  display: flex; align-items: flex-end; gap: 22px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.mf-hero h1 {
  margin: 0;
  font-family: var(--mf-serif); font-weight: 600;
  font-size: 76px;
  line-height: 0.98; letter-spacing: 0;
  color: var(--mf-ink);
}
.mf-hero h1 .am { font-style: italic; font-weight: 400; }
.mf-hero .mf-hero-sub {
  font-family: var(--mf-serif); font-style: italic;
  font-size: 18px; color: var(--mf-ink-soft);
  line-height: 1.5; max-width: 580px; margin: 0 0 6px;
}
.mf-hero .mf-hero-sub-mini {
  font-family: var(--mf-sans); font-size: 14px;
  color: var(--mf-ink-faint); line-height: 1.6;
  max-width: 580px; margin: 0;
}
.mf-hero .mf-hero-meta {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-family: var(--mf-mono); font-size: 11px;
  color: var(--mf-ink-faint); letter-spacing: 0.10em;
  text-transform: uppercase;
  margin: 22px 0 14px;
  padding-top: 14px; border-top: 1px solid var(--mf-rule-soft);
}
.mf-hero .mf-hero-meta .mf-dot { color: var(--mf-ink-ghost); }
.mf-hero .mf-hero-meta .mf-now { color: var(--mf-accent); }
.mf-hero .mf-hero-pills {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-family: var(--mf-sans); font-size: 13px;
}
.mf-hero .mf-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 4px;
  background: var(--mf-bg-card); border: 1px solid var(--mf-rule);
  color: var(--mf-ink-soft); text-decoration: none;
}
.mf-hero .mf-pill.primary {
  background: var(--mf-accent); border-color: var(--mf-accent);
  color: var(--mf-bg);
}
.mf-hero .mf-pill:hover { border-color: var(--mf-accent-soft); }
@media (max-width: 720px) {
  .mf-hero-inner { padding: 36px 20px 24px; }
  .mf-hero .mf-hero-row { gap: 14px; }
  .mf-hero .mf-hero-row svg { width: 56px; height: 56px; }
  .mf-hero h1 { font-size: 48px; }
}
@media (max-width: 420px) {
  .mf-hero h1 { font-size: 44px; }
}

/* ════════════════════════════════════════════════════════════════════════
 * Distribution constellation
 *   ─ .mf-const          → hero-level (5 nodes side by side)
 *   ─ .mf-const-strip    → footer-level (chip row)
 *   ─ data-status="live" / "pending" / "archive" → state switch
 * ════════════════════════════════════════════════════════════════════════ */

.mf-const {
  margin: 28px 0;
  padding: 24px 26px;
  background: var(--mf-bg-card);
  border: 1px solid var(--mf-rule); border-radius: 4px;
}
.mf-const-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mf-mono); font-size: 11px;
  letter-spacing: 0.14em; color: var(--mf-ink-faint);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.mf-const-head .mf-const-r { color: var(--mf-accent-soft); }
.mf-const-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
@media (max-width: 720px) { .mf-const-grid { grid-template-columns: repeat(2, 1fr); } }

.mf-ch-node {
  appearance: none;
  border: 1px solid var(--mf-rule); border-radius: 4px;
  padding: 14px 14px 12px;
  background: var(--mf-bg);
  display: flex; flex-direction: column; gap: 6px;
  font-family: var(--mf-sans);
  text-decoration: none; color: inherit;
  text-align: left;
}
.mf-ch-node:is(button) { cursor: pointer; }
.mf-ch-node:is(button):hover { background: var(--mf-bg-soft); }
.mf-ch-node:is(button):focus-visible,
.mf-ch-chip:is(button):focus-visible,
.mf-inline-link:focus-visible {
  outline: 2px solid var(--mf-accent-soft);
  outline-offset: 3px;
}
.mf-ch-node .mf-ch-top {
  display: flex; align-items: center; justify-content: space-between;
}
.mf-ch-node .mf-ch-ico {
  width: 22px; height: 22px; color: var(--mf-ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.mf-ch-node .mf-ch-status {
  font-family: var(--mf-mono); font-size: 9px;
  letter-spacing: 0.08em; padding: 1px 5px; border-radius: 2px;
  text-transform: uppercase;
  background: var(--mf-bg-soft); color: var(--mf-ink-faint);
  border: 1px solid var(--mf-rule);
}
.mf-ch-node .mf-ch-name {
  font-family: var(--mf-serif); font-weight: 600; font-size: 14px;
  color: var(--mf-ink); line-height: 1.2;
}
.mf-ch-node .mf-ch-role {
  font-family: var(--mf-sans); font-size: 11.5px;
  color: var(--mf-ink-soft); line-height: 1.45;
}

/* MAIN node — black status */
.mf-ch-node[data-status="main"] .mf-ch-status {
  background: var(--mf-ink); color: var(--mf-bg); border-color: var(--mf-ink);
}

/* LIVE — green accent */
.mf-ch-node[data-status="live"] {
  background: var(--mf-bg-soft); border-color: var(--mf-accent-soft);
}
.mf-ch-node[data-status="live"] .mf-ch-ico { color: var(--mf-accent); }
.mf-ch-node[data-status="live"] .mf-ch-status {
  background: var(--mf-accent); color: var(--mf-bg); border-color: var(--mf-accent);
}

/* PENDING — dimmed, dashed */
.mf-ch-node[data-status="pending"] {
  opacity: 0.72;
  border-style: dashed;
}
.mf-ch-node[data-status="pending"] .mf-ch-status::before {
  content: "◌ "; opacity: 0.7;
}

.mf-const-foot {
  margin-top: 18px;
  padding-top: 14px; border-top: 1px solid var(--mf-rule-soft);
  display: flex; gap: 16px; align-items: center;
  font-family: var(--mf-mono); font-size: 11px;
  color: var(--mf-ink-faint); letter-spacing: 0.04em;
}
.mf-const-foot .mf-const-foot-r { color: var(--mf-ink); }

/* Footer chip strip */
.mf-const-strip {
  display: flex; flex-wrap: nowrap; gap: 8px; align-items: center;
  padding: 18px 22px;
  font-family: var(--mf-sans);
}
/* Tight widths: keep one line, drop chip labels to icons. */
@media (max-width: 760px) {
  .mf-const-strip { gap: 6px; padding: 16px 14px; }
  .mf-ch-chip span { display: none; }
  .mf-ch-chip { padding: 6px 8px; }
}
.mf-ch-chip {
  appearance: none;
  display: inline-flex; align-items: center; gap: 6px;
  flex: 0 0 auto;
  padding: 5px 10px; border-radius: 4px;
  border: 1px solid var(--mf-rule);
  font-family: var(--mf-mono); font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--mf-ink-soft); background: var(--mf-bg-card);
  text-decoration: none;
}
.mf-ch-chip:is(button) { cursor: pointer; }
.mf-ch-chip svg { width: 13px; height: 13px; flex: 0 0 auto; }
.mf-ch-chip[data-status="live"] {
  background: var(--mf-accent); color: var(--mf-bg); border-color: var(--mf-accent);
}
.mf-ch-chip[data-status="live"]:hover {
  background: #2d4732;
  border-color: #2d4732;
}
.mf-ch-chip[data-status="pending"] {
  color: var(--mf-ink-faint); border-style: dashed;
}

.site-foot {
  border-top: 1px solid var(--mf-rule-soft);
  background: var(--mf-bg);
}
.site-foot .mf-const-strip {
  max-width: 1100px;
  margin: 0 auto;
  justify-content: center;
}
/* Discreet private-notes entry: quiet by default, clearer on hover/focus. */
.mf-foot-quiet:hover,
.mf-foot-quiet:focus-visible {
  opacity: .85 !important;
}

.mf-inline-link {
  appearance: none;
  border: 0;
  border-radius: 3px;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}
.mf-inline-link:hover {
  background: var(--rule-soft);
  text-decoration-color: var(--ink-faint);
}

/* WeChat QR dialog */
.mf-wechat-dialog {
  width: min(92vw, 380px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mf-ink);
}
.mf-wechat-dialog::backdrop {
  background: rgba(44,42,38,0.38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.mf-wechat-card {
  position: relative;
  padding: 26px 26px 24px;
  border: 1px solid var(--mf-rule);
  border-radius: 8px;
  background: var(--mf-bg-card);
  box-shadow: 0 24px 80px rgba(44,42,38,0.22);
  font-family: var(--mf-sans);
  text-align: center;
}
.mf-wechat-close {
  appearance: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--mf-ink-faint);
  cursor: pointer;
}
.mf-wechat-close:hover {
  background: var(--mf-bg-soft);
  color: var(--mf-ink);
}
.mf-wechat-close:focus-visible,
.mf-wechat-copy:focus-visible {
  outline: 2px solid var(--mf-accent-soft);
  outline-offset: 2px;
}
.mf-wechat-close svg {
  width: 18px;
  height: 18px;
}
.mf-wechat-kicker {
  margin: 0 0 4px;
  font-family: var(--mf-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mf-accent-soft);
}
.mf-wechat-title {
  margin: 0 0 18px;
  font-family: var(--mf-serif);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--mf-ink);
}
.mf-wechat-qr {
  display: flex;
  justify-content: center;
}
.mf-wechat-qr img {
  width: min(100%, 264px);
  height: auto;
  border: 1px solid var(--mf-rule);
  border-radius: 6px;
  background: #fff;
}
.mf-wechat-name {
  margin: 16px 0 2px;
  font-family: var(--mf-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--mf-ink);
}
.mf-wechat-note {
  margin: 0;
  color: var(--mf-ink-soft);
  font-size: 13px;
  line-height: 1.6;
}
.mf-wechat-copy {
  appearance: none;
  margin-top: 16px;
  padding: 7px 12px;
  border: 1px solid var(--mf-rule);
  border-radius: 4px;
  background: var(--mf-bg);
  color: var(--mf-ink-soft);
  cursor: pointer;
  font: 12px/1.2 var(--mf-sans);
}
.mf-wechat-copy:hover {
  background: var(--mf-bg-soft);
  color: var(--mf-ink);
}

@media (max-width: 420px) {
  .mf-wechat-card {
    padding: 24px 18px 20px;
  }
}

/* ════════════════════════════════════════════════════════════════════════
 * Page-link list (.mf-pagelink) — uses section icons in 24px viewBox
 * ════════════════════════════════════════════════════════════════════════ */

.mf-pagelink {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--mf-rule-soft);
  text-decoration: none; color: inherit;
}
.mf-pagelink:last-child { border-bottom: none; }
.mf-pagelink .mf-pl-ico {
  width: 20px; height: 20px; color: var(--mf-accent);
  flex: 0 0 auto;
}
.mf-pagelink .mf-pl-title {
  flex: 1; font-family: var(--mf-serif); font-size: 15px; color: var(--mf-ink);
}
.mf-pagelink .mf-pl-meta {
  font-family: var(--mf-mono); font-size: 10px; color: var(--mf-ink-faint);
  letter-spacing: 0.04em;
}
