/* ============================================================
   BanglaBox demo page — StyleTTS2-style table layout
   + Nerfies-style chrome + Noto Sans Bengali for Bangla text
   ============================================================ */

:root {
  --primary: #5e35b1;        /* deep purple — matches paper figures */
  --primary-light: #ede7f6;
  --primary-dark: #4527a0;
  --accent: #00897b;
  --bg: #ffffff;
  --bg-alt: #fafafa;
  --bg-section: #f8f7fb;
  --border: #e5e5e8;
  --text: #1a1a1a;
  --text-muted: #5a5a5a;
  --text-light: #888;
  --ours-bg: #ede7f6;
  --ours-border: #5e35b1;
  --code-bg: #f5f5f7;
  --max-width: 1200px;
  --radius: 8px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== HERO ==================== */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, #ffffff 100%);
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.venue-badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(94, 53, 177, 0.1);
  color: var(--primary-dark);
  border: 1px solid rgba(94, 53, 177, 0.2);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.hero .subtitle {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 820px;
  margin: 0 auto 12px;
  line-height: 1.45;
}

.hero .authors {
  font-size: 16px;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 28px;
}

.badge-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--text);
  color: white;
  text-decoration: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.15s ease, background 0.15s ease;
}

.badge:hover { background: var(--primary-dark); transform: translateY(-1px); }
.badge span { font-size: 16px; }

.abstract {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 28px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.abstract strong { color: var(--primary-dark); font-weight: 600; }

/* ==================== TOC ==================== */
.toc-bar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.toc-bar .container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 12px 24px;
  font-size: 13px;
}

.toc-bar a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.toc-bar a:hover { color: var(--primary-dark); background: var(--primary-light); }

/* ==================== SECTIONS ==================== */
main { padding: 24px 0 48px; }

section {
  margin: 56px 0;
  scroll-margin-top: 80px;
}

section h2 {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  letter-spacing: -0.01em;
}

section h2 small {
  font-size: 16px;
  color: var(--text-light);
  font-weight: 400;
}

section h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 16px 0 10px;
}

section h3 small {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 400;
}

section h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 14px 0 8px;
}

.section-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 22px;
  max-width: 980px;
}

.section-desc strong { color: var(--primary-dark); }

/* ==================== BANGLA TYPOGRAPHY ==================== */
.bangla {
  font-family: 'Noto Sans Bengali', 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}

.bangla.mini-bn { font-size: 13px; line-height: 1.5; }

.gloss {
  font-size: 12.5px;
  color: var(--text-light);
  font-style: italic;
  margin-top: 4px;
  line-height: 1.45;
}

.domain-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

/* ==================== COMPARISON TABLES ==================== */
.table-scroll {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: var(--radius);
}

table.compare {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table.compare thead th {
  background: var(--bg-alt);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 10px;
  border-bottom: 2px solid var(--border);
  text-align: center;
  white-space: nowrap;
}

table.compare thead th.text-col {
  text-align: left;
  min-width: 280px;
  max-width: 360px;
  white-space: normal;
}

table.compare thead th.ours {
  background: var(--ours-bg);
  color: var(--primary-dark);
}

table.compare tbody td {
  padding: 12px 10px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

table.compare tbody td.text-col {
  text-align: left;
  vertical-align: top;
  padding: 14px 14px;
}

table.compare tbody td.ours,
table.compare tbody tr.ours td {
  background: rgba(94, 53, 177, 0.06);
}

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

table.compare tbody tr:hover td:not(.ours) { background: var(--bg-alt); }
table.compare tbody tr.ours:hover td { background: rgba(94, 53, 177, 0.10); }

table.compare.mini { margin-top: 10px; }
table.compare.mini thead th { font-size: 12px; padding: 8px 6px; }
table.compare.mini tbody td { padding: 8px 6px; font-size: 13px; }

/* ==================== AUDIO PLAYERS ==================== */
audio {
  width: 100%;
  min-width: 180px;
  height: 32px;
  outline: none;
}

audio::-webkit-media-controls-panel {
  background-color: var(--bg-alt);
}

td audio { min-width: 160px; max-width: 220px; }

/* ==================== SPEAKER GRID (cloning) ==================== */
.speaker-grid {
  display: grid;
  gap: 20px;
  margin-top: 16px;
}

.speaker-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.ref-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 12px 0 14px;
  padding: 12px 14px;
  background: var(--bg-alt);
  border-radius: 6px;
  font-size: 13px;
}

.ref-row strong { display: block; margin-bottom: 4px; color: var(--text); }

/* ==================== LONG-FORM ==================== */
.longform-grid { display: grid; gap: 22px; margin-top: 16px; }

.longform-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.longform-text {
  background: var(--bg-section);
  padding: 14px 16px;
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  margin: 10px 0 14px;
  font-size: 15px;
}

.longform-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.longform-comparison > div {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-alt);
}

