/* ==========================================================================
   EigenFlow — Brand styles
   Palette: Navy #0B1F3A, Slate #6B7280, Off-white #F8FAFC, Accent #22C55E
   ========================================================================== */

:root {
  --navy: #0B1F3A;
  --slate: #6B7280;
  --slate-light: #9CA3AF;
  --off-white: #F8FAFC;
  --white: #FFFFFF;
  --accent: #22C55E;
  --accent-hover: #16A34A;
  --bg: #0B1F3A;
  --bg-elevated: #112240;
  --bg-card: rgba(17, 34, 64, 0.6);
  --text: #F8FAFC;
  --text-muted: #9CA3AF;
  --border: rgba(248, 250, 252, 0.08);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  --max-width: 1100px;
  --section-padding: clamp(3rem, 8vw, 5rem);
  --font-en: 'Inter', system-ui, -apple-system, sans-serif;
  --font-zh: 'PingFang SC', 'Noto Sans SC', 'Inter', system-ui, sans-serif;
}

/* Light theme */
.theme-light {
  --bg: #F0F4F8;
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --text: #0B1F3A;
  --text-muted: #6B7280;
  --border: rgba(11, 31, 58, 0.1);
  --shadow: 0 4px 24px rgba(11, 31, 58, 0.06);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  font-family: var(--font-zh);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.theme-light .logo-icon { color: var(--navy); }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 31, 58, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.theme-light .navbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: var(--border);
}
.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.875rem clamp(1.25rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--text); }
.logo-icon { color: var(--accent); flex-shrink: 0; }
.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-link {
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.lang-toggle:hover { color: var(--text); border-color: var(--text-muted); }
.lang-zh.active, .lang-en.active { color: var(--accent); font-weight: 600; }
.theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--text); }
.theme-dark .icon-light { display: none; }
.theme-light .icon-dark { display: none; }
.theme-dark .icon-dark { display: inline; }
.theme-light .icon-light { display: inline; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background: var(--accent);
  color: var(--navy);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--navy); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
}
.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.mobile-menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  .nav-menu {
    position: fixed;
    top: 57px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s, opacity 0.25s, visibility 0.25s;
  }
  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-links { flex-direction: column; align-items: flex-start; }
  .nav-actions { flex-wrap: wrap; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: var(--section-padding) 0;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, var(--bg) 0%, transparent 50%),
    linear-gradient(90deg, transparent 0%, rgba(34, 197, 94, 0.03) 100%);
  pointer-events: none;
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(34, 197, 94, 0.04) 0%, transparent 50%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-title {
  margin: 0 0 1rem;
  font-family: var(--font-en);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--text);
}
.hero-subtitle {
  margin: 0 0 2rem;
  max-width: 36em;
  font-size: 1.0625rem;
  color: var(--text-muted);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  padding: var(--section-padding) 0;
}
.section-alt {
  background: var(--bg-elevated);
}
.section-header {
  margin-bottom: 2.5rem;
  max-width: 38em;
}
.section-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-en);
  font-weight: 600;
  font-size: clamp(1.375rem, 2.5vw, 1.5rem);
  letter-spacing: -0.02em;
  color: var(--text);
}
.section-desc {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
}

/* ==========================================================================
   About — Feature cards
   ========================================================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.feature-card:hover { border-color: rgba(34, 197, 94, 0.2); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15); }
.theme-light .feature-card:hover { box-shadow: 0 8px 32px rgba(11, 31, 58, 0.08); }
.feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  color: var(--accent);
}
.feature-icon svg { width: 100%; height: 100%; }
.feature-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.feature-desc {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ==========================================================================
   Framework — Timeline
   ========================================================================== */
.timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0;
  margin: 0 -0.5rem;
}
.timeline-item {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 200px;
  position: relative;
  padding: 0 0.5rem;
}
.timeline-marker {
  width: 10px;
  height: 10px;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.9;
}
.timeline-connector {
  flex: 0 0 20px;
  min-width: 12px;
  height: 2px;
  margin-top: 4px;
  background: var(--border);
  align-self: center;
}
.timeline-title {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}
.timeline-desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}
@media (max-width: 640px) {
  .timeline-item { max-width: none; flex: 1 1 100%; }
  .timeline-connector { flex: 0 0 0; width: 0; height: 12px; margin: 0 0 0 4px; border-left: 2px solid var(--border); }
  .timeline { flex-direction: column; }
}

/* ==========================================================================
   Philosophy cards
   ========================================================================== */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.philosophy-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}
.philosophy-card:hover { border-color: rgba(34, 197, 94, 0.15); }
.philosophy-number {
  display: block;
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.9;
  margin-bottom: 0.5rem;
}
.philosophy-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.philosophy-desc {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ==========================================================================
   Disclosure
   ========================================================================== */
.section-disclosure { padding: var(--section-padding) 0; }
.disclosure-box {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  border-left: 4px solid var(--accent);
}
.disclosure-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ==========================================================================
   Dashboard preview
   ========================================================================== */
.dashboard-preview {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}
.dashboard-mockup {
  width: 100%;
  max-width: 900px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.mockup-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.mockup-dots {
  display: flex;
  gap: 6px;
}
.mockup-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--slate);
  opacity: 0.5;
}
.mockup-title {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.mockup-content {
  display: flex;
  min-height: 220px;
}
.mockup-sidebar {
  width: 56px;
  padding: 1rem 0.5rem;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mockup-nav-item {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
}
.mockup-nav-item.active { background: var(--accent); opacity: 0.6; }
.mockup-main {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.mockup-chart {
  height: 100px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
}
.mockup-grid {
  flex: 1;
  min-height: 60px;
  border-radius: 8px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 12px,
    var(--border) 12px,
    var(--border) 13px
  );
}
.dashboard-features {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.8;
}
.dashboard-features li { margin-bottom: 0.25rem; }

/* ==========================================================================
   Collaboration / Contact
   ========================================================================== */
.contact-block {
  max-width: 32em;
}
.contact-email, .contact-wechat {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--text-muted);
}
.contact-email a, .contact-wechat a { color: var(--accent); }
.contact-wechat { margin-bottom: 1.25rem; }
#wechatId { font-family: var(--font-en); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-copy {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 1.25rem;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.footer-links a:hover { color: var(--accent); }

/* Skip link for a11y */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--navy);
  font-weight: 500;
  border-radius: 6px;
  z-index: 200;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }
