:root {
  --bg: #07090f;
  --bg-soft: #0d111b;
  --card: #121826;
  --card-hover: #182033;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #8b95a7;
  --accent: #38e0c1;
  --accent-2: #5b8cff;
  --accent-3: #b96bff;
  --danger: #ff5c7a;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 14px;
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

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

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #04120e; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 9, 15, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; font-size: 14px; }
.nav-links a { color: var(--muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  position: relative;
  padding: 80px 0;
}
.hero h1 {
  font-size: clamp(36px, 7vw, 72px);
  line-height: 1.1;
  letter-spacing: -2px;
  font-weight: 800;
  margin-bottom: 24px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .tagline {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 16px;
}
.hero .cmd {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 40px;
  min-height: 24px;
}
.hero .cmd .prompt { color: var(--accent); }
.hero .cursor {
  display: inline-block;
  width: 9px;
  height: 18px;
  background: var(--accent);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover { background: var(--card-hover); border-color: var(--accent); transform: translateY(-2px); }
.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #04120e;
  border: none;
}
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 8px 30px rgba(56, 224, 193, 0.25); }

/* ---------- sections ---------- */
section { padding: 96px 0; }
.section-head { margin-bottom: 48px; }
.section-kicker {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-head h2 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -1px;
  font-weight: 700;
}
.section-head p { color: var(--muted); margin-top: 12px; max-width: 620px; }

/* ---------- grid / cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(56, 224, 193, 0.08), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.card:hover { border-color: rgba(56, 224, 193, 0.4); transform: translateY(-4px); }
.card:hover::before { opacity: 1; }
.card .icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 18px;
  background: rgba(56, 224, 193, 0.1);
  border: 1px solid rgba(56, 224, 193, 0.25);
}
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14.5px; }

/* ---------- skills ---------- */
.skill-row { margin-bottom: 22px; }
.skill-row .top { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.skill-row .top span:last-child { color: var(--accent); font-family: var(--mono); }
.bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- terminal ---------- */
.term {
  background: #05070b;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13.5px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.term-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.term-bar i { width: 12px; height: 12px; border-radius: 50%; }
.term-bar i:nth-child(1) { background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-body { padding: 18px 20px; min-height: 260px; line-height: 1.9; }
.term-body .u { color: var(--accent); }
.term-body .h { color: var(--accent-2); }
.term-body .d { color: var(--muted); }
.term-body .ok { color: #4ade80; }
.term-body .in { color: var(--text); }

/* ---------- blog ---------- */
.post-card { display: flex; flex-direction: column; gap: 12px; }
.post-card .meta { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.post-card .tag {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(91, 140, 255, 0.12);
  color: var(--accent-2);
  border: 1px solid rgba(91, 140, 255, 0.25);
}
.post-card h3 { font-size: 18px; line-height: 1.4; }
.post-card:hover h3 { color: var(--accent); }
.post-card .more { color: var(--accent); font-size: 14px; font-weight: 600; margin-top: auto; }

/* ---------- tools ---------- */
.tool-panel { padding: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 100px; }
.output {
  background: #05070b;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-family: var(--mono);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--accent);
  min-height: 48px;
}
.output.err { color: var(--danger); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: var(--muted);
  font-size: 13.5px;
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-inner a { color: var(--muted); transition: color 0.2s; }
.footer-inner a:hover { color: var(--accent); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s, transform 0.7s; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  section { padding: 64px 0; }
  .footer-inner { flex-direction: column; }
}
