/* ==========================================================================
   NSS Lab — base stylesheet
   Brand: navy #000080 (from the legacy site), Poppins typeface.
   ========================================================================== */

:root {
  --navy: #000080;
  --navy-700: #14148c;
  --navy-900: #07073f;
  --ink: #1c1f2b;
  --muted: #6e6e6e;
  --line: #e6e8ef;
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1140px;
  --shadow: 0 10px 30px rgba(7, 7, 63, 0.08);
  --shadow-sm: 0 4px 14px rgba(7, 7, 63, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 17px; }

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.25; color: var(--navy-900); font-weight: 700; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.2rem; }

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container-narrow { max-width: 820px; }

.muted { color: var(--muted); }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform 0.12s ease, background 0.18s ease, color 0.18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--navy); color: #fff; border-color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.6); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

/* ==========================================================================
   Header / navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
}

.brand { display: flex; align-items: center; gap: 0.65rem; color: var(--navy-900); }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 1px;
  color: #fff;
  background: var(--navy);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
}
.brand-text { display: flex; flex-direction: column; font-weight: 600; font-size: 1.19rem; line-height: 1.2; }
.brand-text small { font-weight: 500; color: var(--muted); font-size: 0.9rem; letter-spacing: 0.5px; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list > li > a {
  display: block;
  padding: 0.5rem 0.85rem;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
}
.nav-list > li > a:hover { color: var(--navy); background: var(--bg-alt); text-decoration: none; }
.caret { font-size: 0.7rem; }

/* Dropdown (People) */
.has-dropdown { position: relative; }
.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}
.has-dropdown:hover .dropdown,
.has-dropdown.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.92rem;
}
.dropdown a:hover { background: var(--bg-alt); color: var(--navy); text-decoration: none; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 22px; margin: 0 auto; background: var(--navy-900); transition: 0.2s; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-900) 100%);
  color: #fff;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}
.hero h1 { color: #fff; margin: 0.5rem 0 1rem; }
.hero-eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 0.78rem; font-weight: 600; color: rgba(255, 255, 255, 0.7); margin: 0; }
.hero-lead { font-size: 1.12rem; max-width: 760px; color: rgba(255, 255, 255, 0.9); }
.hero-actions { margin-top: 1.8rem; display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.news-section { background: var(--bg-alt); border-top: none; }

.section-head { margin-bottom: 2.2rem; }
.section-head h2 { margin: 0 0 0.4rem; }
.section-head p { margin: 0; color: var(--muted); }
.section-foot { margin-top: 1.8rem; }
.link-more { font-weight: 600; }

/* Research cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 0.6rem; color: var(--navy); position: relative; padding-bottom: 0.6rem; }
.card h3::after { content: ""; position: absolute; left: 0; bottom: 0; width: 38px; height: 3px; background: var(--navy); border-radius: 2px; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* News list */
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.news-item {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.news-date {
  flex: 0 0 auto;
  min-width: 120px;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--navy);
}
.news-text { font-size: 0.95rem; }
.news-venue { display: inline-block; margin-left: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); }

/* Location */
.location-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1.5rem; align-items: stretch; }
.location-info h3 { color: var(--navy); margin-top: 0; }
.location-map iframe { width: 100%; min-height: 320px; height: 100%; border: 0; border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* ==========================================================================
   Inner pages
   ========================================================================== */
.page-hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-900) 100%); color: #fff; padding: clamp(2.5rem, 6vw, 4rem) 0; }
.page-hero h1 { color: #fff; margin: 0; }
.page-subtitle { margin: 0.6rem 0 0; color: rgba(255, 255, 255, 0.85); font-size: 1.05rem; }

.page-content h2 { margin-top: 2rem; }
.page-content h2:first-child { margin-top: 0; }
.page-content ul { padding-left: 1.2rem; }

/* People rows */
.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.person-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.person-name { font-weight: 600; }
.person-role { font-weight: 500; color: var(--muted); font-size: 0.85rem; }
.person-links { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pill {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--navy);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.pill:hover { background: var(--navy); color: #fff; text-decoration: none; }
.pill-off { color: var(--muted); background: var(--bg-alt); border-color: var(--line); opacity: 0.45; cursor: default; }
.pill-off:hover { background: var(--bg-alt); color: var(--muted); }

/* Research feature rows: big figure alternating right / left / right */
.research-features { display: flex; flex-direction: column; gap: 3.5rem; }
.research-feature { display: flex; gap: 2.8rem; align-items: center; }
.research-feature:nth-child(even) { flex-direction: row-reverse; }
.rf-text { flex: 1 1 0; min-width: 0; }
.rf-text h2 { color: var(--navy); margin: 0 0 0.7rem; font-size: 1.9rem; }
.rf-text p { margin: 0; color: var(--ink); }
.rf-media { flex: 1 1 0; min-width: 0; }
.rf-media img { width: 100%; height: auto; display: block; border-radius: var(--radius); box-shadow: var(--shadow); }
.rf-topics { margin: 1.1rem 0 0; padding-left: 1.1rem; }
.rf-topics li { margin-bottom: 0.35rem; color: var(--ink); }
@media (max-width: 760px) {
  .research-feature, .research-feature:nth-child(even) { flex-direction: column; }
}

/* Publications */
.pub-year { color: var(--navy); margin: 2rem 0 0.8rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--line); }
.pub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.pub-list li { padding-left: 1.1rem; position: relative; color: var(--ink); font-size: 0.95rem; }
.pub-list li::before { content: "▪"; position: absolute; left: 0; color: var(--navy); }

/* Callout / pending notice */
.notice {
  padding: 1rem 1.2rem;
  background: #f0f3ff;
  border: 1px solid #d6ddff;
  border-left: 4px solid var(--navy);
  border-radius: var(--radius-sm);
  color: var(--navy-900);
  font-size: 0.92rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--navy-900); color: rgba(255, 255, 255, 0.85); margin-top: 0; }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; padding-top: 3rem; padding-bottom: 2.5rem; }
