:root {
  --ink: #F8F9FA;         /* was deep blue text-on-light; now light text-on-blue */
  --paper: #111B2D;        /* was off-white background; now deep blue is the primary surface */
  --paper-dim: #1B2740;    /* muted navy panel tone — card fills, table shading, hover states */
  --signal: #E14640;       /* unchanged — crimson, still reserved for interactive states only */
  --axis: #A9B2BE;         /* lightened muted blue-grey — secondary/meta text needs to stay readable on navy */
  --field: #6FA0C4;        /* lightened blue-grey accent — brighter than the brand's #457B9D so emphasis still pops against a dark page */
  --dark: #212529;         /* unchanged, available */
  --highlight-sky: #CAEBED;/* unchanged — reads as a bright highlight box against the dark page */
  --grid-line: rgba(200, 106, 61, 0.3); /* new — very subtle burnt-orange tint, background grid only */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.content-container {
  max-width: 840px;
  margin: 0 auto;
}

/* ── Navigation ── */

nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.logo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
  background: #FFFFFF;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: 0.25rem 0;
  transition: color 150ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--signal);
}

.nav-links a.active {
  color: var(--signal);
}

.nav-links a.active::before {
  content: '[ ';
}

.nav-links a.active::after {
  content: ' ]';
}

/* ── Main ── */

main {
  flex: 1;
  padding: 90px 3rem 3rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ── Footer ── */

footer {
  border-top: 1px solid var(--ink);
  padding: 1.5rem 3rem;
  margin-top: auto;
  background: var(--paper);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-info {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.75rem;
  color: var(--axis);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.footer-version {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.7rem;
  color: var(--axis);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.footer-social a {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: color 150ms ease;
  text-decoration: none;
}

.footer-social a:hover,
.footer-social a:focus-visible {
  color: var(--signal);
}

/* ── Axis Label (section header) ── */

.axis-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--axis);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.axis-tick {
  color: var(--field);
  font-size: 0.85rem;
  line-height: 1;
}

.axis-text {
  white-space: nowrap;
}

.axis-rule {
  flex: 1;
  height: 1px;
  background: var(--ink);
}

/* ── Meta Row ── */

.meta-row {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.5rem;
}

.meta-number {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 1.8rem;
  color: var(--ink);
  line-height: 1.1;
}

.meta-label {
  font-size: 0.7rem;
  color: var(--axis);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

.meta-divider {
  width: 1px;
  height: 2.8rem;
  background: var(--ink);
}

/* ── Spacing scale ── */
.space-sm { margin-bottom: 0.5rem; }
.space-md { margin-bottom: 1rem; }
.space-lg { margin-bottom: 1.5rem; }
.space-xl { margin-bottom: 2.5rem; }
.space-2xl { margin-bottom: 4rem; }

/* ── Data Row Grid (cards with seams) ── */

.data-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 280px);
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.data-row-grid.single-col {
  grid-template-columns: 1fr;
}

/* Fixed 2x2 layout for the four-department grid — avoids a single
   card orphaning onto its own row when the count is known and even,
   and equalizes both rows so all four cards match in height. */
.data-row-grid.dept-grid {
  grid-template-columns: repeat(2, 280px);
  grid-auto-rows: 1fr;
}

.dept-grid .data-row-link {
  height: 100%;
}

.dept-grid .data-row-link .data-row {
  height: 100%;
}

.data-row {
  background: var(--paper-dim);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 1px solid var(--ink);
  min-height: 145px;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.data-row:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 0 var(--ink);
}

.data-row-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.data-row-link .data-row {
  cursor: pointer;
}

/* ── Member Photo Card (with fallback initials) ── */

.member-row {
  flex-direction: row;
  gap: 1rem;
  align-items: center;
}

.member-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.member-photo {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--paper-dim);
}

.member-photo.fallback {
  background: var(--field);
}

.member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member-photo.fallback .member-initials {
  display: flex;
}

.member-initials {
  display: none;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #FFFFFF;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.member-photo img {
  transition: transform 300ms ease;
}

.data-row:hover .member-photo img {
  transform: scale(1.06);
}

.data-tag {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--field);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  line-height: 1.2;
}

.data-role {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.72rem;
  color: var(--axis);
}

.data-desc {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.5;
  margin-top: 0.2rem;
}

.data-row-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.data-row-link .data-row {
  cursor: pointer;
}

/* ── Network Graph ── */

.graph-wrap {
  width: 100%;
  margin-bottom: 3rem;
  overflow: visible;
}

.cap {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.7rem;
  color: var(--axis);
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
}

.graph-wrap svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--paper-dim);
  border: 1px solid var(--ink);
  border-radius: 4px;
}

