/* ===============================
   Base Variables & Resets
   =============================== */
:root {
  --bg: #0b0d12;
  --panel: #121622;
  --text: #e7eaf0;
  --muted: #a9b2c3;
  --brand: #6aa9ff;
  --brand-2: #7ef0d8;
  --brand-3: #a58cff;
  --link: #84c0ff;
  --border: #20263a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --radius: 16px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

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

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

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 1.25rem;
}

/* ===============================
   Accessibility
   =============================== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: var(--brand);
  color: #000;
  border-radius: 8px;
  margin: 0.5rem;
  display: inline-block;
}

/* ===============================
   Header & Navigation
   =============================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, #373c4b 0%, #0b0d12cc 100%, transparent 80%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(140%) blur(8px);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem; /* Includes horizontal padding for desktop & mobile */
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background:
    radial-gradient(120% 120% at 10% 10%, var(--brand-2), transparent 60%),
    linear-gradient(135deg, var(--brand), var(--brand-3));
  box-shadow: var(--shadow);
}

/* Mobile menu toggle */
#nav-toggle { display: none; }

.burger {
  display: none;
  cursor: pointer;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
}

/* Nav links */
.nav-links {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  flex-wrap: wrap;
}
.nav-links a {
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  color: var(--text);
}
.nav-links a:hover {
  background: var(--panel);
  text-decoration: none;
}
.nav-links a.active {
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #081018;
  font-weight: 700;
}

/* Responsive nav */
@media (max-width: 800px) {
  .burger { display: block; }
  .navbar { 
    position: relative;
    padding: 1rem 1.25rem; /* Retains breathing room on the left of brand & right of burger */
  }

  .nav-links {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 65px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  #nav-toggle:checked ~ .nav-links {
    display: flex;
  }
}

/* ===============================
   Main Content
   =============================== */
main { padding: 2.25rem 0; }

.panel {
  background: linear-gradient(180deg, #121622 0%, #0f1423 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem;
}

h1 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.2;
  margin: 0 0 0.625rem;
}
h2 {
  font-size: clamp(1.125rem, 2.2vw, 1.5rem);
  margin: 1.5rem 0 0.5rem;
}

h3 {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  margin: 1rem 0 0.5rem;
  line-height: 1.3;
}

.lead {
  color: var(--muted);
  max-width: 70ch;
}

/* ===============================
   Hero Section
   =============================== */
.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 0;
  width: 100%; /* Ensures container fills parent */
}

.hero-text { 
  flex: 1 1 auto; 
  min-width: 0; /* CRITICAL FOR SAFARI: Prevents flex child from overflowing */
}

.hero-text p { 
  line-height: 1.6; 
}

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

.hero-photo {
  flex: 0 0 200px;
  width: 200px;      /* CRITICAL FOR SAFARI: Explicit width forces flex size */
  max-width: 200px;  /* Prevents image container from expanding */
}

.hero-photo img {
  width: 100%;       /* Ensures image scales to container */
  height: auto;
  max-height: 300px;
  object-fit: cover; /* Maintains aspect ratio cleanly */
  border-radius: 8px;
  display: block;
}

/* Quick links icons */
.quick-links-icons {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 1rem 0 1.5rem 0;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: color 0.2s ease, opacity 0.2s ease;
}

.icon-link:hover {
  color: var(--brand);
  opacity: 0.85;
}

/* Responsive hero (Mobile layout adjustments) */
@media (max-width: 768px) {
  .hero {
    flex-direction: column-reverse; /* Places photo at the top before name */
    align-items: center;
    text-align: center;
  }

  .hero-photo {
    margin-bottom: 1rem;
  }

  .quick-links-icons {
    justify-content: center; /* Centers icons in the middle of the row on mobile */
  }
}

/* ===============================
   News Section
   =============================== */
.section-divider {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

.news-list {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0 0 0;
}

.news-list li {
  display: flex;
  gap: 1rem;
  padding: 0.625rem 0;
  border-bottom: 1px dashed var(--border);
}

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

.news-date {
  font-weight: 700;
  color: var(--brand);
  min-width: 80px;
}

/* ===============================
   Publications
   =============================== */
.filter-bar {
  margin: 0 0 1.5rem 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--panel);
  color: var(--text);
  transition: all 0.2s ease;
  font-size: 0.85rem;
  font-weight: 600;
}

.filter-btn:hover { 
  border-color: var(--brand);
  color: var(--brand);
}

.filter-btn.active {
  background: var(--brand);
  color: #081018;
  border-color: var(--brand);
}

.pub {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}

.pub:hover {
  border-color: var(--brand);
}

.pub h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

.pub h3 a {
  color: var(--text);
}

.pub h3 a:hover {
  color: var(--brand);
  text-decoration: none;
}

.pub p {
  margin: 0.5rem 0 1rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.pub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pub-row time {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.875rem;
}

.pub-row a {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  color: var(--brand);
  background: rgba(106, 169, 255, 0.1);
  border: 1px solid rgba(106, 169, 255, 0.2);
  transition: background 0.2s ease, color 0.2s ease;
}

.pub-row a:hover {
  background: var(--brand);
  color: #081018;
  text-decoration: none;
}

/* ===============================
   Footer
   =============================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.875rem 0 3.75rem;
  color: var(--muted);
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }