:root {
  color-scheme: dark;
  --bg: #0b1314;
  --surface: #111f21;
  --surface-strong: #16282b;
  --stroke: rgba(255, 255, 255, 0.12);
  --text: #f5f4ef;
  --muted: #9aa8a1;
  --accent: #f2c14e;
  --accent-2: #4ecdc4;
  --accent-3: #f25f5c;
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: "Fraunces", "Georgia", serif;
  font-weight: 700;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.backdrop .grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(transparent 95%, rgba(255, 255, 255, 0.06) 98%),
    linear-gradient(90deg, transparent 95%, rgba(255, 255, 255, 0.06) 98%);
  background-size: 60px 60px;
  opacity: 0.2;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.7;
  animation: float 14s ease-in-out infinite;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(242, 193, 78, 0.35), transparent 60%);
  top: -120px;
  left: -80px;
}

.orb-2 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(78, 205, 196, 0.35), transparent 60%);
  bottom: 80px;
  right: -40px;
  animation-delay: -4s;
}

.orb-3 {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(242, 95, 92, 0.32), transparent 60%);
  top: 40%;
  right: 40%;
  animation-delay: -8s;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 56px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.badge {
  background: rgba(242, 193, 78, 0.2);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 999px;
  width: fit-content;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.hero h1 {
  font-size: clamp(2.2rem, 3vw, 3.2rem);
  line-height: 1.1;
}

.hero-text {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-panel {
  background: linear-gradient(135deg, rgba(22, 40, 43, 0.9), rgba(17, 31, 33, 0.85));
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeUp 0.6s ease-out;
}

.panel-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.panel-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.panel-value {
  font-size: 1.05rem;
  font-weight: 600;
}

.quickstart {
  border-top: 1px solid var(--stroke);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quickstart-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.quickstart-list li {
  margin-bottom: 4px;
}

.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
  background: rgba(17, 31, 33, 0.95);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeUp 0.6s ease-out;
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-subtext {
  color: var(--muted);
  font-size: 0.95rem;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab {
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  background: rgba(78, 205, 196, 0.2);
  color: var(--accent-2);
  border-color: rgba(78, 205, 196, 0.35);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.dropzone {
  border: 1px dashed rgba(242, 193, 78, 0.6);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  background: rgba(242, 193, 78, 0.08);
}

.dropzone input {
  display: none;
}

.drop-title {
  font-weight: 600;
}

.drop-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.drop-note {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}

.field span {
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  background: var(--surface-strong);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.95rem;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(78, 205, 196, 0.6);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.field-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.is-loading {
  opacity: 0.8;
  pointer-events: none;
  position: relative;
}

.btn.is-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.btn.primary {
  background: var(--accent);
  color: #1b1b1b;
  box-shadow: 0 12px 24px rgba(242, 193, 78, 0.3);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--stroke);
}

.btn:hover {
  transform: translateY(-2px);
}

.detect-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.label {
  color: var(--muted);
  font-size: 0.85rem;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(78, 205, 196, 0.15);
  color: var(--accent-2);
  font-weight: 600;
}

.confidence {
  font-size: 1.2rem;
  font-weight: 600;
}

.signal-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.signal {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  font-size: 0.8rem;
  color: var(--muted);
}

.chapter-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chapter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chapter-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chapter-list li {
  background: rgba(22, 40, 43, 0.7);
  border-radius: 10px;
  padding: 8px 10px;
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.summary-card {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  background: rgba(22, 40, 43, 0.7);
}

.summary-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.audio {
  gap: 24px;
}

.audio-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.toggle-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.toggle input {
  accent-color: var(--accent-2);
}

.footnote {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.audio-stream {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stream-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stream-value {
  font-size: 1.05rem;
  font-weight: 600;
}

.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
}

.audio-player {
  background: rgba(22, 40, 43, 0.7);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--stroke);
}

.audio-hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

.queue {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-item {
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(22, 40, 43, 0.7);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.queue-item span {
  font-size: 0.9rem;
}

.queue-status {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.queue-status.queued {
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.queue-status.streaming {
  background: rgba(78, 205, 196, 0.2);
  color: var(--accent-2);
}

.queue-status.ready {
  background: rgba(242, 193, 78, 0.2);
  color: var(--accent);
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.noscript {
  background: #2b2b2b;
  color: #fff;
  padding: 12px;
  text-align: center;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(20px);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 32px 18px 60px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    order: -1;
  }
}
