/* Nanxi.app Landing — Sober, professional */
:root {
  --blue-900: #1a2332;
  --blue-800: #1e3a5f;
  --blue-700: #2563eb;
  --blue-600: #3b82f6;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;
  --white: #ffffff;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--gray-900);
  line-height: 1.6;
  background: var(--white);
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  z-index: 100;
  padding: 0 2rem;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue-700);
  text-decoration: none;
}
.nav-logo span { color: var(--gray-500); font-weight: 400; }
.nav-links { display: flex; gap: 2rem; list-style: none; order: 2; }
.nav-links a {
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--blue-700); }

/* Nav controls wrapper */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  order: 3;
}

/* Language dropdown */
.lang-dropdown {
  position: relative;
}
.lang-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--gray-700);
  font-family: inherit;
  transition: border-color 0.2s;
}
.lang-dropdown-toggle:hover {
  border-color: var(--blue-700);
}
.lang-flag {
  font-size: 1rem;
  line-height: 1;
}
.lang-arrow {
  font-size: 0.65rem;
  opacity: 0.6;
}
.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  margin-top: 0.3rem;
  min-width: 80px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 200;
  list-style: none;
  padding: 0.25rem 0;
}
.lang-dropdown-menu.open {
  display: block;
}
.lang-dropdown-menu li {
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--gray-700);
  transition: background 0.15s;
}
.lang-dropdown-menu li:hover {
  background: var(--gray-100);
}
.lang-dropdown-menu li.active {
  color: var(--blue-700);
  font-weight: 600;
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: border-color 0.2s;
}
.theme-toggle:hover {
  border-color: var(--blue-700);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  padding: 7rem 2rem 2.5rem;
  text-align: center;
  background: linear-gradient(180deg, var(--blue-50) 0%, var(--white) 100%);
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--blue-900);
  margin-bottom: 1.2rem;
  line-height: 1.2;
}
.hero p {
  font-size: 1.2rem;
  color: var(--gray-500);
  max-width: 640px;
  margin: 0 auto 0;
}
.btn-primary {
  display: inline-block;
  background: var(--blue-700);
  color: var(--white);
  padding: 0.85rem 2.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--blue-800); }

/* Features */
.features {
  padding: 3rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.features h2 {
  text-align: center;
  font-size: 2rem;
  color: var(--blue-900);
  margin-bottom: 2rem;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.feature-card {
  padding: 2rem 1.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  text-align: center;
  transition: box-shadow 0.2s;
}
.feature-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}
.feature-card h3 {
  font-size: 1.05rem;
  color: var(--blue-900);
  margin-bottom: 0.6rem;
}
.feature-card p {
  font-size: 0.88rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* Chatbot IA Highlight */
.chatbot-highlight {
  padding: 3rem 2rem;
  background: var(--blue-50);
}
.chatbot-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
.chatbot-icon {
  font-size: 3.5rem;
  margin-bottom: 1.2rem;
}
.chatbot-highlight h2 {
  font-size: 2rem;
  color: var(--blue-900);
  margin-bottom: 1.2rem;
}
.chatbot-highlight p {
  font-size: 1.1rem;
  color: var(--gray-700);
  line-height: 1.7;
}

/* More Features */
.more-features {
  padding: 4rem 2rem;
  max-width: 700px;
  margin: 0 auto;
}
.more-features h2 {
  text-align: center;
  font-size: 1.6rem;
  color: var(--blue-900);
  margin-bottom: 2rem;
}
.more-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
}
.more-feature-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  color: var(--gray-700);
}
.check-icon {
  color: var(--blue-700);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Verticals */
.verticals {
  padding: 3rem 2rem;
  background: var(--gray-100);
}
.verticals h2 {
  text-align: center;
  font-size: 2rem;
  color: var(--blue-900);
  margin-bottom: 0.6rem;
}
.verticals-subtitle {
  text-align: center;
  font-size: 1.05rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}
.verticals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  max-width: 900px;
  margin: 0 auto;
}
.vertical-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.2rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--gray-700);
  transition: box-shadow 0.2s;
}
.vertical-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.vertical-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* About */
.about {
  padding: 3rem 2rem;
}
.about-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
.about h2 {
  font-size: 2rem;
  color: var(--blue-900);
  margin-bottom: 1.5rem;
}
.about p {
  font-size: 1rem;
  color: var(--gray-700);
  margin-bottom: 1rem;
}

/* Contact */
.contact {
  padding: 3rem 2rem;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
.contact h2 {
  font-size: 2rem;
  color: var(--blue-900);
  margin-bottom: 1.5rem;
}
.contact p {
  font-size: 1rem;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}
.contact a {
  color: var(--blue-700);
  text-decoration: none;
}
.contact a:hover { text-decoration: underline; }

/* Footer */
.footer {
  background: var(--blue-900);
  color: var(--gray-300);
  padding: 2rem 2rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
}
.footer-links { display: flex; gap: 1.5rem; list-style: none; }
.footer-links a {
  color: var(--gray-300);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--white); }
.footer-copy {
  width: 100%;
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
}
.footer-author {
  width: 100%;
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}
.footer-author a {
  color: var(--gray-300);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-author a:hover { color: var(--white); }

/* Legal pages */
.legal {
  padding: 8rem 2rem 4rem;
  max-width: 800px;
  margin: 0 auto;
}
.legal h1 {
  font-size: 2rem;
  color: var(--blue-900);
  margin-bottom: 0.5rem;
}
.legal .date {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}
.legal h2 {
  font-size: 1.3rem;
  color: var(--blue-900);
  margin: 2rem 0 0.8rem;
}
.legal p, .legal li {
  color: var(--gray-700);
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}
.legal ul { padding-left: 1.5rem; }

/* Responsive */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }

  /* Mobile nav */
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    flex-direction: column;
    background: var(--white);
    border-bottom: 1px solid var(--gray-300);
    padding: 1rem 2rem;
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 0.6rem 0; }

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

  .more-features-grid {
    grid-template-columns: 1fr;
  }

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

  .footer-inner { flex-direction: column; text-align: center; }
}

/* ========== Dark Mode ========== */
[data-theme="dark"] {
  --blue-900: #e2e8f0;
  --blue-800: #93c5fd;
  --blue-700: #60a5fa;
  --blue-600: #3b82f6;
  --blue-100: #1e293b;
  --blue-50: #0f172a;
  --gray-900: #f1f5f9;
  --gray-700: #cbd5e1;
  --gray-500: #94a3b8;
  --gray-300: #334155;
  --gray-100: #1e293b;
  --white: #0f172a;
}

/* Dark mode overrides for elements that need explicit styling */
[data-theme="dark"] .nav {
  border-bottom-color: #334155;
}
[data-theme="dark"] .feature-card:hover {
  box-shadow: 0 4px 20px rgba(255,255,255,0.05);
}
[data-theme="dark"] .vertical-card:hover {
  box-shadow: 0 2px 12px rgba(255,255,255,0.04);
}
[data-theme="dark"] .nav-toggle span {
  background: #cbd5e1;
}
[data-theme="dark"] .footer {
  background: #0c1220;
}
[data-theme="dark"] .footer-logo {
  color: #e2e8f0;
}
[data-theme="dark"] .footer-links a {
  color: #94a3b8;
}
[data-theme="dark"] .footer-links a:hover {
  color: #e2e8f0;
}
[data-theme="dark"] .footer-copy {
  border-top-color: rgba(255,255,255,0.08);
  color: #64748b;
}
[data-theme="dark"] .contact a {
  color: #60a5fa;
}
[data-theme="dark"] .lang-dropdown-menu {
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
