/* Google Fonts — Cabin is the closest freely-available match to Gill Sans */
@import url('https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ============================================================
   Unary Lab — Main Stylesheet
   ============================================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Base — Gill Sans (macOS/some Windows) → Cabin (Google Font fallback) */
body {
  font-family: "Gill Sans", "Gill Sans MT", "Gill Sans Nova", Cabin, Calibri, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: #333;
  background: #fff;
}

a { color: #333; text-decoration: underline; }
a:hover { color: #000; }
img { max-width: 100%; height: auto; display: block; }

/* ── Layout ──────────────────────────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 0 32px; }
main { padding: 32px 0 72px; }

/* ── Navigation ──────────────────────────────────────── */
nav {
  background: #B0B5AB;
  border-bottom: 1px solid #9da29a;
  position: relative;
}

.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.site-title {
  font-family: "Gill Sans", "Gill Sans MT", "Gill Sans Nova", Cabin, Calibri, sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #1a1a1a;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  padding: 10px 0;
}
.site-title:hover { color: #000; text-decoration: none; }

.nav-logo { height: 48px; width: auto; display: block; }

.nav-links {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: max-content;
  background: #B0B5AB;
  border-top: 1px solid #9da29a;
  flex-direction: column;
  z-index: 999;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.nav-links.open { display: flex; }
.nav-links a {
  padding: 14px 24px;
  font-size: 16px;
  color: #2d2d2d;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
  width: 100%;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.nav-links a span::after { display: none; }
.nav-links a:hover { color: #000; background: rgba(0,0,0,0.08); text-decoration: none; }
.nav-links a.active { font-weight: 700; color: #000; }

.nav-toggle {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #2d2d2d;
  padding: 8px;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ── Section titles ──────────────────────────────────── */


.page-title { font-size: 25px; font-weight: 700; color: #111; margin-bottom: 20px; }

/* ── Home: Profile ───────────────────────────────────── */
.profile {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  margin-bottom: 40px;
}

/* Left column: 1/4 of container width */
.profile-photo {
  flex: 0 0 25%;
}

/* Right column must not expand beyond its flex allocation */
.profile-info {
  flex: 1;
  min-width: 0;
}
.profile-photo img {
  width: 100%;
  border-radius: 2px;
  display: block;
}

/* Name / phonetic block in left column */
.profile-id { margin-top: 10px; }
.profile-id h1 {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  line-height: 1.3;
}
.phonetic { font-weight: 400; font-size: 15px; color: #888; }

/* Social links — vertical list under the photo */
.social-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-top: 15px;
}
.social-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #555;
  text-decoration: none;
}
.social-links a i {
  width: 15px;
  text-align: center;
  font-size: 15px;
  color: #666;
  flex-shrink: 0;
}
.social-links a span { color: #444; }
.social-links a:hover i,
.social-links a:hover span { color: #111; text-decoration: none; }

.bio p { color: #444; font-size: 15px; line-height: 1.7; margin-bottom: 8px; text-align: justify; }

/* ── Normy carousel ──────────────────────────────────── */
.normy-section { margin-top: 55px; }
.normy-caption { font-size: 15px; color: #888; margin-bottom: 8px; }
.normy-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  background: #eee;
  cursor: pointer;
}
.normy-track {
  display: flex;
  transition: transform 0.5s ease;
}
.normy-track img {
  flex-shrink: 0;
  height: 150px;
  object-fit: contain;
  background: #f5f5f5;
  display: block;
}
.normy-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.normy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background 0.2s;
}
.normy-dot.active { background: #777; }
.normy-dot:hover { background: #555; }

/* ── News ────────────────────────────────────────────── */
.news-list { list-style: none; }
.news-item {
  padding: 5px 0;
  font-size: 15px;
  color: #333;
  line-height: 1.6;
}
.news-date { color: #555; margin-right: 3px; }
.news-item a { color: navy; }
.news-item a:hover { color: #000080; }

/* ── Publication tabs ────────────────────────────────── */
.pub-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #ddd;
  margin-bottom: 20px;
}
.pub-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 25px;
  color: #555;
  cursor: pointer;
}
.pub-tab:hover { color: #111; }
.pub-tab.active { font-weight: 700; color: #111; border-bottom-color: #111; }

/* ── Publications ────────────────────────────────────── */
.pub-list { list-style: none; }

.pub-item {
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}
.pub-info { flex: 1; min-width: 0; }

.pub-title { font-weight: 700; font-size: 15px; color: #111; margin-bottom: 3px; line-height: 1.45; }
.pub-venue { font-size: 15px; color: #444; margin-bottom: 2px; }
.pub-authors { font-size: 15px; color: #666; margin-bottom: 6px; }

/* bracket-style links: [paper] [code] */
.pub-links { font-size: 15px; margin-bottom: 4px; color: navy; }
.pub-links a { color: navy; text-decoration: none; }
.pub-links a:hover { text-decoration: underline; color: #000033; }

.pub-award { font-size: 15px; color: darkred; margin-top: 2px; }

/* Year grouping header */
.year-header {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  padding-top: 24px;
  padding-bottom: 6px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 0;
}

/* ── Software ────────────────────────────────────────── */
.software-list { list-style: none; }
.software-item {
  display: flex;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}
.software-thumb { flex-shrink: 0; width: 300px; background: #eee; }
.software-thumb-pdf {
  width: 300px;
  height: 155px;
  border: 1px solid #ddd;
  display: block;
  overflow: hidden;
  pointer-events: none;
  background: #eee;
  color-scheme: light;
}
.software-info { flex: 1; }
.software-name { font-weight: 700; font-size: 15px; color: #111; margin-bottom: 2px; }
.software-venue { font-size: 15px; color: #666; font-style: italic; margin-bottom: 6px; }
.software-desc { font-size: 15px; color: #444; line-height: 1.6; margin-bottom: 6px; }

/* ── Teaching ────────────────────────────────────────── */
.teaching-intro { margin-bottom: 16px; font-size: 15px; }
.teaching-intro a { color: navy; }
.teaching-intro a:hover { color: #000080; }
.teaching-list { list-style: none; }
.teaching-item { padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 15px; }
.teaching-course { font-weight: 600; color: #111; }
.teaching-detail { color: #666; font-size: 15px; }

/* ── Team ────────────────────────────────────────────── */
.team-section { margin-bottom: 36px; }
.team-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  border-bottom: 1px solid #ddd;
  padding-bottom: 6px;
  margin-bottom: 18px;
}
.team-grid { display: flex; flex-wrap: wrap; gap: 20px; }
.team-card { width: 140px; text-align: center; }
.team-card img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 8px;
  border: 1px solid #ddd;
}
.team-card .member-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #eee;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 32px;
}
.team-card .member-name { font-size: 15px; font-weight: 600; color: #111; line-height: 1.3; }
.team-card .member-name a { text-decoration: none; color: #111; }
.team-card .member-name a:hover { text-decoration: underline; }
.team-card .member-degree { font-size: 12px; color: #777; margin-top: 2px; }
.team-card .member-info { font-size: 12px; color: #aaa; margin-top: 2px; }
.credit { color: darkred; }

.alumni-list { list-style: none; }
.alumni-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
  color: #444;
  line-height: 1.5;
}
.alumni-employment { color: #666; white-space: nowrap; flex-shrink: 0; }
.alumni-name { font-weight: 600; color: #111; }
.alumni-name a { text-decoration: none; color: #111; }
.alumni-name a:hover { text-decoration: underline; }

/* ── Photo ───────────────────────────────────────────── */
.photo-timeline { list-style: none; }
.photo-entry { margin-bottom: 32px; padding-bottom: 32px; border-bottom: 1px solid #eee; }
.photo-entry-date { font-size: 12px; color: #aaa; font-weight: 600; margin-bottom: 3px; }
.photo-entry-caption { font-size: 15px; color: #444; line-height: 1.55; }
.photo-grid { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.photo-grid img {
  width: calc(33.33% - 4px);
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid #eee;
}
.photo-grid img:hover { opacity: 0.88; }

/* Lightbox */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.88); z-index: 1000;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; }
.lightbox-pdf { width: 90vw; height: 90vh; border: none; display: none; }
.lightbox-close {
  position: absolute; top: 20px; right: 28px;
  color: #fff; font-size: 36px; cursor: pointer;
  line-height: 1; user-select: none;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .profile { flex-direction: column; }
  .profile-photo { flex: none; width: 50%; }
  .social-links { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .pub-item { flex-direction: column; }
  .software-item { flex-direction: column; }
  .software-thumb { width: 100%; }
  .software-thumb img { width: 100%; height: auto; }
  .photo-grid img { width: calc(50% - 3px); }
  .team-grid { justify-content: center; }

}

@media (min-width: 769px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex !important;
    position: static;
    flex-direction: row;
    align-items: center;
    background: none;
    border: none;
    box-shadow: none;
    z-index: auto;
  }
  .nav-links a {
    height: 72px;
    padding: 0 12px;
    font-size: 18px;
    width: auto;
    border-bottom: none;
  }
  .nav-links a span::after {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    height: 0;
    visibility: hidden;
    overflow: hidden;
  }
}
