:root {
  --bg: #0f1419;
  --card: #1a222c;
  --text: #e8eef5;
  --muted: #93a0b0;
  --accent: #3dd6c6;
  --danger: #f07178;
  --border: #2b3644;
  font-family: "Vazirmatn", "Tahoma", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

nav { display: flex; gap: 1rem; align-items: center; }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.narrow { max-width: 420px; margin-inline: auto; }

.stack { display: flex; flex-direction: column; gap: 0.85rem; }

label { display: flex; flex-direction: column; gap: 0.35rem; }

input[type="text"],
input[type="password"],
input[type="file"],
.file-input,
.file-input-native {
  background: #10161d;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}

.js-upload .file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 8.5rem;
  padding: 1.25rem 1rem;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: #121820;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone-prompt,
.dropzone-file,
.upload-progress {
  display: none;
}

.js-upload .dropzone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.js-upload .dropzone-file:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 28rem;
}

.js-upload .upload-progress:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(61, 214, 198, 0.08);
}

.dropzone.is-uploading {
  pointer-events: none;
  opacity: 0.75;
}

.dropzone-file-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.dropzone-file-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress-track {
  flex: 1;
  height: 0.55rem;
  border-radius: 999px;
  background: #10161d;
  border: 1px solid var(--border);
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.12s linear;
}

.upload-progress-text {
  min-width: 3.2rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.9rem;
}

button, .button-link {
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font: inherit;
}

.primary {
  background: var(--accent);
  color: #06221f;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
}

.linkish {
  background: none;
  color: var(--accent);
  padding: 0;
}

.inline { display: inline; }

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

.jobs { width: 100%; border-collapse: collapse; }
.jobs th, .jobs td { text-align: right; padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--border); }
.jobs a { color: var(--accent); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #243040;
  font-size: 0.85rem;
}

.badge.ready { background: #1d4a3a; color: #8ef0c8; }
.badge.failed { background: #4a1d24; color: #ffb4b8; }
.badge.pending, .badge.extracting, .badge.transcribing, .badge.correcting {
  background: #3a3420;
  color: #f5d67b;
}

.error { color: var(--danger); }
.errorlist { color: var(--danger); padding: 0; list-style: none; }

.usage-box {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.usage-box h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.usage-box pre {
  margin: 0;
  white-space: pre-wrap;
  direction: ltr;
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
  background: #10161d;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}

.pipeline {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  padding: 0;
  margin: 1.25rem 0 1rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
  position: relative;
  color: var(--muted);
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: calc(-50% + 0.7rem);
  right: calc(50% + 0.7rem);
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step.done:not(:last-child)::after,
.step.current:not(:last-child)::after {
  background: var(--accent);
}

.step-dot {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #10161d;
  z-index: 1;
}

.step.done .step-dot {
  background: var(--accent);
  border-color: var(--accent);
}

.step.current .step-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(61, 214, 198, 0.2);
  animation: pulse 1.4s ease-in-out infinite;
}

.step.failed .step-dot {
  background: var(--danger);
  border-color: var(--danger);
}

.step.done,
.step.current {
  color: var(--text);
}

.step.failed {
  color: var(--danger);
}

.step-label {
  font-size: 0.8rem;
  line-height: 1.3;
}

.live-hint {
  margin-right: 0.5rem;
  font-size: 0.85rem;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(61, 214, 198, 0.15); }
  50% { box-shadow: 0 0 0 7px rgba(61, 214, 198, 0.08); }
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.messages li {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: #243040;
}

.messages li.success { background: #1d4a3a; color: #8ef0c8; }
.messages li.error { background: #4a1d24; color: #ffb4b8; }

.landing-body {
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(61, 214, 198, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(232, 168, 94, 0.1), transparent 50%),
    linear-gradient(165deg, #0b1016 0%, #121a22 45%, #0f1419 100%);
  min-height: 100vh;
}

.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.75rem;
}

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

.landing-hero {
  min-height: calc(100vh - 4.5rem);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: end;
  padding: 2rem 1.75rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}

.brand-mark {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.landing-hero h1 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 600;
  margin: 0 0 0.85rem;
  color: #d7e2ec;
}

.hero-lead {
  max-width: 32rem;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 1.5rem;
}

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

.hero-actions .button-link:not(.primary) {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

.landing-hero-visual {
  min-height: 280px;
  border-radius: 18px 18px 0 0;
  background:
    linear-gradient(145deg, rgba(61, 214, 198, 0.25), transparent 55%),
    linear-gradient(335deg, rgba(20, 28, 38, 0.9), rgba(10, 14, 20, 0.95)),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 12px,
      rgba(255, 255, 255, 0.03) 12px,
      rgba(255, 255, 255, 0.03) 13px
    );
  border: 1px solid var(--border);
  box-shadow: inset 0 -40px 80px rgba(0, 0, 0, 0.35);
}

.landing-section {
  max-width: 880px;
  margin: 0 auto;
  padding: 3rem 1.75rem;
  border-top: 1px solid var(--border);
}

.landing-section h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.section-lead {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.landing-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.landing-steps li {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.landing-steps strong { font-size: 1.05rem; }
.landing-steps span { color: var(--muted); }

.pricing-examples {
  padding: 0;
  margin: 0 0 1rem;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.pricing-examples li {
  padding: 0.65rem 0.85rem;
  border-right: 3px solid var(--accent);
  background: rgba(26, 34, 44, 0.7);
}

.landing-footer {
  padding: 2rem 1.75rem 3rem;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 800px) {
  .landing-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    align-items: start;
  }
  .landing-hero-visual {
    min-height: 180px;
    order: -1;
  }
}

@media (max-width: 640px) {
  .pipeline {
    grid-template-columns: 1fr;
  }
  .step {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
  }
  .step:not(:last-child)::after {
    display: none;
  }
}
