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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
  color: #333;
  background-color: #fafafa;
  font-size: 18px;
}

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

.section img {
  width: 100%;
  height: auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1, h2, h3 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: #111;
}

h1 {
  line-height: 1.15;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.2rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: #0f62fe;
}

figure {
  margin: 0;
}

figcaption {
  font-size: 0.95rem;
  color: #555;
  margin-top: 0.75rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

body.lightbox-open {
  overflow: hidden;
}

.navbar {
  background-color: #fff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #111;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo img {
  width: auto;
  height: 42px;
  margin-right: 0.75rem;
  border-radius: 8px;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
  padding: 8px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: #333;
  transition: 0.3s;
  border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}

nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

nav a:hover {
  color: #0f62fe;
  background-color: #f3f6fb;
}

.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.hero-heading {
  text-align: center;
  padding: 4rem 1rem 2rem;
}

.hero-heading h1 {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.hero-tagline {
  font-size: 1.35rem;
  color: #444;
  max-width: 960px;
  margin: 0 auto 1rem;
}

.hero-authors {
  font-size: 1.08rem;
  color: #666;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.5rem;
  text-align: center;
}

.hero-authors .author {
  white-space: nowrap;
}

.hero-authors .author::after {
  content: ", ";
}

.hero-authors .author:last-child::after {
  content: "";
}

.hero-affiliations {
  display: block;
  font-size: 1rem;
  color: #666;
  max-width: 980px;
  margin: 0.75rem auto 0;
  text-align: center;
}

.hero-affiliations span {
  display: block;
  margin-bottom: 0.2rem;
}

.hero-notes {
  margin-top: 0.75rem;
  color: #666;
  font-size: 0.95rem;
}

.hero-links {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.resource-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: #222;
  color: #fff;
  text-decoration: none;
  padding: 0.58rem 1rem;
  border-radius: 8px;
  transition: background-color 0.2s;
  font-size: 0.95rem;
  min-height: 48px;
}

.resource-link-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  max-width: 24px;
  min-height: 24px;
  max-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  overflow: hidden;
}

.resource-link-icon img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  display: block;
}

.resource-link:hover {
  background-color: #444;
  color: #fff;
}

.section {
  padding: 3rem 0;
  background-color: #fff;
}

.section:nth-of-type(even) {
  background-color: #f5f7fb;
}

.news-item,
.callout,
.metric-card,
.text-card,
.code-block {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.news-item {
  border-left: 4px solid #3b8ea5;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.news-item p {
  margin: 0;
}

.callout {
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}

.metrics-grid,
.figure-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  padding: 1.25rem;
}

.metric-card strong {
  display: block;
  font-size: 2rem;
  color: #111;
}

.metric-card span {
  display: block;
  color: #666;
  font-size: 0.95rem;
}

.figure-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.results .figure-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analysis-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analysis-text-row {
  margin-top: 1.25rem;
}

.figure-card,
.text-card {
  padding: 1rem;
  overflow: hidden;
}

.figure-card {
  display: flex;
  flex-direction: column;
}

.figure-card img {
  border-radius: 8px;
  background: #fff;
}

.chart-block {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
}

.figure-card figcaption {
  min-height: 4.8rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.dynamic-figure {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.dynamic-figure.figure-visible {
  opacity: 1;
  transform: translateY(0);
}

.interactive-image {
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border-radius: 10px;
}

.interactive-image:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2000;
}

.image-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.image-lightbox img {
  max-width: min(1200px, 92vw);
  max-height: 82vh;
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  background: #fff;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-caption {
  margin-top: 1rem;
  color: #f1f1f1;
  text-align: center;
  max-width: 900px;
  font-size: 0.95rem;
}

.figure-card h3,
.text-card h3 {
  margin-bottom: 0.75rem;
}

#analysis .text-card {
  padding: 1rem 1.1rem;
}

#analysis .text-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.9rem;
}

#analysis .text-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.code-block {
  padding: 1.25rem;
  overflow-x: auto;
}

pre,
code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer {
  background-color: #111;
  color: #eee;
  text-align: center;
  padding: 2rem 1rem;
}

.footer a {
  color: #7ab6ff;
}

@media (max-width: 960px) {
  .metrics-grid,
  .figure-grid {
    grid-template-columns: 1fr 1fr;
  }

  .results .figure-grid {
    grid-template-columns: 1fr 1fr;
  }

  .analysis-chart-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 17px;
  }

  .hero-heading {
    padding-top: 3rem;
  }

  .hero-heading h1 {
    font-size: 2.3rem;
  }

  .hero-tagline {
    font-size: 1.1rem;
  }

  .logo img {
    height: 32px;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  nav ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
  }

  nav ul.mobile-menu-open {
    display: flex;
  }

  .metrics-grid,
  .figure-grid {
    grid-template-columns: 1fr;
  }

  .results .figure-grid {
    grid-template-columns: 1fr;
  }

  .analysis-chart-grid {
    grid-template-columns: 1fr;
  }
}
