body {
  font-family: Charter, Georgia, serif;
}

/* ===== HEADER ===== */
.header-wrapper {
    background: linear-gradient(135deg, #c3b091 0%, #d4c5a9 30%, #e8e0d0 55%, #f5f0e6 80%, #faf8f3 100%);
    position: relative;
    z-index: 10;
    overflow: hidden;
}

.header-container {
  color: #5a5148;
  text-align: left;
  padding: 28px 20px 34px;
  z-index: 10;
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
}

/* Title */
.header-title {
    margin: 0;
    font-size: clamp(52px, 6vw, 74px);
    line-height: 1;
    letter-spacing: -0.04em;
    color: #2f2a24;
    font-style: italic;
    font-weight: 700;
}

/* Subtitle */
.header-subtitle {
    margin: 10px 0 20px;
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.2;
    color: #4a4036;
    font-weight: 600;
}

/* Short description paragraph */
.header-desc {
    font-size: clamp(16px, 1.15vw, 19px);
    line-height: 1.7;
    color: #5a5148;
    margin: 0 0 24px;
    max-width: 940px;
}

/* Icon list in header — LEAD style */
.icon-container {
    display: grid;
    gap: 20px;
    margin-top: 26px;
    margin-bottom: 8px;
}

.icon-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 14px;
    align-items: start;
    color: #5a5148;
    font-size: 16px;
    line-height: 1.7;
}

.icon-item strong {
    color: #3a3028;
    font-size: 1em;
}

.feature-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #8b7355;
    font-size: 22px;
}

.feature-icon i {
    line-height: 1;
}

@media (max-width: 640px) {
    .icon-item {
        grid-template-columns: 34px 1fr;
        font-size: 15px;
    }

    .feature-icon {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }
}

/* Header image (right side, LEAD style) */
.header-image {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.header-image img {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  object-fit: contain;
}

.header-image-placeholder {
  width: 100%;
  min-height: 420px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 1rem;
  gap: 8px;
}

.header-image-placeholder i {
  font-size: 2.5rem;
}

/* When actual image is used */
.header-image img {
  width: 160%;
  max-width: none;
  height: auto;
  display: block;
  object-fit: contain;
  margin: -30px 0 -30px -20px;
  transition: transform 0.35s ease;
}

.header-image img:hover {
  transform: scale(1.03);
}


/* Buttons — LEAD style */
.button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
    margin-bottom: 10px;
}