.edge {
  stroke: var(--axis);
  stroke-width: 1;
  opacity: 0.35;
  transition: opacity 0.2s, stroke 0.2s;
}

.edge.active {
  opacity: 1;
  stroke: var(--signal);
  stroke-width: 1.5;
}

.node-dot {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.5;
  cursor: pointer;
  transition: fill 0.2s, stroke 0.2s;
}

.node-dot.dept {
  fill: var(--ink);
}

.node-dot:hover,
.node-dot.hovered {
  fill: var(--signal);
  stroke: var(--signal);
}

.node-label {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 26px;
  fill: var(--ink);
  text-anchor: middle;
  pointer-events: none;
}

.node-label.dept {
  font-size: 20px;
  font-weight: 700;
  fill: var(--field);
}

.node-label.root {
  font-size: 30px;
  font-weight: 800;
  fill: var(--ink);
}

.dept-graph .node-label {
  font-size: 8px;
}

.dept-graph .node-label.dept {
  font-size: 9px;
}

.dept-graph .node-label.root {
  font-size: 11px;
}

.node-dot.highlighted {
  fill: var(--field);
  stroke: var(--field);
  animation: nodeGlow 2.5s ease-in-out infinite;
}

.edge.highlighted {
  opacity: 1;
  stroke: var(--field);
  stroke-width: 2;
  animation: edgeShimmer 2s ease-in-out infinite;
}

@keyframes edgeShimmer {
  0%, 100% { stroke-opacity: 0.7; }
  50% { stroke-opacity: 1; }
}

.node-ring {
  fill: none;
  stroke: var(--field);
  stroke-width: 1;
  opacity: 0.45;
  animation: ringPulse 2.5s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { stroke-opacity: 0.3; }
  50% { stroke-opacity: 0.65; }
}

@keyframes nodeGlow {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* ── Headings ── */

.page-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 2.8rem;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.page-title em {
  font-style: normal;
  color: var(--field);
}

.section-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  margin: 0.5rem 0 2rem;
}
.section-title em {
  font-style: normal;
  color: var(--field);
}

.page-subtitle {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--axis);
  line-height: 1.6;
  max-width: 650px;
  margin-bottom: 2rem;
}

/* ── Section Headings ── */

h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--ink);
  margin-bottom: 1rem;
}

h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

/* ── Buttons / CTA (bracket-style) ── */

.btn {
  display: inline-block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.8rem;
  color: var(--ink);
  text-decoration: none;
  padding: 0.25rem 0;
  transition: color 150ms ease;
  border-bottom: 1px solid var(--ink);
}

.btn:hover,
.btn:focus-visible {
  color: var(--signal);
  border-bottom-color: var(--signal);
}

.btn-bracket {
  display: inline-block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.8rem;
  color: var(--ink);
  text-decoration: none;
  padding: 0.35rem 0;
  transition: color 150ms ease;
}

.btn-bracket::before {
  content: '[ ';
}

.btn-bracket::after {
  content: ' ]';
}

.btn-bracket:hover,
.btn-bracket:focus-visible {
  color: var(--signal);
}

/* ── Social Links (inline) ── */

.social-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  border: 1px solid var(--ink);
  transition: color 150ms ease, border-color 150ms ease;
  text-decoration: none;
}

.social-links a:hover,
.social-links a:focus-visible {
  color: var(--signal);
  border-color: var(--signal);
}

/* ── Back Link ── */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.75rem;
  color: var(--axis);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 150ms ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--signal);
}

/* ── Research Detail Page ── */

.research-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.75rem;
  color: var(--axis);
  margin-bottom: 1rem;
}

.research-meta-bar .research-authors {
  color: var(--field);
}

.research-abstract {
  background: var(--highlight-sky);
  color: var(--dark);
  padding: 1.5rem;
  margin: 2rem 0;
  border-left: 3px solid var(--signal);
}

.research-abstract h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--signal);
  margin-bottom: 0.75rem;
}

.research-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
}

.research-content h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.research-content h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.research-content p {
  margin-bottom: 1rem;
}

.research-content ul,
.research-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.research-content li {
  margin-bottom: 0.4rem;
}

