/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:         #ffffff;
  --surface:    #f7f7f7;
  --border:     #e5e5e5;
  --text:       #1f1f1f;
  --muted:      #6b6b6b;
  --accent:     #1a5fb4;
  --accent-dim: rgba(26, 95, 180, 0.08);
  --sans:       'Lato', Verdana, Helvetica, Arial, sans-serif;
  --max-w:      780px;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* === NAV === */
nav {
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.nav-brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.15s;
}

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

.nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* === LAYOUT === */
main {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 80px;
  width: 100%;
}

/* === FOOTER === */
footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

footer a {
  color: var(--muted);
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* === HOME — PROFILE === */
.profile {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 40px;
}

.profile-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  order: 1;
  margin-left: auto;
}

.profile-name {
  font-size: 2rem;
  margin-bottom: 4px;
}

.profile-role {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 2px;
}

.profile-affiliation {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  list-style: none;
  font-size: 0.95rem;
}

.hero-bio {
  font-size: 1.02rem;
  line-height: 1.75;
  max-width: 680px;
  margin-bottom: 20px;
}

.hero-bio:last-child {
  margin-bottom: 0;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* === HOME — CONTACT === */
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
  margin-bottom: 44px;
}

.contact-list li span {
  display: inline-block;
  width: 90px;
  color: var(--muted);
}

/* === SHARED PAGE ELEMENTS === */
.page-heading {
  font-size: 1.75rem;
  margin-bottom: 28px;
}

.section-label {
  font-size: 1.15rem;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 20px;
}

/* === ABOUT === */
.about-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 24px;
  display: block;
}

.about-bio {
  max-width: 680px;
  margin-bottom: 44px;
}

.about-bio p {
  line-height: 1.75;
  margin-bottom: 16px;
}

.about-bio p:last-child {
  margin-bottom: 0;
}

.skills-table {
  width: 100%;
  max-width: 680px;
  border-collapse: collapse;
  margin-bottom: 44px;
  font-size: 0.95rem;
}

.skills-table td {
  padding: 10px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.skills-table tr:last-child td {
  border-bottom: none;
}

.skills-table td:first-child {
  font-weight: 700;
  width: 120px;
  padding-right: 24px;
  white-space: nowrap;
}

.skills-table td:last-child {
  color: var(--text);
  line-height: 1.6;
}

.edu-entry {
  margin-bottom: 16px;
}

.edu-degree {
  font-weight: 700;
  margin-bottom: 2px;
}

.edu-school {
  font-size: 0.95rem;
  color: var(--muted);
}

/* === PROJECTS / EXPERIENCE — FILTERS === */
.filter-tabs {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.filter-btn {
  font-family: inherit;
  font-size: 0.92rem;
  padding: 0 0 4px;
  border: none;
  border-bottom: 1.5px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s;
  margin-bottom: -13px;
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* === CARD (list entry) === */
.card-grid {
  display: flex;
  flex-direction: column;
}

.card-link-wrapper {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-link-wrapper:hover {
  text-decoration: none;
}

.card-link-wrapper:hover .card-title {
  color: var(--accent);
}

.card {
  display: flex;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.card-img,
.card-img-placeholder {
  width: 180px;
  aspect-ratio: 5 / 4;
  flex-shrink: 0;
  border-radius: 4px;
  object-fit: cover;
}

.card-img-placeholder {
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #b3b3b3;
}

.card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  transition: color 0.15s;
}

.card-meta {
  font-size: 0.95rem;
  color: var(--text);
}

.card-dates {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 10px;
}

.card-bullets {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.55;
  padding-left: 18px;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tag {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

.card-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: auto;
}

.card-link {
  font-size: 0.88rem;
  color: var(--accent);
}

.card-link-pending {
  color: var(--muted);
  font-style: italic;
  cursor: default;
}

/* === EMPTY STATE === */
.empty-state {
  font-size: 0.95rem;
  color: var(--muted);
  padding: 40px 0;
}

/* === PROJECT DETAIL === */
.detail-hero {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 28px;
  display: block;
}

.detail-header {
  margin-bottom: 8px;
}

.detail-title {
  font-size: 1.75rem;
  margin-bottom: 12px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.detail-meta .card-tags {
  margin-bottom: 0;
}

.detail-section {
  margin-top: 36px;
}

.detail-text {
  line-height: 1.75;
  white-space: pre-line;
}

.detail-bullets {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-bullets li {
  line-height: 1.6;
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.detail-gallery img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
}

.detail-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-skill-chip {
  font-size: 0.82rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.detail-links {
  margin-bottom: 0;
}

.detail-links li span {
  width: 80px;
}

.detail-back {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .nav-inner {
    padding: 14px 16px;
    gap: 12px;
  }

  .nav-brand {
    white-space: nowrap;
  }

  .nav-links {
    gap: 14px;
  }

  .nav-links a {
    font-size: 0.9rem;
  }

  main {
    padding: 32px 16px 64px;
  }

  .profile {
    flex-direction: column;
    gap: 20px;
  }

  .profile-photo {
    width: 128px;
    height: 128px;
    order: 0;
    margin-left: 0;
  }

  .profile-name {
    font-size: 1.7rem;
  }

  .card {
    flex-direction: column;
    gap: 14px;
  }

  .card-img,
  .card-img-placeholder {
    width: 100%;
  }

  .skills-table td:first-child {
    width: 90px;
    padding-right: 14px;
  }

  .detail-gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .nav-brand {
    font-size: 0.95rem;
  }

  .nav-links {
    gap: 10px;
  }

  .nav-links a {
    font-size: 0.82rem;
  }
}
