:root {
  --bg: #fafaf9;
  --bg-elevated: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --border: #e3e2df;
  --accent: #1d4ed8;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 760px;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --bg-elevated: #1a1a1a;
    --text: #eeeeee;
    --text-muted: #a0a0a0;
    --border: #2c2c2c;
    --accent: #7ba7ff;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

/* Hero */
.hero {
  padding: 4rem 1.5rem 3rem;
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 0.6rem;
}
.hero-role {
  font-size: 1.02rem;
  color: var(--text);
  margin: 0 0 0.9rem;
}
.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 0 1.75rem;
}
.hero-actions {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.92rem;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-elevated); }
.hero-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Sections */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
}
.section-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: -0.75rem 0 1.5rem;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2.25rem;
}
.about-text p { color: var(--text-muted); margin: 0 0 1rem; }
.about-facts {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.fact-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.fact-value { font-size: 0.92rem; }

@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
}
.timeline-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 0.15rem;
}
.timeline-content h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 600;
}
.timeline-org {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.timeline-content p:not(.timeline-org) { color: var(--text-muted); margin: 0.4rem 0 0; }

@media (max-width: 640px) {
  .timeline-item { grid-template-columns: 1fr; gap: 0.35rem; }
}

/* Projects */
.project-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.project-card {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.project-card:last-child { border-bottom: none; padding-bottom: 0; }
.project-card h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 600;
}
.project-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
}
.project-card p:not(.project-role) { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 0.5rem; }

.todo {
  font-size: 0.82rem !important;
  color: var(--accent) !important;
}

/* Achievements */
.achievement-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.achievement-list li {
  display: flex;
  gap: 0.75rem;
  font-size: 0.95rem;
}
.achv-badge {
  color: var(--text-muted);
  font-size: 0.88rem;
  flex-shrink: 0;
  width: 3ch;
}

/* Collabs */
.collab-grid {
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 0.5rem;
  margin: 0 -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.collab-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
}
.collab-card iframe {
  display: block;
  border-radius: var(--radius);
}
.collab-tag {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* GitHub repos */
.repo-grid {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 0.5rem;
  margin: 0 -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.repo-pin {
  display: block;
  line-height: 0;
  flex: 0 0 auto;
  scroll-snap-align: start;
}
.repo-pin img {
  height: 180px;
  width: auto;
  border-radius: var(--radius);
}

/* Contact */
.contact-box p { margin: 0.4rem 0; color: var(--text-muted); }

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
