:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --bg-card: #161616;
  --fg: #f5f0e6;
  --fg-muted: #a09882;
  --fg-dim: #6b6455;
  --gold: #c9a84c;
  --gold-light: #e0c870;
  --red: #b33a3a;
  --red-muted: #8a2e2e;
  --ink: #1a1714;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 10rem;

  --max-width: 1200px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ---- NAV ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-sm) var(--space-md);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201, 168, 76, 0.1);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.logo-cn {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.15em;
}

.logo-en {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

/* ---- HERO ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-md);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.mist {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
}

.mist-1 {
  width: 600px;
  height: 600px;
  background: var(--gold);
  top: 10%;
  right: -10%;
}

.mist-2 {
  width: 400px;
  height: 400px;
  background: var(--red);
  bottom: 20%;
  left: -5%;
}

.mist-3 {
  width: 500px;
  height: 500px;
  background: var(--gold-light);
  top: 50%;
  left: 30%;
  opacity: 0.06;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
}

.hero-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.5rem;
}

.vertical-char {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  opacity: 0.2;
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--fg);
  margin-bottom: var(--space-md);
}

.hero-text h1 em {
  font-style: italic;
  color: var(--gold);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--fg-muted);
  max-width: 540px;
  margin-bottom: var(--space-lg);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(201, 168, 76, 0.15);
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(201, 168, 76, 0.2);
}

.hero-scroll {
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ---- SECTIONS COMMON ---- */
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md);
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: var(--space-sm);
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 2px;
}

section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--fg);
  margin-bottom: var(--space-md);
}

section h2 em {
  font-style: italic;
  color: var(--gold);
}

/* ---- PROBLEM ---- */
.problem {
  background: var(--bg-elevated);
}

.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.problem-left h2 {
  position: sticky;
  top: 100px;
}

.problem-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.problem-card {
  padding: var(--space-md);
  border-left: 2px solid var(--red-muted);
  background: rgba(179, 58, 58, 0.04);
}

.problem-icon {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--red);
  margin-bottom: var(--space-xs);
}

.problem-card h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--fg);
  margin-bottom: var(--space-xs);
}

.problem-card p {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* ---- HOW IT WORKS ---- */
.how-it-works {
  background: var(--bg);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.step {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.step-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
  opacity: 0.25;
  line-height: 1;
  min-width: 80px;
}

.step-content h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--fg);
  margin-bottom: var(--space-xs);
}

.step-content p {
  color: var(--fg-muted);
  font-size: 0.95rem;
  max-width: 560px;
}

/* ---- DYNASTIES ---- */
.dynasties {
  background: var(--bg-elevated);
}

.dynasties-intro {
  color: var(--fg-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin-bottom: var(--space-lg);
}

.dynasty-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.dynasty-card {
  background: var(--bg-card);
  padding: var(--space-md);
  border-top: 2px solid var(--gold);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dynasty-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-light);
}

