/* Design system — cool monochrome (dr-page) + soft elevation */
:root {
  --background: oklch(0.99 0 0);
  --foreground: oklch(0.15 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.15 0 0);
  --primary: oklch(0.15 0 0);
  --primary-foreground: oklch(0.99 0 0);
  --secondary: oklch(0.95 0 0);
  --secondary-foreground: oklch(0.15 0 0);
  --muted: oklch(0.92 0 0);
  --muted-foreground: oklch(0.5 0 0);
  --accent: oklch(0.88 0 0);
  --accent-foreground: oklch(0.15 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.88 0 0);
  --input: oklch(0.88 0 0);
  --ring: oklch(0.15 0 0);
  --radius: 0.75rem;
  --shadow-xs: 0 1px 2px rgba(26, 26, 26, 0.04);
  --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.05), 0 2px 6px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 2px 4px rgba(26, 26, 26, 0.05), 0 6px 16px rgba(26, 26, 26, 0.06);
  --shadow-card: 0 1px 2px rgba(26, 26, 26, 0.04), 0 8px 24px rgba(26, 26, 26, 0.06);
  --shadow-card-hover: 0 4px 8px rgba(26, 26, 26, 0.05), 0 12px 32px rgba(26, 26, 26, 0.08);
  --font-sans: "Nunito", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Playfair Display", ui-serif, Georgia, serif;
  --font-display: "DM Serif Display", ui-serif, Georgia, serif;
  --font-emphasis: "Lato", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-weight: 300;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

strong,
b {
  font-family: var(--font-emphasis);
  font-weight: 600;
}

a {
  color: inherit;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  background: color-mix(in oklab, var(--background) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .site-header__inner {
    padding: 0 2rem;
    height: 5rem;
  }
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-decoration: none;
  line-height: 1.15;
}

.header-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* Layout */
.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

@media (min-width: 1024px) {
  .container {
    padding: 3rem 2rem 5rem;
  }
}

.hero {
  margin-bottom: 2.5rem;
  max-width: 40rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.hero p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 1.05rem;
  max-width: 36rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }
}

/* Cards */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

.card__header h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 0 0 0.35rem;
}

.card__header p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.925rem;
}

/* Dropzone */
.dropzone {
  position: relative;
  border: 1.5px dashed color-mix(in oklab, var(--border) 100%, var(--foreground) 8%);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--secondary) 55%, transparent);
  padding: 2.25rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.dropzone:hover,
.dropzone:focus-within,
.dropzone.is-dragover {
  border-color: var(--foreground);
  background: var(--secondary);
}

.dropzone.is-dragover {
  transform: scale(1.01);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone__icon {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 0.85rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--foreground);
}

.dropzone__title {
  font-family: var(--font-emphasis);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
}

.dropzone__hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.file-chip {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--secondary);
}

.file-chip.is-visible {
  display: flex;
}

.file-chip__meta {
  flex: 1;
  min-width: 0;
}

.file-chip__name {
  font-family: var(--font-emphasis);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-chip__size {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-foreground);
  letter-spacing: 0.04em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-family: var(--font-emphasis);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease,
    transform 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn--primary:hover:not(:disabled) {
  background: color-mix(in oklab, var(--primary) 90%, white);
}

.btn--secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--border);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--accent);
}

.btn--outline {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn--outline:hover:not(:disabled) {
  background: var(--accent);
}

.btn--ghost {
  background: transparent;
  color: var(--muted-foreground);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--secondary);
  color: var(--foreground);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* Progress / status */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.step.is-active {
  background: var(--secondary);
  border-color: var(--border);
}

.step.is-done .step__dot {
  background: var(--foreground);
  color: var(--primary-foreground);
}

.step.is-failed .step__dot {
  background: var(--destructive);
  color: white;
}

.step__dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: var(--card);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.step.is-active .step__dot {
  border-color: var(--foreground);
  animation: pulse-dot 1.4s ease-in-out infinite;
}

.step__label {
  font-family: var(--font-emphasis);
  font-weight: 600;
  font-size: 0.875rem;
}

.step__desc {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-top: 0.15rem;
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in oklab, var(--foreground) 25%, transparent);
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}

.status-banner {
  display: none;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--secondary);
  font-size: 0.875rem;
  gap: 0.5rem;
  align-items: flex-start;
}

.status-banner.is-visible {
  display: flex;
}

.status-banner.is-error {
  border-color: color-mix(in oklab, var(--destructive) 35%, var(--border));
  background: color-mix(in oklab, var(--destructive) 8%, var(--card));
  color: var(--destructive);
}

.status-banner.is-success {
  border-color: color-mix(in oklab, var(--foreground) 20%, var(--border));
}

/* Transcript preview */
.preview {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.preview.is-visible {
  display: flex;
}

.preview__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-foreground);
}

.preview__text {
  margin: 0;
  max-height: 16rem;
  overflow: auto;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--secondary) 40%, var(--card));
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

/* Jobs list */
.jobs {
  margin-top: 2rem;
}

.jobs__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.job-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
  box-shadow: var(--shadow-xs);
}

.job-item__main {
  flex: 1;
  min-width: 12rem;
}

.job-item__name {
  font-family: var(--font-emphasis);
  font-weight: 600;
  font-size: 0.9rem;
}

.job-item__sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted-foreground);
  letter-spacing: 0.03em;
}

.empty {
  color: var(--muted-foreground);
  font-size: 0.9rem;
  margin: 0;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in oklab, currentColor 25%, transparent);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn.is-loading .spinner {
  display: inline-block;
}

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

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.animate-fade-up {
  animation: fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animation-delay-150 {
  animation-delay: 150ms;
}

.animation-delay-300 {
  animation-delay: 300ms;
}

.footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted-foreground);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
}

.footer code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--secondary);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-up,
  .step.is-active .step__dot,
  .spinner {
    animation: none !important;
  }
}
