/* ---- GLOBAL ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
  --accent: #c0674a;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: #1a1a1a;
  background: #fafafa;
  font-size: 1.05rem;
  line-height: 1.75;
}

/* ---- NAVBAR ---- */
.navbar {
  border-bottom: 1px solid #e0e0e0;
  background: #fafafa !important;
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.navbar-nav .nav-link {
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1a1a !important;
  padding: 0 0.8rem !important;
  transition: color 0.15s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--accent) !important;
}

.navbar-nav .nav-link .bi {
  font-size: 1rem;
}

/* ---- TYPOGRAPHY ---- */
h1, h2, h3 {
  font-weight: 500;
  letter-spacing: -0.01em;
}

h1 { font-size: 2.4rem; margin-bottom: 0.4rem; }
h2 { font-size: 1.4rem; margin-top: 2.5rem; margin-bottom: 0.8rem; }
h3 { font-size: 1.05rem; margin-top: 1.8rem; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid #c0674a33;
  transition: border-color 0.15s, opacity 0.15s;
}
a:hover { border-bottom-color: var(--accent); opacity: 0.75; }

/* suppress underline on icon links */
.navbar-nav a,
.nav-link {
  border-bottom: none !important;
}

/* ---- PAGE LAYOUT ---- */
#quarto-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

/* ---- OVERVIEW EDUCATION STRIP ---- */
.overview-education {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2.5rem 0;
  border-top: 1px solid #e0e0e0;
  margin-top: 0;
}

.edu-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.edu-col p {
  font-size: 0.92rem;
  color: #444;
  line-height: 1.65;
  margin: 0;
}

@media (max-width: 640px) {
  .overview-education { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---- HERO (index page) ---- */
.hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 3rem;
}

.hero .tagline {
  font-size: 1rem;
  font-weight: 400;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 1.4rem;
}

.hero .bio {
  font-size: 1.1rem;
  max-width: 600px;
  color: #333;
  line-height: 1.8;
}

.hero-links {
  margin-top: 2rem;
  display: flex;
  gap: 1.5rem;
}

.hero-links a {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

/* ---- SECTION PAGES ---- */
.page-header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 2.5rem;
}

.page-header .category {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

/* ---- PUBLICATIONS LIST ---- */
.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pub-list li {
  padding: 1.2rem 0;
  border-bottom: 1px solid #ebebeb;
  font-size: 0.97rem;
  line-height: 1.7;
}

.pub-list li:last-child { border-bottom: none; }

.pub-year {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-right: 0.5rem;
}

.pub-journal {
  font-size: 0.85rem;
  color: #777;
  font-style: italic;
}

/* ---- PHOTO GALLERY (legacy grid, kept for reference) ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.gallery-grid a {
  border-bottom: none;
  display: block;
  overflow: hidden;
  background: #e8e8e8;
  aspect-ratio: 4/3;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
  display: block;
}

.gallery-grid a:hover img { opacity: 0.85; }

/* ---- MASONRY PHOTO GALLERY ---- */
/* All photos cropped to portrait 2:3 in the grid; full image opens in lightbox */
.masonry-gallery {
  columns: 3 220px;
  column-gap: 0.4rem;
  margin-top: 1.5rem;
}

.masonry-gallery a {
  display: block;
  break-inside: avoid;
  margin-bottom: 0.4rem;
  overflow: hidden;
  border-bottom: none;
  background: #e8e8e8;
  aspect-ratio: 2 / 3;
}

.masonry-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 0.2s;
}

.masonry-gallery a:hover img { opacity: 0.88; }

@media (max-width: 600px) {
  .masonry-gallery { columns: 2 140px; }
}

/* ---- SOFTWARE CARDS ---- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 1.5rem;
}


.project-card {
  border: 1px solid #e0e0e0;
  padding: 1.4rem;
  background: #fff;
  transition: border-color 0.15s;
}

.project-card:hover { border-color: var(--accent); }

.project-card h3 {
  font-size: 0.97rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.project-card h3 a {
  color: inherit;
  text-decoration: none;
}

.project-card h3 a:hover { color: var(--accent); }

.project-card .lang {
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

.project-card p {
  font-size: 0.9rem;
  color: #555;
  margin: 0;
  line-height: 1.6;
}

/* ---- DATAVIZ CAROUSEL ---- */
.viz-carousel {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  align-items: flex-start;
}

.viz-main {
  flex: 1 1 auto;
  min-width: 0;
}

.viz-image-wrap {
  background: #f5f5f5;
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.viz-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 0.6rem;
  transition: opacity 0.18s;
}

.viz-caption {
  padding-top: 0.8rem;
  border-top: 1px solid #e8e8e8;
  margin-top: 0.6rem;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.viz-cap-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

.viz-cap-desc {
  font-size: 0.88rem;
  color: #555;
  flex: 1 1 auto;
}

.viz-cap-link {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent) !important;
  border-bottom: 1px solid var(--accent) !important;
  white-space: nowrap;
}

.viz-cap-link:hover { opacity: 0.75; }

.viz-thumbs {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 130px;
  flex-shrink: 0;
  max-height: 600px;
  overflow-y: auto;
}

.viz-thumb {
  display: block;
  background: #f5f5f5;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  transition: border-color 0.15s, opacity 0.15s;
  flex-shrink: 0;
}

.viz-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.viz-thumb:hover { opacity: 0.8; }

.viz-thumb.active {
  border-color: var(--accent);
}

@media (max-width: 640px) {
  .viz-carousel { flex-direction: column; }
  .viz-thumbs {
    flex-direction: row;
    width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .viz-thumb { width: 80px; flex-shrink: 0; }
}

/* ---- PLACEHOLDER IMAGE ---- */
.img-placeholder {
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.85rem;
  width: 100%;
}

/* ---- FOOTER ---- */
.page-footer {
  border-top: 1px solid #e0e0e0;
  margin-top: 5rem;
  padding: 2rem 0;
  font-size: 0.82rem;
  color: #888;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .project-grid { grid-template-columns: 1fr; }
}
