:root {
  --navy:    #0d1b2a;
  --teal:    #1b8ca8;
  --teal-lt: #2fb8d8;
  --cream:   #f4f1ec;
  --gold:    #c9a84c;
  --text:    #1a1a2e;
  --muted:   #556a7a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
  max-width: 100vw;
}

/* ══ NAV ══ */
nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);
  display: flex; align-items: center;
  padding: 0 2.5rem;
  height: 56px;
  box-shadow: 0 2px 16px rgba(0,0,0,.4);
}

.nav-brand {
  font-family: 'Playfair Display', serif;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: .03em;
  white-space: nowrap;
  margin-right: 2.5rem;
  flex-shrink: 0;
}
.nav-brand span { color: var(--gold); }

.nav-links {
  display: flex; gap: 0; list-style: none;
  flex-wrap: wrap;
}
.nav-links li a {
  display: block;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .82rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 0 .9rem; line-height: 56px;
  transition: color .2s;
  position: relative;
}
.nav-links li a::after {
  content: '';
  position: absolute; bottom: 0; left: .9rem; right: .9rem;
  height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.nav-links li a:hover { color: #fff; }
.nav-links li a:hover::after,
.nav-links li a.active::after { transform: scaleX(1); }
.nav-links li a.active { color: #fff; }

/* ══ PAGES ══ */
.page { display: none; }
.page.active { display: block; }

/* ══ HERO ══ */
.hero {
  position: relative; height: 520px;
  overflow: hidden; display: flex; align-items: flex-end;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(120deg, rgba(13,27,42,.82) 38%, rgba(27,140,168,.35) 100%),
    url(bg1.png) center/cover no-repeat;
  transform: scale(1.04);
  animation: slowzoom 18s ease-in-out infinite alternate;
}
@keyframes slowzoom {
  from { transform: scale(1.04); }
  to   { transform: scale(1.10); }
}
.hero-molecule {
  position: absolute; right: 6%; top: 10%;
  opacity: .18; width: 340px;
}
.hero-content {
  position: relative; z-index: 2;
  padding: 0 3.5rem 3.5rem; max-width: 680px;
}
.hero-tag {
  display: inline-block;
  background: var(--gold); color: var(--navy);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: .25rem .75rem; border-radius: 2px; margin-bottom: 1rem;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  color: #fff; font-size: clamp(1.6rem, 4vw, 3rem);
  line-height: 1.18; margin-bottom: 1rem;
}
.hero-title em { color: var(--teal-lt); font-style: italic; }
.hero-desc {
  color: rgba(255,255,255,.8); font-size: 1.02rem;
  font-weight: 300; line-height: 1.65; max-width: 560px; margin-bottom: 1.8rem;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: .55rem;
  background: var(--teal); color: #fff;
  font-size: .88rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .65rem 1.5rem; border-radius: 3px;
  transition: background .2s, transform .15s;
  text-decoration: none;
}
.hero-cta:hover { background: var(--teal-lt); transform: translateY(-1px); }
.hero-cta svg { width: 16px; height: 16px; }

/* ══ SUB-HEADER ══ */
.sub-header {
  background: var(--navy);
  padding: 2.8rem 3.5rem 2rem;
  position: relative; overflow: hidden;
}
.sub-header::after {
  content: '';
  position: absolute; bottom: 0; left: 3.5rem; right: 3.5rem;
  height: 1px; background: rgba(201,168,76,.35);
}
.sub-header h1 {
  font-family: 'Playfair Display', serif;
  color: #fff; font-size: 2.5rem; margin-bottom: .4rem;
}
.sub-header p { color: rgba(255,255,255,.55); font-size: 1.15rem; font-weight: 300; }

/* ══ CONTENT ══ */
.content1 { max-width: 1180px; margin: 0 auto; padding: 3rem 2.5rem; overflow: visible; }
.content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 2.5rem;
}

/* ══ RESEARCH INTRO ══ */
.research-intro {
  background: #fff; border-left: 4px solid var(--teal);
  border-radius: 0 6px 6px 0; padding: 1.5rem 2rem;
  font-size: 1.02rem; line-height: 1.72; color: var(--muted);
  margin-bottom: 3rem; box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* ══ NEWS ══ */
.year-select, .pub-year-select {
  appearance: none; background: #fff;
  border: 2px solid #ddd; color: var(--muted);
  font-size: .82rem; font-weight: 700; letter-spacing: .06em;
  padding: .45rem 2.5rem .45rem 1.1rem; border-radius: 3px;
  cursor: pointer; margin-bottom: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23556a7a' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center;
}
.year-select:focus, .pub-year-select:focus { outline: none; border-color: var(--teal); }

.news-list { display: flex; flex-direction: column; gap: 1.2rem; }
.news-card {
  background: #fff; border-radius: 6px;
  display: flex; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.news-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.news-date {
  min-width: 80px; background: var(--navy); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1rem; font-family: 'Playfair Display', serif;
}
.news-date .day { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.news-date .month { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.news-body { padding: 1rem 1.4rem; }
.news-body h3 { font-size: 1rem; font-weight: 600; margin-bottom: .3rem; }
.news-body p { font-size: .88rem; color: var(--muted); line-height: 1.55; }

/* ══ GROUP ══ */
.with-sidenav { display: flex; gap: 2.5rem; align-items: flex-start; min-height: 100vh; }
.with-sidenav .main-area { flex: 1; min-width: 0; }


.side-nav {
  display: flex; flex-direction: column; gap: 0;
  background: var(--navy); border-radius: 8px;
  width: 235px; height: 330px; flex-shrink: 0;
  padding-top: 15px;
  position: sticky; top: 66px;
  max-height: calc(100vh - 76px);
}
.side-nav a {
  color: rgba(255,255,255,.7); text-decoration: none;
  font-size: 1rem; font-weight: 600; letter-spacing: .05em;
  padding: .85rem 1.5rem; border-left: 3px solid transparent;
  transition: all .2s; white-space: nowrap;
}
.side-nav a:hover, .side-nav a.active {
  color: #fff; background: rgba(255,255,255,.07);
  border-left-color: var(--gold);
}

/* ══ MEMBER CARDS ══ */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.2rem;
}
.member-card {
  background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  text-align: center; padding-bottom: 1rem;
}
.member-card:hover { transform: translateY(-3px); }
.member-avatar {
  width: 100%; aspect-ratio: 1;
  background: linear-gradient(135deg, var(--teal) 0%, var(--navy) 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.member-card h4 { font-size: .9rem; font-weight: 700; margin: .75rem .5rem .2rem; }
.member-card p  { font-size: .75rem; color: var(--muted); padding: 0 .5rem; }

/* ══ PUBLICATIONS ══ */
.pub-year-select {
  appearance: none; background: #fff;
  border: 2px solid #ddd; color: var(--muted);
  font-size: .82rem; font-weight: 700; letter-spacing: .06em;
  padding: .45rem 2.5rem .45rem 1.1rem; border-radius: 3px;
  cursor: pointer; margin-bottom: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23556a7a' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center;
}
.pub-year-select:focus { outline: none; border-color: var(--teal); }

.pub-list { display: flex; flex-direction: column; gap: .9rem; }
.pub-card {
  background: #fff; border-radius: 6px; padding: 1.2rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06); border-left: 4px solid var(--teal);
}
.pub-card:hover { transform: translateX(4px); }
.pub-card h4 { font-size: .97rem; font-weight: 700; margin-bottom: .3rem; }
.pub-card .pub-meta { font-size: .82rem; color: var(--muted); }
.pub-card .pub-journal { color: var(--teal); font-weight: 600; }

/* ══ RESEARCH TOPICS ══ */
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.topic-card {
  background: #fff; border-radius: 8px; padding: 1.8rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.07); position: relative; overflow: hidden;
}
.topic-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}
.topic-icon { font-size: 2rem; margin-bottom: .8rem; }
.topic-card h3 { font-family: 'Playfair Display', serif; font-size: 1.2rem; margin-bottom: .6rem; }
.topic-card p  { font-size: .9rem; color: var(--muted); line-height: 1.65; }

/* ══ CONTACT ══ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.contact-card { background: #fff; border-radius: 8px; padding: 2rem; box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.contact-card h3 { font-family: 'Playfair Display', serif; font-size: 1.3rem; margin-bottom: 1.2rem; color: var(--navy); }
.contact-row { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .9rem; }
.contact-icon {
  width: 36px; height: 36px; border-radius: 50%; background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--gold); font-size: .95rem;
}
.contact-row p { font-size: .9rem; color: var(--muted); line-height: 1.55; }


/* ══ GALLERY GRID ══ */
.gallery-filters {
  display: flex; gap: .6rem; margin-bottom: 1.8rem; flex-wrap: wrap;
}
.gallery-filter {
  background: #fff; border: 2px solid #ddd; color: var(--muted);
  font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: .38rem 1rem; border-radius: 3px; cursor: pointer;
  transition: all .2s;
}
.gallery-filter:hover { border-color: var(--teal); color: var(--teal); }
.gallery-filter.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
}
.gallery-item {
  border-radius: 6px; overflow: hidden;
  cursor: pointer; aspect-ratio: 4/3;
  position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
  transition: transform .25s ease, box-shadow .25s ease;
}
.gallery-item:nth-child(1) { grid-column: span 2; aspect-ratio: 16/9; }
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s ease; display: block;
}
.gallery-item:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,27,42,.72) 0%, transparent 55%);
  opacity: 0; transition: opacity .3s ease;
  display: flex; align-items: flex-end; padding: .9rem 1rem;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay span {
  color: #fff; font-size: .8rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}
.gallery-item.hidden { display: none; }

/* ══ LIGHTBOX ══ */
.lightbox {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(10,14,20,.96);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox-inner {
  position: relative; max-width: 90vw; max-height: 85vh;
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
}
#lbImg {
  max-width: 90vw; max-height: 80vh;
  object-fit: contain; border-radius: 4px;
  box-shadow: 0 16px 64px rgba(0,0,0,.6);
  transition: opacity .25s ease;
}
.lightbox-caption {
  color: rgba(255,255,255,.65); font-size: .85rem;
  font-weight: 300; letter-spacing: .05em; text-align: center;
}
.lightbox-counter {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.4); font-size: .75rem; letter-spacing: .1em;
}
.lightbox-close {
  position: fixed; top: 1.2rem; right: 1.5rem;
  background: none; border: none; color: rgba(255,255,255,.6);
  font-size: 1.6rem; cursor: pointer; line-height: 1;
  transition: color .2s; z-index: 1000;
}
.lightbox-close:hover { color: #fff; }
.lightbox-arrow {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  color: #fff; font-size: 2.2rem; line-height: 1;
  width: 52px; height: 52px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s; z-index: 1000;
}
.lightbox-arrow:hover { background: rgba(255,255,255,.18); }
.lightbox-arrow.left  { left: 1.2rem; }
.lightbox-arrow.right { right: 1.2rem; }

/* ══ VACANCIES ══ */
.vacancy-list { display: flex; flex-direction: column; gap: 1rem; }
.vacancy-card {
  background: #fff; border-radius: 8px; padding: 1.5rem 1.8rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.vacancy-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: .3rem; }
.vacancy-card p  { font-size: .88rem; color: var(--muted); }
.badge { background: var(--teal); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: .3rem .75rem; border-radius: 20px; white-space: nowrap; }
.badge.closed { background: #bbb; }

/* ══ FOOTER ══ */
footer { background: var(--navy); color: rgba(255,255,255,.45); text-align: center; font-size: .78rem; padding: 1.5rem; letter-spacing: .04em; }
footer span { color: var(--gold); }

/* ══ FADE-IN — transition only on opacity+transform, nothing else ══ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ══ RESPONSIVE TABLET (max 900px) ══ */
@media (max-width: 900px) {
  .topic-grid   { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .gallery-item:nth-child(1) { grid-column: span 1; aspect-ratio: 4/3; }
  .carousel-wrap { height: 360px; }
  .sub-header { padding: 2rem 1.5rem 1.5rem; }
  .sub-header::after { left: 1.5rem; right: 1.5rem; }
  .content { padding: 2rem 1.5rem; }
}

/* ══ RESPONSIVE MOBILE (max 600px) ══ */
@media (max-width: 600px) {

  nav {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.6rem 1rem;
    gap: 0;
  }
  .nav-brand { font-size: 1rem; margin-right: 0; padding: 0.3rem 0; }
  .nav-links {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links li a {
    font-size: .7rem; padding: 0 .5rem;
    line-height: 38px; letter-spacing: .03em;
    white-space: nowrap;
  }
  .nav-links li a::after { left: .5rem; right: .5rem; }

  .hero { height: auto; min-height: 360px; }
  .hero-content { padding: 0 1rem 2rem; }
  .hero-tag { font-size: .6rem; }
  .hero-title { font-size: clamp(1.3rem, 6vw, 1.8rem); }
  .hero-cta { font-size: .76rem; padding: .5rem 1rem; }
  .hero-molecule { display: none; }

  .sub-header { padding: 1.5rem 1rem 1.2rem; }
  .sub-header::after { left: 1rem; right: 1rem; }
  .sub-header h1 { font-size: 1.6rem; }
  .sub-header p  { font-size: .88rem; }

  .content { padding: 1.25rem 1rem; }
  .research-intro { padding: 1rem; font-size: .9rem; margin-bottom: 1.5rem; }

  .news-card { flex-direction: column; }
  .news-date { flex-direction: row; gap: .5rem; padding: .6rem 1rem; min-width: unset; justify-content: flex-start; align-items: center; }
  .news-date .day { font-size: 1.2rem; }
  .news-body { padding: .75rem 1rem; }

  .with-sidenav { flex-direction: column; gap: 1rem; }
  .side-nav { width: 100%; flex-direction: row; flex-wrap: wrap; padding: .4rem; height: auto; }
  .side-nav a { border-left: none; border-bottom: 2px solid transparent; padding: .4rem .8rem; font-size: .78rem; white-space: nowrap; }
  .side-nav a:hover, .side-nav a.active { border-left-color: transparent; border-bottom-color: var(--gold); }

  .member-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .member-avatar { font-size: 1.3rem; }
  .member-card h4 { font-size: .8rem; }
  .member-card p  { font-size: .7rem; }

  .topic-grid { grid-template-columns: 1fr; gap: .9rem; }
  .topic-card { padding: 1.2rem 1rem; }

  .gallery-grid { grid-template-columns: 1fr 1fr; gap: .4rem; }
  .gallery-item:nth-child(1) { grid-column: span 1; aspect-ratio: 4/3; }
  .carousel-wrap { height: 240px; }
  .carousel-btn { width: 38px; height: 38px; font-size: 1.6rem; }
  .carousel-btn.left  { left: .5rem; }
  .carousel-btn.right { right: .5rem; }
  #carCaption { font-size: .85rem; }
  .lightbox-arrow { width: 40px; height: 40px; font-size: 1.8rem; }

  .vacancy-card { flex-direction: column; align-items: flex-start; padding: 1rem; }

  .contact-grid { grid-template-columns: 1fr; }
  .contact-card { padding: 1.2rem 1rem; }

  .pub-card { padding: 1rem; }
  .pub-card h4 { font-size: .88rem; }
}