:root {
  color-scheme: light dark;
  --mf-bg: #f7f4ee;
  --mf-surface: #fffdf9;
  --mf-soft: #efebe2;
  --mf-text: #20231f;
  --mf-muted: #626a61;
  --mf-line: #ddd5c8;
  --mf-green: #136b59;
  --mf-gold: #b7782a;
  --mf-shadow: 0 16px 42px rgba(38, 31, 22, 0.09);
}

@media (prefers-color-scheme: dark) {
  :root {
    --mf-bg: #101612;
    --mf-surface: #18211d;
    --mf-soft: #202b26;
    --mf-text: #f1f5ee;
    --mf-muted: #b5beb3;
    --mf-line: #314037;
    --mf-green: #67d2ba;
    --mf-gold: #f1bf6a;
    --mf-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--mf-bg);
  color: var(--mf-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  line-height: 1.66;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.site-nav,
header nav.site-nav {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 20, 16, 0.68);
  color: #fff;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
body.mrfung-jekyll > header {
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
body.mrfung-jekyll .site-nav {
  position: sticky;
  background: rgba(12, 20, 16, 0.94);
}
.nav-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
}
.nav-links a:hover { color: #fff; }

.mf-page-hero {
  padding: 144px 0 66px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(8, 15, 12, 0.9), rgba(8, 15, 12, 0.62) 48%, rgba(8, 15, 12, 0.24)),
    url("../img/banner.jpg") center / cover no-repeat;
}
.mf-page-hero.home { min-height: 82vh; display: flex; align-items: flex-end; }
.mf-page-hero.compact { padding-bottom: 48px; }
.mf-hero-inner,
.section,
.footer-inner,
body.mrfung-jekyll #container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}
.mf-kicker {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mf-page-hero h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2.8rem, 9vw, 7.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}
.page-intro {
  padding: 112px 0 36px;
  border-bottom: 1px solid var(--mf-line);
  background:
    linear-gradient(135deg, rgba(19, 107, 89, 0.14), transparent 48%),
    var(--mf-soft);
}
.page-kicker {
  margin: 0 0 8px;
  color: var(--mf-gold);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-intro h1 {
  max-width: 850px;
  margin: 0;
  color: var(--mf-text);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
}
.intro-copy {
  max-width: 880px;
  margin-top: 18px;
}
.intro-copy p { margin: 0; }
.mf-hero-copy {
  max-width: 760px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.04rem, 2vw, 1.24rem);
}
.mf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
}
.button.primary {
  color: #102219;
  border-color: transparent;
  background: #f4c76f;
}
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--mf-line); }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
h2,
.section-heading h2 {
  margin: 0;
  color: var(--mf-text);
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.12;
  letter-spacing: 0;
}
h3 {
  margin: 24px 0 8px;
  color: var(--mf-text);
  font-size: 1.35rem;
  line-height: 1.22;
  letter-spacing: 0;
}
p, li { color: var(--mf-muted); }
.section-heading p { max-width: 520px; margin: 0; }

.bilingual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.lang-card,
.feature,
.prose-card,
.contact-card,
.bio-item {
  padding: 22px;
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: var(--mf-surface);
  box-shadow: var(--mf-shadow);
}
.lang-card p,
.feature p,
.prose-card p,
.contact-card p {
  margin: 8px 0 0;
}
.lang-label,
.feature small,
.meta-line {
  color: var(--mf-gold);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.feature {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.feature a,
.prose-card a,
.contact-card a {
  color: var(--mf-green);
  font-weight: 800;
}
.profile-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: stretch;
}
.profile-copy {
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: var(--mf-surface);
  box-shadow: var(--mf-shadow);
}
.profile-copy h2 { max-width: 760px; }
.profile-copy .bilingual { margin-top: 18px; }
.profile-metrics,
.profile-aside {
  align-content: stretch;
}
.profile-metrics {
  grid-template-columns: 1fr;
}
.profile-aside {
  display: grid;
  gap: 12px;
}
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}
.about-main h2 { max-width: 720px; }
.about-main .bilingual { margin-top: 18px; }
.about-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.app-directory { display: grid; gap: 16px; }
.app-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: var(--mf-surface);
  box-shadow: var(--mf-shadow);
}
.app-card h3 {
  margin-top: 10px;
  font-size: clamp(2rem, 5vw, 3.2rem);
}
.app-card .bilingual { margin-top: 14px; }
.app-link-grid {
  display: grid;
  gap: 12px;
}
.app-link-grid a {
  display: block;
  padding: 16px;
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: var(--mf-soft);
}
.app-link-grid strong {
  display: block;
  color: var(--mf-text);
}
.app-link-grid span {
  display: block;
  margin-top: 4px;
  color: var(--mf-muted);
  font-size: 0.94rem;
}
.bio { display: grid; gap: 16px; }
.bio-list,
.metric-grid,
.mf-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.bio-item strong,
.metric strong,
.mf-list-item strong {
  display: block;
  color: var(--mf-text);
}
.bio-item span,
.metric span,
.mf-list-item span {
  color: var(--mf-muted);
  font-size: 0.94rem;
}
.metric {
  padding: 16px;
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: var(--mf-soft);
}
.prose-card,
.contact-card { padding: clamp(24px, 6vw, 44px); }
.callout {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: var(--mf-soft);
}
.content-stack { display: grid; gap: 18px; }
.mf-list { margin-top: 24px; }
.mf-list-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: var(--mf-soft);
}

.site-footer,
body.mrfung-jekyll footer {
  margin: 0;
  padding: 34px 0;
  border-top: 1px solid var(--mf-line);
  color: var(--mf-muted);
  background: var(--mf-soft);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-inner a {
  color: var(--mf-text);
  font-weight: 800;
}

body.mrfung-jekyll #container {
  padding: 56px 0 72px;
  overflow: visible;
}
body.mrfung-jekyll #main {
  float: none;
  width: auto;
  margin: 0;
  line-height: 1.72;
}
body.mrfung-jekyll #main article {
  overflow: hidden;
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: var(--mf-surface);
  box-shadow: var(--mf-shadow);
}
body.mrfung-jekyll article .article-content {
  padding: clamp(24px, 5vw, 44px);
  color: var(--mf-text);
  font-size: 1rem;
}
@media (max-width: 820px) {
  .site-nav,
  header nav.site-nav { position: absolute; }
  body.mrfung-jekyll .site-nav { position: relative; }
  .nav-inner {
    min-height: auto;
    align-items: center;
    justify-content: center;
    padding: 14px 0;
  }
  .nav-links { justify-content: center; gap: 12px; }
  .mf-page-hero { padding-top: 178px; }
  .page-intro { padding-top: 148px; }
  .section { padding: 54px 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .feature-grid,
  .profile-panel,
  .about-layout,
  .about-metrics,
  .app-card,
  .bilingual,
  .bio-list,
  .metric-grid,
  .mf-list,
  .mf-list-item {
    grid-template-columns: 1fr;
  }
}
