/* lab.css — shared styles for project deep-dive pages (envisage, future labs).
   Mirrors the inline blocks in bair-lab.html / meiler-lab.html so deep dives
   share one design system. Loaded after styles.css. */

/* disable snap scroll inherited from styles.css */
main {
  scroll-snap-type: none !important;
  height: auto !important;
  overflow: visible !important;
}
.section {
  scroll-snap-align: none !important;
  height: auto !important;
  min-height: auto !important;
  overflow: visible !important;
  display: block !important;
}
.section .container {
  max-height: none !important;
  overflow: visible !important;
}

.back-link {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: color var(--transition), padding-left 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.back-link:hover {
  color: var(--accent);
  padding-left: 0.25rem;
}

.lab-hero {
  padding: 10rem 0 5rem;
  position: relative;
  overflow: hidden;
}

.lab-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(200, 255, 0, 0.03) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 60%, rgba(200, 255, 0, 0.02) 0%, transparent 70%);
  pointer-events: none;
}

.lab-hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.lab-hero-tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: lowercase;
  margin-bottom: 1.5rem;
  animation: hero-fade-up 0.8s var(--ease-out-expo) 0.1s both;
}

.lab-hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin-bottom: 0.75rem;
  animation: hero-fade-up 0.8s var(--ease-out-expo) 0.25s both;
}

.lab-hero-role {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  animation: hero-fade-up 0.8s var(--ease-out-expo) 0.35s both;
}

.lab-hero-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 620px;
  animation: hero-fade-up 0.8s var(--ease-out-expo) 0.45s both;
}

.lab-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 3rem;
  animation: hero-fade-up 0.8s var(--ease-out-expo) 0.55s both;
}

.lab-stat {
  background: var(--bg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: background 0.3s ease;
  text-decoration: none;
  position: relative;
  cursor: pointer;
}

.lab-stat:hover {
  background: var(--bg-card);
}

.lab-stat[data-detail]::after {
  content: attr(data-detail);
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid var(--border-hover);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.6rem;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.lab-stat[data-detail]:hover::after,
.lab-stat[data-detail]:focus-visible::after {
  opacity: 1;
}

.lab-stat-num {
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--text);
  font-weight: 500;
}

.lab-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: lowercase;
}

/* methods */
.methods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.method-card {
  background: var(--bg-alt);
  padding: 2rem;
  transition: background 0.3s ease;
}

.method-card:hover {
  background: var(--bg-card-hover);
}

.method-card h4 {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.method-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
}

.method-card ul {
  list-style: none;
  margin-top: 0.5rem;
}

.method-card li {
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 0.3rem 0;
  line-height: 1.6;
}

.method-card li::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
  margin-right: 0.6rem;
  vertical-align: middle;
}

/* results */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.result-item {
  background: var(--bg);
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: baseline;
  transition: background 0.3s ease;
}

.result-item:hover {
  background: var(--bg-card);
}

.result-metric {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.result-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* methods / pipeline (numbered steps) */
.pipeline-steps {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.pipeline-step {
  background: var(--bg-alt);
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 1.5rem;
  align-items: start;
  transition: background 0.3s ease;
}

.pipeline-step:hover {
  background: var(--bg-card-hover);
}

.pipeline-step:hover .step-num {
  color: var(--accent);
}

.step-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  padding-top: 0.15rem;
  transition: color 0.3s ease;
}

.step-content h4 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.65;
}

.step-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.step-tools span {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 0.25rem 0.6rem;
  background: var(--accent-dim);
  color: var(--text-secondary);
  border-radius: 3px;
}

/* results (card grid) */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.result-card {
  background: var(--bg);
  padding: 2rem;
  transition: background 0.3s ease;
  position: relative;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.result-card:hover {
  background: var(--bg-card);
}

.result-card:hover::before {
  opacity: 1;
}

.result-card h4 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.result-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.65;
}

