/* ==========================================================================
   Stewart Zhang — Official Website Stylesheet (v3.0 - High Impact Visuals)
   Theme: Deep Tech Sapphire & Electric Cobalt Blue
   Aesthetics: Glassmorphism, Mountain Wave Canvas, 45-Node Neural Graph
   ========================================================================== */

:root {
  /* Color Tokens */
  --bg-dark: #040814;
  --bg-card: rgba(10, 18, 40, 0.75);
  --bg-card-hover: rgba(18, 32, 65, 0.9);
  
  --primary-cyan: #00d2ff;
  --primary-blue: #3b82f6;
  --primary-cobalt: #1d4ed8;
  --accent-gold: #f59e0b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --border-color: rgba(59, 130, 246, 0.3);
  --border-hover: rgba(0, 210, 255, 0.8);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-glow: 0 0 30px rgba(0, 210, 255, 0.3);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
}

body {
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  background-color: var(--bg-dark);
}

/* Canvas Background - Placed cleanly above body background but below content */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

main, header, footer {
  position: relative;
  z-index: 2;
}

/* Utility Containers */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
  position: relative;
}

.section-dark {
  background: rgba(4, 8, 20, 0.75);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

/* Typography & Headings */
.section-header {
  margin-bottom: 50px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
}

.section-header.text-center {
  justify-content: center;
  text-align: center;
}

.section-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary-cyan);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 650px;
  margin-top: 8px;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow), var(--shadow-card);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-cyan) 0%, var(--primary-blue) 100%);
  color: #070c1b;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0, 210, 255, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(0, 210, 255, 0.6);
  transform: translateY(-2px);
}

.btn-outline {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
  background: rgba(30, 58, 138, 0.4);
}

.btn-glow {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-cobalt) 100%);
  color: var(--text-main);
  border: 1px solid rgba(0, 210, 255, 0.5);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-glow:hover {
  box-shadow: 0 6px 25px rgba(0, 210, 255, 0.5);
  transform: translateY(-2px);
}

.btn-glow-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
  background: rgba(0, 210, 255, 0.15);
  color: var(--primary-cyan);
  border: 1px solid rgba(0, 210, 255, 0.4);
}

.btn-glow-sm:hover {
  background: rgba(0, 210, 255, 0.3);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-xs {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-cyan {
  background: rgba(0, 210, 255, 0.12);
  color: var(--primary-cyan);
  border: 1px solid rgba(0, 210, 255, 0.3);
}

.badge-cobalt {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-gold {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-arxiv {
  background: rgba(185, 28, 28, 0.2);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 16px 0;
  background: rgba(4, 8, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
}

.logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: #070c1b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--primary-cyan);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Tri-Lingual Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.2s ease;
}

.lang-btn.active, .lang-btn:hover {
  color: var(--primary-cyan);
}

.lang-divider {
  color: var(--text-dim);
  font-size: 0.7rem;
}

/* HERO SECTION */
.hero-section {
  padding: 160px 0 100px;
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.hero-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

.hero-glow-1 {
  width: 500px;
  height: 500px;
  background: rgba(0, 210, 255, 0.18);
  top: 10%;
  left: 20%;
}

.hero-glow-2 {
  width: 450px;
  height: 450px;
  background: rgba(59, 130, 246, 0.18);
  top: 30%;
  right: 15%;
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 10;
}

.hero-badge-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hero-title {
  font-size: 3.8rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-subtitle-gradient {
  display: block;
  font-size: 1.8rem;
  margin-top: 10px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary-cyan) 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 760px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

/* STRICT SINGLE-ROW 4-STATS COUNTER GRID */
.stats-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr 1fr !important;
  gap: 20px !important;
  margin-top: 40px !important;
  width: 100% !important;
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 500px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
}

.stat-card {
  background: rgba(10, 18, 40, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 22px 16px;
  backdrop-filter: blur(12px);
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--primary-cyan);
  transform: translateY(-4px);
  box-shadow: 0 4px 25px rgba(0, 210, 255, 0.25);
}

.stat-number {
  font-size: 2.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary-cyan);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* EXPERTISE TAGS MATRIX */
.expertise-tags-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  max-width: 960px;
  margin: 0 auto;
}

.expertise-tag {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s ease;
}

.expertise-tag i {
  color: var(--primary-cyan);
}

.expertise-tag:hover {
  border-color: var(--primary-cyan);
  background: rgba(30, 58, 138, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.2);
}

/* PROJECTS GRID */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.project-icon {
  font-size: 1.5rem;
  color: var(--primary-cyan);
}

.project-stars {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-gold);
}

.project-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 18px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.project-tech span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 3px 8px;
  background: rgba(30, 58, 138, 0.4);
  color: #93c5fd;
  border-radius: 4px;
}

.project-footer {
  display: flex;
  gap: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
}

.project-link {
  color: var(--primary-cyan);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-link:hover {
  text-decoration: underline;
}

/* PUBLICATIONS LIST */
.publications-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.paper-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.paper-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.paper-journal {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.paper-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
}

.paper-authors {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.paper-abstract {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.paper-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

/* CONSULTING & KNOWLEDGE GRAPH LAYOUT */
.consulting-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
  align-items: stretch;
}

@media (max-width: 992px) {
  .consulting-layout {
    grid-template-columns: 1fr;
  }
}

.consulting-cases {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.consulting-card {
  padding: 22px;
}

.case-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.case-category {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.metric-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  background: rgba(0, 210, 255, 0.15);
  color: var(--primary-cyan);
  border-radius: 4px;
}

.case-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.case-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Graph Visualizer Container */
.graph-box {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 520px;
}

.graph-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.graph-header h4 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-cyan);
}

.graph-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

#knowledge-graph {
  display: block;
  width: 100% !important;
  height: 440px !important;
  background: rgba(3, 7, 18, 0.95);
  border-radius: 12px;
  border: 1px solid rgba(0, 210, 255, 0.4);
  box-shadow: inset 0 0 20px rgba(0, 210, 255, 0.1);
  cursor: grab;
}

#knowledge-graph:active {
  cursor: grabbing;
}

.graph-legend {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 12px;
  justify-content: center;
}

/* INSIGHTS GRID */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.insight-card {
  display: flex;
  flex-direction: column;
}

.insight-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--primary-cyan);
  margin-bottom: 10px;
}

.insight-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.35;
}

.insight-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-grow: 1;
}

.insight-read-more {
  color: var(--primary-cyan);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* CONTACT SECTION */
.contact-box {
  padding: 40px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 40px;
}

@media (max-width: 850px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-title {
  font-size: 2rem;
  font-weight: 800;
  margin: 12px 0 16px;
}

.contact-lead {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.contact-direct {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 30px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(0, 210, 255, 0.1);
  color: var(--primary-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.contact-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
}

.contact-value {
  color: var(--text-main);
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
}

.contact-value:hover {
  color: var(--primary-cyan);
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-links a:hover {
  color: var(--primary-cyan);
  border-color: var(--primary-cyan);
  transform: translateY(-2px);
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
  background: rgba(4, 8, 20, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

.btn-block {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

/* Footer */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary-cyan);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title { font-size: 2.5rem; }
  .hero-subtitle-gradient { font-size: 1.3rem; }
  .nav-links { display: none; }
  .section-title { font-size: 1.8rem; }
}
