/* ── Reset & base ──────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: #374151;
  background: #fafafa;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  background: #111827;
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 22px;
  font-weight: 500;
  color: #f9fafb;
  margin-right: 32px;
  white-space: nowrap;
}

.topbar-title a { color: #f9fafb; }
.topbar-title a:hover { text-decoration: none; }

/* ── Primary nav ─────────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  height: 100%;
  flex: 1;
  overflow-x: clip;
}

.nav-item {
  position: relative;
  height: 64px;
  display: flex;
  align-items: center;
}

.nav-item > a,
.nav-label {
  font-size: 13px;
  color: #d1d5db;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  cursor: pointer;
  user-select: none;
}

.nav-item > a:hover,
.nav-item > a.active,
.nav-label:hover,
.nav-label.active {
  color: #60a5fa;
  border-bottom-color: #60a5fa;
  text-decoration: none;
}

/* CSS chevron icon */
.chevron {
  opacity: 0.6;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.nav-item.has-children:hover .chevron { transform: rotate(180deg); }

/* Dropdown */
.dropdown {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  background: #1f2937;
  border: 1px solid #374151;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  min-width: 180px;
  border-radius: 6px;
  overflow: hidden;
  z-index: 200;
}

.nav-item:hover .dropdown { display: block; }

.dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: #e5e7eb;
  white-space: nowrap;
}

.dropdown a:hover {
  background: #374151;
  text-decoration: none;
  color: #f9fafb;
}

.dropdown a.active {
  color: #60a5fa;
  background: #374151;
}

/* ── Page content ────────────────────────────────────────── */
.page-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Hero / banner image ─────────────────────────────────── */
.hero-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
  margin-bottom: 32px;
  border-radius: 8px;
}

/* ── Headings ────────────────────────────────────────────── */
h1 {
  font-size: 34px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 22px;
  font-weight: 600;
  color: #111827;
  margin: 32px 0 16px;
}

h3 {
  font-size: 17px;
  font-weight: 600;
  color: #111827;
  margin: 24px 0 12px;
}

/* ── Body text ───────────────────────────────────────────── */
p {
  font-size: 15px;
  line-height: 1.8;
  color: #374151;
  margin-bottom: 16px;
  max-width: 700px;
}

strong { font-weight: 600; color: #111827; }

ul {
  margin: 8px 0 16px 24px;
  max-width: 700px;
}

ul li {
  font-size: 15px;
  line-height: 1.8;
  color: #374151;
  margin-bottom: 4px;
}

/* ── Section images ──────────────────────────────────────── */
.section-img {
  width: 100%;
  max-width: 700px;
  display: block;
  margin: 16px 0 24px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* ── Two-column image grid ───────────────────────────────── */
.img-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 700px;
  margin: 16px 0 24px;
}

.img-grid-2 img {
  width: 100%;
  display: block;
  border-radius: 8px;
}

/* ── Three-column image grid ─────────────────────────────── */
.img-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  max-width: 700px;
  margin: 16px 0 24px;
}

.img-grid-3 img {
  width: 100%;
  display: block;
  border-radius: 8px;
}

/* ── Home page project tiles ─────────────────────────────── */
.project-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.project-tile {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.project-tile:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.project-tile img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.project-tile-label {
  padding: 10px 12px;
  font-size: 13px;
  color: #2563eb;
  font-weight: 500;
}

/* ── Resume content ──────────────────────────────────────── */
.resume-block { margin-bottom: 24px; max-width: 700px; }
.resume-block p { margin-bottom: 6px; }

/* ── Book list ───────────────────────────────────────────── */
.book-list { list-style: none; margin-left: 0; }
.book-list li {
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
  color: #374151;
}

/* ── Footer contact ──────────────────────────────────────── */
.footer-contact {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  font-size: 13px;
  color: #6b7280;
}

.footer-contact a { color: #2563eb; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 12px 16px; }
  .topbar-title { font-size: 18px; margin-right: 0; width: 100%; margin-bottom: 8px; }
  .img-grid-2, .img-grid-3 { grid-template-columns: 1fr; }
  .project-tiles { grid-template-columns: 1fr 1fr; }
}
