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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* --- Header --- */
.site-header {
  padding: 24px;
  border-bottom: 1px solid #1a1a1a;
}

.site-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.site-header p {
  font-size: 14px;
  color: #666;
  margin-top: 4px;
}

/* --- Lesson Cards --- */
.lessons {
  padding: 24px;
  display: grid;
  gap: 16px;
  max-width: 800px;
}

.lesson-card {
  background: #111;
  border: 1px solid #1a1a1a;
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.lesson-card:hover {
  border-color: #333;
  background: #151515;
}

.lesson-card .lesson-number {
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.lesson-card h2 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.lesson-card .description {
  font-size: 14px;
  color: #888;
  line-height: 1.5;
  margin-bottom: 12px;
}

.lesson-card .meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: #555;
}

.lesson-card .meta svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
}

.lesson-card .actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-primary:hover { background: #1d4ed8; }

.btn-secondary {
  background: #1a1a1a;
  color: #ccc;
  border: 1px solid #333;
}

.btn-secondary:hover { background: #222; }

.btn svg {
  width: 14px;
  height: 14px;
}

/* --- Player Page --- */
.player-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.player-header {
  padding: 16px 24px;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #888;
  transition: color 0.15s;
}

.back-link:hover { color: #fff; }

.player-header h1 {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  flex: 1;
}

.player-header .download-links {
  display: flex;
  gap: 8px;
}

.player-bar {
  padding: 16px 24px;
  border-bottom: 1px solid #1a1a1a;
  background: #111;
}

.player-bar audio {
  width: 100%;
  height: 40px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.player-controls label {
  font-size: 13px;
  color: #888;
}

.speed-btn {
  background: #222;
  border: 1px solid #333;
  color: #ccc;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.speed-btn:hover { background: #333; }
.speed-btn.active { background: #2563eb; border-color: #3b82f6; color: #fff; }

.auto-scroll-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #888;
  cursor: pointer;
  user-select: none;
}

.auto-scroll-toggle input { cursor: pointer; }

/* --- Transcript --- */
.transcript {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  scroll-behavior: smooth;
}

.segment {
  display: flex;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}

.segment:hover { background: #1a1a1a; }

.segment.active {
  background: #1a1a2e;
}

.segment.active .text { color: #fff; }
.segment.active .timestamp { color: #3b82f6; }

.timestamp {
  font-size: 13px;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: #555;
  white-space: nowrap;
  padding-top: 2px;
  min-width: 60px;
}

.text {
  font-size: 16px;
  line-height: 1.6;
  color: #aaa;
  transition: color 0.15s;
}

/* --- Loading --- */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
  color: #555;
  font-size: 15px;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .site-header, .lessons { padding: 16px; }
  .lesson-card .actions { flex-direction: column; }
  .player-header { flex-wrap: wrap; }
  .player-header .download-links { width: 100%; }
  .segment { gap: 10px; }
  .text { font-size: 15px; }
}
