/* AWARE Project Page Styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #f59e0b;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-dark: #0f172a;
  --text: #1e293b;
  --text-light: #64748b;
  --text-inv: #f1f5f9;
  --border: #e2e8f0;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.6;
  background: var(--bg);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar .logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar .logo-img {
  height: 128px;
  width: auto;
}

.navbar-repos {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 1rem;
}

.navbar-repos a {
  display: flex;
  align-items: center;
  height: 128px;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
}

.navbar-repos a:hover {
  opacity: 1;
  transform: scale(1.1);
}

.navbar-repos img {
  height: 50px;
  width: auto;
}

.navbar nav { display: flex; gap: 1.5rem; }

.navbar nav a {
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.navbar nav a:hover { color: var(--primary); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text);
}

/* Hero */
.hero {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-inv);
  position: relative;
  overflow: hidden;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Smooth crossfade for hero background */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -3;
  background-size: cover;
  background-position: center center;
  opacity: 1;
  transition: opacity 5s cubic-bezier(0.77,0,0.175,1);
  pointer-events: none;
}

.hero-bg.fade-out {
  opacity: 0;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #1a2a3a;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080"><defs><filter id="blur"><feGaussianBlur stdDeviation="2"/></filter></defs></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  animation: slideBackgrounds 24s infinite linear;
  z-index: -2;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 58, 95, 0.7) 50%, rgba(37, 99, 235, 0.5) 100%);
  z-index: -1;
}

.hero > * {
  position: relative;
  z-index: 1;
}

@keyframes slideBackgrounds {
  0% { background-image: url('../images/bg/night.png'); }
  14% { background-image: url('../images/bg/night.png'); }
  15% { background-image: url('../images/bg/foggy.png'); }
  29% { background-image: url('../images/bg/foggy.png'); }
  30% { background-image: url('../images/bg/rainy.png'); }
  44% { background-image: url('../images/bg/rainy.png'); }
  45% { background-image: url('../images/bg/snowy.png'); }
  59% { background-image: url('../images/bg/snowy.png'); }
  60% { background-image: url('../images/bg/cloudy.png'); }
  74% { background-image: url('../images/bg/cloudy.png'); }
  75% { background-image: url('../images/bg/image.png'); }
  89% { background-image: url('../images/bg/image.png'); }
  90% { background-image: url('../images/bg/night.png'); }
  100% { background-image: url('../images/bg/night.png'); }
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  max-width: 900px;
  margin: 0 auto 1rem;
  line-height: 1.2;
}

.hero .subtitle {
  font-size: 1.1rem;
  color: #94a3b8;
  max-width: 700px;
  margin: 0 auto 1.5rem;
}

.hero .authors {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin-bottom: 2rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
}
.btn-outline:hover { border-color: white; }

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

/* Sections */
.section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-alt {
  background: var(--bg-alt);
}

.section-dark {
  background: var(--bg-dark);
  color: var(--text-inv);
}

.section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section .section-subtitle {
  color: var(--text-light);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

/* Key Findings Cards */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.finding-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.finding-card .number {
  display: inline-block;
  background: var(--primary);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  text-align: center;
  line-height: 32px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.finding-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.finding-card p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Figure Gallery */
.figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.figure-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.figure-card:hover { box-shadow: var(--shadow-lg); }

.figure-card img {
  width: 100%;
  height: auto;
  display: block;
}

.figure-card .caption {
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

.figure-card .caption strong {
  color: var(--text);
}

/* AWACS Section */
.awacs-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.awacs-stripe {
  text-align: center;
}

.awacs-stripe img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.awacs-stripe .label {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* Interactive Violin Chart */
.chart-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin: 1.5rem 0;
  position: relative;
}

.chart-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

.chart-controls label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
}

.chart-controls select, .chart-controls input[type="text"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  background: white;
}

/* Interactive Gallery */
.gallery-section {
  max-width: 1200px;
  margin: 0 auto;
}

/* Input Image Thumbnail Strip */
.gallery-input-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 1rem 0.5rem;
  margin-bottom: 1.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.gallery-input-strip::-webkit-scrollbar {
  height: 6px;
}
.gallery-input-strip::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.gallery-input-thumb {
  flex-shrink: 0;
  width: 140px;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  border: 3px solid transparent;
  transition: all 0.2s;
  background: white;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
}

.gallery-input-thumb:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.gallery-input-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary), var(--shadow-lg);
}

