/* HourGlass demo page: a few additions on top of Bootstrap 5.3. */

:root {
  --hg-ink: #1d2433;
  --hg-muted: #5c6878;
  --hg-line: #e2e6ec;
  --hg-bg: #f5f6f8;
  --hg-surface: #ffffff;
  --hg-accent: #1f5aa6;
  /* Waveform of the one-player script (merged-player.js), in the colours of the paper's figures. */
  --hg-wave-input: #0F9FD5; /* accBlue, audio tokens: the played prompt or ASR input */
  --hg-wave-ours: #E97232; /* accOrange, HourGlass in every data figure: played output */
  --hg-wave-unplayed: #E7E8E7; /* palGray */
  --hg-wave-divider: #808080; /* palLine: where the output starts */
}

html {
  color-scheme: light;
}

body {
  background: var(--hg-bg);
  color: var(--hg-ink);
}

/* 16 px side gutter at every width. */
.container {
  --bs-gutter-x: 2rem;
}

/* Header */
.hero {
  background: var(--hg-surface);
  border-bottom: 1px solid var(--hg-line);
  padding: 3rem 0 2.25rem;
  text-align: center;
}

.hero .title {
  font-size: clamp(1.6rem, 1.15rem + 2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  max-width: 46rem;
  margin: 0 auto 0.9rem;
}

.authors {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.affiliation {
  color: var(--hg-muted);
  margin-bottom: 0;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.summary {
  max-width: 46rem;
  margin: 1.5rem auto 0;
  line-height: 1.65;
  text-align: left;
}

.architecture {
  max-width: 60rem;
  margin: 2rem auto 0;
}

.architecture img {
  display: block;
  width: 100%;
  height: auto;
}

/* Tabs */
main {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.demo-tabs {
  margin-bottom: 1.5rem;
}

@media (max-width: 575.98px) {
  /* One scrollable row of tabs instead of wrapped, overlapping ones; the page itself never scrolls sideways. */
  .demo-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }

  .demo-tabs .nav-link {
    white-space: nowrap;
  }

  .hero {
    padding-top: 2rem;
  }
}

.tab-lead {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.tab-note {
  margin-bottom: 0.3rem;
}

.tab-credit {
  color: var(--hg-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Sample cards */
.sample {
  border-color: var(--hg-line);
  margin-bottom: 1rem;
}

.sample .card-body {
  padding: 1.1rem 1.25rem 1.25rem;
}

.field-label,
.player-label,
.transcripts dt {
  color: var(--hg-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.player.ours .player-label {
  color: var(--hg-accent);
}

.target-text {
  font-size: 1.06rem;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.target-text,
.prompt-text,
.transcripts dd,
.row-id,
.metrics {
  overflow-wrap: anywhere;
}

.players,
.baseline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 1rem 1.5rem;
}

/* Capped so the play button stays near its timeline where a player has the whole card width (ASR, scripts off). */
audio {
  display: block;
  width: 100%;
  max-width: 28rem;
  height: 2.5rem;
}

/* One player over one waveform (merged-player.js); it hides the native players it stands for. */
.players.mp-ready > .mp {
  grid-column: 1 / -1;
}

/* The ASR input is one short recording: keep its button, waveform and read-out together. */
.asr-input > .mp {
  max-width: 32rem;
}

.mp-native {
  display: none !important;
}

.mp-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mp-play {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--hg-ink);
  color: var(--hg-surface);
}

.mp-play:focus-visible,
.mp-wave:focus-visible {
  outline: 3px solid var(--hg-accent);
  outline-offset: 2px;
}

/* Play: a triangle; pause: two bars. */
.mp-icon {
  display: block;
  width: 0;
  height: 0;
  margin-left: 0.2rem;
  border-style: solid;
  border-width: 0.45rem 0 0.45rem 0.75rem;
  border-color: transparent transparent transparent currentColor;
}

.mp.is-playing .mp-icon {
  width: 0.75rem;
  height: 0.85rem;
  margin-left: 0;
  border-width: 0 0.25rem;
  border-color: currentColor;
}

.mp-wave {
  display: block;
  flex: 1 1 0%;
  min-width: 0;
  height: 3rem;
}

.mp-wave.is-seekable {
  cursor: pointer;
}

.mp-time {
  flex: none;
  color: var(--hg-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Swatches in the palette colours; the text stays in ink (the accents are about 3:1 on white). */
.mp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0.35rem 0 0 3.25rem;
  font-size: 0.85rem;
}

.mp-key {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.mp-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
}

.mp-swatch-input {
  background: var(--hg-wave-input);
}

.mp-swatch-ours {
  background: var(--hg-wave-ours);
}

.missing {
  display: flex;
  align-items: center;
  height: 2.5rem;
  color: var(--hg-muted);
}

.prompt-text {
  color: var(--hg-muted);
  font-size: 0.88rem;
  margin: 0.45rem 0 0;
}

.source {
  color: var(--hg-muted);
  font-size: 0.8rem;
  margin: 0.3rem 0 0;
}

.split {
  background: var(--hg-bg);
  border: 1px solid var(--hg-line);
  color: var(--hg-muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

details.baselines {
  border-top: 1px solid var(--hg-line);
  margin-top: 1.1rem;
  padding-top: 0.8rem;
}

details.baselines > summary {
  color: var(--hg-accent);
  cursor: pointer;
  font-weight: 600;
  width: fit-content;
}

details.baselines[open] > summary {
  margin-bottom: 0.9rem;
}

details.more-baselines {
  border-top: 1px dashed var(--hg-line);
  margin-top: 1rem;
  padding-top: 0.7rem;
}

details.more-baselines > summary {
  color: var(--hg-accent);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  width: fit-content;
}

details.more-baselines[open] > summary {
  margin-bottom: 0.9rem;
}

.transcripts {
  margin: 1rem 0 0;
}

.transcripts dd {
  line-height: 1.55;
  margin-bottom: 0.8rem;
}

.transcripts dd:last-child {
  margin-bottom: 0;
}

/* Preview only */
.picks {
  background: #fffaf0;
  border-color: #efd9a7;
  margin-bottom: 1.5rem;
}

.picks-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.pick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-bottom: 0.35rem;
}

.pick-row .form-check-input {
  margin-top: 0;
}

.metrics {
  color: var(--hg-muted);
  font-family: var(--bs-font-monospace);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

/* Footer */
.site-footer {
  background: var(--hg-surface);
  border-top: 1px solid var(--hg-line);
  font-size: 0.92rem;
  padding: 2rem 0 3rem;
}

.site-footer .container {
  max-width: 52rem;
}

.site-footer h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
}