.longform-comparison > div.ours {
  border-color: var(--ours-border);
  background: var(--ours-bg);
}

.longform-comparison strong { display: block; margin-bottom: 6px; }

/* ==================== FAILURE CARDS ==================== */
.failure-list { display: grid; gap: 18px; margin-top: 16px; }

.failure-card {
  background: white;
  border: 1px solid #f1d4d4;
  border-left: 4px solid #d04545;
  border-radius: var(--radius);
  padding: 18px 22px;
}

.failure-card h4 { color: #b73838; }

.failure-card audio { max-width: 400px; margin: 8px 0; }

.diagnosis {
  margin-top: 8px;
  padding: 10px 14px;
  background: #fdf2f2;
  border-radius: 4px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.diagnosis strong { color: #b73838; }

/* ==================== CROSS-LINGUAL ==================== */
.crosslingual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.cross-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.cross-card > div { margin-top: 10px; font-size: 13px; }

.cross-card .ours { padding: 8px 10px; background: var(--ours-bg); border-radius: 4px; }

/* ==================== BIBTEX ==================== */
#bibtex { background: var(--bg-section); padding: 32px; border-radius: var(--radius); }

#bibtex pre {
  background: var(--code-bg);
  padding: 18px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: 'JetBrains Mono', Consolas, Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid var(--border);
}

#bibtex pre code { background: transparent; padding: 0; }

#copy-bibtex {
  margin-top: 12px;
  padding: 9px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s ease;
}

#copy-bibtex:hover { background: var(--primary-dark); }
#copy-bibtex.copied { background: var(--accent); }

/* ==================== CODE INLINE ==================== */
code {
  font-family: 'JetBrains Mono', Consolas, Menlo, monospace;
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--primary-dark);
}

/* ==================== FOOTER ==================== */
footer {
  margin-top: 64px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-section);
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
}

footer p { margin: 4px 0; }
footer a { color: var(--text-muted); }

/* Speaker grid: 2 columns on wide screens */
@media (min-width: 900px) {
  .speaker-grid { grid-template-columns: 1fr 1fr; }
}

/* Missing-audio pill */
.gen-pill {
  display: inline-block;
  font-size: 11px;
  color: #888;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .hero h1 { font-size: 38px; }
  .hero .subtitle { font-size: 16px; }
  section h2 { font-size: 24px; }
  .toc-bar .container { font-size: 12px; padding: 10px 16px; gap: 2px 4px; }
  .toc-bar a { padding: 4px 6px; }
  .longform-comparison { grid-template-columns: 1fr; }
  .ref-row { grid-template-columns: 1fr; }
  td audio { min-width: 130px; }
  table.compare thead th.text-col { min-width: 200px; }
  .badge { padding: 8px 14px; font-size: 13px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero { padding: 36px 0 32px; }
  .hero h1 { font-size: 30px; }
  section { margin: 40px 0; }
}
