/* =========================================================================
   DESIGN TOKENS
   Adjust these variables to retheme the whole site from one place.
   ========================================================================= */
:root {
  --bg: #0B0E14;
  --bg-elev: #12161F;
  --bg-elev-2: #171C27;
  --border: #262C3A;
  --border-soft: #1D2230;

  --text: #E7E9EE;
  --text-muted: #98A2B3;
  --text-faint: #626B7C;

  --accent: #6FD9C9;       /* teal — links, active states, primary accent */
  --accent-strong: #48C4B0;
  --accent-warm: #E3AE5D;  /* warm amber — awards, highlights, used sparingly */

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius: 10px;
  --content-max: 880px;
}

/* =========================================================================
   BASE
   ========================================================================= */
* { box-sizing: border-box; }

html { color-scheme: dark; }

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

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.25em; }

img { max-width: 100%; display: block; }

.d-none { display: none !important; }

/* =========================================================================
   TOP NAV
   ========================================================================= */
.site-header {
  position: relative;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-warm) 45%, transparent 85%);
  z-index: 3;
}

.nav-bar {
  position: relative;
  z-index: 2;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active {
  color: var(--bg);
  background: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
}

#particleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border-soft);
    padding: 8px 16px 16px;
    gap: 2px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-link { border-radius: 8px; }
  #particleCanvas { display: none; }
}

/* =========================================================================
   PAGE LAYOUT
   ========================================================================= */
.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 860px) {
  .page { grid-template-columns: 1fr; padding: 28px 18px 64px; }
}

/* =========================================================================
   SIDEBAR / PROFILE
   ========================================================================= */
.sidebar {
  position: sticky;
  top: 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 28px 24px;
}

@media (max-width: 860px) { .sidebar { position: static; } }

.profile-photo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
  position: relative;
}

.profile-photo-wrap::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(111, 217, 201, 0.22) 0%, transparent 70%);
}

.profile-photo-wrap img {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  padding: 3px;
}

.profile-name {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.profile-role {
  text-align: center;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.profile-department {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.profile-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
}

.contact-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.contact-line i { color: var(--accent); width: 14px; text-align: center; }
.contact-line:hover { color: var(--text); }

.profile-cv {
  display: block;
  text-align: center;
  margin: 0 auto 20px;
  padding: 9px 18px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 500;
  width: fit-content;
}
.profile-cv:hover { background: var(--accent); color: var(--bg); text-decoration: none; }
.profile-cv i { margin-right: 6px; }

.social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.social-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-elev-2);
  color: var(--text-muted);
  font-size: 0.95rem;
}
.social-icon:hover { color: var(--accent); background: var(--bg); text-decoration: none; }

.profile-address {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-soft);
  padding-top: 16px;
  margin-bottom: 0;
}
.profile-address i { color: var(--accent-warm); margin-top: 3px; }
.profile-address p { margin: 0; }

/* =========================================================================
   CONTENT SECTIONS
   ========================================================================= */
#home-content, #publications-content, #links-content, #gallery-content {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
#home-content.is-visible, #publications-content.is-visible,
#links-content.is-visible, #gallery-content.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.content-section {
  max-width: var(--content-max);
  margin-bottom: 48px;
}
.content-section:last-child { margin-bottom: 0; }

.section-heading {
  position: relative;
  font-size: 1.4rem;
  margin-bottom: 16px;
  padding-bottom: 10px;
  padding-left: 14px;
  border-bottom: 1px solid var(--border);
}
.section-heading::before {
  content: "";
  position: absolute;
  left: 0; top: 3px;
  width: 3px;
  height: 1.1em;
  background: var(--accent);
  border-radius: 2px;
}

.section-body {
  font-size: 1.05rem;
  color: var(--text);
}
.section-body a { text-underline-offset: 2px; }

/* News */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.news-list li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  font-size: 0.98rem;
  color: var(--text-muted);
}
.news-date {
  color: var(--accent-warm);
  font-family: var(--font-display);
  font-weight: 600;
}
.news-list strong { color: var(--text); }

/* Publications */
.pub-group { margin-bottom: 32px; }
.pub-group:last-child { margin-bottom: 0; }
.pub-group h4 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 12px;
}
.pub-group ol {
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text);
  padding-left: 1.4em;
}
.pub-group li { margin-bottom: 14px; }
.pub-group li:last-child { margin-bottom: 0; }
.pub-group li::marker { color: var(--accent); font-family: var(--font-body); }
.pub-group b { color: var(--text); }
.pub-group i { color: var(--text-muted); font-style: italic; }

/* Links */
.link-entry {
  padding: 18px 0 18px 16px;
  border-top: 1px solid var(--border-soft);
  border-left: 2px solid transparent;
  transition: border-left-color 0.15s ease;
}
.link-entry:hover { border-left-color: var(--accent); }
.link-entry:first-child { border-top: none; padding-top: 0; }
.link-entry h4 { font-size: 1.1rem; margin-bottom: 4px; }
.link-url { font-size: 0.88rem; color: var(--text-faint); }
.link-url:hover { color: var(--accent); }
.link-entry p { margin-top: 10px; color: var(--text-muted); font-size: 0.98rem; }

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  max-width: none;
}
.gallery-card {
  margin: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.gallery-card:hover, .gallery-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.gallery-thumb { position: relative; overflow: hidden; }
.gallery-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-card:hover img { transform: scale(1.05); }

.photo-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(11, 14, 20, 0.75);
  border: 1px solid var(--border-soft);
  color: var(--text);
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}
.photo-count i { color: var(--accent); font-size: 0.7rem; }
.gallery-card figcaption { padding: 14px 16px; }
.gallery-card h5 { font-size: 1rem; margin-bottom: 4px; }
.gallery-card p { color: var(--text-muted); font-size: 0.85rem; margin: 0; }

/* Modal */
.modal-content {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  color: var(--text);
}
.modal-content img { border-radius: 6px; margin-bottom: 14px; }
#modalTitle { font-family: var(--font-display); margin-bottom: 2px; }
#modalMeta { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 12px; }
#modalDescription { color: var(--text-muted); text-align: left; }

.modal-photo-wrap { position: relative; }
.modal-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: rgba(11, 14, 20, 0.72);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.modal-nav-btn:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.modal-nav-prev { left: 10px; }
.modal-nav-next { right: 10px; }
.modal-counter {
  position: absolute;
  bottom: 22px;
  right: 10px;
  background: rgba(11, 14, 20, 0.72);
  border: 1px solid var(--border-soft);
  color: var(--text);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
}
.btn-secondary {
  background: var(--bg-elev-2);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--border); border-color: var(--border); }
.btn-close { filter: invert(1); }

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-faint);
  padding: 20px 24px 32px;
  border-top: none;
}

/* =========================================================================
   SCROLLBAR
   ========================================================================= */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--bg-elev-2);
  border-radius: 8px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--border); }
* { scrollbar-color: var(--bg-elev-2) var(--bg); scrollbar-width: thin; }

/* =========================================================================
   MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