.footer-brand { font-size: 1.3rem; font-weight: 800; color: #fff; margin-bottom: 0.6rem; }
.footer-col h4 { color: #fff; font-size: 0.95rem; margin: 0 0 0.8rem; }
.footer-col p { margin: 0 0 0.5rem; font-size: 0.9rem; }
.site-footer a { color: #fff; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.footer-links a { font-size: 0.9rem; opacity: 0.85; }
.footer-links a:hover { opacity: 1; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 1.1rem 0; }
.footer-bottom p { margin: 0; font-size: 0.82rem; color: rgba(255, 255, 255, 0.6); }

/* ==========================================================================
   Logo, people positions, faculty, publications, gallery
   ========================================================================== */
.brand-logo { height: 52px; width: auto; display: block; }

/* People: name stacked over position (left-aligned); links to the right */
.person-row { align-items: center; }
.person-position { color: var(--muted); font-weight: 600; font-size: 0.9rem; text-align: right; flex: 0 1 auto; padding-left: 1rem; }
.people-group { color: var(--navy); margin: 2rem 0 0.9rem; }
.people-group:first-child { margin-top: 0; }

/* Faculty: intro on the left, photo on the right */
.faculty-profile { display: flex; gap: 2rem; align-items: flex-start; }
.faculty-info { flex: 1 1 auto; }
.faculty-photo { width: 180px; flex: 0 0 auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.faculty-info h2 { margin: 0 0 0.3rem; color: var(--navy); }
.faculty-info h3 { margin: 1.4rem 0 0.4rem; }
.faculty-title { color: var(--muted); font-weight: 500; margin: 0 0 1rem; }

/* Publications: title spans full width; authors + venue + Paper share the next row */
.pub-group { margin-bottom: 1.6rem; }
.pub-year { text-align: left; }
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-item { padding: 1rem 0; border-bottom: 1px solid var(--line); text-align: left; }
.pub-item:last-child { border-bottom: none; }
.pub-title { margin: 0 0 0.3rem; }
.pub-name { font-weight: 700; color: var(--ink); }
.pub-venue { color: #ff0000; font-weight: 700; }
.pub-meta { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }
.pub-meta-text { flex: 1 1 auto; min-width: 0; }
.pub-authors { display: block; font-size: 0.92rem; color: var(--ink); }
.pub-info { display: block; font-size: 0.87rem; color: var(--muted); font-style: italic; }
.pub-btn { flex: 0 0 auto; display: inline-block; padding: 0.42rem 1rem; font-size: 0.8rem; font-weight: 600; color: #fff; background: var(--navy); border-radius: 999px; white-space: nowrap; }
.pub-btn:hover { background: var(--navy-700); color: #fff; text-decoration: none; }

/* Awards: year -> award name -> prize + recipients */
.award-group { margin-bottom: 1.4rem; }
.award-year { text-align: left; color: var(--navy); margin: 1.6rem 0 0.8rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--line); }
.award-item { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.award-item:last-child { border-bottom: none; }
.award-name { margin: 0 0 0.3rem; font-weight: 700; color: var(--ink); }
.award-line { margin: 0 0 0.15rem; font-size: 0.94rem; color: var(--ink); }
.award-prize { font-weight: 700; color: var(--navy); }

/* People combined page: faculty mini-card + subgroup headings */
.faculty-mini { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 0.5rem; }
.faculty-mini img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-sm); flex: 0 0 auto; }
.faculty-mini .person-name { display: block; font-size: 1.1rem; font-weight: 700; }
.people-subgroup { color: var(--muted); margin: 1.3rem 0 0.6rem; font-size: 1rem; }

/* Gallery: full-width, one image at a time, with caption overlay + arrows */
.gallery { position: relative; }
.gallery-strip { display: flex; gap: 0; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: none; border-radius: var(--radius); box-shadow: var(--shadow); }
.gallery-strip::-webkit-scrollbar { display: none; }
.gallery-item { position: relative; flex: 0 0 100%; width: 100%; margin: 0; scroll-snap-align: center; }
.gallery-item img { width: 100%; height: 520px; display: block; object-fit: cover; }
.gallery-item figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.5rem 1.6rem 1.1rem; color: #fff; font-size: 1.15rem; font-weight: 600; line-height: 1.3; background: linear-gradient(transparent, rgba(0,0,0,0.8)); }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 52px; height: 52px; border-radius: 50%; border: none; background: rgba(7,7,63,0.55); color: #fff; font-size: 1.9rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.gallery-nav:hover { background: rgba(7,7,63,0.85); }
.gallery-prev { left: 16px; }
.gallery-next { right: 16px; }

@media (max-width: 860px) {
  .faculty-profile { flex-direction: column; }
  .faculty-photo { width: 55%; max-width: 220px; }
  .gallery-item img { height: 300px; }
  .gallery-nav { width: 42px; height: 42px; font-size: 1.5rem; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
    padding: 0.6rem 1.25rem 1rem;
  }
  .site-nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0.1rem; }
  .nav-list > li > a { padding: 0.75rem 0.5rem; }
  .has-dropdown .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0 1rem;
    display: none;
  }
  .has-dropdown.open .dropdown { display: block; }
  .location-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .news-item { flex-direction: column; gap: 0.2rem; }
  .news-date { min-width: 0; }
}
