/* ============ Design tokens ============ */
:root {
  --bg: #0a0e14;
  --bg-raised: #111722;
  --bg-card: #131a27;
  --border: #1e2938;
  --text: #c9d4e3;
  --text-bright: #eef3fa;
  --text-dim: #7d8ba1;
  --accent: #34d8ac;
  --accent-dim: rgba(52, 216, 172, 0.1);
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --max-w: 1080px;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

strong { color: var(--text-bright); font-weight: 600; }

/* ============ Buttons ============ */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
  background: transparent;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: var(--accent-dim); text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent-dim); }
.btn-small { padding: 8px 16px; font-size: 13px; }
.btn-large { padding: 16px 36px; font-size: 15px; }

/* ============ Nav ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.nav.scrolled { border-bottom-color: var(--border); box-shadow: 0 8px 30px rgba(0,0,0,0.4); }

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 18px;
  color: var(--text-bright);
}
.logo:hover { text-decoration: none; }

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a:not(.btn) {
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
}
.nav-links a:not(.btn):hover { color: var(--accent); text-decoration: none; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; }
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--accent);
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ============ Hero ============ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
}

.hero-kicker { color: var(--accent); font-size: 16px; margin-bottom: 18px; }

.hero-title {
  font-size: clamp(42px, 7.5vw, 76px);
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: clamp(26px, 4.5vw, 48px);
  font-weight: 700;
  color: var(--text-dim);
  line-height: 1.15;
  margin-top: 8px;
  letter-spacing: -0.015em;
}

.hero-desc { max-width: 560px; margin-top: 26px; color: var(--text-dim); }

.hero-cta { display: flex; gap: 16px; margin-top: 36px; flex-wrap: wrap; }

/* terminal card */
.hero-terminal {
  margin-top: 64px;
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.terminal-bar {
  display: flex; gap: 8px;
  padding: 12px 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}
.terminal-bar span {
  width: 12px; height: 12px; border-radius: 50%;
  background: #2c3a4e;
}
.terminal-bar span:first-child { background: #f56565; }
.terminal-bar span:nth-child(2) { background: #ecc94b; }
.terminal-bar span:nth-child(3) { background: #48bb78; }
.terminal-body { padding: 18px 20px; font-size: 14px; line-height: 2; }
.t-prompt { color: var(--accent); }
.t-out { color: var(--text-dim); }
.t-cursor { animation: blink 1.1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

/* ============ Sections ============ */
.section { padding: 110px 0; }

.section-title {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 700;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
  white-space: nowrap;
}
.section-num { font-size: 0.75em; font-weight: 500; }
.section-title::after {
  content: "";
  height: 1px;
  background: var(--border);
  flex: 1;
  margin-left: 12px;
}

/* ============ About ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text p + p { margin-top: 18px; }

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 26px;
  font-size: 14px;
}
.about-card-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}
.about-card-row + .about-card-row { border-top: 1px solid var(--border); }
.about-card-row .k { color: var(--text-dim); }
.about-card-row .v { color: var(--text-bright); text-align: right; }

/* ============ Skills ============ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
}
.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 26px;
}
.skill-group h3 {
  font-size: 15px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  margin-bottom: 16px;
}
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 13.5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ============ Projects ============ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 22px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(52, 216, 172, 0.45);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.project-card.featured { border-top: 2px solid var(--accent); }

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.folder-icon { font-size: 30px; }
.project-gh { font-size: 13px; }

.project-card h3 { font-size: 20px; margin-bottom: 12px; }
.project-card h3 a { color: var(--text-bright); }
.project-card h3 a:hover { color: var(--accent); text-decoration: none; }
.project-card p { font-size: 15px; color: var(--text-dim); flex: 1; }

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--accent);
}

.more-projects { text-align: center; margin-top: 44px; font-size: 15px; }

/* ============ Open Source ============ */
.oss-intro {
  color: var(--text-dim);
  max-width: 700px;
  margin-bottom: 34px;
  font-size: 15.5px;
}

.oss-list { display: flex; flex-direction: column; gap: 22px; }

.oss-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 10px;
  padding: 28px 30px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.oss-card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 216, 172, 0.45);
  border-left-color: var(--accent);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

.oss-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.oss-status {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.oss-status.merged {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(52, 216, 172, 0.4);
}
.oss-status.active {
  color: #ecc94b;
  background: rgba(236, 201, 75, 0.1);
  border-color: rgba(236, 201, 75, 0.4);
}

.oss-repo { font-size: 13px; color: var(--text-dim); }

.oss-card h3 { font-size: 19px; line-height: 1.45; margin-bottom: 10px; }
.oss-card h3 a { color: var(--text-bright); }
.oss-card h3 a:hover { color: var(--accent); text-decoration: none; }
.oss-card h3 code { font-size: 0.92em; }

.oss-meta {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.oss-card > p { font-size: 15px; color: var(--text-dim); }
.oss-card > p + p { margin-top: 12px; }

.oss-card code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============ Experience ============ */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 40px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -32px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}
.timeline-date { font-size: 13px; color: var(--accent); margin-bottom: 6px; }
.timeline-item h3 { color: var(--text-bright); font-size: 19px; margin-bottom: 8px; }
.timeline-item p { color: var(--text-dim); max-width: 640px; }

/* ============ Contact ============ */
.section-contact { text-align: center; padding-bottom: 140px; }
.contact-title {
  font-size: clamp(32px, 5vw, 52px);
  color: var(--text-bright);
  font-weight: 800;
  margin: 14px 0 18px;
}
.contact-desc { max-width: 540px; margin: 0 auto 38px; color: var(--text-dim); }

.socials {
  margin-top: 44px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 15px;
}
.socials span { color: var(--text-dim); }

/* ============ Footer ============ */
.footer {
  text-align: center;
  padding: 28px;
  font-size: 13px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

/* ============ Reveal animation ============ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

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

/* ============ Responsive ============ */
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
  .nav-links { gap: 18px; }
  .oss-card { padding: 24px 22px; }
  .oss-head { flex-wrap: wrap; gap: 10px; }
}

@media (max-width: 680px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: 62px; right: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 22px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 10px 0 0 10px;
    padding: 28px 32px;
    transform: translateX(110%);
    transition: transform 0.3s ease;
  }
  .nav-links.open { transform: none; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .hero { padding-top: 110px; }
}
