:root {
  --bg: #f6f4ee;
  --card: #fffdf8;
  --ink: #1e2520;
  --muted: #68736b;
  --line: #d9d4c6;
  --accent: #1f6f54;
  --accent-ink: #ffffff;
  --accent-soft: #e3efe8;
  --danger: #a33a2f;
  --shadow: 0 18px 50px rgba(30, 37, 32, 0.08);
  --radius: 18px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141816;
    --card: #1c221f;
    --ink: #eef2ec;
    --muted: #a3aea5;
    --line: #333c36;
    --accent: #6fc7a4;
    --accent-ink: #102018;
    --accent-soft: #22352c;
    --danger: #e08a7e;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 10% -10%, var(--accent-soft), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 860px;
  margin: 0 auto;
  padding: 22px 20px 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.brand-text strong { color: var(--accent); }

.header-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.header-link:hover { color: var(--accent); }

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.hero { max-width: 680px; margin: 18px 0 28px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.03rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.record-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.record-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 15px 24px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

.record-button:hover { transform: translateY(-1px); }
.record-button:active { transform: translateY(0); }
.record-button:disabled { opacity: 0.55; cursor: not-allowed; }

.record-button.recording {
  background: var(--danger);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(163, 58, 47, 0.35); }
  50% { box-shadow: 0 0 0 12px rgba(163, 58, 47, 0); }
}

.mic {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.record-meta { min-width: 0; }

.status {
  margin: 0;
  font-weight: 550;
}

.status.error { color: var(--danger); }

.timer {
  margin: 2px 0 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

.file-label:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.example-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.file-name {
  margin: 8px 0 0;
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.88rem;
}

.transcript-wrap { margin-top: 20px; }

.transcript {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1.08rem;
  line-height: 1.6;
}

.transcript:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.transcript-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.ghost {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 14px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ghost:disabled { opacity: 0.45; cursor: not-allowed; }

footer {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 40px;
  color: var(--muted);
  font-size: 0.86rem;
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

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

@media (max-width: 560px) {
  .card { padding: 20px; }
  .record-row { align-items: flex-start; flex-direction: column; gap: 14px; }
  .record-button { width: 100%; justify-content: center; }
}
