:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --cyan: #0891b2;
  --cyan-strong: #0e7490;
  --violet: #7c3aed;
  --green: #059669;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --sans: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

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

.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
}

.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 320px at 78% -60px, rgba(124, 58, 237, 0.07), transparent 70%),
    radial-gradient(700px 380px at 18% -80px, rgba(8, 145, 178, 0.08), transparent 70%);
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: var(--mono); font-size: 17px; font-weight: 700;
  color: var(--text); text-decoration: none; letter-spacing: .3px;
}
.logo-mark { color: var(--green); }
.logo-dot { color: var(--cyan); }
.nav-links { display: flex; gap: 26px; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 14px;
  font-family: var(--mono); transition: color .2s;
}
.nav-links a:hover { color: var(--cyan-strong); }

/* ---------- hero ---------- */
.hero {
  max-width: 1080px; margin: 0 auto;
  padding: 168px 24px 96px;
}
.term-line {
  font-family: var(--mono); font-size: 14px; color: var(--muted);
  margin-bottom: 18px;
}
.prompt { color: var(--green); }
.path { color: var(--cyan); }
.hero h1 {
  font-size: clamp(52px, 9vw, 96px);
  font-weight: 800; letter-spacing: 2px; line-height: 1.1;
  background: linear-gradient(100deg, var(--text) 25%, var(--cyan) 60%, var(--violet) 92%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.tagline {
  margin-top: 14px; font-size: clamp(16px, 2.4vw, 21px); color: var(--muted);
  max-width: 640px;
}
.typed-line {
  margin-top: 26px; font-family: var(--mono); font-size: 16px; color: var(--green);
  min-height: 1.7em;
}
.cursor { color: var(--cyan); animation: blink 1s steps(1) infinite; margin-right: 6px; }
@keyframes blink { 50% { opacity: 0; } }
.tags {
  list-style: none; margin-top: 30px;
  display: flex; flex-wrap: wrap; gap: 10px; max-width: 760px;
}
.tags li {
  font-family: var(--mono); font-size: 12.5px; color: var(--cyan-strong);
  border: 1px solid rgba(8, 145, 178, 0.35); border-radius: 999px;
  padding: 4px 14px; background: rgba(8, 145, 178, 0.07);
}
.hero-cta { margin-top: 40px; display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 11px 26px; border-radius: 8px;
  font-family: var(--mono); font-size: 14.5px; text-decoration: none;
  transition: transform .2s, box-shadow .2s, border-color .2s, color .2s;
}
.btn-primary {
  color: #ffffff; font-weight: 700;
  background: linear-gradient(95deg, #06b6d4, var(--cyan));
  box-shadow: 0 4px 18px rgba(8, 145, 178, 0.28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 26px rgba(8, 145, 178, 0.4); }
.btn-ghost { color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--cyan-strong); border-color: rgba(8, 145, 178, 0.5); transform: translateY(-2px); }

/* ---------- sections ---------- */
.projects, .about, .experience { max-width: 1080px; margin: 0 auto; padding: 40px 24px 72px; }
.section-head h2, .about-box h2 {
  font-size: clamp(24px, 3.6vw, 34px); font-weight: 700; letter-spacing: 1px;
}
.hash { color: var(--violet); font-family: var(--mono); margin-right: 8px; }
.section-head p { margin-top: 8px; color: var(--muted); font-size: 15px; }

.grid {
  margin-top: 36px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(8, 145, 178, 0.5);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(8, 145, 178, 0.12);
}
.card-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.card-bar i { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.card-bar i:first-child { background: #f87171; }
.card-bar i:nth-child(2) { background: #fbbf24; }
.card-bar i:nth-child(3) { background: #34d399; }
.card-bar span { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.card h3 { margin: 18px 20px 0; font-size: 18.5px; }
.card p { margin: 10px 20px 0; color: var(--muted); font-size: 14px; }
.card-tags {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px;
  margin: 16px 20px 22px;
}
.card-tags li {
  font-family: var(--mono); font-size: 11.5px; color: #6d28d9;
  background: rgba(124, 58, 237, 0.07); border: 1px solid rgba(124, 58, 237, 0.3);
  padding: 2px 10px; border-radius: 6px;
}

/* ---------- stats ---------- */
.stats {
  margin-top: 48px; max-width: 780px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px;
}
.stats div {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel-2); padding: 16px 18px;
}
.stats strong {
  display: block; font-family: var(--mono); font-size: 26px; color: var(--cyan);
  line-height: 1.2;
}
.stats span { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

/* ---------- timeline ---------- */
.timeline {
  list-style: none; margin-top: 36px; padding-left: 28px;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 32px;
}
.timeline li { position: relative; }
.timeline > li::before {
  content: ''; position: absolute; left: -33px; top: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 8px rgba(8, 145, 178, 0.5);
}
.t-date { font-family: var(--mono); font-size: 12.5px; color: var(--green); }
.timeline h3 { margin-top: 6px; font-size: 17.5px; }
.timeline p { margin-top: 8px; color: var(--muted); font-size: 14px; max-width: 840px; }
.timeline .card-tags { margin: 12px 0 0; }

/* ---------- about ---------- */
.about-box {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel-2);
  padding: 34px 32px;
}
.about-box p { margin-top: 14px; color: var(--muted); max-width: 760px; }
.mono-dim { font-family: var(--mono); color: var(--green); font-size: 14px; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 26px 24px 34px; text-align: center;
  color: var(--muted); font-size: 13px; font-family: var(--mono);
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--cyan-strong); }
.footer p + p { margin-top: 6px; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.on { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 640px) {
  .hero { padding-top: 132px; }
  .nav-links { gap: 16px; }
}
