:root {
  --bg: #0f1720;
  --bg-light: #f7f8fa;
  --accent: #3b82f6;
  --accent-dark: #1d4ed8;
  --text-dark: #1a1f29;
  --text-muted: #5b6572;
  --border: #e3e6ea;
  --card-bg: #ffffff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.6;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  background: linear-gradient(135deg, var(--bg) 0%, #1e293b 100%);
  color: #fff;
  padding: 64px 24px 48px;
  text-align: center;
}
header h1 { margin: 0 0 8px; font-size: 2.4rem; letter-spacing: 0.5px; }
header .title { font-size: 1.15rem; color: #93c5fd; margin-bottom: 20px; font-weight: 500; }
.contact-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  font-size: 0.92rem;
  color: #cbd5e1;
}
.contact-bar a { color: #cbd5e1; }
.contact-bar span { display: inline-flex; align-items: center; gap: 6px; }

nav.site-nav {
  background: #16202c;
  padding: 10px 24px;
  text-align: center;
}
nav.site-nav a {
  color: #cbd5e1;
  font-size: 0.85rem;
  margin: 0 12px;
  display: inline-block;
  padding: 4px 0;
}
nav.site-nav a:hover { color: #fff; text-decoration: none; border-bottom: 2px solid var(--accent); }

main { max-width: 960px; margin: 0 auto; padding: 0 24px; }

section { padding: 48px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }
h2 {
  font-size: 1.5rem;
  margin: 0 0 24px;
  color: var(--text-dark);
  position: relative;
  padding-left: 14px;
}
h2::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
}

.profile p { margin: 0 0 16px; color: var(--text-dark); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}
.skill-card h3 { margin: 0 0 10px; font-size: 0.95rem; color: var(--accent-dark); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
}

.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.job { position: relative; margin-bottom: 36px; }
.job:last-child { margin-bottom: 0; }
.job::before {
  content: "";
  position: absolute;
  left: -24px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-light);
}
.job-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.job h3 { margin: 0 0 2px; font-size: 1.1rem; }
.job .role { color: var(--accent-dark); font-weight: 600; font-size: 0.95rem; margin-bottom: 10px; }
.job p.desc { margin: 8px 0; color: var(--text-muted); font-size: 0.92rem; }
.job ul { margin: 8px 0; padding-left: 20px; }
.job ul li { margin-bottom: 4px; font-size: 0.92rem; }
.job .projects { margin-top: 10px; font-size: 0.88rem; }
.job .projects strong { display: block; margin-bottom: 4px; color: var(--text-dark); }

.edu-item, .lang-item { margin-bottom: 18px; }
.edu-item h3, .lang-item h3 { margin: 0 0 2px; font-size: 1.05rem; }
.edu-item .meta, .lang-item .level { color: var(--text-muted); font-size: 0.88rem; }

.lang-list { display: flex; gap: 32px; flex-wrap: wrap; }

.refs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.ref-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}
.ref-card h3 { margin: 0 0 4px; font-size: 1rem; }
.ref-card .role { color: var(--text-muted); font-size: 0.85rem; }
.refs-note { margin-top: 14px; font-size: 0.85rem; color: var(--text-muted); font-style: italic; }

/* Projects grid (home page) */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.project-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(15, 23, 32, 0.08); }
.project-card .cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  background: var(--border);
}
.project-card .body { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project-card h3 { margin: 0; font-size: 1.02rem; }
.project-card .meta { font-size: 0.78rem; color: var(--text-muted); }
.project-card .summary { font-size: 0.88rem; color: var(--text-muted); flex: 1; }
.project-card .card-link {
  align-self: flex-start;
  font-size: 0.85rem;
  font-weight: 600;
}
.project-card a.card-overlay-link { color: inherit; text-decoration: none; display: contents; }

.state-message {
  padding: 24px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.9rem;
}
.state-message.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Project detail page */
.back-link { display: inline-block; margin: 24px 0 0; font-size: 0.9rem; }
.detail-header { padding-top: 24px; }
.detail-header h1 { margin: 8px 0 4px; font-size: 1.9rem; }
.detail-header .meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.detail-cover {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 20px;
}
.detail-summary { font-size: 1.05rem; color: var(--text-dark); margin-bottom: 12px; }
.detail-description { color: var(--text-muted); margin-bottom: 24px; }

.action-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: #eef2ff; color: #3730a3; }
.btn-secondary:hover { background: #e0e7ff; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  header { padding: 48px 16px 36px; }
  header h1 { font-size: 1.9rem; }
  section { padding: 36px 0; }
}
