:root {
  --bg: #0d0f0e;
  --bg-surface: #141716;
  --bg-card: #1a1d1b;
  --border: #252825;
  --text: #e8ede9;
  --text-muted: #7a8c7e;
  --accent: #3dd68c;
  --accent-dim: #2a9d63;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --max-w: 900px;
  --section-gap: 7rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
}

/* Layout */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: var(--section-gap) 0;
}

/* Animate-in */
.anim {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
}
.anim.visible {
  opacity: 1;
  transform: translateY(0);
}
.anim-delay-1 { transition-delay: 0.1s; }
.anim-delay-2 { transition-delay: 0.2s; }
.anim-delay-3 { transition-delay: 0.3s; }
.anim-delay-4 { transition-delay: 0.4s; }

/* Nav */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(13, 15, 14, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* Hero */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 5rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
}

.hero-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.hero-role {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 2.2rem;
  line-height: 1.75;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #0d0f0e;
  border: 1px solid var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.hero-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Section headings */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 2.5rem;
  line-height: 1.2;
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-bottom: var(--section-gap);
}

/* About */
#about p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.8;
}

#about p + p {
  margin-top: 1.2rem;
}

#about strong {
  color: var(--text);
  font-weight: 500;
}

/* Experience */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0 2rem;
  padding: 1.8rem 0;
  border-top: 1px solid var(--border);
  position: relative;
}

.timeline-item:last-child {
  border-bottom: 1px solid var(--border);
}

.timeline-period {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  padding-top: 0.1rem;
  line-height: 1.5;
}

.timeline-current {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: rgba(61, 214, 140, 0.12);
  color: var(--accent);
  margin-top: 0.3rem;
}

.timeline-company {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.timeline-role {
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.timeline-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Stack */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 1rem;
}

.stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.1rem 0.5rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition:
    border-color 0.2s,
    transform 0.2s;
}

.stack-item:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

.stack-item i {
  font-size: 1.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.stack-item:hover i {
  color: var(--accent);
}

.stack-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.stack-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  margin-top: 1.8rem;
}

.stack-group-label:first-child {
  margin-top: 0;
}

/* Education */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.edu-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.edu-item:last-child {
  border-bottom: 1px solid var(--border);
}

.edu-year {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 0.1rem;
}

.edu-school {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.edu-degree {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Projects */
.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-card);
  transition: border-color 0.25s;
}

.project-card:hover {
  border-color: var(--accent-dim);
}

.project-content {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.project-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.8rem;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.8rem;
}

.project-visual {
  background: linear-gradient(135deg, #0e2019 0%, #1a3328 50%, #0d0f0e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  position: relative;
  overflow: hidden;
}

.project-visual-inner {
  text-align: center;
  z-index: 1;
}

.project-visual-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  display: block;
  line-height: 1;
}

.project-visual-text {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
}

.project-visual::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(61, 214, 140, 0.06);
  top: -40px;
  right: -40px;
}

.project-visual::after {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(61, 214, 140, 0.04);
  bottom: -20px;
  left: -20px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-built {
  font-size: 0.8rem;
  color: var(--border);
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 700px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-avatar {
    width: 90px;
    height: 90px;
    order: -1;
  }
  .nav-links {
    display: none;
  }

  .timeline-item,
  .edu-item {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .timeline-period,
  .edu-year {
    margin-bottom: 0.2rem;
  }

  .project-card {
    grid-template-columns: 1fr;
  }
  .project-visual {
    min-height: 180px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  :root {
    --section-gap: 4rem;
  }
}

@media (max-width: 480px) {
  .stack-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  }
}