.research-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border: 1px solid var(--ink);
}

.research-content table caption {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.75rem;
  color: var(--field);
  margin-bottom: 0.5rem;
  text-align: left;
}

.research-content th {
  background: var(--paper-dim);
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--ink);
}

.research-content td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--paper-dim);
  font-size: 0.9rem;
}

.research-content tr:hover td {
  background: var(--paper-dim);
}

/* ── Download Button ── */

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease;
}

.download-btn:hover,
.download-btn:focus-visible {
  color: var(--signal);
  border-color: var(--signal);
}

/* ── Home page specific ── */

.home-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 110px 2rem 0;
  text-align: center;
}

.home-container .main-logo {
  width: 100px;
  height: 100px;
  margin-bottom: 2rem;
  border: 1px solid var(--ink);
  background: #FFFFFF;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-container .main-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-container .page-title {
  color: var(--ink);
  font-size: 3.5rem;
}

.home-container .page-title em {
  color: var(--field);
}

.home-container .page-subtitle {
  color: var(--axis);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.home-container .social-links a {
  color: var(--ink);
  border-color: var(--ink);
}

.home-container .social-links a:hover {
  color: var(--signal);
  border-color: var(--signal);
}

.home-container .content-container {
  width: 100%;
}

/* ── Collaborations / Partner Logos ── */

.partner-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem 1.5rem;
}

.partner-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 136px;
}

.partner-logo {
  width: 128px;
  height: 128px;
  padding: 16px;
  border: 1px solid var(--paper-dim);
  border-radius: 18px;
  background: var(--paper-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.partner-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  transition: transform 250ms ease;
}

.partner-badge:hover .partner-logo {
  border-color: var(--field);
}

.partner-badge:hover .partner-logo img {
  transform: scale(1.04);
}

.partner-name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 0.75rem;
  color: var(--axis);
  text-align: center;
  letter-spacing: 0.02em;
  transition: color 200ms ease;
}

.partner-badge:hover .partner-name {
  color: var(--ink);
}

/* ── Events Grid ── */

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.event-card {
  background: var(--paper-dim);
  border: 1px solid var(--ink);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.event-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 0 var(--ink);
}

.event-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 300ms ease;
}

.event-card:hover .event-card-image {
  transform: scale(1.045);
}

.event-card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.event-card-content .data-name {
  font-size: 1rem;
}

.event-card-content .data-desc {
  font-size: 0.85rem;
  flex: 1;
}

/* ── Research List ── */

.research-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--ink);
  margin-bottom: 3rem;
}

.research-list .data-row {
  padding: 1.5rem;
}

.research-list .data-row:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 0 var(--ink);
  background: var(--paper);
}

/* ── Focus States ── */

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* ── Responsive ── */

@media (max-width: 768px) {
  nav {
    padding: 0.75rem 1.25rem;
  }

  .logo {
    font-size: 1rem;
  }

  .logo img {
    width: 26px;
    height: 26px;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.7rem;
  }

  main {
    padding: 80px 1.25rem 2rem;
  }

  .page-title {
    font-size: 2rem;
  }

  .page-subtitle {
    font-size: 0.95rem;
  }

  .meta-row {
    gap: 0;
  }

  .meta-item {
    padding: 0.5rem 1rem;
  }

  .meta-number {
    font-size: 1.4rem;
  }

  .data-row-grid,
  .data-row-grid.dept-grid {
    grid-template-columns: 1fr;
  }

  .events-grid {
    grid-template-columns: 1fr;
  }

  .graph-wrap svg {
    max-height: 300px;
  }

  footer {
    padding: 1rem 1.25rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .home-container {
    padding: 95px 1.25rem 0;
  }

  .home-container .page-title {
    font-size: 2.2rem;
  }

  .home-container .main-logo {
    width: 80px;
    height: 80px;
  }

  .partner-grid {
    gap: 1.5rem 1.75rem;
  }

  .partner-badge {
    width: 104px;
  }

  .partner-logo {
    width: 92px;
    height: 92px;
    padding: 12px;
    border-radius: 14px;
  }

  .partner-name {
    font-size: 0.68rem;
  }
}

@media (max-width: 600px) {
  .meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .meta-divider {
    width: 100%;
    height: 1px;
  }

  .meta-item {
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.5rem 0;
    width: 100%;
    justify-content: space-between;
  }
}