.button-container a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  border: 2px solid #c8b896;
  background: linear-gradient(135deg, #f5f0e6, #ebe4d4);
  color: #3a3028;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.button-container a.button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  border-color: #a89270;
  background: linear-gradient(135deg, #fff, #f5f0e6);
}

.button-container a.button .icon {
  margin-right: 0;
}

.button-container a.button i {
  font-size: 0.95em;
  line-height: 1;
}

/* Desktop: side-by-side grid layout (LEAD style) */
@media (min-width: 1100px) {
  .header-container {
    grid-template-columns: minmax(0, 1.24fr) minmax(420px, 0.76fr);
    gap: 34px;
    padding: 28px 0 34px;
    min-height: 620px;
  }

  .header-content {
    max-width: 980px;
  }
}

/* Tablet */
@media (max-width: 1099px) {
  .header-container {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 10px;
    min-height: auto;
  }

  /* Image moves ABOVE the text on smaller screens */
  .header-image {
    order: -1;
  }

  .header-image img {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .header-container {
    padding: 28px 12px 34px;
  }

  .header-image img {
    max-width: 100%;
  }

  .button-container {
    gap: 10px;
  }

  .button-container a.button {
    min-height: 48px;
    padding: 0 14px;
    font-size: 14px;
  }
}

/* Byline / Authors */
.byline {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0 5px 10px;
  margin-bottom: 20px;
}

.byline-container {
    padding-top: 2rem;
    padding-bottom: 0.5rem;
    text-align: center;
}

.authors {
    line-height: 1.8;
    font-size: 1.15rem;
}

.author-name {
    white-space: nowrap;
    font-weight: 500;
}

.authors a,
.authors a * {
    text-decoration: none !important;
    border-bottom: none !important;
    color: inherit;
}

.authors a:hover,
.authors a:hover * {
    color: #007bff !important;
    text-decoration: underline !important;
}

.affiliations {
    margin-top: 0.5rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .authors {
        font-size: 1rem;
        line-height: 1.6;
    }
    .affiliations {
        font-size: 0.95rem;
    }
}

/* Article content — drop Distill grid entirely, use simple block layout */
d-article {
  display: block !important;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem 0;
  position: relative;
}

d-article section {
  margin: 0 !important;
}

/* Ensure all images stay within their container */
d-article img {
  max-width: 100%;
  height: auto;
}

d-article figure {
  text-align: center;
}


/* Underline below h1 headings */
d-article h1 {
  border-bottom: 1px solid rgba(0, 0, 0, 0.15) !important;
  padding-bottom: 0.4em !important;
}

/* Figures */
.pdf-figure {
  max-width: 100%;
  height: auto;
  border: none;
}


figcaption {
  text-align: center;
  font-size: 0.95em;
  color: #555;
  margin-top: 0.5em;
}

/* Highlight boxes */
.highlight-box {
  margin: 2rem auto;
  max-width: auto;
  padding: 1.5rem;
  background-color: #faf6ef;
  border: 2px solid #a89270;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

.highlight-box p {
  margin: 0;
  color: #3a3028;
  font-size: 1.1em;
  line-height: 1.6;
}

/* Tables */
.table-container {
  overflow-x: auto;
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid #e8e5df;
}

.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88em;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.data-table th,
.data-table td {
  padding: 0.7em 1em;
  text-align: center;
  border-bottom: 1px solid #ece9e3;
  white-space: nowrap;
}

.data-table thead th {
  background: linear-gradient(180deg, #f7f5f0, #eeebe4);
  font-weight: 700;
  border-bottom: 2px solid #c8c3b8;
  color: #3a3028;
  font-size: 0.95em;
  letter-spacing: 0.01em;
}

.data-table .tb-hdr {
  background: linear-gradient(180deg, #f7f5f0, #eeebe4);
  font-weight: 700;
  color: #3a3028;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: rgba(200, 184, 150, 0.08);
}


.data-table tr.highlight {
  background-color: rgba(200, 170, 120, 0.12) !important;
}

.data-table tr.highlight td {
  font-weight: 600;
  color: #2a2018;
}

/* Category row styling */
.data-table tbody tr[style*="background-color: #f2f8fc"] td {
  background: linear-gradient(90deg, #f5f2eb, #eeebe4) !important;
  color: #5a4e3e;
  font-size: 0.92em;
  letter-spacing: 0.02em;
  border-bottom: 1px solid #d8d3c8;
}

/* Teaser image section */
.teaser-section {
  margin-top: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.teaser-section img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* BibTeX */
#bibtex {
  position: relative;
  margin-top: 40px;
  margin-bottom: 0px;
  color: gray;
}

#bibtex pre {
  background-color: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.5;
}

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

/* Method overview icons */
.method-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.method-highlight-item {
  text-align: center;
  padding: 1.5rem 1rem;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.method-highlight-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.method-highlight-item i {
  font-size: 2rem;
  color: #0f3460;
  margin-bottom: 0.8rem;
  display: block;
}

.method-highlight-item h4 {
  margin: 0.5rem 0;
  font-size: 1rem;
  color: #333;
}

.method-highlight-item p {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

/* ===== medium-zoom overrides (must be at end to win specificity) ===== */
.medium-zoom-overlay {
  z-index: 9999 !important;
}

.medium-zoom-image--opened {
  z-index: 10000 !important;
}

img.medium-zoom-image {
  cursor: zoom-in !important;
}

img.medium-zoom-image--opened {
  cursor: zoom-out !important;
}
