:root {
  --bg: #0b0f0e;
  --bg-alt: #0e1412;
  --surface: #131b18;
  --surface-hover: #18221e;
  --border: #22302b;
  --text: #e6edea;
  --text-dim: #93a49d;
  --accent: #4ade80;
  --accent-soft: rgba(74, 222, 128, 0.12);
  --accent-glow: rgba(74, 222, 128, 0.35);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --radius: 14px;
  --maxw: 1080px;
  --nav-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

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

section[id] {
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(var(--maxw), 100% - 2.5rem);
  margin-inline: auto;
}

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

.accent {
  color: var(--accent);
}

.dim {
  color: var(--text-dim);
}

.icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
  vertical-align: -0.18em;
}

/* ---------- Navbar ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(11, 15, 14, 0.82);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}

.nav-inner {
  height: 100%;
  width: min(var(--maxw), 100% - 2.5rem);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.4rem;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-burger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 0.4rem;
  cursor: pointer;
}

.nav-burger .icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 2rem) 0 3rem;
  background:
    radial-gradient(ellipse 70% 50% at 70% -10%, var(--accent-soft), transparent),
    var(--bg);
}

.hero-greeting {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.hero-name {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-title {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: var(--accent);
  margin-top: 0.6rem;
}

.hero-sub {
  max-width: 46rem;
  color: var(--text-dim);
  margin-top: 1.1rem;
  font-size: 1.02rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.3rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.hero-chip .icon {
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.8rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #06130b;
}

.btn-primary:hover {
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.btn-sm {
  padding: 0.5rem 0.95rem;
  font-size: 0.82rem;
}

/* ---------- Sections ---------- */

.section {
  padding: 4.5rem 0;
}

.section:nth-of-type(even) {
  background: var(--bg-alt);
}

.section-title {
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.section-title .mono {
  font-size: 0.85em;
}

.section-sub {
  color: var(--text-dim);
  margin-bottom: 2.2rem;
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--accent-soft);
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

.about-text {
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.about-text:last-child {
  margin-bottom: 0;
}

.about-facts {
  list-style: none;
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

.about-facts li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  color: var(--text-dim);
}

.about-facts .icon {
  color: var(--accent);
}

/* ---------- Stack ---------- */

.stack-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.stack-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.stack-head h3 {
  font-size: 1rem;
}

.stack-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  background: var(--accent-soft);
  border: 1px solid rgba(74, 222, 128, 0.25);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.3rem 0.65rem;
  border-radius: 7px;
  white-space: nowrap;
}

/* ---------- Projects ---------- */

.featured {
  margin-bottom: 1.4rem;
  background: linear-gradient(160deg, var(--surface-hover), var(--surface));
  position: relative;
  overflow: hidden;
}

.featured::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 100% 0%, var(--accent-soft), transparent);
  pointer-events: none;
}

.featured-body {
  position: relative;
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: #06130b;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.9rem;
}

.featured-title {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  margin-bottom: 0.7rem;
}

.featured-desc {
  color: var(--text-dim);
  max-width: 60rem;
  margin-bottom: 1rem;
}

.featured-tags {
  margin-bottom: 1.2rem;
}

.featured-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}

.stat {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat strong {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
}

.stat span {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.project-title {
  font-size: 1rem;
}

.project-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  flex-grow: 1;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.project-link:hover {
  text-decoration: none;
  color: var(--text);
}

/* ---------- Experience ---------- */

.timeline {
  position: relative;
  display: grid;
  gap: 2rem;
  padding-left: 1.6rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.6rem;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-meta {
  margin-bottom: 0.6rem;
}

.timeline-title {
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.timeline-org {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.timeline-date {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-top: 0.3rem;
}

.timeline-items {
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.timeline-items li {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.timeline-items li::before {
  content: "▸";
  color: var(--accent);
  margin-right: 0.5rem;
}

/* ---------- Education ---------- */

.education-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.edu-org {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0.4rem 0;
}

.edu-card .timeline-date {
  margin-top: 0;
}

.edu-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.edu-list li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.edu-list .icon {
  color: var(--accent);
}

/* ---------- Contact ---------- */

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 1.6rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ---------- Reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .card {
    transition: none;
  }
}

/* ---------- Responsive ---------- */

@media (min-width: 640px) {
  .about-grid {
    grid-template-columns: 1.4fr 1fr;
  }

  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .education-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stack-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .nav-burger {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(11, 15, 14, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.25rem 1rem;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }
}