:root {
  --bg: #0b0d12;
  --bg-alt: #12151d;
  --card: #161a24;
  --border: #242a38;
  --text: #e8eaf0;
  --text-dim: #9aa2b1;
  --accent: #6fe3c4;
  --accent-2: #7c9cff;
  --danger: #ff7c7c;
  --radius: 14px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Segoe UI", Roboto, sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(111, 227, 196, 0.08), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(124, 156, 255, 0.10), transparent 40%),
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  opacity: 0.5;
}

a { color: inherit; text-decoration: none; }

/* Nav */
.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: var(--text-dim);
  font-size: 0.92rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

/* Hero */
.hero {
  padding-bottom: 60px;
  border-bottom: 1px solid var(--border);
}
.hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 20px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 2px solid var(--border);
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 12px;
  background: linear-gradient(90deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tagline {
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 0 32px;
  font-size: 1.02rem;
}
.hero-links { display: flex; gap: 14px; margin-bottom: 40px; flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #0b0d12;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: #85f0d3; }

.hero-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
}
.stat { text-align: center; }
.stat-num { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

/* Sections */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 20px;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }
.section-title {
  font-size: 1.6rem;
  margin: 0 0 36px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.section-title span {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  font-family: monospace;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: start;
}
.about-text { color: var(--text-dim); margin: 0; }
.about-cards { display: flex; flex-direction: column; gap: 14px; }
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.info-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.info-value { font-weight: 600; }

.interest-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.interest-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.interest-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent);
  margin-bottom: 8px;
}
.interest-desc {
  color: var(--text-dim);
  font-size: 0.86rem;
}

/* Skills */
.skills-chart { display: flex; flex-direction: column; gap: 16px; }
.skill-row { display: grid; grid-template-columns: 140px 1fr 50px; align-items: center; gap: 14px; }
.skill-name { font-size: 0.92rem; font-weight: 600; }
.skill-bar-bg { height: 10px; background: var(--bg-alt); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.skill-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  width: 0;
  transition: width 1s ease;
}
.skill-count { font-size: 0.85rem; color: var(--text-dim); text-align: right; }

.section-lead {
  color: var(--text-dim);
  margin: -20px 0 32px;
  font-size: 0.95rem;
}

/* Featured project case studies */
.featured-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  transition: border-color 0.18s;
}
.feature-card:hover { border-color: var(--accent); }
.feature-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.feature-name { margin: 0; font-size: 1.15rem; }
.feature-link {
  font-size: 0.85rem;
  color: var(--accent);
  white-space: nowrap;
}
.feature-link:hover { text-decoration: underline; }
.feature-tagline {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 12px;
}
.feature-story {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0 0 18px;
}
.feature-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.feature-tech { display: flex; gap: 8px; flex-wrap: wrap; }
.tech-chip {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--accent-2);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
}
.feature-star { font-size: 0.8rem; color: var(--text-dim); }

/* Other repositories - compact list */
.other-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.other-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  transition: border-color 0.15s;
}
.other-card:hover { border-color: var(--accent); }
.other-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.other-meta { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 0.78rem; white-space: nowrap; }
.other-updated { margin-left: 4px; }

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
  align-items: center;
}
.filter-chip {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip:hover { color: var(--text); }
.filter-chip.active {
  background: var(--accent);
  color: #0b0d12;
  border-color: var(--accent);
  font-weight: 600;
}
#search-box {
  margin-left: auto;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  width: 220px;
  outline: none;
}
#search-box:focus { border-color: var(--accent); }

/* Project grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s, border-color 0.18s;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.project-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.project-name { font-weight: 700; font-size: 1.02rem; }
.project-star { font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; }
.project-desc { color: var(--text-dim); font-size: 0.88rem; flex-grow: 1; min-height: 2.6em; }
.project-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; }
.project-tag {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
}
.project-lang { color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.lang-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.project-updated { color: var(--text-dim); }

.load-more-wrap { display: flex; justify-content: center; margin-top: 30px; }
.load-more-wrap.hidden { display: none; }

/* Contact */
.contact-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.contact-links { display: flex; gap: 14px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* Footer */
.footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-dim);
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .nav-links { gap: 14px; }
  .about-grid { grid-template-columns: 1fr; }
  .interest-grid { grid-template-columns: 1fr; }
  .skill-row { grid-template-columns: 90px 1fr 40px; }
  #search-box { width: 100%; margin-left: 0; }
}
