@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@500;600;700&family=ZCOOL+XiaoWei&family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
  --mx-crimson: #8b1519;
  --mx-crimson-deep: #4a0c10;
  --mx-ink: #1a100f;
  --mx-gold: #c9a227;
  --mx-gold-soft: #e8d48b;
  --mx-paper: #f7f1e8;
  --mx-paper-2: #ebe2d4;
  --mx-muted: #6e5c52;
  --mx-white: #fffaf3;
  --mx-line: rgba(139, 21, 25, 0.16);
  --mx-max: 1120px;
  --mx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mx-display: "Noto Serif SC", "ZCOOL XiaoWei", "Songti SC", serif;
  --mx-body: "Source Sans 3", "Noto Sans SC", sans-serif;
}

.mx-page {
  background: var(--mx-paper);
  color: var(--mx-ink);
  font-family: var(--mx-body);
}

.mx-page .site-nav.on-dark:not(.scrolled) {
  color: var(--mx-white);
}

.mx-page .site-nav.on-dark:not(.scrolled) .brand {
  color: var(--mx-white);
}

.mx-hero {
  position: relative;
  min-height: min(100vh, 920px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: var(--mx-white);
  isolation: isolate;
}

.mx-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(26, 16, 15, 0.25) 0%, rgba(74, 12, 16, 0.55) 42%, rgba(26, 16, 15, 0.92) 100%),
    url("../images/marx-hero.jpg") center / cover no-repeat;
  transform: scale(1.06);
  animation: mx-ken 28s var(--mx-ease) infinite alternate;
  z-index: -2;
}

.mx-hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 18% 70%, rgba(201, 162, 39, 0.22), transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 20%, rgba(139, 21, 25, 0.35), transparent 55%);
  z-index: -1;
  pointer-events: none;
}

.mx-hero-particles {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.mx-hero-particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--mx-gold-soft);
  opacity: 0;
  animation: mx-float 9s linear infinite;
}

.mx-hero-particles span:nth-child(1) { left: 12%; animation-delay: 0s; }
.mx-hero-particles span:nth-child(2) { left: 28%; animation-delay: 1.4s; }
.mx-hero-particles span:nth-child(3) { left: 46%; animation-delay: 2.8s; }
.mx-hero-particles span:nth-child(4) { left: 63%; animation-delay: 0.8s; }
.mx-hero-particles span:nth-child(5) { left: 78%; animation-delay: 3.5s; }
.mx-hero-particles span:nth-child(6) { left: 88%; animation-delay: 2.1s; }

.mx-hero-inner {
  width: min(var(--mx-max), calc(100% - 48px));
  margin: 0 auto;
  padding: calc(var(--nav-h, 64px) + 72px) 0 72px;
}

.mx-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  animation: mx-rise 1s var(--mx-ease) both;
}

.mx-brand-mark img {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 8px 24px rgba(201, 162, 39, 0.35));
  animation: mx-pulse 4.5s ease-in-out infinite;
}

.mx-brand-mark strong {
  font-family: var(--mx-display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.05;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.mx-brand-mark em {
  display: block;
  margin-top: 8px;
  font-family: var(--mx-body);
  font-style: normal;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--mx-gold-soft);
  opacity: 0.9;
}

.mx-hero h1 {
  max-width: 18ch;
  margin: 0 0 18px;
  font-family: var(--mx-display);
  font-size: clamp(1.55rem, 3.4vw, 2.35rem);
  font-weight: 600;
  line-height: 1.35;
  animation: mx-rise 1s var(--mx-ease) 0.12s both;
}

.mx-hero .lead {
  max-width: 42ch;
  margin: 0 0 28px;
  font-size: 1.08rem;
  line-height: 1.7;
  color: rgba(255, 250, 243, 0.86);
  animation: mx-rise 1s var(--mx-ease) 0.22s both;
}

.mx-hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  animation: mx-rise 1s var(--mx-ease) 0.32s both;
}

.mx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform 0.25s var(--mx-ease), background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.mx-btn:hover { transform: translateY(-2px); }