.dynasty-period {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.dynasty-years {
  font-size: 0.75rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.dynasty-card p {
  color: var(--fg-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---- CREATORS ---- */
.creators {
  background: var(--bg);
}

.creators-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-xl);
  align-items: center;
}

.creators-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.creators-list li {
  padding-left: var(--space-sm);
  border-left: 2px solid var(--gold);
}

.creators-list li strong {
  display: block;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.2rem;
}

.creators-list li span {
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.creators-visual {
  display: flex;
  justify-content: center;
}

.pipeline-box {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: 4px;
}

.pipeline-step {
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 3px;
  white-space: nowrap;
}

.ps-1 {
  background: rgba(201, 168, 76, 0.1);
  color: var(--fg-muted);
  border: 1px solid rgba(201, 168, 76, 0.2);
}

.ps-2 {
  background: rgba(201, 168, 76, 0.2);
  color: var(--gold);
  border: 1px solid var(--gold);
}

.ps-3 {
  background: rgba(201, 168, 76, 0.1);
  color: var(--fg-muted);
  border: 1px solid rgba(201, 168, 76, 0.2);
}

.pipeline-arrow {
  color: var(--gold);
  font-size: 1.2rem;
  opacity: 0.5;
}

/* ---- PHILOSOPHY ---- */
.philosophy {
  background: var(--bg);
  border-top: 1px solid rgba(201, 168, 76, 0.08);
}

.philosophy-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.philosophy-content blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-style: italic;
  color: var(--gold);
  line-height: 1.4;
  margin-bottom: var(--space-md);
  position: relative;
}

.philosophy-content blockquote::before {
  content: '"';
  position: absolute;
  left: -0.5em;
  top: -0.2em;
  font-size: 3em;
  color: var(--gold);
  opacity: 0.15;
  font-family: var(--font-display);
}

.philosophy-content > p {
  color: var(--fg-muted);
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}

.philosophy-closing {
  font-weight: 500;
  color: var(--fg) !important;
  font-size: 1.1rem !important;
  margin-top: var(--space-md) !important;
}

/* ---- FOOTER ---- */
.site-footer {
  padding: var(--space-xl) var(--space-md) var(--space-md);
  border-top: 1px solid rgba(201, 168, 76, 0.08);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: var(--space-xs);
}

.footer-cn {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.15em;
}

.footer-en {
  font-size: 0.8rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.footer-tagline {
  color: var(--fg-dim);
  font-size: 0.9rem;
  margin-bottom: var(--space-lg);
}

.footer-bottom {
  font-size: 0.75rem;
  color: var(--fg-dim);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .hero-content {
    flex-direction: column;
    gap: var(--space-md);
  }

  .hero-vertical {
    flex-direction: row;
    gap: 0.5rem;
  }

  .vertical-char {
    font-size: 3rem;
  }

  .hero-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .stat-divider {
    width: 40px;
    height: 1px;
  }

  .problem-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .problem-left h2 {
    position: static;
  }

  .dynasty-grid {
    grid-template-columns: 1fr 1fr;
  }

  .creators-layout {
    grid-template-columns: 1fr;
  }

  .pipeline-box {
    flex-direction: column;
  }

  .pipeline-arrow {
    transform: rotate(90deg);
  }

  .step {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .step-number {
    font-size: 2rem;
    min-width: auto;
  }

  .section-inner {
    padding: var(--space-xl) var(--space-sm);
  }
}

/* ---- AUTH MODAL ---- */
.nav-actions { display: flex; align-items: center; gap: var(--space-sm); }
.nav-link { font-size: 0.85rem; color: var(--fg-muted); text-decoration: none; padding: 0.4rem 0.8rem; border-radius: 2px; transition: color 0.15s; }
.nav-link:hover { color: var(--gold); }
.nav-credits { font-size: 0.8rem; color: var(--gold); font-family: var(--font-display); }

.nav-btn {
  background: transparent;
  border: 1px solid rgba(201, 168, 76, 0.3);
  color: var(--fg-muted);
  padding: 0.4rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}
.nav-btn:hover { border-color: var(--gold); color: var(--gold); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.modal-box {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid rgba(201, 168, 76, 0.2);
  padding: var(--space-md);
  width: 400px;
  max-width: 90vw;
  border-radius: 4px;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--fg-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--fg); }

.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--fg);
  margin-bottom: var(--space-sm);
}

.auth-tabs { display: flex; gap: 0; margin-bottom: var(--space-md); border-bottom: 1px solid rgba(201, 168, 76, 0.15); }

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--fg-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.auth-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.auth-tab:hover { color: var(--fg-muted); }

.auth-form { display: flex; flex-direction: column; gap: 0.75rem; }

.auth-form input {
  background: var(--bg-card);
  border: 1px solid rgba(201, 168, 76, 0.15);
  color: var(--fg);
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  border-radius: 2px;
  transition: border-color 0.15s;
}
.auth-form input:focus { border-color: var(--gold); }

.auth-submit {
  background: var(--gold);
  color: var(--ink);
  border: none;
  padding: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s;
}
.auth-submit:hover { background: var(--gold-light); }

.auth-error { color: var(--red); font-size: 0.85rem; margin-top: 0.5rem; }
.auth-success { color: var(--gold); font-size: 0.85rem; margin-top: 0.5rem; }