.gallery-input-thumb img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.gallery-input-thumb .thumb-label {
  padding: 0.35rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Selected Input Preview */
.gallery-selected-input {
  margin-bottom: 1.5rem;
}

.selected-input-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  border-left: 4px solid var(--primary);
}

.selected-input-card img {
  width: 200px;
  height: 130px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.selected-input-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.selected-input-info p {
  color: var(--text-light);
  font-size: 0.85rem;
}

/* Gallery Filters */
.gallery-filters {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.gallery-filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.gallery-filter-row + .gallery-filter-row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.gallery-filters .filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  min-width: 60px;
}

.gallery-filters .filter-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0;
}

.gallery-filters .pill {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--border);
  background: white;
  transition: all 0.2s;
  color: var(--text);
}

.gallery-filters .pill:hover {
  border-color: var(--pill-color, var(--primary));
  color: var(--pill-color, var(--primary));
}

.gallery-filters .pill.active {
  background: var(--pill-color, var(--primary));
  color: white;
  border-color: var(--pill-color, var(--primary));
}

.gallery-filters select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  background: white;
  min-width: 180px;
}

/* Gallery Results */
.gallery-results {
  min-height: 200px;
}

.gallery-placeholder {
  text-align: center;
  color: var(--text-light);
  padding: 3rem 1rem;
  font-size: 1rem;
}

/* Strategy Group */
.gallery-strategy-group {
  margin-bottom: 2rem;
}

.gallery-strategy-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.gallery-strategy-header h4 {
  font-size: 1rem;
  font-weight: 700;
}

.gallery-strategy-header .family-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.gallery-item {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  cursor: pointer;
}

.gallery-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.gallery-item .info {
  padding: 0.5rem 0.75rem;
}

.gallery-item .info .condition-name {
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: capitalize;
}