.mx-btn-primary {
  background: linear-gradient(135deg, var(--mx-gold) 0%, #a8871f 100%);
  color: #2a1a08;
  box-shadow: 0 12px 32px rgba(201, 162, 39, 0.35);
}

.mx-btn-primary:hover {
  box-shadow: 0 16px 40px rgba(201, 162, 39, 0.45);
}

.mx-btn-ghost {
  background: rgba(255, 250, 243, 0.08);
  border-color: rgba(255, 250, 243, 0.35);
  color: var(--mx-white);
  backdrop-filter: blur(8px);
}

.mx-btn-ghost:hover {
  background: rgba(255, 250, 243, 0.16);
}

.mx-section {
  padding: 88px 0;
}

.mx-section.tight { padding: 56px 0; }

.mx-wrap {
  width: min(var(--mx-max), calc(100% - 48px));
  margin: 0 auto;
}

.mx-eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mx-crimson);
}

.mx-section h2 {
  margin: 0 0 14px;
  font-family: var(--mx-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.mx-section .mx-lede {
  margin: 0 0 36px;
  max-width: 52ch;
  color: var(--mx-muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.mx-story {
  background:
    linear-gradient(180deg, #fffaf3 0%, var(--mx-paper-2) 100%);
}

.mx-story-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}

.mx-story-visual {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 360px;
  box-shadow: 0 28px 60px rgba(74, 12, 16, 0.18);
}

.mx-story-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 360px;
  transform: scale(1.04);
  transition: transform 1.2s var(--mx-ease);
}

.mx-story-visual:hover img { transform: scale(1.08); }

.mx-story-visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(transparent, rgba(74, 12, 16, 0.55));
  pointer-events: none;
}

.mx-chapters {
  display: grid;
  gap: 18px;
}

.mx-chapter {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  padding: 18px 18px 18px 14px;
  border-left: 3px solid transparent;
  border-radius: 0 12px 12px 0;
  background: rgba(255, 250, 243, 0.65);
  transition: border-color 0.3s, transform 0.3s var(--mx-ease), box-shadow 0.3s;
}

.mx-chapter:hover {
  border-left-color: var(--mx-crimson);
  transform: translateX(4px);
  box-shadow: 0 10px 28px rgba(74, 12, 16, 0.08);
}

.mx-chapter .num {
  font-family: var(--mx-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--mx-gold);
  line-height: 1.2;
}

.mx-chapter h3 {
  margin: 0 0 6px;
  font-family: var(--mx-display);
  font-size: 1.15rem;
}

.mx-chapter p {
  margin: 0;
  color: var(--mx-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.mx-band {
  position: relative;
  padding: 96px 0;
  color: var(--mx-white);
  overflow: hidden;
  isolation: isolate;
}

.mx-band-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(26, 16, 15, 0.88) 0%, rgba(74, 12, 16, 0.72) 48%, rgba(26, 16, 15, 0.82) 100%),
    url("../images/marx-network.jpg") center / cover no-repeat;
  z-index: -2;
  animation: mx-ken 32s var(--mx-ease) infinite alternate;
}

.mx-band h2 {
  color: var(--mx-white);
}

.mx-band .mx-lede {
  color: rgba(255, 250, 243, 0.78);
}

.mx-nodes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.mx-node {
  position: relative;
  padding: 22px 18px;
  border-radius: 14px;
  background: rgba(255, 250, 243, 0.08);
  border: 1px solid rgba(232, 212, 139, 0.22);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition: transform 0.35s var(--mx-ease), background 0.35s;
}

.mx-node::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--mx-gold), transparent);
  transform: translateX(-100%);
  animation: mx-scan 4.5s ease-in-out infinite;
}

.mx-node:nth-child(2)::before { animation-delay: 0.7s; }
.mx-node:nth-child(3)::before { animation-delay: 1.4s; }
.mx-node:nth-child(4)::before { animation-delay: 2.1s; }

.mx-node:hover {
  transform: translateY(-6px);
  background: rgba(255, 250, 243, 0.14);
}

