/* ==========================================================================
   Hero Section & Key Results Stats
   ========================================================================== */

.hero {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 64px 24px 48px;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 48px;
  align-items: start;
}

/* Left Column: Editorial Copy */
.hero-copy {
  display: flex;
  flex-direction: column;
}

.hero-copy .eyebrow {
  margin-bottom: 16px;
}

#paper-title {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.title-brand {
  font-size: clamp(3rem, 6.5vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--accent-orange) !important;
}

.title-description {
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
}

.hero-summary {
  font-size: clamp(1.1rem, 1.9vw, 1.3rem);
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 20px;
  width: 100%;
  max-width: 100%;
}

.hero-summary strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Right Column: Research Architecture Visual & Quick Links */
.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 0;
}

.hero-visual .actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
  width: 100%;
}

.hero-visual .actions .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  padding: 12px 14px;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
}

/* Right Column: 8-Bit Architecture Diagram */
.hero-diagram {
  background: var(--bg-surface);
  border: 2px solid var(--border-dark);
  box-shadow: var(--shadow-pixel-lg);
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Stepped pixel brackets on corners */
.hero-diagram::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  width: 12px;
  height: 12px;
  border-top: 4px solid var(--accent-orange);
  border-left: 4px solid var(--accent-orange);
  pointer-events: none;
}

.hero-diagram::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-bottom: 4px solid var(--accent-orange);
  border-right: 4px solid var(--accent-orange);
  pointer-events: none;
}

.hero-image-wrapper,
.figure-zoomable {
  background: #FFFFFF;
  border: 2px solid var(--border-dark);
  padding: 12px;
  box-shadow: 3px 3px 0px var(--border-dark);
  position: relative;
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: block;
}

.hero-image-wrapper:hover,
.figure-zoomable:hover {
  border-color: var(--accent-orange);
  box-shadow: 5px 5px 0px var(--border-dark);
  transform: translateY(-2px);
}

.hero-image-wrapper:focus-visible,
.figure-zoomable:focus-visible {
  outline: 3px solid var(--accent-orange);
  outline-offset: 3px;
}

.hero-diagram figcaption {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: left;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-medium);
}

.hero-diagram figcaption strong {
  font-family: var(--font-body);
  color: var(--text-primary);
  font-weight: 600;
}

.hero-diagram svg {
  width: 100%;
  height: auto;
  display: block;
}

.hero-diagram text {
  font-family: var(--font-body);
}

.hero-diagram .diagram-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}

.hero-diagram .diagram-small {
  font-family: var(--font-body);
  font-size: 12px;
}

.hero-diagram .diagram-check {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.diagram-footnote {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-medium);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: left;
}

.diagram-footnote strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Author Credits - Full Width */
.hero-credits {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 2px solid var(--border-dark);
  width: 100%;
}

.authors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.authors sup {
  color: var(--accent-orange);
  font-family: var(--font-mono);
  font-size: 0.75em;
  margin-left: 2px;
}

.affiliations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 14px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.affil-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.affil-item sup {
  color: var(--accent-orange);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8em;
}

.affil-sep {
  color: var(--border-medium);
  user-select: none;
  font-size: 0.85em;
}

.affiliation-logo {
  height: 14px;
  width: auto;
  vertical-align: middle;
  display: inline-block;
  margin: 0 1px;
  object-fit: contain;
}

.affiliation-logo--eth {
  height: 10px;
}

.affiliation-logo--uzh {
  height: 13px;
}

.affiliation-logo--sorbonne {
  height: 13px;
}

.affiliation-logo--cnrs {
  height: 12px;
}

.affiliation-logo--lip6 {
  height: 11px;
}

.affiliation-logo--sta {
  height: 14px;
}

.author-note {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 980px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 40px 16px 32px;
  }
  .title-brand {
    font-size: clamp(2.2rem, 9vw, 3.25rem);
    word-break: break-word;
  }
  .title-description {
    font-size: clamp(1.3rem, 5.5vw, 1.85rem);
    word-break: break-word;
  }
  .hero-summary {
    font-size: 1.05rem;
    margin-bottom: 24px;
  }
  .affiliations {
    gap: 6px 12px;
  }
  .affil-sep {
    display: none;
  }
  .hero-diagram {
    padding: 16px 14px;
  }
  .hero-diagram figcaption {
    font-size: 0.75rem;
  }
  .hero-visual .actions,
  .actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 32px 14px 24px;
  }
  .title-brand {
    font-size: 1.85rem;
    letter-spacing: -0.02em;
  }
  .title-description {
    font-size: 1.2rem;
    letter-spacing: -0.02em;
  }
  .hero-diagram {
    padding: 12px 10px;
  }
  .authors {
    font-size: 0.95rem;
    gap: 8px 14px;
  }
}

/* ==========================================================================
   Figure 1 Expandable Modal Dialog (Lightbox)
   Not full-screen: centered, constrained with backdrop overlay
   ========================================================================== */
.figure-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.figure-modal[hidden] {
  display: none !important;
}

.figure-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 17, 16, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.figure-modal-card {
  position: relative;
  z-index: 1;
  background: #FFFFFF;
  border: 2px solid var(--border-dark);
  box-shadow: 8px 8px 0px var(--border-dark);
  max-width: min(1080px, 94vw);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: figureModalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes figureModalPopIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.figure-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--bg-canvas-subtle);
  border-bottom: 2px solid var(--border-dark);
}

.figure-modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.figure-modal-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-orange);
}

.figure-modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.figure-modal-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  color: var(--text-primary);
  border: 2px solid var(--border-dark);
  box-shadow: 2px 2px 0px var(--border-dark);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease, color 0.1s ease;
  flex-shrink: 0;
}

.figure-modal-close:hover {
  background: var(--accent-orange-bg);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  box-shadow: 3px 3px 0px var(--border-dark);
  transform: translateY(-1px);
}

.figure-modal-close:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0px var(--border-dark);
}

.figure-modal-close:focus-visible {
  outline: 3px solid var(--accent-orange);
  outline-offset: 2px;
}

.figure-modal-close .kbd-hint {
  background: var(--bg-canvas-subtle);
  border: 1px solid var(--border-medium);
  padding: 1px 5px;
  font-size: 0.625rem;
  border-radius: 2px;
  color: var(--text-secondary);
}

.figure-modal-body {
  padding: 24px 28px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  max-height: calc(90vh - 170px);
}

.figure-modal-img {
  width: 100%;
  max-width: 1020px;
  height: auto;
  max-height: calc(90vh - 210px);
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--border-subtle);
  box-shadow: 2px 2px 0px rgba(18, 17, 16, 0.08);
}

.figure-modal-footer {
  padding: 12px 20px;
  background: #FAF8F5;
  border-top: 1px dashed var(--border-medium);
}

.figure-modal-caption {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.figure-modal-caption strong {
  color: var(--text-primary);
  font-weight: 600;
}

@media (max-width: 640px) {
  .figure-modal {
    padding: 12px;
  }
  .figure-modal-card {
    max-height: 94vh;
  }
  .figure-modal-header {
    padding: 10px 14px;
  }
  .figure-modal-title {
    font-size: 0.875rem;
  }
  .figure-modal-body {
    padding: 14px 12px;
    max-height: calc(94vh - 160px);
  }
  .figure-modal-footer {
    padding: 10px 14px;
  }
  .figure-modal-close .kbd-hint {
    display: none;
  }
}