.gallery-item .info .strategy-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.gallery-item .info .family-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.family-2drendering { background: #d5f5e3; color: #1e8449; }
.family-cnngan { background: #d6eaf8; color: #2471a3; }
.family-styletransfer { background: #e8daef; color: #7d3c98; }
.family-diffusion { background: #fadbd8; color: #c0392b; }
.family-multimodaldiffusion { background: #fce4f0; color: #c2185b; }
.family-standardaug { background: #fef3c7; color: #92400e; }
.family-baseline { background: #e5e7eb; color: #6b7280; }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: var(--radius);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

/* Tables */
.data-table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: white;
}

.data-table th {
  background: var(--bg-dark);
  color: var(--text-inv);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.data-table th:hover { background: #1e293b; }

.data-table th .sort-arrow { margin-left: 0.25rem; opacity: 0.5; }
.data-table th.sorted .sort-arrow { opacity: 1; }

.data-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover { background: #f8fafc; }

.data-table .positive { color: var(--success); font-weight: 600; }
.data-table .negative { color: var(--danger); font-weight: 600; }
.data-table .best { font-weight: 700; background: #fefce8; }

/* Filter pills */
.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.pill {
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--border);
  background: white;
  transition: all 0.2s;
}

.pill:hover { border-color: var(--primary); }
.pill.active { background: var(--primary); color: white; border-color: var(--primary); }

/* BibTeX */
.bibtex-block {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: var(--radius);
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-x: auto;
  position: relative;
}

.bibtex-block .copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  cursor: pointer;
}

.bibtex-block .copy-btn:hover { background: var(--primary-dark); }

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-item {
  text-align: center;
}

.stat-item .stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-item .stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  gap: 0;
}

.tab {
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-size: 0.9rem;
}

.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Footer */
.footer {
  background: var(--bg-dark);
  color: var(--text-light);
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
}

.footer a { color: var(--primary); text-decoration: none; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .hero { padding: 2.5rem 1rem; min-height: 320px; }
  .section { padding: 2.5rem 1rem; }
  .navbar nav { display: none; }
  .navbar nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  .nav-toggle { display: block; }
  .navbar-repos { display: none; }
  .awacs-grid { grid-template-columns: repeat(4, 1fr); }
  .figure-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .gallery-input-thumb { width: 110px; }
  .gallery-input-thumb img { height: 70px; }
  .selected-input-card { flex-direction: column; }
  .selected-input-card img { width: 100%; height: auto; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* Chart tooltip */
.chart-tooltip {
  position: absolute;
  background: var(--bg-dark);
  color: var(--text-inv);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
  display: none;
}

/* Accordion for supplementary */
.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.accordion-header {
  padding: 1rem 1.25rem;
  background: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  transition: background 0.2s;
}

.accordion-header:hover { background: var(--bg-alt); }

.accordion-header .chevron {
  transition: transform 0.2s;
  font-size: 0.8rem;
}

.accordion-item.open .accordion-header .chevron {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1.25rem;
}

.accordion-item.open .accordion-body {
  max-height: 2000px;
  padding: 0 1.25rem 1.25rem;
}

/* Search */
.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.highlight { background: #fef9c3; padding: 0.1rem 0.2rem; border-radius: 2px; }

/* Hero logo */
.hero-logo {
  max-width: 350px;
  margin-bottom: 1.5rem;
}

/* Active nav link */
.nav-active { color: var(--primary) !important; }

/* Sub-page header */
.page-header {
  background: var(--bg-dark);
  color: var(--text-inv);
  padding: 2rem 2rem 1.75rem;
  margin-top: 64px;
}

.page-header .breadcrumb {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.page-header .breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.page-header .breadcrumb a:hover { text-decoration: underline; }

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: #94a3b8;
  font-size: 0.95rem;
  max-width: 700px;
}

/* Page navigation cards (main page → sub-pages) */
.page-nav-section {
  background: var(--bg-alt);
  padding: 4rem 2rem;
}

.page-nav-section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-nav-section .section-subtitle {
  color: var(--text-light);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.page-nav-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.page-nav-card {
  display: block;
  text-decoration: none;
  background: white;
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition: all 0.2s;
  color: var(--text);
}

.page-nav-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.page-nav-card .card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.page-nav-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.page-nav-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .page-header h1 { font-size: 1.35rem; }
  .page-nav-grid { grid-template-columns: 1fr; }
}

/* Download list in supplementary */
.download-list {
  list-style: none;
  padding: 0;
}

.download-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.download-list li:last-child { border-bottom: none; }

.download-desc {
  color: var(--text-light);
  font-size: 0.8rem;
}

/* Method family headings in supplementary */
.method-family-heading {
  margin: 1rem 0 0.5rem;
}

.method-family-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.method-list {
  font-size: 0.85rem;
  line-height: 1.8;
  padding-left: 1.25rem;
}

.formula-block {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
}
.formula-block p {
  margin: 0.25rem 0;
}
.formula-block .method-list {
  margin-top: 0.5rem;
  margin-bottom: 0;
}
.formula {
  font-family: 'Courier New', monospace;
  font-size: 0.88rem;
  color: var(--text);
  padding: 0.3rem 0;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   Architecture Flow Diagram
   ═══════════════════════════════════════════════════════════════ */

.arch-diagram-wrap {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.arch-diagram-wrap.arch-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Controls */
.arch-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.arch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-light);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.arch-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}

.arch-play-btn {
  width: 36px;
  justify-content: center;
  font-size: 0.85rem;
  padding: 0.35rem 0;
}

.arch-hint {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-light);
  opacity: 0.7;
}

/* SVG Canvas */
.arch-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: default;
  overflow: visible;
}

/* Node styles */
.arch-node {
  cursor: pointer;
  opacity: 0;
  animation: archNodeIn 0.5s ease forwards;
  animation-delay: var(--delay, 0s);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.arch-diagram-wrap.arch-visible .arch-node {
  animation: archNodeIn 0.5s ease forwards;
  animation-delay: var(--delay, 0s);
}

/* ensure nodes are invisible before the wrapper is visible */
.arch-diagram-wrap:not(.arch-visible) .arch-node {
  animation: none;
  opacity: 0;
}

@keyframes archNodeIn {
  0%   { opacity: 0; transform: translateY(8px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0)   scale(1);    }
}

.arch-node rect {
  transition: filter 0.25s, stroke-width 0.25s, transform 0.25s;
}

.arch-node:hover rect,
.arch-node.arch-highlighted rect {
  filter: url(#archShadow) brightness(1.03);
  stroke-width: 3;
}

.arch-node.arch-dimmed {
  opacity: 0.18 !important;
  pointer-events: none;
}

.arch-node:focus {
  outline: none;
}

.arch-node:focus rect {
  stroke: var(--primary);
  stroke-width: 3;
}

/* Connection paths */
.arch-conn-path {
  transition: stroke-opacity 0.35s, stroke-width 0.35s;
}

/* Particles */
.arch-particle {
  pointer-events: none;
  will-change: transform;
}

.arch-svg.arch-paused .arch-particle-layer {
  display: none;
}

/* Tooltip */
.arch-tooltip {
  position: absolute;
  z-index: 100;
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.78rem;
  line-height: 1.45;
  max-width: 280px;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  opacity: 0;
  animation: archTTIn 0.15s ease forwards;
}

@keyframes archTTIn {
  to { opacity: 1; }
}

.arch-tt-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.arch-tt-sub {
  color: #94a3b8;
  margin-bottom: 0.3rem;
}

.arch-tt-detail {
  color: #cbd5e1;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 0.35rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
  .arch-diagram-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .arch-svg {
    min-width: 800px;
  }
  .arch-hint {
    display: none;
  }
}

/* ===================== PROMPT PAGE ===================== */

/* Pipeline overview */
.prompt-pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.pipeline-step {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  flex: 1;
  min-width: 220px;
  max-width: 320px;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.pipeline-step:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.pipeline-step h3 {
  margin: 0.5rem 0 0.4rem;
  font-size: 1.1rem;
}
.pipeline-step p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}
.pipeline-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pipeline-arrow {
  font-size: 1.8rem;
  color: var(--text-secondary);
  font-weight: 300;
}

/* Prompt grid */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.prompt-grid--weather {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.prompt-grid--counter {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Prompt card */
.prompt-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.prompt-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.prompt-card--target {
  border-color: #64748b;
  border-width: 2px;
}
.prompt-card--confounder {
  border-left: 3px solid #ef4444;
}
.prompt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.prompt-category-badge {
  display: inline-block;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
}
.prompt-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Prompt list */
.prompt-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.prompt-list li {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.3rem;
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.08);
  color: var(--text-primary);
  word-break: break-word;
}
.prompt-list li:hover {
  background: rgba(99, 102, 241, 0.09);
  border-color: rgba(99, 102, 241, 0.15);
}
.prompt-note {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* Stats row  */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.stat-item {
  text-align: center;
  min-width: 100px;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Image generation prompt styles */
.prompt-variant-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.prompt-tab {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.prompt-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.prompt-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.prompt-grid--gen {
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}
.prompt-card--gen {
  border-left: 3px solid var(--accent);
}
.gen-prompt-block {
  margin-bottom: 0.75rem;
}
.gen-prompt-block:last-child {
  margin-bottom: 0;
}
.gen-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}
.gen-label--pos {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}
.gen-label--neg {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.gen-prompt-text {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.08);
  margin: 0;
  word-break: break-word;
}
.gen-prompt-text.neg {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.08);
}

/* Responsive prompts */
@media (max-width: 768px) {
  .prompt-grid {
    grid-template-columns: 1fr;
  }
  .prompt-grid--gen {
    grid-template-columns: 1fr;
  }
  .prompt-pipeline {
    flex-direction: column;
  }
  .pipeline-arrow {
    transform: rotate(90deg);
  }
  .stats-row {
    gap: 1rem;
  }
}

/* ═════════════════════════════════════════════════════
   Segmentation Results Page
   ═════════════════════════════════════════════════════ */

/* Control bar */
.seg-control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}
.seg-control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.seg-control-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
  white-space: nowrap;
}
.seg-control-group select {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
}

/* Reference row (Input + GT) */
.seg-reference-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.seg-ref-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.seg-ref-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.seg-img-wrap {
  position: relative;
  overflow: hidden;
  background: #1a1a2e;
}
.seg-img-wrap img {
  width: 100%;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.seg-img-wrap img:hover {
  transform: scale(1.02);
}
.seg-ref-label {
  text-align: center;
  padding: 0.6rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Section heading inside viewer */
.seg-section-heading {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

/* Predictions grid */
.seg-predictions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.seg-pred-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  border-top: 3px solid var(--model-color, var(--accent));
  transition: box-shadow 0.2s, transform 0.2s;
}
.seg-pred-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.seg-pred-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.seg-model-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Slider comparison widget ── */
.seg-slider-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.seg-slider-controls label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-light);
}
.seg-slider-controls select {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
}
.seg-slider-widget {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #1a1a2e;
  max-width: 900px;
  margin: 0 auto;
  user-select: none;
}
.seg-slider-img-left,
.seg-slider-img-right {
  position: absolute;
  inset: 0;
}
.seg-slider-img-right {
  position: relative;
}
.seg-slider-img-left {
  z-index: 2;
  clip-path: inset(0 50% 0 0);
}
.seg-slider-img-left img,
.seg-slider-img-right img {
  width: 100%;
  display: block;
}
.seg-slider-tag {
  position: absolute;
  bottom: 10px;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  pointer-events: none;
  z-index: 3;
}
.seg-slider-tag-left  { left: 10px;  background: rgba(99,102,241,0.85); }
.seg-slider-tag-right { right: 10px; background: rgba(30,30,60,0.75); }
.seg-slider-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: col-resize;
  z-index: 10;
  margin: 0;
}
.seg-slider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  z-index: 5;
  pointer-events: none;
  transform: translateX(-50%);
}

/* ── Toggle overlay ── */
.seg-toggle-viewer {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #1a1a2e;
  max-width: 900px;
  margin: 0 auto;
}
.seg-toggle-layer {
  width: 100%;
  display: block;
}
.seg-toggle-top {
  position: absolute;
  inset: 0;
  transition: opacity 0.15s ease;
}
.seg-toggle-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(99,102,241,0.9);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.2rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  z-index: 5;
  user-select: none;
  transition: background 0.2s;
}
.seg-toggle-btn:hover { background: rgba(99,102,241,1); }
.seg-toggle-btn:active { background: rgba(79,82,221,1); }
.seg-toggle-hint {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ── Comparison strip ── */
.seg-strip-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
}
.seg-strip-item {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.seg-strip-item .seg-img-wrap img {
  height: 180px;
  object-fit: cover;
}
.seg-strip-label {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
}

/* ── Responsive segmentation ── */
@media (max-width: 768px) {
  .seg-reference-row {
    grid-template-columns: 1fr;
  }
  .seg-predictions-grid {
    grid-template-columns: 1fr;
  }
  .seg-control-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .seg-slider-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  .seg-strip-item {
    flex: 0 0 220px;
  }
}