.mx-node .flag {
  display: block;
  width: 28px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.mx-node strong {
  display: block;
  font-family: var(--mx-display);
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.mx-node span {
  font-size: 0.86rem;
  color: rgba(255, 250, 243, 0.7);
}

.mx-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.mx-feature {
  padding: 28px 24px;
  border-radius: 16px;
  background: var(--mx-white);
  border: 1px solid var(--mx-line);
  box-shadow: 0 14px 36px rgba(74, 12, 16, 0.06);
  transition: transform 0.35s var(--mx-ease), box-shadow 0.35s;
}

.mx-feature:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 48px rgba(74, 12, 16, 0.12);
}

.mx-feature .ico {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(139, 21, 25, 0.12), rgba(201, 162, 39, 0.18));
  color: var(--mx-crimson);
  font-family: var(--mx-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.mx-feature h3 {
  margin: 0 0 8px;
  font-family: var(--mx-display);
  font-size: 1.2rem;
}

.mx-feature p {
  margin: 0;
  color: var(--mx-muted);
  line-height: 1.65;
  font-size: 0.96rem;
}

.mx-download {
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, rgba(201, 162, 39, 0.14), transparent 50%),
    radial-gradient(ellipse 50% 60% at 0% 100%, rgba(139, 21, 25, 0.1), transparent 55%),
    var(--mx-paper);
}

.mx-dl-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  padding: 36px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 250, 243, 0.95), rgba(235, 226, 212, 0.9));
  border: 1px solid var(--mx-line);
  box-shadow: 0 30px 70px rgba(74, 12, 16, 0.12);
  overflow: hidden;
  position: relative;
}

.mx-dl-card::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  top: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.22), transparent 70%);
  animation: mx-pulse 5s ease-in-out infinite;
}

.mx-dl-card h2 { position: relative; }
.mx-dl-card .mx-lede { margin-bottom: 22px; position: relative; }

.mx-specs {
  position: relative;
  display: grid;
  gap: 10px;
}

.mx-spec {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--mx-line);
  font-size: 0.95rem;
}

.mx-spec span { color: var(--mx-muted); }
.mx-spec strong { font-weight: 650; text-align: right; }

.mx-quote {
  margin: 28px 0 0;
  padding: 18px 20px;
  border-left: 3px solid var(--mx-gold);
  background: rgba(139, 21, 25, 0.05);
  font-family: var(--mx-display);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--mx-ink);
}

.mx-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--mx-ease), transform 0.9s var(--mx-ease);
}

.mx-reveal.in {
  opacity: 1;
  transform: none;
}

.mx-delay-1 { transition-delay: 0.1s; }
.mx-delay-2 { transition-delay: 0.2s; }
.mx-delay-3 { transition-delay: 0.3s; }

@keyframes mx-ken {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
}

@keyframes mx-rise {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}

@keyframes mx-float {
  0% { transform: translateY(110vh) scale(0.6); opacity: 0; }
  15% { opacity: 0.7; }
  85% { opacity: 0.35; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

@keyframes mx-spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes mx-scan {
  0%, 100% { transform: translateX(-100%); opacity: 0; }
  40% { opacity: 1; }
  60% { transform: translateX(100%); opacity: 0; }
}

@keyframes mx-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}

@media (max-width: 900px) {
  .mx-story-grid,
  .mx-dl-card,
  .mx-features {
    grid-template-columns: 1fr;
  }

  .mx-nodes {
    grid-template-columns: repeat(2, 1fr);
  }

  .mx-hero-inner {
    padding-bottom: 56px;
  }

  .mx-brand-mark strong {
    font-size: clamp(2rem, 9vw, 3rem);
  }
}

@media (max-width: 560px) {
  .mx-nodes { grid-template-columns: 1fr; }
  .mx-dl-card { padding: 24px 18px; }
  .mx-hero .actions { width: 100%; }
  .mx-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .mx-hero-bg,
  .mx-band-bg,
  .mx-brand-mark img,
  .mx-node::before,
  .mx-dl-card::before,
  .mx-hero-particles span {
    animation: none !important;
  }

  .mx-reveal {
    opacity: 1;
    transform: none;
  }
}