.result-card .mono {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* metric table (paper-style numeric comparison) */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 2rem;
}

.metric-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 0.85rem;
}

.metric-table th,
.metric-table td {
  padding: 0.9rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.metric-table thead th {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.06em;
  font-weight: 400;
  background: var(--bg-alt);
}

.metric-table td {
  color: var(--text-secondary);
}

.metric-table td:first-child {
  color: var(--text);
}

.metric-table .num {
  font-family: var(--mono);
  text-align: right;
}

.metric-table .best {
  color: var(--accent);
  font-weight: 500;
}

.metric-table tbody tr:last-child td {
  border-bottom: none;
}

.metric-table tbody tr.total td {
  background: rgba(200, 255, 0, 0.04);
  color: var(--text);
}

.metric-caption {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* publications / outputs */
.output-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 434px;
  overflow-y: auto;
}

.output-card {
  background: var(--bg-alt);
  padding: 1.5rem 2rem;
  transition: background 0.3s ease;
  cursor: pointer;
  position: relative;
}

.output-card:hover {
  background: var(--bg-card-hover);
}

.output-card.active {
  background: var(--bg-card);
  box-shadow: inset 0 0 0 1px var(--border-hover);
}

.output-card h4 {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.output-card p {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.6;
}

.output-detail-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.4s ease, margin-top 0.4s ease;
  margin-top: 0;
}

.output-detail-panel.open {
  max-height: 300px;
  opacity: 1;
  padding: 2rem;
  margin-top: 1.5rem;
}

.output-detail-panel h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.output-detail-panel p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
}

.output-poster-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  border: 1px solid rgba(200, 255, 0, 0.3);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.output-poster-link:hover {
  background: rgba(200, 255, 0, 0.08);
  border-color: var(--accent);
}

.output-status {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--accent);
  text-transform: lowercase;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

/* github cta */
.repo-cta {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  transition: border-color 0.4s ease;
  margin-top: 1.5rem;
}

.repo-cta:hover {
  border-color: var(--border-hover);
}

.repo-cta + .repo-cta {
  margin-top: 1rem;
}

.repo-cta-text h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.repo-cta-text p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 560px;
}

@media (max-width: 900px) {
  .lab-stats {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .result-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

@media (max-width: 640px) {
  .lab-hero {
    padding: 7rem 0 3rem;
  }

  .lab-stats {
    grid-template-columns: 1fr 1fr;
  }

  .pipeline-step {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1.25rem;
  }

  .step-num {
    font-size: 0.65rem;
  }

  .repo-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 1.5rem;
  }

  .metric-table {
    font-size: 0.78rem;
  }

  .metric-table th,
  .metric-table td {
    padding: 0.7rem 0.8rem;
  }
}

@media (max-width: 414px) {
  .lab-hero {
    padding: 6rem 0 2.5rem;
  }

  .method-card {
    padding: 1.5rem;
  }
}

/* footer override for deep-dive pages */
.footer {
  background: #0a1f0a;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(200, 255, 0, 0.08);
}

.footer-inner .mono,
.footer-links a {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.scroll-top-circle {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  transition: color 0.3s ease;
  vertical-align: middle;
  margin-left: 0.25rem;
}

.scroll-top-circle:hover {
  color: var(--accent);
}

/* floating return-to-projects button */
.floating-return {
  position: fixed;
  bottom: 1.1rem;
  right: 2rem;
  z-index: 100;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.floating-return:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .floating-return {
    bottom: 1rem;
    right: 1rem;
    font-size: 0.65rem;
    padding: 0.45rem 0.7rem;
  }
}

/* deep-dive typography — route display headings through the variable face and
   bloom the section labels like the main site (tokens inherited from styles.css) */
.lab-hero-title {
  font-family: var(--display);
  font-weight: 600;
}

.step-content h4,
.result-card h4,
.output-card h4 {
  font-family: var(--display);
}

.section-label {
  text-shadow: var(--accent-glow-sm);
}
