/* ===== Design tokens ===== */
:root {
  --bg: #0a0e14;
  --bg-alt: #0d131c;
  --panel: #121a26;
  --panel-border: #223044;
  --text: #e7edf5;
  --text-dim: #93a2b8;
  --text-faint: #5c6c82;
  --accent: #00e5c7;
  --accent-soft: rgba(0, 229, 199, 0.12);
  --accent-2: #4da3ff;
  --amber: #ffb454;
  --green: #3ddc84;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  --radius: 10px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }

.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0, 229, 199, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 199, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
}

/* ===== Navbar ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
#navbar.scrolled {
  border-bottom-color: var(--panel-border);
  background: rgba(10, 14, 20, 0.92);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.logo-bracket { color: var(--accent); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-size: 0.92rem;
  color: var(--text-dim);
  font-weight: 500;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent) !important;
}
.nav-cta:hover { background: var(--accent-soft); }
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 12px;
  margin-left: 4px;
  border-left: 1px solid var(--panel-border);
}
.nav-user[hidden] { display: none; }
.nav-user-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.nav-user-label strong {
  color: var(--text);
  font-weight: 600;
}
.nav-logout {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.nav-logout:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 120px 24px 80px;
}
#netCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.55;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(0, 229, 199, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 28px;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  margin-bottom: 12px;
}
.hero-name-cn {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.55em;
  display: inline-block;
  margin-left: 6px;
}
.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  font-weight: 500;
  color: var(--accent-2);
  margin-bottom: 22px;
}
.hero-summary {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto 28px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 36px;
}
.cred-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 7px 14px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}
a.cred-badge:hover {
  border-color: var(--accent);
  color: var(--text);
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.btn {
  padding: 13px 26px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  display: inline-block;
}
.btn-primary {
  background: var(--accent);
  color: #06251f;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 229, 199, 0.25);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--text-faint);
  border-radius: 14px;
  z-index: 1;
}
.scroll-cue span {
  position: absolute;
  top: 8px; left: 50%;
  width: 4px; height: 8px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollcue 1.6s ease-in-out infinite;
}
@keyframes scrollcue {
  0% { opacity: 1; top: 8px; }
  100% { opacity: 0; top: 20px; }
}

/* ===== Stats strip ===== */
.stats-strip {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  background: var(--bg-alt);
}
.stats-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat-card {
  padding: 32px 24px;
  border-right: 1px solid var(--panel-border);
}
.stat-card:last-child { border-right: none; }
.stat-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.dot-green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-cyan { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.dot-amber { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.stat-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ===== Sections ===== */
.section { padding: 100px 24px; position: relative; z-index: 1; }
.section-alt { background: var(--bg-alt); }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: 44px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text p { color: var(--text-dim); margin-bottom: 18px; font-size: 1.02rem; }
.about-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 8px 24px;
}
.panel-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--panel-border);
  font-size: 0.9rem;
}
.panel-row:last-child { border-bottom: none; }
.panel-row span { color: var(--text-faint); }
.panel-row strong { color: var(--text); font-weight: 600; text-align: right; }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--panel-border);
}
.timeline-item {
  position: relative;
  margin-bottom: 56px;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker {
  position: absolute;
  left: -34px;
  top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 10px rgba(0,229,199,0.4);
}
.timeline-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 28px 28px 32px;
}
.company-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--panel-border);
}
.company-head h3 { font-size: 1.25rem; margin-bottom: 6px; }
.company-meta { color: var(--text-faint); font-size: 0.85rem; max-width: 520px; }
.company-meta a { color: var(--accent-2); }
.company-meta a:hover { text-decoration: underline; }
.company-duration {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--panel-border);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.role-progression {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.role-step {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-border);
  min-width: 160px;
}
.role-step.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.role-title { font-size: 0.88rem; font-weight: 600; }
.role-date { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }
.role-single-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-2);
  margin-bottom: 18px;
}

.role-bullets li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  color: var(--text-dim);
  font-size: 0.94rem;
}
.role-bullets li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.role-bullets li:last-child { margin-bottom: 0; }
.role-bullets strong { color: var(--text); }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
}
.skill-card h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.skill-icon { color: var(--accent); font-size: 0.8rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--panel-border);
  padding: 6px 11px;
  border-radius: 6px;
}

/* Certifications */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.cert-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.cert-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.cert-emblem {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 50%;
  width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  background: var(--accent-soft);
  text-decoration: none;
}
.cert-card h3 { font-size: 1rem; margin-bottom: 8px; }
.cert-card p { color: var(--text-faint); font-size: 0.85rem; font-family: var(--font-mono); }

/* Education */
.edu-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 28px;
}
.edu-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}
.edu-head h3 { font-size: 1.15rem; }
.edu-date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); }
.edu-degree { color: var(--accent-2); font-weight: 600; margin-bottom: 16px; display: block; }

/* Contact */
.section-contact { text-align: center; }
.section-contact .section-tag,
.section-contact .section-title { text-align: center; }
.contact-lead {
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 40px;
  font-size: 1.02rem;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 880px;
  margin: 0 auto 40px;
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
a.contact-item:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}
.contact-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.contact-value { font-weight: 600; font-size: 0.98rem; }

/* Footer */
.site-footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--panel-border);
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .stat-card:nth-child(2) { border-right: none; }
  .stat-card:nth-child(3), .stat-card:nth-child(4) { border-top: 1px solid var(--panel-border); }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .nav-links {
    position: fixed;
    top: 62px; left: 0; right: 0;
    background: rgba(10,14,20,0.98);
    backdrop-filter: blur(14px);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 18px;
    border-bottom: 1px solid var(--panel-border);
    transform: translateY(-16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
  }
  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nav-toggle { display: flex; }
  .nav-user {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-left: 0;
    padding-top: 14px;
    margin-left: 0;
    margin-top: 4px;
    border-left: none;
    border-top: 1px solid var(--panel-border);
    width: 100%;
  }
  .stats-inner { grid-template-columns: 1fr; }
  .stat-card { border-right: none !important; border-top: 1px solid var(--panel-border); }
  .stat-card:first-child { border-top: none; }
  .section { padding: 72px 20px; }
  .company-head { flex-direction: column; }
}
