:root {
  --bg0: #e8f0ec;
  --bg1: #f4f7f5;
  --ink: #1c2b24;
  --muted: #5a6d63;
  --line: #c5d4cb;
  --accent: #2f6b55;
  --accent-soft: #d7ebe1;
  --danger: #8b3a3a;
  --surface: rgba(255, 255, 255, 0.72);
  --shadow: 0 18px 50px rgba(28, 43, 36, 0.08);
  --radius: 18px;
  /* Local-only fonts (no CDN) — expressive stacks available on macOS */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #cfe4d8 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #d9e6ef 0%, transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

.page {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
}

.header {
  margin-bottom: 2rem;
}

.brand {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0 0 1rem;
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.pill.error {
  background: #f3e0e0;
  color: var(--danger);
}

.main {
  display: grid;
  gap: 1.25rem;
}

.uploader,
.result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 1.25rem;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 180px;
  padding: 1.5rem;
  border: 1.5px dashed #9bb5a6;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(232, 240, 236, 0.35));
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(215, 235, 225, 0.55);
  transform: translateY(-1px);
}

.dropzone-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.dropzone-hint {
  color: var(--muted);
  font-size: 0.95rem;
}

.file-meta {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.option {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.option input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.option span {
  display: grid;
  gap: 0.2rem;
  font-weight: 600;
}

.option small {
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

button {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 0.7rem 1.1rem;
  background: var(--accent);
  color: #f7fcf9;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 140ms ease, transform 140ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.result h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

#transcript {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font: inherit;
  line-height: 1.55;
}

.progress {
  margin-bottom: 0.85rem;
}

.progress p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.progress-bar {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent), var(--accent-soft));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.meta dt {
  font-weight: 600;
  color: var(--ink);
}

.meta dd {
  margin: 0;
}

.footer {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (min-width: 860px) {
  .main {
    grid-template-columns: 1fr 1.15fr;
    align-items: start;
  }
}
