:root {
  --bg: #f8fafc;
  --paper: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --dark: #111827;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

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

.nav {
  position: sticky;
  top: 0;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 16px;
  font-size: 14px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
}

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 80px 22px 40px;
  text-align: center;
}

.hero h1 {
  max-width: 900px;
  margin: 0 auto;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.hero p {
  max-width: 760px;
  margin: 24px auto;
  color: var(--text);
  font-size: 20px;
}

.buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0;
}

.buttons a {
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--dark);
  color: white;
  text-decoration: none;
  font-weight: 700;
}

.hero-figure,
.wide-figure {
  width: 100%;
  max-width: 960px;
  margin-top: 32px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: white;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 22px;
}

section {
  padding: 58px 0;
}

h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin: 0 0 24px;
}

.card-grid,
.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.card,
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.card h3 {
  margin-top: 0;
}

.card p {
  color: var(--muted);
  margin-bottom: 0;
}

.demo-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 18px;
  align-items: start;
}

label {
  display: block;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 6px;
}

select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fafb;
  font-size: 15px;
}

audio {
  width: 100%;
  margin-bottom: 20px;
}

.timeline {
  position: relative;
  height: 170px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(10% - 1px),
      rgba(17, 24, 39, 0.08) 10%
    ),
    #f9fafb;
  overflow: visible;
  cursor: pointer;
}

.marker {
  position: absolute;
  width: 3px;
  top: 28px;
  bottom: 0;
  height: auto;
  border-radius: 999px;
}

.marker-label {
  position: absolute;
  top: -4px;
  left: 8px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  color: white;
  padding: 4px 7px;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
}

th {
  color: #374151;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

pre {
  background: #0f172a;
  color: #e5e7eb;
  padding: 20px;
  border-radius: 16px;
  overflow-x: auto;
}

@media (max-width: 820px) {
  .nav-links {
    display: none;
  }

  .demo-layout {
    grid-template-columns: 1fr;
  }

  .card-grid,
  .method-grid {
    grid-template-columns: 1fr;
  }
}

#leaderboard tbody tr.type-ours {
  background: rgba(34, 197, 94, 0.18);
  border-left: 6px solid #16a34a;
}

#leaderboard tbody tr.type-open {
  background: rgba(59, 130, 246, 0.16);
  border-left: 6px solid #2563eb;
}

#leaderboard tbody tr.type-closed {
  background: rgba(245, 158, 11, 0.18);
  border-left: 6px solid #d97706;
}

#leaderboard tbody tr.type-ours:hover {
  background: rgba(34, 197, 94, 0.24);
}

#leaderboard tbody tr.type-open:hover {
  background: rgba(59, 130, 246, 0.22);
}

#leaderboard tbody tr.type-closed:hover {
  background: rgba(245, 158, 11, 0.24);
}

.section-description {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  margin: -10px 0 28px;
}

.demo-stack {
  display: grid;
  gap: 34px;
}

.demo-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
}

.demo-card-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.demo-card-header h3 {
  margin: 0;
}

.demo-task {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--dark);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.audio-id {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.question-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.demo-question {
  margin: 0 0 16px;
}

.ground-truth-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #f9fafb;
  margin-bottom: 14px;
}

.ground-truth-box p {
  margin: 6px 0 0;
  color: #374151;
}

.example-observation {
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--green);
  background: rgba(22, 163, 74, 0.08);
  border-radius: 10px;
  color: #374151;
  font-size: 14px;
}

.prediction-table td {
  vertical-align: top;
}

.prediction-observation {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.prediction-row.ours {
  background: rgba(34, 197, 94, 0.12);
}

.prediction-row.open {
  background: rgba(59, 130, 246, 0.09);
}

.prediction-row.closed {
  background: rgba(245, 158, 11, 0.12);
}

@media (max-width: 820px) {
  .demo-card-header {
    display: block;
  }

  .audio-id {
    margin-top: 8px;
  }
}


.timeline-player audio {
  display: none;
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.timeline-play-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #ffffff;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.16);
}

.timeline-play-button:hover {
  transform: translateY(-1px);
}

.timeline-play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 15px;
  line-height: 1;
}

.timeline-play-icon.is-stop::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #ffffff;
}

.timeline-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.timeline-time-separator {
  color: #9ca3af;
}

.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 3px;
  background: #111827;
  z-index: 999;
  pointer-events: none;
  transform: translateX(-50%);
}

.timeline-playhead::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #111827;
  transform: translateX(-50%);
}

.marker {
  z-index: 10;
}

.marker-label {
  z-index: 20;
}

.demo-question {
  white-space: pre-line;
}

.demo-question-block {
  margin-bottom: 16px;
}

.demo-question-title {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.demo-options {
  color: #374151;
  font-size: 14px;
  line-height: 1.55;
}

.demo-option {
  margin: 5px 0;
  padding: 4px 8px;
  border-radius: 8px;
}

.demo-option.correct-option {
  font-weight: 800;
  color: #065f46;
  background: rgba(34, 197, 94, 0.14);
  border-left: 4px solid #16a34a;
}

.demo-options p {
  margin: 5px 0;
}

.demo-question-section-title {
  margin-top: 14px;
  margin-bottom: 6px;
  padding: 0;
  font-weight: 800;
  color: #111827;
  font-size: 14px;
  text-transform: none;
  background: transparent;
  border-left: 0;
}

.demo-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.demo-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.interval {
  position: absolute;
  height: 24px;
  border-radius: 999px;
  opacity: 0.92;
  z-index: 10;
  overflow: visible;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  padding: 0 8px;
}

.interval::before,
.interval::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 3px;
  height: 32px;
  border-radius: 999px;
  background: inherit;
}

.interval::before {
  left: 0;
}

.interval::after {
  right: 0;
}

.interval-model-label {
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%);
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.interval-range-inline {
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
