/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --text: #1a1a2e;
  --text-soft: #555770;
  --accent: #3b5bdb;
  --accent-soft: #e7ecff;
  --border: #e6e8ef;
  --radius: 14px;
  --maxw: 820px;
  --shadow: 0 6px 24px rgba(20, 24, 60, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, #f6f8fa 0%, #eef2ff 100%);
  border-bottom: 1px solid var(--border);
  padding-bottom: 64px;
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 1px;
  color: var(--text);
  border: 2px solid var(--text);
  border-radius: 8px;
  padding: 4px 9px;
}
.nav-logo:hover { text-decoration: none; }

.nav-links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a { color: var(--text-soft); font-size: 0.95rem; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.hero-content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 44px;
  flex-wrap: wrap;
}

.hero-text {
  flex: 1 1 320px;
  max-width: 520px;
  text-align: left;
}

.hero-photo { flex: 0 0 auto; }
.hero-photo img {
  display: block;
  height: 360px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  margin: 0 0 10px;
  letter-spacing: -0.5px;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-soft);
  margin: 0 0 10px;
  max-width: 600px;
}

.hero-location {
  font-size: 0.95rem;
  color: var(--text-soft);
  margin: 0 0 28px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }

/* ---------- Sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 24px;
}

.section-title {
  font-size: 1.6rem;
  margin: 0 0 28px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 42px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.prose { color: var(--text-soft); max-width: 640px; font-size: 1.05rem; }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 8px; }

.timeline-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.timeline-item:first-child { border-top: none; }

.timeline-meta { color: var(--text-soft); font-size: 0.9rem; padding-top: 3px; }
.timeline-body h3 { margin: 0 0 2px; font-size: 1.15rem; }
.timeline-org { margin: 0 0 8px; color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.timeline-body p { margin: 0; color: var(--text-soft); }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.card p { margin: 0 0 14px; color: var(--text-soft); font-size: 0.95rem; }

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.project-card h3 { margin: 0 0 6px; font-size: 1.2rem; line-height: 1.3; }
.project-meta { margin: 0 0 14px; font-size: 0.85rem; color: var(--text-soft); }
.project-org { color: var(--accent); font-weight: 600; }
.project-card > p { margin: 0 0 18px; color: var(--text-soft); font-size: 0.95rem; }
.project-card .tags { margin-top: auto; }
.project-card .tag {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.78rem;
  padding: 5px 12px;
}

/* ---------- Skills ---------- */
.skill-block { margin-bottom: 28px; }
.skill-block:last-child { margin-bottom: 0; }
.skill-block h3 { margin: 0 0 12px; font-size: 1.1rem; }

.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Contact ---------- */
.section-contact { text-align: center; }
.section-contact .section-title { display: inline-block; }
.section-contact .prose { margin: 0 auto 24px; }

.contact-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.contact-links a {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-weight: 600;
}
.contact-links a:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-soft);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero-content { flex-direction: column-reverse; text-align: center; }
  .hero-text { text-align: center; }
  .hero-tagline { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-photo img { height: 300px; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .timeline-meta { padding-top: 0; }
}
